[Libreoffice-commits] .: 2 commits - writerfilter/qa writerfilter/source
Miklos Vajna
vmiklos at kemper.freedesktop.org
Mon Jul 2 13:10:49 PDT 2012
writerfilter/qa/cppunittests/doctok/testdoctok.cxx | 3 --
writerfilter/source/doctok/WW8DocumentImpl.cxx | 18 +++++------------
writerfilter/source/doctok/WW8StreamImpl.cxx | 3 --
writerfilter/source/doctok/resourcesimpl.xsl | 4 +--
writerfilter/source/ooxml/Handler.cxx | 16 +++++++--------
writerfilter/source/ooxml/OOXMLFastContextHandler.cxx | 4 ---
writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx | 19 ++++--------------
writerfilter/source/ooxml/factoryimpl.xsl | 7 ++----
writerfilter/source/ooxml/factoryimpl_ns.xsl | 8 +++----
writerfilter/source/ooxml/factoryimpl_values.xsl | 6 ++---
10 files changed, 34 insertions(+), 54 deletions(-)
New commits:
commit 6d93a746955d01e6339a1ebc1382c2f0b98b6840
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Mon Jul 2 22:11:10 2012 +0200
writerfilter is now RTL_CONSTASCII..PARAM-free
Change-Id: I04ef6ffefa7e27a1f9cac6d7d46cb6022223b9ff
diff --git a/writerfilter/qa/cppunittests/doctok/testdoctok.cxx b/writerfilter/qa/cppunittests/doctok/testdoctok.cxx
index 5d8e633..2fc9e1d 100644
--- a/writerfilter/qa/cppunittests/doctok/testdoctok.cxx
+++ b/writerfilter/qa/cppunittests/doctok/testdoctok.cxx
@@ -92,8 +92,7 @@ public:
{
uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess >
xNameContainer(xFactory->createInstanceWithContext
- (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM
- ("com.sun.star.ucb.SimpleFileAccess" )),
+ ("com.sun.star.ucb.SimpleFileAccess",
xComponentContext), uno::UNO_QUERY );
if (xNameContainer.is())
diff --git a/writerfilter/source/doctok/WW8DocumentImpl.cxx b/writerfilter/source/doctok/WW8DocumentImpl.cxx
index b0ba4ea..f7f67a8 100644
--- a/writerfilter/source/doctok/WW8DocumentImpl.cxx
+++ b/writerfilter/source/doctok/WW8DocumentImpl.cxx
@@ -171,16 +171,13 @@ WW8DocumentImpl::WW8DocumentImpl(WW8Stream::Pointer_t rpStream)
: bSubDocument(false), mfcPicLoc(0), mbPicIsData(false), mpStream(rpStream),
mbInSection(false), mbInParagraphGroup(false), mbInCharacterGroup(false)
{
- mpDocStream = getSubStream(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM
- ("WordDocument")));
+ mpDocStream = getSubStream("WordDocument");
- mpSummaryInformationStream = getSubStream(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM
- ("\5SummaryInformation")));
+ mpSummaryInformationStream = getSubStream("\5SummaryInformation");
try
{
- mpDataStream = getSubStream(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM
- ("Data")));
+ mpDataStream = getSubStream("Data");
}
catch (const ExceptionNotFound &)
{
@@ -188,8 +185,7 @@ mbInSection(false), mbInParagraphGroup(false), mbInCharacterGroup(false)
try
{
- mpCompObjStream = getSubStream(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM
- ("\1CompObj")));
+ mpCompObjStream = getSubStream("\1CompObj");
}
catch (const ExceptionNotFound &)
{
@@ -205,14 +201,12 @@ mbInSection(false), mbInParagraphGroup(false), mbInCharacterGroup(false)
switch (mpFib->get_fWhichTblStm())
{
case 0:
- mpTableStream = getSubStream(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM
- ("0Table")));
+ mpTableStream = getSubStream("0Table");
break;
case 1:
- mpTableStream = getSubStream(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM
- ("1Table")));
+ mpTableStream = getSubStream("1Table");
break;
diff --git a/writerfilter/source/doctok/WW8StreamImpl.cxx b/writerfilter/source/doctok/WW8StreamImpl.cxx
index 50bc003..2a9c7a7 100644
--- a/writerfilter/source/doctok/WW8StreamImpl.cxx
+++ b/writerfilter/source/doctok/WW8StreamImpl.cxx
@@ -51,8 +51,7 @@ WW8StreamImpl::WW8StreamImpl(uno::Reference<uno::XComponentContext> rContext,
xOLESimpleStorage = uno::Reference<container::XNameContainer>
(xFactory->createInstanceWithArgumentsAndContext
- (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM
- ("com.sun.star.embed.OLESimpleStorage")),
+ ("com.sun.star.embed.OLESimpleStorage",
aArgs, mrComponentContext ),
uno::UNO_QUERY );
diff --git a/writerfilter/source/ooxml/Handler.cxx b/writerfilter/source/ooxml/Handler.cxx
index 7b14d2c..2c42224 100644
--- a/writerfilter/source/ooxml/Handler.cxx
+++ b/writerfilter/source/ooxml/Handler.cxx
@@ -294,10 +294,10 @@ OOXMLHyperlinkHandler::OOXMLHyperlinkHandler(OOXMLFastContextHandler * pContext)
OOXMLHyperlinkHandler::~OOXMLHyperlinkHandler()
{
- ::rtl::OUString sReturn(RTL_CONSTASCII_USTRINGPARAM(" HYPERLINK \""));
+ ::rtl::OUString sReturn(" HYPERLINK \"");
sReturn += mURL;
- sReturn += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\""));
+ sReturn += "\"";
sReturn += mFieldCode;
mpFastContext->text(sReturn);
@@ -308,23 +308,23 @@ void OOXMLHyperlinkHandler::attribute(Id name, Value & val)
switch (name)
{
case NS_ooxml::LN_CT_Hyperlink_tgtFrame:
- mFieldCode += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" \\t \""));
+ mFieldCode += " \\t \"";
mFieldCode += val.getString();
- mFieldCode += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\""));
+ mFieldCode += "\"";
break;
case NS_ooxml::LN_CT_Hyperlink_tooltip:
- mFieldCode += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" \\o \""));
+ mFieldCode += " \\o \"";
mFieldCode += val.getString();
- mFieldCode += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\""));
+ mFieldCode += "\"";
break;
case NS_ooxml::LN_CT_Hyperlink_docLocation:
break;
case NS_ooxml::LN_CT_Hyperlink_history:
break;
case NS_ooxml::LN_CT_Hyperlink_anchor:
- mFieldCode += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" \\l \""));
+ mFieldCode += " \\l \"";
mFieldCode += val.getString();
- mFieldCode += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\""));
+ mFieldCode += "\"";
break;
case NS_ooxml::LN_CT_Hyperlink_r_id:
mURL = mpFastContext->getTargetForId(val.getString());
diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
index 738fac5..87bd54a 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
@@ -1916,9 +1916,7 @@ OOXMLFastContextHandlerShape::OOXMLFastContextHandlerShape
mrShapeContext.set
(rServiceManager->
createInstanceWithContext
- (::rtl::OUString
- (RTL_CONSTASCII_USTRINGPARAM
- ("com.sun.star.xml.sax.FastShapeContextHandler")), xContext),
+ ("com.sun.star.xml.sax.FastShapeContextHandler", xContext),
uno::UNO_QUERY);
getDocument()->setShapeContext( mrShapeContext );
}
diff --git a/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx b/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx
index c99b690..7d3c769 100644
--- a/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx
@@ -31,12 +31,6 @@ namespace ooxml
{
using namespace ::std;
-static ::rtl::OUString strue(RTL_CONSTASCII_USTRINGPARAM("true"));
-static ::rtl::OUString sTrue(RTL_CONSTASCII_USTRINGPARAM("True"));
-static ::rtl::OUString s1(RTL_CONSTASCII_USTRINGPARAM("1"));
-static ::rtl::OUString sOn(RTL_CONSTASCII_USTRINGPARAM("On"));
-static ::rtl::OUString son(RTL_CONSTASCII_USTRINGPARAM("on"));
-
OOXMLProperty::~OOXMLProperty()
{
}
@@ -278,14 +272,11 @@ OOXMLBooleanValue::OOXMLBooleanValue(bool bValue)
OOXMLBooleanValue::OOXMLBooleanValue(const rtl::OUString & rValue)
: mbValue(false)
{
- if (strue.compareTo(rValue) == 0
- || sTrue.compareTo(rValue) == 0
- || s1.compareTo(rValue) == 0
- || son.compareTo(rValue) == 0
- || sOn.compareTo(rValue) == 0)
- mbValue = true;
- else
- mbValue = false;
+ mbValue = (rValue == "true"
+ || rValue == "True"
+ || rValue == "1"
+ || rValue == "on"
+ || rValue == "On");
}
OOXMLBooleanValue::~OOXMLBooleanValue()
commit 02a72b30259923eece476abb4aa5c41965d454e7
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Mon Jul 2 21:58:42 2012 +0200
writerfilter: kill CONSTASCII in generated code
Change-Id: I7d1d7d8c5f8291defb86f205ea0d65674493b467
diff --git a/writerfilter/source/doctok/resourcesimpl.xsl b/writerfilter/source/doctok/resourcesimpl.xsl
index 9a243f2..431e72c 100644
--- a/writerfilter/source/doctok/resourcesimpl.xsl
+++ b/writerfilter/source/doctok/resourcesimpl.xsl
@@ -554,9 +554,9 @@ writerfilter::Reference < BinaryObj > ::Pointer_t createSprmBinary
<xsl:with-param name="id" select="$optname"/>
</xsl:call-template>
<xsl:text>:
- result = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("</xsl:text>
+ result = "</xsl:text>
<xsl:value-of select="$optname"/>
- <xsl:text>"));
+ <xsl:text>";
break;</xsl:text>
</xsl:template>
diff --git a/writerfilter/source/ooxml/factoryimpl.xsl b/writerfilter/source/ooxml/factoryimpl.xsl
index a70b3cc..07571b0 100644
--- a/writerfilter/source/ooxml/factoryimpl.xsl
+++ b/writerfilter/source/ooxml/factoryimpl.xsl
@@ -326,15 +326,14 @@ uno::Reference < xml::sax::XFastParser > OOXMLStreamImpl::getFastParser()
(mxContext->getServiceManager());
mxFastParser.set(xFactory->createInstanceWithContext
- ( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM
- ( "com.sun.star.xml.sax.FastParser" )),
+ ( "com.sun.star.xml.sax.FastParser",
mxContext ), uno::UNO_QUERY_THROW);
</xsl:text>
<xsl:for-each select="//namespace-alias">
<xsl:text>
- mxFastParser->registerNamespace(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("</xsl:text>
+ mxFastParser->registerNamespace("</xsl:text>
<xsl:value-of select="@name"/>
- <xsl:text>")), </xsl:text>
+ <xsl:text>", </xsl:text>
<xsl:call-template name="namespaceid"/>
<xsl:text>);</xsl:text>
</xsl:for-each>
diff --git a/writerfilter/source/ooxml/factoryimpl_ns.xsl b/writerfilter/source/ooxml/factoryimpl_ns.xsl
index da52c83..bf20ecc 100644
--- a/writerfilter/source/ooxml/factoryimpl_ns.xsl
+++ b/writerfilter/source/ooxml/factoryimpl_ns.xsl
@@ -527,9 +527,9 @@ CreateElementMapPointer </xsl:text>
<xsl:call-template name="idtoqname">
<xsl:with-param name="id" select="@tokenid"/>
</xsl:call-template>
- <xsl:text>, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("</xsl:text>
+ <xsl:text>, "</xsl:text>
<xsl:value-of select="@value"/>
- <xsl:text>")));</xsl:text>
+ <xsl:text>");</xsl:text>
</xsl:when>
<xsl:when test="@action='mark'">
<xsl:text>
@@ -537,9 +537,9 @@ CreateElementMapPointer </xsl:text>
<xsl:call-template name="idtoqname">
<xsl:with-param name="id" select="@sendtokenid"/>
</xsl:call-template>
- <xsl:text>, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("</xsl:text>
+ <xsl:text>, "</xsl:text>
<xsl:value-of select="@value"/>
- <xsl:text>")));</xsl:text>
+ <xsl:text>");</xsl:text>
</xsl:when>
<xsl:when test="@action='tokenproperty'">
<xsl:text>
diff --git a/writerfilter/source/ooxml/factoryimpl_values.xsl b/writerfilter/source/ooxml/factoryimpl_values.xsl
index f1902d7..35c967b 100644
--- a/writerfilter/source/ooxml/factoryimpl_values.xsl
+++ b/writerfilter/source/ooxml/factoryimpl_values.xsl
@@ -60,16 +60,16 @@ rtl::OUString </xsl:text>
<xsl:call-template name="valuestringname">
<xsl:with-param name="string"></xsl:with-param>
</xsl:call-template>
-<xsl:text>(RTL_CONSTASCII_USTRINGPARAM(""));</xsl:text>
+<xsl:text>("");</xsl:text>
<xsl:for-each select="//rng:value[generate-id(key('value-with-content', text())[1]) = generate-id(.)]">
<xsl:text>
rtl::OUString </xsl:text>
<xsl:call-template name="valuestringname">
<xsl:with-param name="string" select="."/>
</xsl:call-template>
-<xsl:text>(RTL_CONSTASCII_USTRINGPARAM("</xsl:text>
+<xsl:text>("</xsl:text>
<xsl:value-of select="."/>
-<xsl:text>"));</xsl:text>
+<xsl:text>");</xsl:text>
</xsl:for-each>
</xsl:template>
More information about the Libreoffice-commits
mailing list