summaryrefslogtreecommitdiff
path: root/autodoc
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2009-09-18 09:05:17 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2009-09-18 09:05:17 +0000
commit5f489dd4dcd6b402d3b13b45971fa4a968710e24 (patch)
tree98b7e9a940bc21e41910aa7af5e93c6cd7c1ca95 /autodoc
parentbe29d7f7e574e990bf322b808cbc64d4808b1178 (diff)
CWS-TOOLING: integrate CWS adc25
2009-09-10 12:20:49 +0200 np r276029 : #i100671# 2009-09-10 11:25:02 +0200 np r276025 : #i100671# 2009-09-10 11:22:03 +0200 np r276024 : #i100671#
Diffstat (limited to 'autodoc')
-rw-r--r--autodoc/source/exes/adc_uni/cmd_sincedata.cxx14
-rw-r--r--autodoc/source/parser/inc/x_docu.hxx61
-rw-r--r--autodoc/source/parser/kernel/makefile.mk3
-rw-r--r--autodoc/source/parser/kernel/x_docu.cxx64
-rw-r--r--autodoc/source/parser_i/idl/unoidl.cxx8
-rw-r--r--autodoc/source/parser_i/idoc/docu_pe2.cxx42
6 files changed, 182 insertions, 10 deletions
diff --git a/autodoc/source/exes/adc_uni/cmd_sincedata.cxx b/autodoc/source/exes/adc_uni/cmd_sincedata.cxx
index 895a1b0853df..0a577eb8ef8f 100644
--- a/autodoc/source/exes/adc_uni/cmd_sincedata.cxx
+++ b/autodoc/source/exes/adc_uni/cmd_sincedata.cxx
@@ -60,18 +60,26 @@ SinceTagTransformationData::DoesTransform() const
}
const String &
-SinceTagTransformationData::DisplayOf( const String & i_sVersionNumber ) const
+SinceTagTransformationData::DisplayOf( const String & i_versionNumber ) const
{
if (DoesTransform())
{
- const String * ret = csv::find_in_map(aTransformationTable, i_sVersionNumber);
+ StreamLock
+ sl(200);
+ sl() << i_versionNumber;
+ sl().strip_frontback_whitespace();
+ String
+ sVersionNumber(sl().c_str());
+
+ const String *
+ ret = csv::find_in_map(aTransformationTable, sVersionNumber);
return ret != 0
? *ret
: String::Null_();
}
else
{
- return i_sVersionNumber;
+ return i_versionNumber;
}
}
diff --git a/autodoc/source/parser/inc/x_docu.hxx b/autodoc/source/parser/inc/x_docu.hxx
new file mode 100644
index 000000000000..36185dbac4ab
--- /dev/null
+++ b/autodoc/source/parser/inc/x_docu.hxx
@@ -0,0 +1,61 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: x_parse.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef ADC_X_DOCU_HXX
+#define ADC_X_DOCU_HXX
+
+// BASE CLASSES
+#include <autodoc/x_parsing.hxx>
+
+
+
+
+class X_Docu : public autodoc::X_Parser_Ifc
+{
+ public:
+ // LIFECYCLE
+ X_Docu(
+ const char * i_tag,
+ const char * i_explanation );
+ ~X_Docu();
+ // INQUIRY
+ virtual E_Event GetEvent() const;
+ virtual void GetInfo(
+ std::ostream & o_rOutputMedium ) const;
+
+ private:
+ String sTagName;
+ String sExplanation;
+};
+
+
+
+
+#endif
diff --git a/autodoc/source/parser/kernel/makefile.mk b/autodoc/source/parser/kernel/makefile.mk
index df4b6a74bf84..340136565c7d 100644
--- a/autodoc/source/parser/kernel/makefile.mk
+++ b/autodoc/source/parser/kernel/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -50,6 +50,7 @@ PRJINC=$(PRJ)$/source
OBJFILES= \
$(OBJ)$/parsefct.obj \
+ $(OBJ)$/x_docu.obj \
$(OBJ)$/x_parse.obj
diff --git a/autodoc/source/parser/kernel/x_docu.cxx b/autodoc/source/parser/kernel/x_docu.cxx
new file mode 100644
index 000000000000..992d1cb511d0
--- /dev/null
+++ b/autodoc/source/parser/kernel/x_docu.cxx
@@ -0,0 +1,64 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: x_parse.cxx,v $
+ * $Revision: 1.7 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include <precomp.h>
+#include <x_docu.hxx>
+
+// NOT FULLY DECLARED SERVICES
+
+
+
+X_Docu::X_Docu( const char * i_tag,
+ const char * i_explanation )
+ : sTagName(i_tag),
+ sExplanation(i_explanation)
+{
+}
+
+X_Docu::~X_Docu()
+{
+}
+
+X_Docu::E_Event
+X_Docu::GetEvent() const
+{
+ return x_Any;
+}
+
+void
+X_Docu::GetInfo( std::ostream & o_rOutputMedium ) const
+{
+ o_rOutputMedium
+ << "Error in tag '"
+ << sTagName
+ << "': "
+ << sExplanation
+ << Endl();
+}
diff --git a/autodoc/source/parser_i/idl/unoidl.cxx b/autodoc/source/parser_i/idl/unoidl.cxx
index aa1c0ecd3521..e8f86c885363 100644
--- a/autodoc/source/parser_i/idl/unoidl.cxx
+++ b/autodoc/source/parser_i/idl/unoidl.cxx
@@ -38,6 +38,7 @@
#include <ary/ary.hxx>
#include <ary/idl/i_gate.hxx>
#include <ary/doc/d_oldidldocu.hxx>
+#include <../parser/inc/x_docu.hxx>
#include <parser/parserinfo.hxx>
#include <tools/filecoll.hxx>
#include <tools/tkpchars.hxx>
@@ -113,6 +114,13 @@ IdlParser::Run( const autodoc::FileCollector_Ifc & i_rFiles )
= new FileParsePerformers(*pRepository,
static_cast< ParserInfo& >(*this));
}
+ catch (X_Docu & xd)
+ {
+ // Currently thic catches only wrong since tags, while since tags are
+ // transformed. In this case the program shall be terminated.
+ Cerr() << xd << Endl();
+ exit(1);
+ }
catch (...)
{
Cout() << "Unknown error." << Endl();
diff --git a/autodoc/source/parser_i/idoc/docu_pe2.cxx b/autodoc/source/parser_i/idoc/docu_pe2.cxx
index b03e33491b92..687b189cf894 100644
--- a/autodoc/source/parser_i/idoc/docu_pe2.cxx
+++ b/autodoc/source/parser_i/idoc/docu_pe2.cxx
@@ -38,6 +38,7 @@
#include <parser/parserinfo.hxx>
#include <adc_cl.hxx>
#include <adc_msg.hxx>
+#include <../parser/inc/x_docu.hxx>
#include <s2_dsapi/dsapitok.hxx>
#include <s2_dsapi/tk_atag2.hxx>
#include <s2_dsapi/tk_html.hxx>
@@ -511,15 +512,44 @@ SapiDocu_PE::SetCurSinceAtTagVersion( DYN ary::inf::DocuToken & let_drNewToken )
return;
}
- char cFirst = *pToken->GetText();
- const char cCiphersend = '9' + 1;
- if ( autodoc::CommandLine::Get_().DoesTransform_SinceTag()
- AND NOT csv::in_range('0', cFirst, cCiphersend) )
+ const String
+ sVersion(pToken->GetText());
+ const char
+ cFirst = *sVersion.begin();
+ const char
+ cCiphersend = '9' + 1;
+ const autodoc::CommandLine &
+ rCommandLine = autodoc::CommandLine::Get_();
+
+
+ if ( rCommandLine.DoesTransform_SinceTag())
{
- delete &let_drNewToken;
- return;
+ // The @since version number shall be interpreted,
+
+ if ( NOT csv::in_range('0', cFirst, cCiphersend) )
+ {
+ // But this is a non-number-part, so we wait for
+ // the next one.
+ delete &let_drNewToken;
+ return;
+ }
+ else if (rCommandLine.DisplayOf_SinceTagValue(sVersion).empty())
+ {
+ // This is the numbered part, but we don't know it.
+ delete &let_drNewToken;
+
+ StreamLock
+ sl(200);
+ sl()
+ << "Since-value '"
+ << sVersion
+ << "' not found in translation table.";
+ throw X_Docu("since", sl().c_str());
+ }
}
+ // Either since tags are not specially interpreted, or
+ // we got a known one.
pCurAtTag->AddToken(let_drNewToken);
fCurTokenAddFunction = &SapiDocu_PE::AddDocuToken2SinceAtTag;
}