Makefile.in | 2 cui/source/dialogs/about.src | 2 desktop/source/app/app.cxx | 2 desktop/source/app/cmdlinehelp.cxx | 2 framework/source/fwe/helper/titlehelper.cxx | 15 ---- instsetoo_native/util/openoffice.lst.in | 24 +------ sfx2/source/bastyp/bastyp.src | 2 solenv/bin/modules/installer.pm | 3 solenv/bin/modules/installer/download.pm | 4 - solenv/bin/modules/installer/setupscript.pm | 25 ------- solenv/bin/modules/installer/ziplist.pm | 4 - solenv/bin/modules/t/installer-setupscript.t | 1 svx/source/dialog/linkwarn.src | 2 svx/source/src/app.src | 2 unotools/source/config/docinfohelper.cxx | 1 xmloff/inc/xmloff/xmlimp.hxx | 8 ++ xmloff/source/core/xmlimp.cxx | 89 +++++++++++++++++++++------ xmloff/source/draw/ximpshap.cxx | 6 - xmloff/source/meta/xmlmetai.cxx | 31 ++++++--- 19 files changed, 122 insertions(+), 103 deletions(-)
New commits: commit c106167f5f6ec1bff9b2291ff8791ca6d4d411c3 Author: Michael Stahl <[email protected]> Date: Fri Jan 18 22:14:57 2013 +0100 PRODUCTEXTENSION: fix various obvious strings and such... ... to look pretty; most of these expect PRODUCTEXTENSION to be a word like "Beta" but nowadays it is ".micro.rc.alphabeta" numbers so there should be no space before it. ReplaceStringHookProc adds insult to injury by refusing to replace %ABOUTBOX variables unless some %PRODUCT is in the string. Change-Id: Ib676f3837ab0785529a226fc9359e8defacf3459 diff --git a/cui/source/dialogs/about.src b/cui/source/dialogs/about.src index defcf90..8daf783 100644 --- a/cui/source/dialogs/about.src +++ b/cui/source/dialogs/about.src @@ -63,7 +63,7 @@ ModalDialog RID_DEFAULTABOUT }; String ABOUT_STR_VERSION { - Text [ en-US ] = "Version %ABOUTBOXPRODUCTVERSION%ABOUTBOXPRODUCTVERSIONSUFFIX %PRODUCTEXTENSION"; + Text [ en-US ] = "Version %ABOUTBOXPRODUCTVERSION%ABOUTBOXPRODUCTVERSIONSUFFIX"; }; String ABOUT_STR_DESCRIPTION { diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 96010c9..e384912 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -477,7 +477,7 @@ rtl::OUString ReplaceStringHookProc( const rtl::OUString& rStr ) { rtl::OUString sRet(rStr); - if ( sRet.indexOf( "%PRODUCT" ) != -1 ) + if (sRet.indexOf("%PRODUCT") != -1 || sRet.indexOf("%ABOUTBOX") != -1) { rtl::OUString sBrandName = BrandName::get(); rtl::OUString sVersion = Version::get(); diff --git a/desktop/source/app/cmdlinehelp.cxx b/desktop/source/app/cmdlinehelp.cxx index 8ed32f7..73d5613 100644 --- a/desktop/source/app/cmdlinehelp.cxx +++ b/desktop/source/app/cmdlinehelp.cxx @@ -45,7 +45,7 @@ namespace desktop // [OK] const char aCmdLineHelp_version[] = - "%PRODUCTNAME %PRODUCTVERSION %PRODUCTEXTENSION\n"\ + "%PRODUCTNAME %PRODUCTVERSION%PRODUCTEXTENSION\n"\ "\n"; const char aCmdLineHelp_head[] = "Usage: %CMDNAME [options] [documents...]\n"\ diff --git a/framework/source/fwe/helper/titlehelper.cxx b/framework/source/fwe/helper/titlehelper.cxx index ff64742..ec2ae43 100644 --- a/framework/source/fwe/helper/titlehelper.cxx +++ b/framework/source/fwe/helper/titlehelper.cxx @@ -490,7 +490,6 @@ void TitleHelper::impl_updateTitleForFrame (const css::uno::Reference< css::fram impl_appendComponentTitle (sTitle, xComponent); impl_appendProductName (sTitle); impl_appendModuleName (sTitle); - impl_appendProductExtension (sTitle); impl_appendDebugVersion (sTitle); // SYNCHRONIZED -> @@ -531,17 +530,6 @@ void TitleHelper::impl_appendProductName (::rtl::OUStringBuffer& sTitle) } //***************************************************************************************************************** -void TitleHelper::impl_appendProductExtension (::rtl::OUStringBuffer& sTitle) -{ - rtl::OUString ext(utl::ConfigManager::getProductExtension()); - if (!ext.isEmpty()) - { - sTitle.append(' '); - sTitle.append(ext); - } -} - -//***************************************************************************************************************** void TitleHelper::impl_appendModuleName (::rtl::OUStringBuffer& sTitle) { // SYNCHRONIZED -> @@ -578,6 +566,9 @@ void TitleHelper::impl_appendModuleName (::rtl::OUStringBuffer& sTitle) #ifdef DBG_UTIL void TitleHelper::impl_appendDebugVersion (::rtl::OUStringBuffer& sTitle) { + rtl::OUString version(utl::ConfigManager::getProductVersion()); + sTitle.append(' '); + sTitle.append(version); ::rtl::OUString sDefault(RTL_CONSTASCII_USTRINGPARAM("development")); ::rtl::OUString sVersion = ::utl::Bootstrap::getBuildIdData(sDefault); sTitle.appendAscii(RTL_CONSTASCII_STRINGPARAM(" [")); diff --git a/sfx2/source/bastyp/bastyp.src b/sfx2/source/bastyp/bastyp.src index 1d31cc8..6ade628 100644 --- a/sfx2/source/bastyp/bastyp.src +++ b/sfx2/source/bastyp/bastyp.src @@ -19,5 +19,5 @@ String STR_HTML_GENERATOR { - Text = "%PRODUCTNAME %PRODUCTVERSION %PRODUCTEXTENSION (%1)" ; + Text = "%PRODUCTNAME %PRODUCTVERSION%PRODUCTEXTENSION (%1)" ; }; diff --git a/svx/source/dialog/linkwarn.src b/svx/source/dialog/linkwarn.src index 56e0538..dd8eb54 100644 --- a/svx/source/dialog/linkwarn.src +++ b/svx/source/dialog/linkwarn.src @@ -28,7 +28,7 @@ ModalDialog RID_SVXDLG_LINK_WARNING Moveable = TRUE; SVLook = TRUE; - Text = "%PRODUCTNAME %PRODUCTVERSION %PRODUCTEXTENSION"; + Text = "%PRODUCTNAME %PRODUCTVERSION%PRODUCTEXTENSION"; FixedImage FI_QUERY { diff --git a/svx/source/src/app.src b/svx/source/src/app.src index 6591eb1..3b61482 100644 --- a/svx/source/src/app.src +++ b/svx/source/src/app.src @@ -22,7 +22,7 @@ //---------------------------------------------------------------------------- String RID_APPTITLE { - Text = "%PRODUCTNAME %PRODUCTVERSION %PRODUCTEXTENSION" ; + Text = "%PRODUCTNAME %PRODUCTVERSION%PRODUCTEXTENSION" ; }; #define MASKCOLOR MaskColor = Color { Red = 0xFFFF; Green = 0x0000; Blue = 0xFFFF; }; diff --git a/unotools/source/config/docinfohelper.cxx b/unotools/source/config/docinfohelper.cxx index e2b0e83..91c9569 100644 --- a/unotools/source/config/docinfohelper.cxx +++ b/unotools/source/config/docinfohelper.cxx @@ -50,7 +50,6 @@ namespace utl aValue = utl::ConfigManager::getProductExtension(); if ( !aValue.isEmpty() ) { - aResult.append( (sal_Unicode)'_' ); aResult.append( aValue.replace( ' ', '_' ) ); } } commit e024a8d88dbca3a2d178ad88c069721a92156ddf Author: Michael Stahl <[email protected]> Date: Fri Jan 18 19:20:42 2013 +0100 installer: remove SHORT_PRODUCTEXTENSION Currently PRODUCTEXTENSION does not have a value, which is unfortunate because some places such as the soffice --help output and utl::DocInfoHelper::GetGeneratorString() which creates the meta:generator for ODF files (via Setup.xcu Product/ooSetupExtension) write an incomplete version number. Since there doesn't appear to be a point in having 2 variables here, remove SHORT_ one and use PRODUCTEXTENSION consistently. Change-Id: I5aac25bcedd785a098cba612643ea68fe19c77f0 diff --git a/instsetoo_native/util/openoffice.lst.in b/instsetoo_native/util/openoffice.lst.in index a6c7912..86d92f8 100644 --- a/instsetoo_native/util/openoffice.lst.in +++ b/instsetoo_native/util/openoffice.lst.in @@ -43,8 +43,7 @@ LibreOffice { PRODUCTNAME LibreOffice PRODUCTVERSION @LIBO_VERSION_MAJOR@.@LIBO_VERSION_MINOR@ - PRODUCTEXTENSION - SHORT_PRODUCTEXTENSION .@LIBO_VERSION_MICRO@.@LIBO_VERSION_PATCH@@LIBO_VERSION_SUFFIX@ + PRODUCTEXTENSION .@LIBO_VERSION_MICRO@.@LIBO_VERSION_PATCH@@LIBO_VERSION_SUFFIX@ POSTVERSIONEXTENSION BRANDPACKAGEVERSION @LIBO_VERSION_MAJOR@.@LIBO_VERSION_MINOR@ USERDIRPRODUCTVERSION @LIBO_VERSION_MAJOR@ @@ -93,8 +92,7 @@ LibreOffice_Dev { PRODUCTNAME LOdev PRODUCTVERSION @LIBO_VERSION_MAJOR@.@LIBO_VERSION_MINOR@ - PRODUCTEXTENSION - SHORT_PRODUCTEXTENSION .@LIBO_VERSION_MICRO@.@LIBO_VERSION_PATCH@@LIBO_VERSION_SUFFIX@ + PRODUCTEXTENSION .@LIBO_VERSION_MICRO@.@LIBO_VERSION_PATCH@@LIBO_VERSION_SUFFIX@ UNIXBASISROOTNAME lodev@LIBO_VERSION_MAJOR@.@LIBO_VERSION_MINOR@ POSTVERSIONEXTENSION BRANDPACKAGEVERSION @LIBO_VERSION_MAJOR@.@LIBO_VERSION_MINOR@ @@ -151,8 +149,7 @@ LibreOffice_SDK { PRODUCTNAME LibreOffice PRODUCTVERSION @LIBO_VERSION_MAJOR@.@LIBO_VERSION_MINOR@ - PRODUCTEXTENSION - SHORT_PRODUCTEXTENSION .@LIBO_VERSION_MICRO@.@LIBO_VERSION_PATCH@@LIBO_VERSION_SUFFIX@ + PRODUCTEXTENSION .@LIBO_VERSION_MICRO@.@LIBO_VERSION_PATCH@@LIBO_VERSION_SUFFIX@ POSTVERSIONEXTENSION SDK BRANDPACKAGEVERSION @LIBO_VERSION_MAJOR@.@LIBO_VERSION_MINOR@ PACKAGEVERSION @LIBO_VERSION_MAJOR@.@LIBO_VERSION_MINOR@.@LIBO_VERSION_MICRO@.@LIBO_VERSION_PATCH@@LIBO_VERSION_SUFFIX@ @@ -190,8 +187,7 @@ LibreOffice_Dev_SDK { PRODUCTNAME LOdev PRODUCTVERSION @LIBO_VERSION_MAJOR@.@LIBO_VERSION_MINOR@ - PRODUCTEXTENSION - SHORT_PRODUCTEXTENSION .@LIBO_VERSION_MICRO@.@LIBO_VERSION_PATCH@@LIBO_VERSION_SUFFIX@ + PRODUCTEXTENSION .@LIBO_VERSION_MICRO@.@LIBO_VERSION_PATCH@@LIBO_VERSION_SUFFIX@ UNIXBASISROOTNAME lodev@LIBO_VERSION_MAJOR@.@LIBO_VERSION_MINOR@ POSTVERSIONEXTENSION SDK BRANDPACKAGEVERSION @LIBO_VERSION_MAJOR@.@LIBO_VERSION_MINOR@ @@ -235,8 +231,7 @@ LibreOffice_Test { PRODUCTNAME LibreOffice PRODUCTVERSION @LIBO_VERSION_MAJOR@.@LIBO_VERSION_MINOR@ - PRODUCTEXTENSION - SHORT_PRODUCTEXTENSION .@LIBO_VERSION_MICRO@.@LIBO_VERSION_PATCH@@LIBO_VERSION_SUFFIX@ + PRODUCTEXTENSION .@LIBO_VERSION_MICRO@.@LIBO_VERSION_PATCH@@LIBO_VERSION_SUFFIX@ POSTVERSIONEXTENSION TEST BRANDPACKAGEVERSION @LIBO_VERSION_MAJOR@.@LIBO_VERSION_MINOR@ PACKAGEVERSION @LIBO_VERSION_MAJOR@.@LIBO_VERSION_MINOR@.@LIBO_VERSION_MICRO@.@LIBO_VERSION_PATCH@@LIBO_VERSION_SUFFIX@ @@ -274,8 +269,7 @@ LibreOffice_Dev_Test { PRODUCTNAME LOdev PRODUCTVERSION @LIBO_VERSION_MAJOR@.@LIBO_VERSION_MINOR@ - PRODUCTEXTENSION - SHORT_PRODUCTEXTENSION .@LIBO_VERSION_MICRO@.@LIBO_VERSION_PATCH@@LIBO_VERSION_SUFFIX@ + PRODUCTEXTENSION .@LIBO_VERSION_MICRO@.@LIBO_VERSION_PATCH@@LIBO_VERSION_SUFFIX@ UNIXBASISROOTNAME lodev@LIBO_VERSION_MAJOR@.@LIBO_VERSION_MINOR@ POSTVERSIONEXTENSION TEST BRANDPACKAGEVERSION @LIBO_VERSION_MAJOR@.@LIBO_VERSION_MINOR@ diff --git a/solenv/bin/modules/installer/download.pm b/solenv/bin/modules/installer/download.pm index 21bd62f..6d370ae 100644 --- a/solenv/bin/modules/installer/download.pm +++ b/solenv/bin/modules/installer/download.pm @@ -345,7 +345,7 @@ sub get_download_version my $version = ""; $version = $allvariables->{'PRODUCTVERSION'}; - if (( $allvariables->{'SHORT_PRODUCTEXTENSION'} ) && ( $allvariables->{'SHORT_PRODUCTEXTENSION'} ne "" )) { $version = $version . $allvariables->{'SHORT_PRODUCTEXTENSION'}; } + if (( $allvariables->{'PRODUCTEXTENSION'} ) && ( $allvariables->{'PRODUCTEXTENSION'} ne "" )) { $version = $version . $allvariables->{'PRODUCTEXTENSION'}; } return $version; } @@ -586,7 +586,7 @@ sub resolve_variables_in_downloadname $downloadname =~ s/\{packageversion\}/$packageversion/; my $extension = ""; - if ( $allvariables->{'SHORT_PRODUCTEXTENSION'} ) { $extension = $allvariables->{'SHORT_PRODUCTEXTENSION'}; } + if ( $allvariables->{'PRODUCTEXTENSION'} ) { $extension = $allvariables->{'PRODUCTEXTENSION'}; } $extension = lc($extension); $downloadname =~ s/\{extension\}/$extension/; diff --git a/solenv/bin/modules/installer/ziplist.pm b/solenv/bin/modules/installer/ziplist.pm index aa15ba0..06b9dd9 100644 --- a/solenv/bin/modules/installer/ziplist.pm +++ b/solenv/bin/modules/installer/ziplist.pm @@ -843,9 +843,9 @@ sub add_variables_to_allvariableshashref my $lcvariable = lc($variableshashref->{'PRODUCTNAME'}); $variableshashref->{'LCPRODUCTNAME'} = $lcvariable; - if ($variableshashref->{'SHORT_PRODUCTEXTENSION'}) + if ($variableshashref->{'PRODUCTEXTENSION'}) { - $variableshashref->{'LCPRODUCTEXTENSION'} = "\-" . lc($variableshashref->{'SHORT_PRODUCTEXTENSION'}); # including the "-" ! + $variableshashref->{'LCPRODUCTEXTENSION'} = "\-" . lc($variableshashref->{'PRODUCTEXTENSION'}); # including the "-" ! } else { commit 9a5183ddad4d361c406823fb56bb68b27e43063e Author: Michael Stahl <[email protected]> Date: Fri Jan 18 19:16:19 2013 +0100 installer: remove SERVICETAG remnants of product registration Change-Id: Ic87bb4666bcc4b28476dbfe2193a8330413547cf diff --git a/instsetoo_native/util/openoffice.lst.in b/instsetoo_native/util/openoffice.lst.in index 79113e4..a6c7912 100644 --- a/instsetoo_native/util/openoffice.lst.in +++ b/instsetoo_native/util/openoffice.lst.in @@ -8,11 +8,6 @@ Globals URELAYERVERSION 1 REFERENCEOOOMAJORMINOR 3.4 UNIXBASISROOTNAME libreoffice@LIBO_VERSION_MAJOR@.@LIBO_VERSION_MINOR@ - SERVICETAG_PRODUCTNAME LibreOffice @LIBO_VERSION_MAJOR@.@LIBO_VERSION_MINOR@ - SERVICETAG_PRODUCTVERSION @LIBO_VERSION_MAJOR@.@LIBO_VERSION_MINOR@ - SERVICETAG_PARENTNAME LibreOffice @LIBO_VERSION_MAJOR@.@LIBO_VERSION_MINOR@ - SERVICETAG_SOURCE {buildsource}{minor}(Build:{buildid}) - SERVICETAG_URN urn:uuid:0187debd-e458-11de-82d6-080020a9ed93 HIDELICENSEDIALOG 1 PACKAGEPREFIX BASISPACKAGEPREFIX libobasis @@ -112,7 +107,6 @@ LibreOffice_Dev UREPACKAGEPREFIX lodev SOLSUREPACKAGEPREFIX lodev REGISTRYLAYERNAME LayerDev - SERVICETAG_URN urn:uuid:1680b00d-e45c-11de-82d6-080020a9ed93 UPDATEURL http://update.libreoffice.org/check.php ADD_INCLUDE_FILES cliureversion.mk,clioootypesversion.mk ADDSYSTEMINTEGRATION 1 diff --git a/solenv/bin/modules/installer.pm b/solenv/bin/modules/installer.pm index 4df3bc7..91b3ef0 100644 --- a/solenv/bin/modules/installer.pm +++ b/solenv/bin/modules/installer.pm @@ -280,9 +280,6 @@ sub run { installer::setupscript::add_installationobject_to_variables($allvariableshashref, $allscriptvariablesref); - # Adding also all variables, that must be included into the $allvariableshashref. - installer::setupscript::add_forced_properties($allvariableshashref); - # Replacing preset properties, not using the default mechanisms (for example for UNIXPRODUCTNAME) installer::setupscript::replace_preset_properties($allvariableshashref); diff --git a/solenv/bin/modules/installer/setupscript.pm b/solenv/bin/modules/installer/setupscript.pm index 53590d3..08d20cf 100644 --- a/solenv/bin/modules/installer/setupscript.pm +++ b/solenv/bin/modules/installer/setupscript.pm @@ -37,7 +37,6 @@ use installer::scriptitems; use installer::ziplist; our @EXPORT_OK = qw( - add_forced_properties add_installationobject_to_variables add_lowercase_productname_setupscriptvariable add_predefined_folder @@ -463,30 +462,6 @@ sub add_installationobject_to_variables } ##################################################################################### -# Adding all variables, that must be defined, but are not defined until now. -##################################################################################### - -sub add_forced_properties -{ - my ($allvariables) = @_; - - my @forced_properties = qw( - SERVICETAG_PRODUCTNAME - SERVICETAG_PRODUCTVERSION - SERVICETAG_PARENTNAME - SERVICETAG_SOURCE - SERVICETAG_URN - ); - - for my $property (@forced_properties) - { - if ( ! exists($allvariables->{$property}) ) { - $allvariables->{$property} = ""; - } - } -} - -##################################################################################### # Some properties are created automatically. It should be possible to # overwrite them, with PRESET properties. For example UNIXPRODUCTNAME # with PRESETUNIXPRODUCTNAME, if this is defined and the automatic process diff --git a/solenv/bin/modules/t/installer-setupscript.t b/solenv/bin/modules/t/installer-setupscript.t index 1320d7f..2079efe 100644 --- a/solenv/bin/modules/t/installer-setupscript.t +++ b/solenv/bin/modules/t/installer-setupscript.t @@ -32,7 +32,6 @@ use lib '.'; BEGIN { use_ok('installer::setupscript', qw( - add_forced_properties add_installationobject_to_variables add_lowercase_productname_setupscriptvariable add_predefined_folder commit 2a9ecb89d40373286da00386a874098c857847c1 Author: Michael Stahl <[email protected]> Date: Fri Jan 18 22:11:53 2013 +0100 Makefile.in: rebuild configure on .in file changes Change-Id: I9359cca02f6c48efb50ce446d32695d14a0c81fa diff --git a/Makefile.in b/Makefile.in index a383ecd..c28ca6b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -31,6 +31,8 @@ Makefile: $(BUILDDIR)/config_host.mk force-restart $(BUILDDIR)/config_host.mk : \ $(SRCDIR)/config_host.mk.in \ $(SRCDIR)/Makefile.in \ + $(SRCDIR)/solenv/inc/minor.mk.in \ + $(SRCDIR)/instsetoo_native/util/openoffice.lst.in \ $(SRCDIR)/configure.ac \ $(BUILDDIR)/autogen.lastrun $(SRCDIR)/autogen.sh commit bea63709d05514555d5283279cd66439f4ceed73 Author: Michael Stahl <[email protected]> Date: Fri Jan 18 23:40:13 2013 +0100 xmloff: refactor Generator version handling: Since there are now 2 forks of OpenOffice.org, we cannot rely on a simple total ordering of versions any more; add a new function SvXMLImport::isGeneratorVersionOlderThan(), taking 2 reference versions. Also extract the LibreOffice version number from the generator string, and extend the BuildId property to store this as a third number. This also allows removal of the "fake LibreOffice3 as OpenOffice.org 3.3 release" hack, which is not future-proof. Change-Id: I44d8105eb537ac43fb9529a8b1b661ae0f2bba30 diff --git a/xmloff/inc/xmloff/xmlimp.hxx b/xmloff/inc/xmloff/xmlimp.hxx index 4fac737..d97fe84 100644 --- a/xmloff/inc/xmloff/xmlimp.hxx +++ b/xmloff/inc/xmloff/xmlimp.hxx @@ -423,8 +423,16 @@ public: static const sal_uInt16 OOo_32x = 32; static const sal_uInt16 OOo_33x = 33; static const sal_uInt16 OOo_34x = 34; + static const sal_uInt16 LO_flag = 0x100; + static const sal_uInt16 LO_3x = 30 | LO_flag; + static const sal_uInt16 LO_4x = 40 | LO_flag; static const sal_uInt16 ProductVersionUnknown = SAL_MAX_UINT16; + /** depending on whether the generator version indicates LO, compare + against either the given LO or given OOo version */ + bool isGeneratorVersionOlderThan( + sal_uInt16 const nOOoVersion, sal_uInt16 const nLOVersion); + /** this checks the build ID and returns * OOo_1x for files created with OpenOffice.org 1.x or StarOffice 7 (this also includes binary import over binfilter) diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 3cdd319..6b492ef 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -157,6 +157,31 @@ void SAL_CALL SvXMLImportEventListener::disposing( const lang::EventObject& ) namespace { + +static OUString +getBuildIdsProperty(uno::Reference<beans::XPropertySet> const& xImportInfo) +{ + if (xImportInfo.is()) + { + try + { + Reference< XPropertySetInfo > const xSetInfo( + xImportInfo->getPropertySetInfo()); + if (xSetInfo.is() && xSetInfo->hasPropertyByName("BuildId")) + { + OUString aBuildId; + xImportInfo->getPropertyValue("BuildId") >>= aBuildId; + return aBuildId; + } + } + catch (Exception const& e) + { + SAL_WARN("xmloff", "exception getting BuildId" << e.Message); + } + } + return OUString(); +} + class DocumentInfo { private: @@ -166,6 +191,30 @@ namespace 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 loVersion(buildIds.copy(ix + 1)); + if (!loVersion.isEmpty()) + { + if ('3' == loVersion[0]) + { + mnGeneratorVersion = SvXMLImport::LO_3x; + } + else + { + SAL_INFO_IF('4' != loVersion[0], "xmloff", + "unknown LO version: " << loVersion); + mnGeneratorVersion = SvXMLImport::LO_4x; + } + return; // ignore buildIds + } + } + } sal_Int32 nUPD, nBuild; if ( rImport.getBuildIds( nUPD, nBuild ) ) { @@ -1769,29 +1818,20 @@ void SvXMLImport::initXForms() bool SvXMLImport::getBuildIds( sal_Int32& rUPD, sal_Int32& rBuild ) const { bool bRet = false; - if( mxImportInfo.is() ) try + OUString const aBuildId(getBuildIdsProperty(mxImportInfo)); + if (!aBuildId.isEmpty()) { - const OUString aPropName( "BuildId" ); - Reference< XPropertySetInfo > xSetInfo( mxImportInfo->getPropertySetInfo() ); - if( xSetInfo.is() && xSetInfo->hasPropertyByName( aPropName ) ) + sal_Int32 nIndex = aBuildId.indexOf('$'); + if (nIndex != -1) { - OUString aBuildId; - mxImportInfo->getPropertyValue( aPropName ) >>= aBuildId; - if( !aBuildId.isEmpty() ) - { - sal_Int32 nIndex = aBuildId.indexOf('$'); - if( nIndex != -1 ) - { - rUPD = aBuildId.copy( 0, nIndex ).toInt32(); - rBuild = aBuildId.copy( nIndex+1 ).toInt32(); - bRet = true; - } - } + rUPD = aBuildId.copy( 0, nIndex ).toInt32(); + sal_Int32 nIndexEnd = aBuildId.indexOf(';', nIndex); + rBuild = (nIndexEnd == -1) + ? aBuildId.copy(nIndex + 1).toInt32() + : aBuildId.copy(nIndex + 1, nIndexEnd - nIndex - 1).toInt32(); + bRet = true; } } - catch( Exception& ) - { - } return bRet; } @@ -1802,6 +1842,17 @@ sal_uInt16 SvXMLImport::getGeneratorVersion() const // <-- } +bool SvXMLImport::isGeneratorVersionOlderThan( + sal_uInt16 const nOOoVersion, sal_uInt16 const nLOVersion) +{ + assert( (nLOVersion & LO_flag)); + assert(!(nOOoVersion & LO_flag)); + const sal_uInt16 nGeneratorVersion(getGeneratorVersion()); + return (nGeneratorVersion & LO_flag) + ? nGeneratorVersion < nLOVersion + : nGeneratorVersion < nOOoVersion; +} + bool SvXMLImport::isGraphicLoadOnDemandSupported() const { return mbIsGraphicLoadOnDemandSupported; diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index 3143910..08d8decf 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -2696,10 +2696,8 @@ void SdXMLObjectShapeContext::StartElement( const ::com::sun::star::uno::Referen void SdXMLObjectShapeContext::EndElement() { - // #i67705# - const sal_uInt16 nGeneratorVersion(GetImport().getGeneratorVersion()); - - if(nGeneratorVersion < SvXMLImport::OOo_34x) + if (GetImport().isGeneratorVersionOlderThan( + SvXMLImport::OOo_34x, SvXMLImport::LO_4x)) { // #i118485# // If it's an old file from us written before OOo3.4, we need to correct diff --git a/xmloff/source/meta/xmlmetai.cxx b/xmloff/source/meta/xmlmetai.cxx index ba9c58b..af3362f 100644 --- a/xmloff/source/meta/xmlmetai.cxx +++ b/xmloff/source/meta/xmlmetai.cxx @@ -279,17 +279,27 @@ void SvXMLMetaDocumentContext::setBuildId(::rtl::OUString const& i_rBuildId, con sBuildId = OUString("680$9134"); // fake NeoOffice as OpenOffice.org 2.2 release } } -// Is this really what we want / correct ? -#ifdef FIXME_REMOVE_WHEN_RE_BASE_COMPLETE - else + + if (i_rBuildId.startsWith("LibreOffice/")) { - if (i_rBuildId.startsWith("LibreOffice/3")) + OUStringBuffer sNumber; + for (sal_Int32 i = sizeof("LibreOffice/") - 1; + i < i_rBuildId.getLength(); ++i) + { + if (isdigit(i_rBuildId[i])) + { + sNumber.append(i_rBuildId[i]); + } + else if ('.' != i_rBuildId[i]) + { + break; + } + } + if (sNumber.getLength()) { - // #118558# fake LibreOffice3 as OpenOffice.org 3.3 release - sBuildId = OUString::createFromAscii( "330$9567" ); + sBuildId += (";" + sNumber.makeStringAndClear()); } } -#endif if ( !sBuildId.isEmpty() ) try { commit 0669d78ea76ab9bfeff27ea02d785973f3720d6b Author: Michael Stahl <[email protected]> Date: Fri Jan 18 17:47:20 2013 +0100 fdo#59517: fix detection of ancient OOo ODF generator strings: SvXMLMetaDocumentContext::setBuildId: check only the prefix of the generator string, not all of it. (regression from 17ff7b41d15ab9928e2e2706faa26234a09802cd) Change-Id: I0cdd958d67cd13fd2368cc6958893ce3528a9e94 diff --git a/xmloff/source/meta/xmlmetai.cxx b/xmloff/source/meta/xmlmetai.cxx index 651d6a5..ba9c58b 100644 --- a/xmloff/source/meta/xmlmetai.cxx +++ b/xmloff/source/meta/xmlmetai.cxx @@ -268,12 +268,13 @@ void SvXMLMetaDocumentContext::setBuildId(::rtl::OUString const& i_rBuildId, con if ( sBuildId.isEmpty() ) { - if ( i_rBuildId == "StarOffice 7" || i_rBuildId == "StarSuite 7" || - i_rBuildId == "OpenOffice.org 1" ) + if ( i_rBuildId.startsWith("StarOffice 7") + || i_rBuildId.startsWith("StarSuite 7") + || i_rBuildId.startsWith("OpenOffice.org 1")) { sBuildId = OUString("645$8687"); } - else if ( i_rBuildId == "NeoOffice/2" ) + else if (i_rBuildId.startsWith("NeoOffice/2")) { sBuildId = OUString("680$9134"); // fake NeoOffice as OpenOffice.org 2.2 release } @@ -282,7 +283,7 @@ void SvXMLMetaDocumentContext::setBuildId(::rtl::OUString const& i_rBuildId, con #ifdef FIXME_REMOVE_WHEN_RE_BASE_COMPLETE else { - if ( i_rBuildId == "LibreOffice/3" ) + if (i_rBuildId.startsWith("LibreOffice/3")) { // #118558# fake LibreOffice3 as OpenOffice.org 3.3 release sBuildId = OUString::createFromAscii( "330$9567" ); _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
