[Libreoffice-commits] core.git: 4 commits - filter/source oox/source xmloff/source
Markus Mohrhard
markus.mohrhard at googlemail.com
Thu Jan 7 18:36:04 PST 2016
filter/source/odfflatxml/OdfFlatXml.cxx | 24 +-
filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx | 12 -
oox/source/drawingml/chart/datasourcecontext.cxx | 5
xmloff/source/core/xmlimp.cxx | 183 ++++++++++----------
4 files changed, 111 insertions(+), 113 deletions(-)
New commits:
commit c1d04fedc278d9590b53282403de2f8a6900546f
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Wed Jan 6 02:08:14 2016 +0100
fix indentation
Change-Id: Ic147145fca2ee1c3c9f9c504d858b84e72eeb6bc
diff --git a/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx b/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx
index 1a32c98..429fdc5 100644
--- a/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx
+++ b/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx
@@ -95,14 +95,14 @@ bool SAL_CALL XmlFilterAdaptor::importImpl( const Sequence< css::beans::Property
// create an XProperty set to configure the exporter for pretty printing
PropertyMapEntry aImportInfoMap[] =
- {
+ {
{ OUString("BaseURI"), 0, ::cppu::UnoType<OUString>::get(), PropertyAttribute::MAYBEVOID, 0},
- { OUString(), 0, css::uno::Type(), 0, 0 }
- };
+ { OUString(), 0, css::uno::Type(), 0, 0 }
+ };
- Reference< XPropertySet > xInfoSet(
- GenericPropertySet_CreateInstance( new PropertySetInfo( aImportInfoMap ) ) );
- xInfoSet->setPropertyValue( "BaseURI", makeAny( aBaseURI ));
+ Reference< XPropertySet > xInfoSet(
+ GenericPropertySet_CreateInstance( new PropertySetInfo( aImportInfoMap ) ) );
+ xInfoSet->setPropertyValue( "BaseURI", makeAny( aBaseURI ));
aAnys[0] <<= xInfoSet;
commit c1038a187a6a5152de51b111123cbd11adbffbbe
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Jan 5 19:47:27 2016 +0100
fix indentation
Change-Id: Ie79848c6649cfef6d32f0b2ca1e98ca0b00f716a
diff --git a/filter/source/odfflatxml/OdfFlatXml.cxx b/filter/source/odfflatxml/OdfFlatXml.cxx
index 2d32977..f0ffdb2 100644
--- a/filter/source/odfflatxml/OdfFlatXml.cxx
+++ b/filter/source/odfflatxml/OdfFlatXml.cxx
@@ -146,20 +146,20 @@ OdfFlatXml::importer(
inputSource.aInputStream = inputStream;
saxParser->setDocumentHandler(docHandler);
try
- {
- css::uno::Reference< css::io::XSeekable > xSeekable( inputStream, css::uno::UNO_QUERY );
- if ( xSeekable.is() )
- xSeekable->seek( 0 );
+ {
+ css::uno::Reference< css::io::XSeekable > xSeekable( inputStream, css::uno::UNO_QUERY );
+ if ( xSeekable.is() )
+ xSeekable->seek( 0 );
- saxParser->parseStream(inputSource);
- }
+ saxParser->parseStream(inputSource);
+ }
catch (const Exception &exc)
- {
- SAL_WARN(
- "filter.odfflatxml",
- "caught exception \"" << exc.Message << "\"");
- return sal_False;
- }
+ {
+ SAL_WARN(
+ "filter.odfflatxml",
+ "caught exception \"" << exc.Message << "\"");
+ return sal_False;
+ }
return sal_True;
}
commit 070258271cb3b79cdb7b612c3b0c885aa3a275cb
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Jan 5 19:42:14 2016 +0100
indentation fixes
Change-Id: Ibc652519d7ccc9a1ec483f19d443c9b5303e0f92
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index 8ade9dc9..52b10a9 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -166,110 +166,111 @@ getBuildIdsProperty(uno::Reference<beans::XPropertySet> const& xImportInfo)
return OUString();
}
- class DocumentInfo
- {
- private:
- sal_uInt16 mnGeneratorVersion;
+class DocumentInfo
+{
+private:
+ sal_uInt16 mnGeneratorVersion;
- public:
- explicit DocumentInfo( const SvXMLImport& rImport )
- : mnGeneratorVersion( SvXMLImport::ProductVersionUnknown )
+public:
+ explicit DocumentInfo( const SvXMLImport& rImport )
+ : mnGeneratorVersion( SvXMLImport::ProductVersionUnknown )
+ {
+ OUString const buildIds(
+ getBuildIdsProperty(rImport.getImportInfo()));
+ if (!buildIds.isEmpty())
+ {
+ sal_Int32 const ix = buildIds.indexOf(';');
+ if (-1 != ix)
{
- OUString const buildIds(
- getBuildIdsProperty(rImport.getImportInfo()));
- if (!buildIds.isEmpty())
- {
- sal_Int32 const ix = buildIds.indexOf(';');
- if (-1 != ix)
- {
- OUString const loVersion(buildIds.copy(ix + 1));
- if (!loVersion.isEmpty())
- {
- if ('3' == loVersion[0])
- {
- mnGeneratorVersion = SvXMLImport::LO_3x;
- }
- else if ('4' == loVersion[0])
- {
- if (loVersion.getLength() > 1
- && (loVersion[1] == '0' || loVersion[1] == '1'))
- {
- mnGeneratorVersion = SvXMLImport::LO_41x; // 4.0/4.1
- }
- else if (loVersion.getLength() > 1 && '2' == loVersion[1])
- {
- mnGeneratorVersion = SvXMLImport::LO_42x; // 4.2
- }
- else if (loVersion.getLength() > 1 && '3' == loVersion[1])
- {
- mnGeneratorVersion = SvXMLImport::LO_43x; // 4.3
- }
- else if (loVersion.getLength() > 1 && '4' == loVersion[1])
- {
- mnGeneratorVersion = SvXMLImport::LO_44x; // 4.4
- }
- }
- else
- {
- SAL_INFO_IF('5' != loVersion[0], "xmloff.core", "unknown LO version: " << loVersion);
- mnGeneratorVersion = SvXMLImport::LO_5x;
- }
- return; // ignore buildIds
- }
- }
- }
- sal_Int32 nUPD, nBuild;
- if ( rImport.getBuildIds( nUPD, nBuild ) )
+ OUString const loVersion(buildIds.copy(ix + 1));
+ if (!loVersion.isEmpty())
{
- if ( nUPD >= 640 && nUPD <= 645 )
- {
- mnGeneratorVersion = SvXMLImport::OOo_1x;
- }
- else if ( nUPD == 680 )
- {
- mnGeneratorVersion = SvXMLImport::OOo_2x;
- }
- else if ( nUPD == 300 && nBuild <= 9379 )
+ if ('3' == loVersion[0])
{
- mnGeneratorVersion = SvXMLImport::OOo_30x;
+ mnGeneratorVersion = SvXMLImport::LO_3x;
}
- else if ( nUPD == 310 )
+ else if ('4' == loVersion[0])
{
- mnGeneratorVersion = SvXMLImport::OOo_31x;
- }
- else if ( nUPD == 320 )
- {
- mnGeneratorVersion = SvXMLImport::OOo_32x;
- }
- else if ( nUPD == 330 )
- {
- mnGeneratorVersion = SvXMLImport::OOo_33x;
- }
- else if ( nUPD == 340 )
- {
- mnGeneratorVersion = SvXMLImport::OOo_34x;
- }
- else if (nUPD == 400)
- {
- mnGeneratorVersion = SvXMLImport::AOO_40x;
+ if (loVersion.getLength() > 1
+ && (loVersion[1] == '0' || loVersion[1] == '1'))
+ {
+ mnGeneratorVersion = SvXMLImport::LO_41x; // 4.0/4.1
+ }
+ else if (loVersion.getLength() > 1 && '2' == loVersion[1])
+ {
+ mnGeneratorVersion = SvXMLImport::LO_42x; // 4.2
+ }
+ else if (loVersion.getLength() > 1 && '3' == loVersion[1])
+ {
+ mnGeneratorVersion = SvXMLImport::LO_43x; // 4.3
+ }
+ else if (loVersion.getLength() > 1 && '4' == loVersion[1])
+ {
+ mnGeneratorVersion = SvXMLImport::LO_44x; // 4.4
+ }
}
- else if (nUPD >= 410)
+ else
{
- // effectively this means "latest", see use
- // in XMLGraphicsDefaultStyle::SetDefaults()!
- mnGeneratorVersion = SvXMLImport::AOO_4x;
+ SAL_INFO_IF('5' != loVersion[0], "xmloff.core", "unknown LO version: " << loVersion);
+ mnGeneratorVersion = SvXMLImport::LO_5x;
}
+ return; // ignore buildIds
}
}
-
- ~DocumentInfo()
- {}
-
- sal_uInt16 getGeneratorVersion() const
+ }
+ sal_Int32 nUPD, nBuild;
+ if ( rImport.getBuildIds( nUPD, nBuild ) )
+ {
+ if ( nUPD >= 640 && nUPD <= 645 )
+ {
+ mnGeneratorVersion = SvXMLImport::OOo_1x;
+ }
+ else if ( nUPD == 680 )
+ {
+ mnGeneratorVersion = SvXMLImport::OOo_2x;
+ }
+ else if ( nUPD == 300 && nBuild <= 9379 )
+ {
+ mnGeneratorVersion = SvXMLImport::OOo_30x;
+ }
+ else if ( nUPD == 310 )
+ {
+ mnGeneratorVersion = SvXMLImport::OOo_31x;
+ }
+ else if ( nUPD == 320 )
+ {
+ mnGeneratorVersion = SvXMLImport::OOo_32x;
+ }
+ else if ( nUPD == 330 )
+ {
+ mnGeneratorVersion = SvXMLImport::OOo_33x;
+ }
+ else if ( nUPD == 340 )
+ {
+ mnGeneratorVersion = SvXMLImport::OOo_34x;
+ }
+ else if (nUPD == 400)
+ {
+ mnGeneratorVersion = SvXMLImport::AOO_40x;
+ }
+ else if (nUPD >= 410)
{
- return mnGeneratorVersion;
+ // effectively this means "latest", see use
+ // in XMLGraphicsDefaultStyle::SetDefaults()!
+ mnGeneratorVersion = SvXMLImport::AOO_4x;
}
- };
+ }
+ }
+
+ ~DocumentInfo()
+ {}
+
+ sal_uInt16 getGeneratorVersion() const
+ {
+ return mnGeneratorVersion;
+ }
+};
+
}
class SvXMLImport_Impl
commit f9234784f05742a6d4bf3ddb62ce89d3c2a022d1
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Jan 5 19:35:05 2016 +0100
deleting a null pointer is fine
Change-Id: Iba329fae2d6882799a0d470590bb7bcfe88d1e92
diff --git a/oox/source/drawingml/chart/datasourcecontext.cxx b/oox/source/drawingml/chart/datasourcecontext.cxx
index ceb0efc..83893cb 100644
--- a/oox/source/drawingml/chart/datasourcecontext.cxx
+++ b/oox/source/drawingml/chart/datasourcecontext.cxx
@@ -44,10 +44,7 @@ DoubleSequenceContext::DoubleSequenceContext( ContextHandler2Helper& rParent, Da
DoubleSequenceContext::~DoubleSequenceContext()
{
- if( mpNumberFormatter != nullptr )
- {
- delete mpNumberFormatter;
- }
+ delete mpNumberFormatter;
}
ContextHandlerRef DoubleSequenceContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
More information about the Libreoffice-commits
mailing list