[ooo-build-commit] Branch 'ooo/master' - autodoc/source
Jan Holesovsky
kendy at kemper.freedesktop.org
Fri Sep 18 19:56:08 PDT 2009
autodoc/source/exes/adc_uni/cmd_sincedata.cxx | 16 ++++--
autodoc/source/parser/inc/x_docu.hxx | 61 ++++++++++++++++++++++++
autodoc/source/parser/kernel/makefile.mk | 3 -
autodoc/source/parser/kernel/x_docu.cxx | 64 ++++++++++++++++++++++++++
autodoc/source/parser_i/idl/unoidl.cxx | 10 +++-
autodoc/source/parser_i/idoc/docu_pe2.cxx | 44 +++++++++++++++--
6 files changed, 185 insertions(+), 13 deletions(-)
New commits:
commit 797ae9128c199c5d5742f5e99d3b7952816786f2
Author: Ivo Hinkelmann <ihi at openoffice.org>
Date: Fri Sep 18 09:05:17 2009 +0000
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#
diff --git a/autodoc/source/exes/adc_uni/cmd_sincedata.cxx b/autodoc/source/exes/adc_uni/cmd_sincedata.cxx
index 6511d81..0a577eb 100644
--- a/autodoc/source/exes/adc_uni/cmd_sincedata.cxx
+++ b/autodoc/source/exes/adc_uni/cmd_sincedata.cxx
@@ -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
@@ -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 0000000..f6b8d94
--- /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 df4b6a7..3401365 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 0000000..96f0c62
--- /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 cb68b9d..b90d492 100644
--- a/autodoc/source/parser_i/idl/unoidl.cxx
+++ b/autodoc/source/parser_i/idl/unoidl.cxx
@@ -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
@@ -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 63d8837..79d3bc4 100644
--- a/autodoc/source/parser_i/idoc/docu_pe2.cxx
+++ b/autodoc/source/parser_i/idoc/docu_pe2.cxx
@@ -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
@@ -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;
}
More information about the ooo-build-commit
mailing list