This is an automated email from the ASF dual-hosted git repository. mseidel pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/trunk by this push: new 2eda3cb Fixed more typos (catched -> caught), removed whitespace 2eda3cb is described below commit 2eda3cbf09288370cef8ee33ae6d85a5cf00a3bb Author: mseidel <msei...@apache.org> AuthorDate: Sun Oct 25 20:05:08 2020 +0100 Fixed more typos (catched -> caught), removed whitespace --- .../source/xsltdialog/typedetectionexport.cxx | 22 +- main/filter/source/xsltdialog/xmlfilterjar.cxx | 100 +++---- .../source/xsltdialog/xmlfiltersettingsdialog.cxx | 242 ++++++++--------- .../source/xsltdialog/xmlfiltertabdialog.cxx | 16 +- .../source/xsltdialog/xmlfiltertestdialog.cxx | 68 ++--- main/sc/source/core/data/globalx.cxx | 86 +++--- main/sc/source/filter/xml/xmlwrap.cxx | 192 +++++++------- main/sd/source/filter/xml/sdxmlwrp.cxx | 78 +++--- main/sd/source/ui/app/sdxfer.cxx | 166 ++++++------ main/sw/source/core/unocore/unoparagraph.cxx | 24 +- main/sw/source/core/unocore/unoport.cxx | 30 +-- main/sw/source/filter/xml/swxml.cxx | 292 +++++++++++---------- main/xmlhelp/source/cxxhelp/test/searchdemo.cxx | 39 +-- 13 files changed, 679 insertions(+), 676 deletions(-) diff --git a/main/filter/source/xsltdialog/typedetectionexport.cxx b/main/filter/source/xsltdialog/typedetectionexport.cxx index faa52a2..59b42e5 100644 --- a/main/filter/source/xsltdialog/typedetectionexport.cxx +++ b/main/filter/source/xsltdialog/typedetectionexport.cxx @@ -1,5 +1,5 @@ /************************************************************** - * + * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -7,16 +7,16 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * + * *************************************************************/ @@ -52,7 +52,7 @@ TypeDetectionExporter::TypeDetectionExporter( Reference< XMultiServiceFactory >& static OUString createRelativeURL( const OUString& rFilterName, const OUString& rURL ) { - if( rURL.getLength() && + if( rURL.getLength() && (rURL.compareToAscii( RTL_CONSTASCII_STRINGPARAM("http:") ) != 0) && (rURL.compareToAscii( RTL_CONSTASCII_STRINGPARAM("shttp:") ) != 0) && (rURL.compareToAscii( RTL_CONSTASCII_STRINGPARAM("jar:") ) != 0) && @@ -85,7 +85,7 @@ static OUString createRelativeURL( const OUString& rFilterName, const OUString& } } -void TypeDetectionExporter::doExport( Reference< XOutputStream > xOS, const XMLFilterVector& rFilters ) +void TypeDetectionExporter::doExport( Reference< XOutputStream > xOS, const XMLFilterVector& rFilters ) { try { @@ -149,7 +149,7 @@ void TypeDetectionExporter::doExport( Reference< XOutputStream > xOS, const XML sValue += sComma; sValue += OUString::valueOf( pFilter->mnDocumentIconID ); sValue += sComma; - + addProperty( xHandler, sData, sValue ); addLocaleProperty( xHandler, sUIName, pFilter->maInterfaceName ); xHandler->ignorableWhitespace ( sWhiteSpace ); @@ -193,7 +193,7 @@ void TypeDetectionExporter::doExport( Reference< XOutputStream > xOS, const XML sValue += sXSLTFilterService; sValue += sDelim; sValue += sDelim; - + const application_info_impl* pAppInfo = getApplicationInfo( pFilter->maExportService ); sValue += pAppInfo->maXMLImporter; sValue += sDelim; @@ -227,7 +227,7 @@ void TypeDetectionExporter::doExport( Reference< XOutputStream > xOS, const XML } catch( Exception& ) { - DBG_ERROR( "TypeDetectionExporter::doExport exception catched!" ); + DBG_ERROR( "TypeDetectionExporter::doExport exception caught!" ); } } @@ -257,7 +257,7 @@ void TypeDetectionExporter::addProperty( Reference< XDocumentHandler > xHandler, } catch( Exception& ) { - DBG_ERROR( "TypeDetectionExporter::addProperty exception catched!" ); + DBG_ERROR( "TypeDetectionExporter::addProperty exception caught!" ); } } @@ -288,7 +288,7 @@ void TypeDetectionExporter::addLocaleProperty( Reference< XDocumentHandler > xHa } catch( Exception& ) { - DBG_ERROR( "TypeDetectionExporter::addLocaleProperty exception catched!" ); + DBG_ERROR( "TypeDetectionExporter::addLocaleProperty exception caught!" ); } } diff --git a/main/filter/source/xsltdialog/xmlfilterjar.cxx b/main/filter/source/xsltdialog/xmlfilterjar.cxx index 182415f..6786a03 100644 --- a/main/filter/source/xsltdialog/xmlfilterjar.cxx +++ b/main/filter/source/xsltdialog/xmlfilterjar.cxx @@ -1,5 +1,5 @@ /************************************************************** - * + * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -7,16 +7,16 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * + * *************************************************************/ @@ -97,9 +97,9 @@ static OUString encodeZipUri( const OUString& rURI ) static Reference< XInterface > addFolder( Reference< XInterface >& xRootFolder, Reference< XSingleServiceFactory >& xFactory, const OUString& rName ) throw( Exception ) { - if ( rName.equals( OUString( RTL_CONSTASCII_USTRINGPARAM( ".." ) ) ) - || rName.equals( OUString( RTL_CONSTASCII_USTRINGPARAM( "." ) ) ) ) - throw lang::IllegalArgumentException(); + if ( rName.equals( OUString( RTL_CONSTASCII_USTRINGPARAM( ".." ) ) ) + || rName.equals( OUString( RTL_CONSTASCII_USTRINGPARAM( "." ) ) ) ) + throw lang::IllegalArgumentException(); Sequence< Any > aArgs(1); aArgs[0] <<= (sal_Bool)sal_True; @@ -121,12 +121,12 @@ static Reference< XInterface > addFolder( Reference< XInterface >& xRootFolder, static void _addFile( Reference< XInterface >& xRootFolder, Reference< XSingleServiceFactory >& xFactory, Reference< XInputStream >& xInput, OUString aName ) throw( Exception ) { - Reference< XActiveDataSink > xSink( xFactory->createInstance(), UNO_QUERY ); - Reference< XUnoTunnel > xTunnel( xSink, UNO_QUERY ); + Reference< XActiveDataSink > xSink( xFactory->createInstance(), UNO_QUERY ); + Reference< XUnoTunnel > xTunnel( xSink, UNO_QUERY ); if( xSink.is() && xTunnel.is()) - { - Reference< XNameContainer > xNameContainer(xRootFolder, UNO_QUERY ); - xNameContainer->insertByName(aName = encodeZipUri( aName ), makeAny(xTunnel)); + { + Reference< XNameContainer > xNameContainer(xRootFolder, UNO_QUERY ); + xNameContainer->insertByName(aName = encodeZipUri( aName ), makeAny(xTunnel)); xSink->setInputStream( xInput ); } } @@ -134,14 +134,14 @@ static void _addFile( Reference< XInterface >& xRootFolder, Reference< XSingleSe /* static void addFile( Reference< XInterface > xRootFolder, Reference< XSingleServiceFactory > xFactory, const OUString& rSourceFile, const OUString& rName ) throw( Exception ) { - Reference< XInputStream > xInput( new utl::OSeekableInputStreamWrapper( new SvFileStream(rSourceFile, STREAM_READ ), true ) ); + Reference< XInputStream > xInput( new utl::OSeekableInputStreamWrapper( new SvFileStream(rSourceFile, STREAM_READ ), true ) ); _addFile( xRootFolder, xFactory, xInput, rName ); } */ void XMLFilterJarHelper::addFile( Reference< XInterface > xRootFolder, Reference< XSingleServiceFactory > xFactory, const OUString& rSourceFile ) throw( Exception ) { - if( rSourceFile.getLength() && + if( rSourceFile.getLength() && (rSourceFile.compareToAscii( RTL_CONSTASCII_STRINGPARAM("http:") ) != 0) && (rSourceFile.compareToAscii( RTL_CONSTASCII_STRINGPARAM("shttp:") ) != 0) && (rSourceFile.compareToAscii( RTL_CONSTASCII_STRINGPARAM("jar:") ) != 0) && @@ -158,7 +158,7 @@ void XMLFilterJarHelper::addFile( Reference< XInterface > xRootFolder, Reference OUString aName( aURL.getName() ); SvFileStream* pStream = new SvFileStream(aFileURL, STREAM_READ ); - Reference< XInputStream > xInput( new utl::OSeekableInputStreamWrapper( pStream, true ) ); + Reference< XInputStream > xInput( new utl::OSeekableInputStreamWrapper( pStream, true ) ); _addFile( xRootFolder, xFactory, xInput, aName ); } } @@ -174,11 +174,11 @@ bool XMLFilterJarHelper::savePackage( const OUString& rPackageURL, const XMLFilt Sequence< Any > aArguments( 2 ); aArguments[ 0 ] <<= rPackageURL; - // let ZipPackage be used ( no manifest.xml is required ) - beans::NamedValue aArg; - aArg.Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StorageFormat" ) ); - aArg.Value <<= ZIP_STORAGE_FORMAT_STRING; - aArguments[ 1 ] <<= aArg; + // let ZipPackage be used ( no manifest.xml is required ) + beans::NamedValue aArg; + aArg.Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StorageFormat" ) ); + aArg.Value <<= ZIP_STORAGE_FORMAT_STRING; + aArguments[ 1 ] <<= aArg; Reference< XHierarchicalNameAccess > xIfc( mxMSF->createInstanceWithArguments( @@ -201,7 +201,7 @@ bool XMLFilterJarHelper::savePackage( const OUString& rPackageURL, const XMLFilt { const filter_info_impl* pFilter = (*aIter); - Reference< XInterface > xFilterRoot( addFolder( xRootFolder, xFactory, pFilter->maFilterName ) ); + Reference< XInterface > xFilterRoot( addFolder( xRootFolder, xFactory, pFilter->maFilterName ) ); if( xFilterRoot.is() ) { @@ -217,7 +217,7 @@ bool XMLFilterJarHelper::savePackage( const OUString& rPackageURL, const XMLFilt } catch( com::sun::star::container::ElementExistException&) { - // in case of same named import / export XSLT the latter + // in case of same named import / export XSLT the latter // is ignored DBG_ERROR( "XMLFilterJarHelper::same named xslt filter exception!" ); } @@ -243,9 +243,9 @@ bool XMLFilterJarHelper::savePackage( const OUString& rPackageURL, const XMLFilt aExporter.doExport(xOS,rFilters); } - Reference< XInputStream > XIS( new utl::OSeekableInputStreamWrapper( new SvFileStream(aTempFileURL, STREAM_READ ), true ) ); + Reference< XInputStream > XIS( new utl::OSeekableInputStreamWrapper( new SvFileStream(aTempFileURL, STREAM_READ ), true ) ); OUString szTypeDetection( RTL_CONSTASCII_USTRINGPARAM( "TypeDetection.xcu" ) ); - _addFile( xRootFolder, xFactory, XIS, szTypeDetection ); + _addFile( xRootFolder, xFactory, XIS, szTypeDetection ); Reference< XChangesBatch > xBatch( xIfc, UNO_QUERY ); if( xBatch.is() ) @@ -256,7 +256,7 @@ bool XMLFilterJarHelper::savePackage( const OUString& rPackageURL, const XMLFilt } catch( Exception& ) { - DBG_ERROR( "XMLFilterJarHelper::savePackage exception catched!" ); + DBG_ERROR( "XMLFilterJarHelper::savePackage exception caught!" ); } osl::File::remove( rPackageURL ); @@ -277,11 +277,11 @@ void XMLFilterJarHelper::openPackage( const OUString& rPackageURL, XMLFilterVect Sequence< Any > aArguments( 2 ); aArguments[ 0 ] <<= rPackageURL; - // let ZipPackage be used ( no manifest.xml is required ) - beans::NamedValue aArg; - aArg.Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StorageFormat" ) ); - aArg.Value <<= ZIP_STORAGE_FORMAT_STRING; - aArguments[ 1 ] <<= aArg; + // let ZipPackage be used ( no manifest.xml is required ) + beans::NamedValue aArg; + aArg.Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StorageFormat" ) ); + aArg.Value <<= ZIP_STORAGE_FORMAT_STRING; + aArguments[ 1 ] <<= aArg; Reference< XHierarchicalNameAccess > xIfc( mxMSF->createInstanceWithArguments( @@ -333,7 +333,7 @@ void XMLFilterJarHelper::openPackage( const OUString& rPackageURL, XMLFilterVect } catch( Exception& ) { - DBG_ERROR( "XMLFilterJarHelper::savePackage exception catched!" ); + DBG_ERROR( "XMLFilterJarHelper::savePackage exception caught!" ); } } @@ -362,9 +362,9 @@ bool XMLFilterJarHelper::copyFile( Reference< XHierarchicalNameAccess > xIfc, OU { OUString szPackagePath( encodeZipUri( rURL.copy( sVndSunStarPackage.getLength() ) ) ); - if ( ::comphelper::OStorageHelper::PathHasSegment( szPackagePath, OUString( RTL_CONSTASCII_USTRINGPARAM( ".." ) ) ) - || ::comphelper::OStorageHelper::PathHasSegment( szPackagePath, OUString( RTL_CONSTASCII_USTRINGPARAM( "." ) ) ) ) - throw lang::IllegalArgumentException(); + if ( ::comphelper::OStorageHelper::PathHasSegment( szPackagePath, OUString( RTL_CONSTASCII_USTRINGPARAM( ".." ) ) ) + || ::comphelper::OStorageHelper::PathHasSegment( szPackagePath, OUString( RTL_CONSTASCII_USTRINGPARAM( "." ) ) ) ) + throw lang::IllegalArgumentException(); if( xIfc->hasByHierarchicalName( szPackagePath ) ) { @@ -374,7 +374,7 @@ bool XMLFilterJarHelper::copyFile( Reference< XHierarchicalNameAccess > xIfc, OU if( xFileEntry.is() ) { Reference< XInputStream > xIS( xFileEntry->getInputStream() ); - + INetURLObject aBaseURL( rTargetURL ); rURL = URIHelper::SmartRel2Abs( aBaseURL, szPackagePath, Link(), false ); @@ -385,20 +385,20 @@ bool XMLFilterJarHelper::copyFile( Reference< XHierarchicalNameAccess > xIfc, OU if( !createDirectory( rURL ) ) return false; - ::osl::File file(rURL); - ::osl::FileBase::RC rc = - file.open(OpenFlag_Write|OpenFlag_Create); - if (::osl::FileBase::E_EXIST == rc) { - rc = file.open(OpenFlag_Write); - if (::osl::FileBase::E_None == rc) { - file.setSize(0); // #i97170# truncate - } - } - if (::osl::FileBase::E_None != rc) { - throw RuntimeException(); - } - Reference< XOutputStream > const xOS( - new comphelper::OSLOutputStreamWrapper(file)); + ::osl::File file(rURL); + ::osl::FileBase::RC rc = + file.open(OpenFlag_Write|OpenFlag_Create); + if (::osl::FileBase::E_EXIST == rc) { + rc = file.open(OpenFlag_Write); + if (::osl::FileBase::E_None == rc) { + file.setSize(0); // #i97170# truncate + } + } + if (::osl::FileBase::E_None != rc) { + throw RuntimeException(); + } + Reference< XOutputStream > const xOS( + new comphelper::OSLOutputStreamWrapper(file)); return copyStreams( xIS, xOS ); } @@ -407,7 +407,7 @@ bool XMLFilterJarHelper::copyFile( Reference< XHierarchicalNameAccess > xIfc, OU } catch( Exception& ) { - DBG_ERROR( "XMLFilterJarHelper::copyFile exception catched" ); + DBG_ERROR( "XMLFilterJarHelper::copyFile exception caught" ); } return false; } diff --git a/main/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/main/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx index a413a36..6f1c0a3 100644 --- a/main/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx +++ b/main/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx @@ -1,5 +1,5 @@ /************************************************************** - * + * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -7,16 +7,16 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * + * *************************************************************/ @@ -113,7 +113,7 @@ XMLFilterSettingsDialog::XMLFilterSettingsDialog( Window* pParent, ResMgr& rResM } catch(Exception&) { - DBG_ERROR( "XMLFilterSettingsDialog::XMLFilterSettingsDialog exception catched!" ); + DBG_ERROR( "XMLFilterSettingsDialog::XMLFilterSettingsDialog exception caught!" ); } } @@ -207,28 +207,28 @@ void XMLFilterSettingsDialog::updateStates() bool bHasSelection = pSelectedEntry != NULL; bool bMultiSelection = bHasSelection && (mpFilterListBox->NextSelected( pSelectedEntry ) != NULL ); - bool bIsReadonly = false; - bool bIsDefault = false; - if(pSelectedEntry) - { - filter_info_impl* pInfo = (filter_info_impl*)pSelectedEntry->GetUserData(); - bIsReadonly = 0 != pInfo->mbReadonly; - - sal_Int32 nFact = SvtModuleOptions::E_WRITER; - while(nFact <= SvtModuleOptions::E_BASIC) - { - ::rtl::OUString sDefault = maModuleOpt.GetFactoryDefaultFilter((SvtModuleOptions::EFactory)nFact); - if( sDefault == pInfo->maFilterName ) - { - bIsDefault = true; - break; - } - ++nFact; - } - } - maPBEdit.Enable( bHasSelection && !bMultiSelection && !bIsReadonly); + bool bIsReadonly = false; + bool bIsDefault = false; + if(pSelectedEntry) + { + filter_info_impl* pInfo = (filter_info_impl*)pSelectedEntry->GetUserData(); + bIsReadonly = 0 != pInfo->mbReadonly; + + sal_Int32 nFact = SvtModuleOptions::E_WRITER; + while(nFact <= SvtModuleOptions::E_BASIC) + { + ::rtl::OUString sDefault = maModuleOpt.GetFactoryDefaultFilter((SvtModuleOptions::EFactory)nFact); + if( sDefault == pInfo->maFilterName ) + { + bIsDefault = true; + break; + } + ++nFact; + } + } + maPBEdit.Enable( bHasSelection && !bMultiSelection && !bIsReadonly); maPBTest.Enable( bHasSelection && !bMultiSelection ); - maPBDelete.Enable( bHasSelection && !bMultiSelection && !bIsReadonly && !bIsDefault); + maPBDelete.Enable( bHasSelection && !bMultiSelection && !bIsReadonly && !bIsDefault); maPBSave.Enable( bHasSelection ); } @@ -349,7 +349,7 @@ OUString XMLFilterSettingsDialog::createUniqueFilterName( const OUString& rFilte { OUString aFilterName( rFilterName ); OUString aSpace( sal_Unicode( ' ' ) ); - + sal_Int32 nId = 2; while( mxFilterContainer->hasByName( aFilterName ) ) @@ -431,7 +431,7 @@ OUString XMLFilterSettingsDialog::createUniqueInterfaceName( const OUString& rIn } catch( Exception& ) { - DBG_ERROR( "XMLFilterSettingsDialog::createUniqueInterfaceName exception catched!" ); + DBG_ERROR( "XMLFilterSettingsDialog::createUniqueInterfaceName exception caught!" ); } OUString aInterfaceName( rInterfaceName ); @@ -476,7 +476,7 @@ bool XMLFilterSettingsDialog::insertOrEdit( filter_info_impl* pNewInfo, const fi } catch( Exception& ) { - DBG_ERROR( "XMLFilterSettingsDialog::insertOrEdit exception catched!" ); + DBG_ERROR( "XMLFilterSettingsDialog::insertOrEdit exception caught!" ); bOk = false; } } @@ -517,7 +517,7 @@ bool XMLFilterSettingsDialog::insertOrEdit( filter_info_impl* pNewInfo, const fi SvFileStream aInputStream(pFilterEntry->maImportTemplate, STREAM_READ ); Reference< XInputStream > xIS( new utl::OInputStreamWrapper( aInputStream ) ); SvFileStream aOutputStream(aDestURL, STREAM_WRITE ); - Reference< XOutputStream > xOS( new utl::OOutputStreamWrapper( aOutputStream ) ); + Reference< XOutputStream > xOS( new utl::OOutputStreamWrapper( aOutputStream ) ); if( copyStreams( xIS, xOS ) ) pFilterEntry->maImportTemplate = aDestURL; @@ -598,7 +598,7 @@ bool XMLFilterSettingsDialog::insertOrEdit( filter_info_impl* pNewInfo, const fi } catch( Exception& ) { - DBG_ERROR( "XMLFilterSettingsDialog::insertOrEdit exception catched!" ); + DBG_ERROR( "XMLFilterSettingsDialog::insertOrEdit exception caught!" ); bOk = false; } } @@ -616,7 +616,7 @@ bool XMLFilterSettingsDialog::insertOrEdit( filter_info_impl* pNewInfo, const fi */ aValues[1].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "ClipboardFormat" ) ); OUString aDocType; - if( !pFilterEntry->maDocType.match( sDocTypePrefix ) ) + if( !pFilterEntry->maDocType.match( sDocTypePrefix ) ) { aDocType = sDocTypePrefix; aDocType += pFilterEntry->maDocType; @@ -625,10 +625,10 @@ bool XMLFilterSettingsDialog::insertOrEdit( filter_info_impl* pNewInfo, const fi { aDocType = pFilterEntry->maDocType; } - if (aDocType == sDocTypePrefix) - aValues[1].Value <<= OUString(); - else - aValues[1].Value <<= aDocType; + if (aDocType == sDocTypePrefix) + aValues[1].Value <<= OUString(); + else + aValues[1].Value <<= aDocType; aValues[2].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "DocumentIconID" ) ); aValues[2].Value <<= pFilterEntry->mnDocumentIconID; @@ -636,13 +636,13 @@ bool XMLFilterSettingsDialog::insertOrEdit( filter_info_impl* pNewInfo, const fi aValues[3].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Extensions" ) ); aValues[3].Value <<= createExtensionsSequence( pFilterEntry->maExtension ); - // the detect service will only be registered, if a doctype/search token was specified - if (aDocType.getLength() > sDocTypePrefix.getLength()) - { - aValues.realloc(5); - aValues[4].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "DetectService" ) ); - aValues[4].Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.filters.XMLFilterDetect" ) ); - } + // the detect service will only be registered, if a doctype/search token was specified + if (aDocType.getLength() > sDocTypePrefix.getLength()) + { + aValues.realloc(5); + aValues[4].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "DetectService" ) ); + aValues[4].Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.filters.XMLFilterDetect" ) ); + } // 6. insert new or replace existing type information if( mxTypeDetection.is() ) @@ -661,7 +661,7 @@ bool XMLFilterSettingsDialog::insertOrEdit( filter_info_impl* pNewInfo, const fi } catch( Exception& ) { - DBG_ERROR( "XMLFilterSettingsDialog::insertOrEdit exception catched!" ); + DBG_ERROR( "XMLFilterSettingsDialog::insertOrEdit exception caught!" ); bOk = false; } } @@ -676,21 +676,21 @@ bool XMLFilterSettingsDialog::insertOrEdit( filter_info_impl* pNewInfo, const fi } catch( Exception& ) { - DBG_ERROR( "XMLFilterSettingsDialog::insertOrEdit exception catched!" ); + DBG_ERROR( "XMLFilterSettingsDialog::insertOrEdit exception caught!" ); bOk = false; } } if( !bOk ) { - // we failed to add the type, so lets remove the filter + // we failed to add the type, so let's remove the filter try { mxFilterContainer->removeByName( pFilterEntry->maFilterName ); } catch( Exception& ) { - DBG_ERROR( "XMLFilterSettingsDialog::insertOrEdit exception catched!" ); + DBG_ERROR( "XMLFilterSettingsDialog::insertOrEdit exception caught!" ); bOk = false; } } @@ -706,20 +706,20 @@ bool XMLFilterSettingsDialog::insertOrEdit( filter_info_impl* pNewInfo, const fi } catch( Exception& ) { - DBG_ERROR( "XMLFilterSettingsDialog::insertOrEdit exception catched!" ); + DBG_ERROR( "XMLFilterSettingsDialog::insertOrEdit exception caught!" ); bOk = false; } if( !bOk ) { - // we failed to add the filter, so lets remove the type + // we failed to add the filter, so let's remove the type try { mxTypeDetection->removeByName( pFilterEntry->maType ); } catch( Exception& ) { - DBG_ERROR( "XMLFilterSettingsDialog::insertOrEdit exception catched!" ); + DBG_ERROR( "XMLFilterSettingsDialog::insertOrEdit exception caught!" ); } } @@ -896,7 +896,7 @@ void XMLFilterSettingsDialog::onDelete() } catch( Exception& ) { - DBG_ERROR( "XMLFilterSettingsDialog::onDelete exception catched!" ); + DBG_ERROR( "XMLFilterSettingsDialog::onDelete exception caught!" ); } } } @@ -922,9 +922,9 @@ void XMLFilterSettingsDialog::onSave() } // Open Fileopen-Dialog - ::sfx2::FileDialogHelper aDlg( - com::sun::star::ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION, - 0 ); + ::sfx2::FileDialogHelper aDlg( + com::sun::star::ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION, + 0 ); String aExtensions( RTL_CONSTASCII_USTRINGPARAM("*.jar") ); String aFilterName( RESID( STR_FILTER_PACKAGE ) ); @@ -969,8 +969,8 @@ void XMLFilterSettingsDialog::onOpen() XMLFilterVector aFilters; // Open Fileopen-Dialog - ::sfx2::FileDialogHelper aDlg( - com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0 ); + ::sfx2::FileDialogHelper aDlg( + com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0 ); String aExtensions( RTL_CONSTASCII_USTRINGPARAM("*.jar") ); String aFilterName( RESID( STR_FILTER_PACKAGE ) ); @@ -994,7 +994,7 @@ void XMLFilterSettingsDialog::onOpen() filter_info_impl* pInfo = (*aIter++); if( insertOrEdit( pInfo ) ) - { + { aFilterName = pInfo->maFilterName; nFilters++; } @@ -1017,7 +1017,7 @@ void XMLFilterSettingsDialog::onOpen() { aMsg = String( RESID( STR_FILTER_INSTALLED ) ); aMsg.SearchAndReplace( sPlaceholder, aFilterName ); - + } else { @@ -1039,22 +1039,22 @@ void XMLFilterSettingsDialog::onClose() long XMLFilterSettingsDialog::Notify( NotifyEvent& rNEvt ) { - // Zuerst Basisklasse rufen wegen TabSteuerung - long nRet = WorkWindow::Notify( rNEvt ); - if ( !nRet ) - { - if ( rNEvt.GetType() == EVENT_KEYINPUT ) - { - const KeyEvent* pKEvt = rNEvt.GetKeyEvent(); - KeyCode aKeyCode = pKEvt->GetKeyCode(); - sal_uInt16 nKeyCode = aKeyCode.GetCode(); - - if( nKeyCode == KEY_ESCAPE ) - { - Close(); - return sal_True; - } - } + // Zuerst Basisklasse rufen wegen TabSteuerung + long nRet = WorkWindow::Notify( rNEvt ); + if ( !nRet ) + { + if ( rNEvt.GetType() == EVENT_KEYINPUT ) + { + const KeyEvent* pKEvt = rNEvt.GetKeyEvent(); + KeyCode aKeyCode = pKEvt->GetKeyCode(); + sal_uInt16 nKeyCode = aKeyCode.GetCode(); + + if( nKeyCode == KEY_ESCAPE ) + { + Close(); + return sal_True; + } + } } return nRet; @@ -1142,11 +1142,11 @@ void XMLFilterSettingsDialog::initFilterList() { pValues->Value >>= pTempFilter->maImportTemplate; } - else if(pValues->Name.equalsAscii( "Finalized" )) - { - pValues->Value >>= pTempFilter->mbReadonly; - } - } + else if(pValues->Name.equalsAscii( "Finalized" )) + { + pValues->Value >>= pTempFilter->mbReadonly; + } + } // if this is not a XmlFilterAdaptor entry, skip it if( !aFilterService.equalsAscii( "com.sun.star.comp.Writer.XmlFilterAdaptor" ) ) @@ -1225,13 +1225,13 @@ void XMLFilterSettingsDialog::initFilterList() { pValues2->Value >>= pTempFilter->mnDocumentIconID; } - else if(pValues2->Name.equalsAscii( "Finalized" )) - { - // both the filter and the type may be finalized - sal_Bool bTemp = sal_False; - pValues2->Value >>= bTemp; - pTempFilter->mbReadonly |= bTemp; - } + else if(pValues2->Name.equalsAscii( "Finalized" )) + { + // both the filter and the type may be finalized + sal_Bool bTemp = sal_False; + pValues2->Value >>= bTemp; + pTempFilter->mbReadonly |= bTemp; + } } } } @@ -1250,7 +1250,7 @@ void XMLFilterSettingsDialog::initFilterList() } catch( Exception& ) { - DBG_ERROR( "XMLFilterSettingsDialog::initFilterList exception catched!" ); + DBG_ERROR( "XMLFilterSettingsDialog::initFilterList exception caught!" ); } } @@ -1283,7 +1283,7 @@ std::vector< application_info_impl* >& getApplicationInfos() if( aInfos.empty() ) { - ResId aResId1( STR_APPL_NAME_WRITER, *getXSLTDialogResMgr() ); + ResId aResId1( STR_APPL_NAME_WRITER, *getXSLTDialogResMgr() ); aInfos.push_back( new application_info_impl( "com.sun.star.text.TextDocument", aResId1, @@ -1311,8 +1311,8 @@ std::vector< application_info_impl* >& getApplicationInfos() "com.sun.star.comp.Draw.XMLImporter", "com.sun.star.comp.Draw.XMLExporter" ) ); - // --- oasis file formats... - ResId aResId5( STR_APPL_NAME_OASIS_WRITER, *getXSLTDialogResMgr() ); + // --- oasis file formats... + ResId aResId5( STR_APPL_NAME_OASIS_WRITER, *getXSLTDialogResMgr() ); aInfos.push_back( new application_info_impl( "com.sun.star.text.TextDocument", aResId5, @@ -1353,8 +1353,8 @@ const application_info_impl* getApplicationInfo( const OUString& rServiceName ) while( aIter != rInfos.end() ) { // if( rServiceName == (*aIter)->maDocumentService ) - if( rServiceName == (*aIter)->maXMLExporter || - rServiceName == (*aIter)->maXMLImporter) + if( rServiceName == (*aIter)->maXMLExporter || + rServiceName == (*aIter)->maXMLImporter) { return (*aIter); } @@ -1527,15 +1527,15 @@ IMPL_LINK( XMLFilterListBox, HeaderEndDrag_Impl, HeaderBar*, pBar ) long nWidth = mpHeaderBar->GetItemSize(ITEMID_NAME); long nBarWidth = mpHeaderBar->GetSizePixel().Width(); - if(nWidth < 30) - mpHeaderBar->SetItemSize( ITEMID_TYPE, 30); - else if ( ( nBarWidth - nWidth ) < 30 ) - mpHeaderBar->SetItemSize( ITEMID_TYPE, nBarWidth - 30 ); + if(nWidth < 30) + mpHeaderBar->SetItemSize( ITEMID_TYPE, 30); + else if ( ( nBarWidth - nWidth ) < 30 ) + mpHeaderBar->SetItemSize( ITEMID_TYPE, nBarWidth - 30 ); for ( sal_uInt16 i = 1; i <= nTabs; ++i ) { long nW = mpHeaderBar->GetItemSize(i); - aSz.Width() = nW + nTmpSz; + aSz.Width() = nW + nTmpSz; nTmpSz += nW; SetTab( i, PixelToLogic( aSz, MapMode(MAP_APPFONT) ).Width(), MAP_APPFONT ); } @@ -1577,10 +1577,10 @@ String XMLFilterListBox::getEntryString( const filter_info_impl* pInfo ) const String aEntryStr( pInfo->maFilterName ); aEntryStr += '\t'; // aEntryStr += String( getApplicationUIName( pInfo->maDocumentService ) ); - if ( pInfo->maExportService.getLength() > 0 ) - aEntryStr += String( getApplicationUIName( pInfo->maExportService ) ); - else - aEntryStr += String( getApplicationUIName( pInfo->maImportService ) ); + if ( pInfo->maExportService.getLength() > 0 ) + aEntryStr += String( getApplicationUIName( pInfo->maExportService ) ); + else + aEntryStr += String( getApplicationUIName( pInfo->maImportService ) ); aEntryStr += ' '; aEntryStr += '-'; aEntryStr += ' '; @@ -1600,7 +1600,7 @@ String XMLFilterListBox::getEntryString( const filter_info_impl* pInfo ) const { aEntryStr += String( RESID( STR_EXPORT_ONLY ) ); } - else + else { aEntryStr += String( RESID( STR_UNDEFINED_FILTER ) ); } @@ -1615,8 +1615,8 @@ String XMLFilterListBox::getEntryString( const filter_info_impl* pInfo ) const filter_info_impl::filter_info_impl() : maFlags(0x00080040), maFileFormatVersion(0), - mnDocumentIconID(0), - mbReadonly(sal_False) + mnDocumentIconID(0), + mbReadonly(sal_False) { } @@ -1639,8 +1639,8 @@ filter_info_impl::filter_info_impl( const filter_info_impl& rInfo ) : maExportService( rInfo.maExportService ), maFlags( rInfo.maFlags ), maFileFormatVersion( rInfo.maFileFormatVersion ), - mnDocumentIconID( rInfo.mnDocumentIconID ), - mbReadonly( rInfo.mbReadonly ) + mnDocumentIconID( rInfo.mnDocumentIconID ), + mbReadonly( rInfo.mbReadonly ) { } @@ -1659,7 +1659,7 @@ int filter_info_impl::operator==( const filter_info_impl& r ) const maDTD != r.maDTD || maExportXSLT != r.maExportXSLT || maImportXSLT != r.maImportXSLT || - maExportService != r.maExportService || + maExportService != r.maExportService || maImportService != r.maImportService || maImportTemplate != r.maImportTemplate || maFlags != r.maFlags || @@ -1676,17 +1676,17 @@ Sequence< OUString > filter_info_impl::getFilterUserData() const Sequence< OUString > aUserData(8); aUserData[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.documentconversion.XSLTFilter" ) ); - /* + /* const application_info_impl* pInfo = getApplicationInfo( maDocumentService ); if( pInfo ) { aUserData[2] = pInfo->maXMLImporter; aUserData[3] = pInfo->maXMLExporter; } - */ + */ aUserData[2] = maImportService; aUserData[3] = maExportService; - aUserData[4] = maImportXSLT; + aUserData[4] = maImportXSLT; aUserData[5] = maExportXSLT; aUserData[6] = maDTD; aUserData[7] = maComment; @@ -1696,20 +1696,20 @@ Sequence< OUString > filter_info_impl::getFilterUserData() const // ----------------------------------------------------------------------- - + OUString string_encode( const OUString & rText ) { static sal_Bool const aCharClass[] - = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* UricNoSlash */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, /* !"#$%&'()*+,-./*/ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, /*0123456789:;<=>?*/ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /*@ABCDEFGHIJKLMNO*/ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, /*PQRSTUVWXYZ[\]^_*/ - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /*`abcdefghijklmno*/ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0 /*pqrstuvwxyz{|}~ */ - }; + = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* UricNoSlash */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, /* !"#$%&'()*+,-./*/ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, /*0123456789:;<=>?*/ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /*@ABCDEFGHIJKLMNO*/ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, /*PQRSTUVWXYZ[\]^_*/ + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /*`abcdefghijklmno*/ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0 /*pqrstuvwxyz{|}~ */ + }; return Uri::encode( rText, aCharClass, rtl_UriEncodeCheckEscapes, RTL_TEXTENCODING_UTF8 ); @@ -1762,7 +1762,7 @@ bool copyStreams( Reference< XInputStream > xIS, Reference< XOutputStream > xOS } catch(Exception&) { - DBG_ERROR( "copyStreams() exception catched!" ); + DBG_ERROR( "copyStreams() exception caught!" ); } return false; diff --git a/main/filter/source/xsltdialog/xmlfiltertabdialog.cxx b/main/filter/source/xsltdialog/xmlfiltertabdialog.cxx index fc8b3db..7dbdf3c 100644 --- a/main/filter/source/xsltdialog/xmlfiltertabdialog.cxx +++ b/main/filter/source/xsltdialog/xmlfiltertabdialog.cxx @@ -1,5 +1,5 @@ /************************************************************** - * + * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -7,16 +7,16 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * + * *************************************************************/ @@ -106,7 +106,7 @@ XMLFilterTabDialog::XMLFilterTabDialog( Window *pParent, ResMgr& rResMgr, const ActivatePageHdl( &maTabCtrl ); - AdjustLayout(); + AdjustLayout(); } // ----------------------------------------------------------------------- @@ -158,11 +158,11 @@ bool XMLFilterTabDialog::onOk() } catch( Exception& ) { - DBG_ERROR( "XMLFilterTabDialog::onOk exception catched!" ); + DBG_ERROR( "XMLFilterTabDialog::onOk exception caught!" ); } } } - + // 2. see if the interface name is ok if( (mpNewInfo->maInterfaceName.getLength() == 0) || (mpNewInfo->maInterfaceName != mpOldInfo->maInterfaceName) ) { @@ -216,7 +216,7 @@ bool XMLFilterTabDialog::onOk() } catch( Exception& ) { - DBG_ERROR( "XMLFilterTabDialog::onOk exception catched!" ); + DBG_ERROR( "XMLFilterTabDialog::onOk exception caught!" ); } } } diff --git a/main/filter/source/xsltdialog/xmlfiltertestdialog.cxx b/main/filter/source/xsltdialog/xmlfiltertestdialog.cxx index eff42ff..83c3059 100644 --- a/main/filter/source/xsltdialog/xmlfiltertestdialog.cxx +++ b/main/filter/source/xsltdialog/xmlfiltertestdialog.cxx @@ -1,5 +1,5 @@ /************************************************************** - * + * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -7,16 +7,16 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * + * *************************************************************/ @@ -81,10 +81,10 @@ public: GlobalEventListenerImpl( XMLFilterTestDialog* pDialog ); // XEventListener - virtual void SAL_CALL notifyEvent( const com::sun::star::document::EventObject& Event ) throw (RuntimeException); + virtual void SAL_CALL notifyEvent( const com::sun::star::document::EventObject& Event ) throw (RuntimeException); // lang::XEventListener - virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw (RuntimeException); + virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw (RuntimeException); private: XMLFilterTestDialog* mpDialog; }; @@ -119,10 +119,10 @@ static bool checkComponent( Reference< XComponent >& rxComponent, const OUString { if( xInfo->supportsService( rServiceName ) ) { - // special case for impress documents which supports same service as draw documents + // special case for Impress documents which support same service as draw documents if( rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.drawing.DrawingDocument" ) ) ) { - // so if we want a draw we need to check if its not an impress + // so if we want a Draw we need to check if it's not an Impress if( !xInfo->supportsService( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.presentation.PresentationDocument") ) ) ) return true; } @@ -135,7 +135,7 @@ static bool checkComponent( Reference< XComponent >& rxComponent, const OUString } catch( Exception& ) { - DBG_ERROR( "checkComponent exception catched!" ); + DBG_ERROR( "checkComponent exception caught!" ); } return false; @@ -194,7 +194,7 @@ XMLFilterTestDialog::XMLFilterTestDialog( Window* pParent, ResMgr& rResMgr, cons } catch( Exception& ) { - DBG_ERROR( "XMLFilterTestDialog::XMLFilterTestDialog exception catched!" ); + DBG_ERROR( "XMLFilterTestDialog::XMLFilterTestDialog exception caught!" ); } } @@ -207,7 +207,7 @@ XMLFilterTestDialog::~XMLFilterTestDialog() } catch( Exception& ) { - DBG_ERROR( "XMLFilterTestDialog::~XMLFilterTestDialog exception catched!" ); + DBG_ERROR( "XMLFilterTestDialog::~XMLFilterTestDialog exception caught!" ); } delete mpSourceDLG; @@ -229,7 +229,7 @@ void XMLFilterTestDialog::test( const filter_info_impl& rFilterInfo ) static OUString getFileNameFromURL( OUString& rURL ) { INetURLObject aURL( rURL ); - OUString aName( aURL.getName(INetURLObject::LAST_SEGMENT, sal_True, INetURLObject::DECODE_WITH_CHARSET) ); + OUString aName( aURL.getName(INetURLObject::LAST_SEGMENT, sal_True, INetURLObject::DECODE_WITH_CHARSET) ); return aName; } @@ -257,7 +257,7 @@ void XMLFilterTestDialog::updateCurrentDocumentButtonState( Reference< XComponen Reference< XDocumentProperties > xProps( xDPS->getDocumentProperties() ); if( xProps.is() ) { - aTitle = xProps->getTitle(); + aTitle = xProps->getTitle(); } } @@ -269,7 +269,7 @@ void XMLFilterTestDialog::updateCurrentDocumentButtonState( Reference< XComponen if( xStorable->hasLocation() ) { OUString aURL( xStorable->getLocation() ); - aTitle = getFileNameFromURL( aURL ); + aTitle = getFileNameFromURL( aURL ); } } } @@ -280,7 +280,7 @@ void XMLFilterTestDialog::updateCurrentDocumentButtonState( Reference< XComponen void XMLFilterTestDialog::initDialog() { - DBG_ASSERT( mpFilterInfo, "i need a filter I can test!" ); + DBG_ASSERT( mpFilterInfo, "I need a filter I can test!" ); if( NULL == mpFilterInfo ) return; @@ -325,10 +325,10 @@ void XMLFilterTestDialog::onExportBrowse() try { // Open Fileopen-Dialog - ::sfx2::FileDialogHelper aDlg( - com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, - 0 ); - + ::sfx2::FileDialogHelper aDlg( + com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, + 0 ); + Reference< XNameAccess > xFilterContainer( mxMSF->createInstance( OUString::createFromAscii("com.sun.star.document.FilterFactory" ) ), UNO_QUERY ); Reference< XNameAccess > xTypeDetection( mxMSF->createInstance( OUString::createFromAscii("com.sun.star.document.TypeDetection" ) ), UNO_QUERY ); if( xFilterContainer.is() && xTypeDetection.is() ) @@ -351,7 +351,7 @@ void XMLFilterTestDialog::onExportBrowse() int nFound = 0; - for( sal_Int32 nValue = 0; (nValue < aValues.getLength()) && (nFound != 15); nValue++, pValues++ ) + for( sal_Int32 nValue = 0; (nValue < aValues.getLength()) && (nFound != 15); nValue++, pValues++ ) { if( pValues->Name.equalsAscii( "Type" ) ) { @@ -481,7 +481,7 @@ void XMLFilterTestDialog::doExport( Reference< XComponent > xComp ) // create xslt exporter Reference< XOutputStream > xIS( new comphelper::OSLOutputStreamWrapper( aOutputFile ) ); - + int bUseDTD = (mpFilterInfo->maDTD.getLength() != 0) ? 1 : 0 ; int bUseDocType = (mpFilterInfo->maDocType.getLength() != 0 ) ? 1 : 0; Sequence< PropertyValue > aSourceData( 2 + bUseDTD + bUseDocType ); @@ -544,10 +544,10 @@ void XMLFilterTestDialog::doExport( Reference< XComponent > xComp ) if( xExporter2.is() ) { xExporter2->setSourceDocument( xComp ); - + Sequence< PropertyValue > aDescriptor( 1 ); aDescriptor[0].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "FileName" ) ); - aDescriptor[0].Value <<= aTempFileURL; + aDescriptor[0].Value <<= aTempFileURL; if( xFilter->filter( aDescriptor ) ) displayXMLFile( aTempFileURL ); @@ -559,7 +559,7 @@ void XMLFilterTestDialog::doExport( Reference< XComponent > xComp ) } catch( Exception& ) { - DBG_ERROR( "XMLFilterTestDialog::doExport exception catched!" ); + DBG_ERROR( "XMLFilterTestDialog::doExport exception caught!" ); } } @@ -574,8 +574,8 @@ void XMLFilterTestDialog::displayXMLFile( const OUString& rURL ) void XMLFilterTestDialog::onImportBrowse() { // Open Fileopen-Dialog - ::sfx2::FileDialogHelper aDlg( - com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0 ); + ::sfx2::FileDialogHelper aDlg( + com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0 ); String aFilterName( mpFilterInfo->maInterfaceName ); String aExtensions; @@ -592,7 +592,7 @@ void XMLFilterTestDialog::onImportBrowse() if( nLastIndex == -1 ) { - + aExtensions += String( mpFilterInfo->maExtension.copy( nCurrentIndex ) ); } else @@ -607,7 +607,7 @@ void XMLFilterTestDialog::onImportBrowse() aFilterName += aExtensions; aFilterName += sal_Unicode(')'); - aDlg.AddFilter( aFilterName, aExtensions ); + aDlg.AddFilter( aFilterName, aExtensions ); aDlg.SetDisplayDirectory( maImportRecentFile ); if ( aDlg.Execute() == ERRCODE_NONE ) @@ -655,7 +655,7 @@ void XMLFilterTestDialog::import( const OUString& rURL ) osl::File::RC rc = aInputFile.open( OpenFlag_Read ); Reference< XInputStream > xIS( new comphelper::OSLInputStreamWrapper( aInputFile ) ); - + Sequence< PropertyValue > aSourceData( 5 ); int i = 0; @@ -675,7 +675,7 @@ void XMLFilterTestDialog::import( const OUString& rURL ) aSourceData[i++].Value <<= sDTDPath; Reference< XDocumentHandler > xWriter( mxMSF->createInstance( OUString::createFromAscii( "com.sun.star.xml.sax.Writer" ) ), UNO_QUERY ); - + File aOutputFile( aTempFileURL ); rc = aOutputFile.open( OpenFlag_Write ); @@ -689,10 +689,10 @@ void XMLFilterTestDialog::import( const OUString& rURL ) displayXMLFile( aTempFileURL ); } - } + } catch(Exception&) { - DBG_ERROR("XMLFilterTestDialog::import catched an exception" ); + DBG_ERROR("XMLFilterTestDialog::import caught an exception" ); } } @@ -737,7 +737,7 @@ Reference< XComponent > XMLFilterTestDialog::getFrontMostDocument( const OUStrin { xRet = xTest; } - else + else { xTest = (Reference< XComponent >)xDesktop->getCurrentComponent(); @@ -772,7 +772,7 @@ Reference< XComponent > XMLFilterTestDialog::getFrontMostDocument( const OUStrin } catch( Exception& ) { - DBG_ERROR( "XMLFilterTestDialog::getFrontMostDocument exception catched!" ); + DBG_ERROR( "XMLFilterTestDialog::getFrontMostDocument exception caught!" ); } return xRet; diff --git a/main/sc/source/core/data/globalx.cxx b/main/sc/source/core/data/globalx.cxx index bca6d54..cd1b496 100644 --- a/main/sc/source/core/data/globalx.cxx +++ b/main/sc/source/core/data/globalx.cxx @@ -1,5 +1,5 @@ /************************************************************** - * + * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -7,16 +7,16 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * + * *************************************************************/ @@ -92,8 +92,8 @@ void ScGlobal::InitAddIns() // no assertion if AddIn directory doesn't exist } - if ( xResultSet.is() ) - { + if ( xResultSet.is() ) + { Reference< sdbc::XRow > xRow( xResultSet, UNO_QUERY ); Reference< XContentAccess > xContentAccess( xResultSet, UNO_QUERY ); @@ -109,15 +109,15 @@ void ScGlobal::InitAddIns() while ( xResultSet->next() ); } } - catch ( Exception& ) - { - DBG_ERRORFILE( "ResultSetException catched!" ); - } - } + catch ( Exception& ) + { + DBG_ERRORFILE( "ResultSetException caught!" ); + } + } } catch ( Exception& ) { - DBG_ERRORFILE( "Exception catched!" ); + DBG_ERRORFILE( "Exception caught!" ); } catch ( ... ) { @@ -133,35 +133,35 @@ void ScGlobal::InitAddIns() // static String ScGlobal::GetOrdinalSuffix( sal_Int32 nNumber) { - if (!xOrdinalSuffix.is()) - { - try - { - Reference< lang::XMultiServiceFactory > xServiceManager = - ::comphelper::getProcessServiceFactory(); - Reference< XInterface > xInterface = - xServiceManager->createInstance( - ::rtl::OUString::createFromAscii("com.sun.star.i18n.OrdinalSuffix")); - if (xInterface.is()) - xOrdinalSuffix = Reference< i18n::XOrdinalSuffix >( xInterface, UNO_QUERY); - } - catch ( Exception& ) - { - DBG_ERRORFILE( "GetOrdinalSuffix: exception caught during init" ); - } - } - DBG_ASSERT( xOrdinalSuffix.is(), "GetOrdinalSuffix: createInstance failed"); - if (xOrdinalSuffix.is()) - { - try - { - return xOrdinalSuffix->getOrdinalSuffix( nNumber, - ScGlobal::pLocaleData->getLocale()); - } - catch ( Exception& ) - { - DBG_ERRORFILE( "GetOrdinalSuffix: exception caught during getOrdinalSuffix" ); - } - } - return String(); + if (!xOrdinalSuffix.is()) + { + try + { + Reference< lang::XMultiServiceFactory > xServiceManager = + ::comphelper::getProcessServiceFactory(); + Reference< XInterface > xInterface = + xServiceManager->createInstance( + ::rtl::OUString::createFromAscii("com.sun.star.i18n.OrdinalSuffix")); + if (xInterface.is()) + xOrdinalSuffix = Reference< i18n::XOrdinalSuffix >( xInterface, UNO_QUERY); + } + catch ( Exception& ) + { + DBG_ERRORFILE( "GetOrdinalSuffix: exception caught during init" ); + } + } + DBG_ASSERT( xOrdinalSuffix.is(), "GetOrdinalSuffix: createInstance failed"); + if (xOrdinalSuffix.is()) + { + try + { + return xOrdinalSuffix->getOrdinalSuffix( nNumber, + ScGlobal::pLocaleData->getLocale()); + } + catch ( Exception& ) + { + DBG_ERRORFILE( "GetOrdinalSuffix: exception caught during getOrdinalSuffix" ); + } + } + return String(); } diff --git a/main/sc/source/filter/xml/xmlwrap.cxx b/main/sc/source/filter/xml/xmlwrap.cxx index ec05e7b..63fb94d 100644 --- a/main/sc/source/filter/xml/xmlwrap.cxx +++ b/main/sc/source/filter/xml/xmlwrap.cxx @@ -1,5 +1,5 @@ /************************************************************** - * + * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -7,16 +7,16 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * + * *************************************************************/ @@ -94,9 +94,9 @@ using ::rtl::OUString; ScXMLImportWrapper::ScXMLImportWrapper(ScDocument& rD, SfxMedium* pM, const uno::Reference < embed::XStorage >& xStor ) : rDoc(rD), pMedium(pM), - xStorage(xStor) + xStorage(xStor) { - DBG_ASSERT( pMedium || xStorage.is(), "ScXMLImportWrapper: Medium or Storage must be set" ); + DBG_ASSERT( pMedium || xStorage.is(), "ScXMLImportWrapper: Medium or Storage must be set" ); } //UNUSED2008-05 uno::Reference <task::XStatusIndicator> ScXMLImportWrapper::GetStatusIndicator( @@ -138,7 +138,7 @@ uno::Reference <task::XStatusIndicator> ScXMLImportWrapper::GetStatusIndicator() { const SfxUnoAnyItem* pItem = static_cast<const SfxUnoAnyItem*>(pSet->GetItem(SID_PROGRESS_STATUSBAR_CONTROL)); if (pItem) - xStatusIndicator.set(pItem->GetValue(), uno::UNO_QUERY); + xStatusIndicator.set(pItem->GetValue(), uno::UNO_QUERY); } } return xStatusIndicator; @@ -151,9 +151,9 @@ sal_uInt32 ScXMLImportWrapper::ImportFromComponent(uno::Reference<lang::XMultiSe const rtl::OUString& sOldDocName, uno::Sequence<uno::Any>& aArgs, sal_Bool bMustBeSuccessfull) { - uno::Reference < io::XStream > xDocStream; - if ( !xStorage.is() && pMedium ) - xStorage = pMedium->GetStorage(); + uno::Reference < io::XStream > xDocStream; + if ( !xStorage.is() && pMedium ) + xStorage = pMedium->GetStorage(); // Get data source ... @@ -161,8 +161,8 @@ sal_uInt32 ScXMLImportWrapper::ImportFromComponent(uno::Reference<lang::XMultiSe // uno::Reference< io::XActiveDataSource > xSource; sal_Bool bEncrypted = sal_False; - rtl::OUString sStream(sDocName); - if( xStorage.is() ) + rtl::OUString sStream(sDocName); + if( xStorage.is() ) { try { @@ -196,7 +196,7 @@ sal_uInt32 ScXMLImportWrapper::ImportFromComponent(uno::Reference<lang::XMultiSe return SCERR_IMPORT_UNKNOWN; } } - // #99667#; no longer necessary + // #99667#; no longer necessary /* else if ( pMedium ) { // if there is a medium and if this medium has a load environment, @@ -232,12 +232,12 @@ sal_uInt32 ScXMLImportWrapper::ImportFromComponent(uno::Reference<lang::XMultiSe DBG_ASSERT( xInfoSet.is(), "missing property set" ); if( xInfoSet.is() ) { - rtl::OUString sPropName( RTL_CONSTASCII_USTRINGPARAM("StreamName") ); - xInfoSet->setPropertyValue( sPropName, uno::makeAny( sStream ) ); + rtl::OUString sPropName( RTL_CONSTASCII_USTRINGPARAM("StreamName") ); + xInfoSet->setPropertyValue( sPropName, uno::makeAny( sStream ) ); } - sal_uInt32 nReturn(0); - rDoc.SetRangeOverflowType(0); // is modified by the importer if limits are exceeded + sal_uInt32 nReturn(0); + rDoc.SetRangeOverflowType(0); // is modified by the importer if limits are exceeded uno::Reference<xml::sax::XDocumentHandler> xDocHandler( xServiceFactory->createInstanceWithArguments( @@ -290,7 +290,7 @@ sal_uInt32 ScXMLImportWrapper::ImportFromComponent(uno::Reference<lang::XMultiSe { #ifdef DBG_UTIL - ByteString aError( "SAX parse exception catched while importing:\n" ); + ByteString aError( "SAX parse exception caught while importing:\n" ); aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US ); DBG_ERROR( aError.GetBuffer() ); #endif @@ -326,7 +326,7 @@ sal_uInt32 ScXMLImportWrapper::ImportFromComponent(uno::Reference<lang::XMultiSe { #ifdef DBG_UTIL - ByteString aError( "SAX exception catched while importing:\n" ); + ByteString aError( "SAX exception caught while importing:\n" ); aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US ); DBG_ERROR( aError.GetBuffer() ); #endif @@ -338,44 +338,44 @@ sal_uInt32 ScXMLImportWrapper::ImportFromComponent(uno::Reference<lang::XMultiSe catch( packages::zip::ZipIOException& r ) { #ifdef DBG_UTIL - ByteString aError( "Zip exception catched while importing:\n" ); + ByteString aError( "Zip exception caught while importing:\n" ); aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US ); DBG_ERROR( aError.GetBuffer() ); #endif - (void)r; // avoid warning in product version + (void)r; // avoid warning in product version nReturn = ERRCODE_IO_BROKENPACKAGE; } catch( io::IOException& r ) { #ifdef DBG_UTIL - ByteString aError( "IO exception catched while importing:\n" ); + ByteString aError( "IO exception caught while importing:\n" ); aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US ); DBG_ERROR( aError.GetBuffer() ); #endif - (void)r; // avoid warning in product version + (void)r; // avoid warning in product version nReturn = SCERR_IMPORT_OPEN; } catch( uno::Exception& r ) { #ifdef DBG_UTIL - ByteString aError( "uno exception catched while importing:\n" ); + ByteString aError( "uno exception caught while importing:\n" ); aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US ); DBG_ERROR( aError.GetBuffer() ); #endif - (void)r; // avoid warning in product version + (void)r; // avoid warning in product version nReturn = SCERR_IMPORT_UNKNOWN; } - // #i31130# Can't use getImplementation here to get the ScXMLImport from xDocHandler, - // because when OOo 1.x files are loaded, xDocHandler is the OOo2OasisTransformer. - // So the overflow warning ErrorCode is now stored in the document. - // Export works differently, there getImplementation still works. + // #i31130# Can't use getImplementation here to get the ScXMLImport from xDocHandler, + // because when OOo 1.x files are loaded, xDocHandler is the OOo2OasisTransformer. + // So the overflow warning ErrorCode is now stored in the document. + // Export works differently, there getImplementation still works. - if (rDoc.HasRangeOverflow() && !nReturn) - nReturn = rDoc.GetRangeOverflowType(); + if (rDoc.HasRangeOverflow() && !nReturn) + nReturn = rDoc.GetRangeOverflowType(); // free the component xParser->setDocumentHandler( NULL ); @@ -386,7 +386,7 @@ sal_uInt32 ScXMLImportWrapper::ImportFromComponent(uno::Reference<lang::XMultiSe sal_Bool ScXMLImportWrapper::Import(sal_Bool bStylesOnly, ErrCode& nError) { - RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "sb99857", "ScXMLImportWrapper::Import" ); + RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "sb99857", "ScXMLImportWrapper::Import" ); uno::Reference<lang::XMultiServiceFactory> xServiceFactory = comphelper::getProcessServiceFactory(); @@ -398,8 +398,8 @@ sal_Bool ScXMLImportWrapper::Import(sal_Bool bStylesOnly, ErrCode& nError) if (pMedium) aParserInput.sSystemId = OUString(pMedium->GetName()); - if ( !xStorage.is() && pMedium ) - xStorage = pMedium->GetStorage(); + if ( !xStorage.is() && pMedium ) + xStorage = pMedium->GetStorage(); // get parser uno::Reference<uno::XInterface> xXMLParser( @@ -423,15 +423,15 @@ sal_Bool ScXMLImportWrapper::Import(sal_Bool bStylesOnly, ErrCode& nError) { MAP_LEN( "ProgressMax" ), 0, &::getCppuType((sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0}, { MAP_LEN( "ProgressCurrent" ), 0, &::getCppuType((sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0}, { MAP_LEN( "NumberStyles" ), 0, &::getCppuType((uno::Reference<container::XNameAccess> *)0), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0}, - { MAP_LEN( "PrivateData" ), 0, &::getCppuType( (uno::Reference<uno::XInterface> *)0 ), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, - { MAP_LEN( "BaseURI" ), 0, &::getCppuType( (rtl::OUString *)0 ), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, - { MAP_LEN( "StreamRelPath" ), 0, &::getCppuType( (rtl::OUString *)0 ), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, - { MAP_LEN( "StreamName" ), 0, &::getCppuType( (rtl::OUString *)0 ), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, + { MAP_LEN( "PrivateData" ), 0, &::getCppuType( (uno::Reference<uno::XInterface> *)0 ), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, + { MAP_LEN( "BaseURI" ), 0, &::getCppuType( (rtl::OUString *)0 ), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, + { MAP_LEN( "StreamRelPath" ), 0, &::getCppuType( (rtl::OUString *)0 ), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, + { MAP_LEN( "StreamName" ), 0, &::getCppuType( (rtl::OUString *)0 ), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, { MAP_LEN( "BuildId" ), 0, &::getCppuType( (OUString *)0 ), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, { MAP_LEN( "VBACompatibilityMode" ), 0, &::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, { MAP_LEN( "ScriptConfiguration" ), 0, &::getCppuType((uno::Reference<container::XNameAccess> *)0), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0}, - { MAP_LEN( "OrganizerMode" ), 0, &::getBooleanCppuType(), - ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, + { MAP_LEN( "OrganizerMode" ), 0, &::getBooleanCppuType(), + ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, { NULL, 0, 0, NULL, 0, 0 } }; @@ -489,16 +489,16 @@ sal_Bool ScXMLImportWrapper::Import(sal_Bool bStylesOnly, ErrCode& nError) sPropName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StreamRelPath")); xInfoSet->setPropertyValue( sPropName, uno::makeAny( aName ) ); } - } + } - if (bStylesOnly) - { + if (bStylesOnly) + { ::rtl::OUString const sOrganizerMode( RTL_CONSTASCII_USTRINGPARAM("OrganizerMode")); xInfoSet->setPropertyValue(sOrganizerMode, uno::makeAny(sal_True)); - } + } - sal_Bool bOasis = ( SotStorage::GetVersion( xStorage ) > SOFFICE_FILEFORMAT_60 ); + sal_Bool bOasis = ( SotStorage::GetVersion( xStorage ) > SOFFICE_FILEFORMAT_60 ); if (!bStylesOnly && bOasis) { @@ -532,15 +532,15 @@ sal_Bool ScXMLImportWrapper::Import(sal_Bool bStylesOnly, ErrCode& nError) } } - // #i103539#: always read meta.xml for generator + // #i103539#: always read meta.xml for generator sal_uInt32 nMetaRetval(0); - uno::Sequence<uno::Any> aMetaArgs(1); - uno::Any* pMetaArgs = aMetaArgs.getArray(); - pMetaArgs[0] <<= xInfoSet; + uno::Sequence<uno::Any> aMetaArgs(1); + uno::Any* pMetaArgs = aMetaArgs.getArray(); + pMetaArgs[0] <<= xInfoSet; - RTL_LOGFILE_CONTEXT_TRACE( aLog, "meta import start" ); + RTL_LOGFILE_CONTEXT_TRACE( aLog, "meta import start" ); - nMetaRetval = ImportFromComponent( + nMetaRetval = ImportFromComponent( xServiceFactory, xModel, xXMLParser, aParserInput, bOasis ? rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.XMLOasisMetaImporter")) : rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.XMLMetaImporter")), @@ -714,21 +714,21 @@ sal_Bool ScXMLImportWrapper::Import(sal_Bool bStylesOnly, ErrCode& nError) bool lcl_HasValidStream(ScDocument& rDoc) { - SfxObjectShell* pObjSh = rDoc.GetDocumentShell(); - if ( pObjSh->IsDocShared() ) - return false; // never copy stream from shared file - - // don't read remote file again - // (could instead re-use medium directly in that case) - SfxMedium* pSrcMed = rDoc.GetDocumentShell()->GetMedium(); - if ( !pSrcMed || pSrcMed->IsRemote() ) - return false; - - SCTAB nTabCount = rDoc.GetTableCount(); - for (SCTAB nTab=0; nTab<nTabCount; ++nTab) - if (rDoc.IsStreamValid(nTab)) - return true; - return false; + SfxObjectShell* pObjSh = rDoc.GetDocumentShell(); + if ( pObjSh->IsDocShared() ) + return false; // never copy stream from shared file + + // don't read remote file again + // (could instead re-use medium directly in that case) + SfxMedium* pSrcMed = rDoc.GetDocumentShell()->GetMedium(); + if ( !pSrcMed || pSrcMed->IsRemote() ) + return false; + + SCTAB nTabCount = rDoc.GetTableCount(); + for (SCTAB nTab=0; nTab<nTabCount; ++nTab) + if (rDoc.IsStreamValid(nTab)) + return true; + return false; } sal_Bool ScXMLImportWrapper::ExportToComponent(uno::Reference<lang::XMultiServiceFactory>& xServiceFactory, @@ -739,12 +739,12 @@ sal_Bool ScXMLImportWrapper::ExportToComponent(uno::Reference<lang::XMultiServic { sal_Bool bRet(sal_False); uno::Reference<io::XOutputStream> xOut; - uno::Reference<io::XStream> xStream; + uno::Reference<io::XStream> xStream; - if ( !xStorage.is() && pMedium ) - xStorage = pMedium->GetOutputStorage(); + if ( !xStorage.is() && pMedium ) + xStorage = pMedium->GetOutputStorage(); - if( xStorage.is() ) + if( xStorage.is() ) { // #96807#; trunc stream before use, because it could be an existing stream // and the new content could be shorter than the old content. In this case @@ -761,11 +761,11 @@ sal_Bool ScXMLImportWrapper::ExportToComponent(uno::Reference<lang::XMultiServic // even plain stream should be encrypted in encrypted documents xSet->setPropertyValue( aUseCommonPassPropName, uno::makeAny(sal_True) ); - } + } - xOut = xStream->getOutputStream(); + xOut = xStream->getOutputStream(); } - // #99667#; no longer necessary + // #99667#; no longer necessary /* else if ( pMedium ) { xOut = pMedium->GetDataSink(); @@ -778,11 +778,11 @@ sal_Bool ScXMLImportWrapper::ExportToComponent(uno::Reference<lang::XMultiServic DBG_ASSERT( xInfoSet.is(), "missing property set" ); if( xInfoSet.is() ) { - rtl::OUString sPropName( RTL_CONSTASCII_USTRINGPARAM("StreamName") ); - xInfoSet->setPropertyValue( sPropName, uno::makeAny( sName ) ); + rtl::OUString sPropName( RTL_CONSTASCII_USTRINGPARAM("StreamName") ); + xInfoSet->setPropertyValue( sPropName, uno::makeAny( sName ) ); } - uno::Reference<io::XActiveDataSource> xSrc( xWriter, uno::UNO_QUERY ); + uno::Reference<io::XActiveDataSource> xSrc( xWriter, uno::UNO_QUERY ); xSrc->setOutputStream( xOut ); uno::Reference<document::XFilter> xFilter( @@ -858,7 +858,7 @@ sal_Bool ScXMLImportWrapper::ExportToComponent(uno::Reference<lang::XMultiServic sal_Bool ScXMLImportWrapper::Export(sal_Bool bStylesOnly) { - RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "sb99857", "ScXMLImportWrapper::Export" ); + RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "sb99857", "ScXMLImportWrapper::Export" ); uno::Reference<lang::XMultiServiceFactory> xServiceFactory(comphelper::getProcessServiceFactory()); DBG_ASSERT( xServiceFactory.is(), "got no service manager" ); @@ -871,8 +871,8 @@ sal_Bool ScXMLImportWrapper::Export(sal_Bool bStylesOnly) if(!xWriter.is()) return sal_False; - if ( !xStorage.is() && pMedium ) - xStorage = pMedium->GetOutputStorage(); + if ( !xStorage.is() && pMedium ) + xStorage = pMedium->GetOutputStorage(); uno::Reference<xml::sax::XDocumentHandler> xHandler( xWriter, uno::UNO_QUERY ); @@ -894,42 +894,42 @@ sal_Bool ScXMLImportWrapper::Export(sal_Bool bStylesOnly) { MAP_LEN( "ProgressCurrent" ), 0, &::getCppuType((sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0}, { MAP_LEN( "WrittenNumberStyles" ), 0, &::getCppuType((uno::Sequence<sal_Int32>*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0}, { MAP_LEN( "UsePrettyPrinting" ), 0, &::getCppuType((sal_Bool*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0}, - { MAP_LEN( "BaseURI" ), 0, &::getCppuType( (rtl::OUString *)0 ), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, - { MAP_LEN( "StreamRelPath" ), 0, &::getCppuType( (rtl::OUString *)0 ), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, - { MAP_LEN( "StreamName" ), 0, &::getCppuType( (rtl::OUString *)0 ), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, - { MAP_LEN( "StyleNames" ), 0, &::getCppuType( (uno::Sequence<rtl::OUString>*)0 ), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, - { MAP_LEN( "StyleFamilies" ), 0, &::getCppuType( (uno::Sequence<sal_Int32>*)0 ), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, + { MAP_LEN( "BaseURI" ), 0, &::getCppuType( (rtl::OUString *)0 ), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, + { MAP_LEN( "StreamRelPath" ), 0, &::getCppuType( (rtl::OUString *)0 ), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, + { MAP_LEN( "StreamName" ), 0, &::getCppuType( (rtl::OUString *)0 ), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, + { MAP_LEN( "StyleNames" ), 0, &::getCppuType( (uno::Sequence<rtl::OUString>*)0 ), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, + { MAP_LEN( "StyleFamilies" ), 0, &::getCppuType( (uno::Sequence<sal_Int32>*)0 ), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, { MAP_LEN( "TargetStorage" ), 0, &embed::XStorage::static_type(), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, { NULL, 0, 0, NULL, 0, 0 } }; uno::Reference< beans::XPropertySet > xInfoSet( comphelper::GenericPropertySet_CreateInstance( new comphelper::PropertySetInfo( aExportInfoMap ) ) ); - if ( pObjSh && xStorage.is() ) + if ( pObjSh && xStorage.is() ) { pObjSh->UpdateDocInfoForSave(); // update information - uno::Reference<frame::XModel> xModel(pObjSh->GetModel()); + uno::Reference<frame::XModel> xModel(pObjSh->GetModel()); uno::Reference<task::XStatusIndicator> xStatusIndicator(GetStatusIndicator()); sal_Int32 nProgressRange(1000000); if(xStatusIndicator.is()) xStatusIndicator->start(rtl::OUString(ScGlobal::GetRscString(STR_SAVE_DOC)), nProgressRange); - xInfoSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ProgressRange")), uno::makeAny(nProgressRange)); + xInfoSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ProgressRange")), uno::makeAny(nProgressRange)); SvtSaveOptions aSaveOpt; sal_Bool bUsePrettyPrinting(aSaveOpt.IsPrettyPrinting()); - xInfoSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UsePrettyPrinting")), uno::makeAny(bUsePrettyPrinting)); + xInfoSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UsePrettyPrinting")), uno::makeAny(bUsePrettyPrinting)); const OUString sTargetStorage( RTL_CONSTASCII_USTRINGPARAM("TargetStorage") ); xInfoSet->setPropertyValue( sTargetStorage, uno::Any( xStorage ) ); OSL_ENSURE( pMedium, "There is no medium to get MediaDescriptor from!\n" ); - ::rtl::OUString aBaseURL = pMedium ? pMedium->GetBaseURL( true ) : ::rtl::OUString(); - rtl::OUString sPropName( RTL_CONSTASCII_USTRINGPARAM("BaseURI") ); - xInfoSet->setPropertyValue( sPropName, uno::makeAny( aBaseURL ) ); + ::rtl::OUString aBaseURL = pMedium ? pMedium->GetBaseURL( true ) : ::rtl::OUString(); + rtl::OUString sPropName( RTL_CONSTASCII_USTRINGPARAM("BaseURI") ); + xInfoSet->setPropertyValue( sPropName, uno::makeAny( aBaseURL ) ); // TODO/LATER: do not do it for embedded links - if( SFX_CREATE_MODE_EMBEDDED == pObjSh->GetCreateMode() ) - { + if( SFX_CREATE_MODE_EMBEDDED == pObjSh->GetCreateMode() ) + { OUString aName = ::rtl::OUString::createFromAscii( "dummyObjectName" ); if ( pMedium && pMedium->GetItemSet() ) { @@ -952,7 +952,7 @@ sal_Bool ScXMLImportWrapper::Export(sal_Bool bStylesOnly) sal_Bool bSettingsRet(sal_False); ScMySharedData* pSharedData = NULL; - sal_Bool bOasis = ( SotStorage::GetVersion( xStorage ) > SOFFICE_FILEFORMAT_60 ); + sal_Bool bOasis = ( SotStorage::GetVersion( xStorage ) > SOFFICE_FILEFORMAT_60 ); // RDF metadata: ODF >= 1.2 if ( !bStylesOnly && bOasis ) @@ -978,7 +978,7 @@ sal_Bool ScXMLImportWrapper::Export(sal_Bool bStylesOnly) { } } - + // meta export if (!bStylesOnly && !bMetaRet) { @@ -1106,5 +1106,3 @@ sal_Bool ScXMLImportWrapper::Export(sal_Bool bStylesOnly) return sal_False; } - - diff --git a/main/sd/source/filter/xml/sdxmlwrp.cxx b/main/sd/source/filter/xml/sdxmlwrp.cxx index 7cf167a..2153cc8 100644 --- a/main/sd/source/filter/xml/sdxmlwrp.cxx +++ b/main/sd/source/filter/xml/sdxmlwrp.cxx @@ -1,5 +1,5 @@ /************************************************************** - * + * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -7,16 +7,16 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * + * *************************************************************/ @@ -217,7 +217,7 @@ sal_Int32 ReadThroughComponent( DBG_ASSERT(rFactory.is(), "factory missing"); DBG_ASSERT(NULL != pFilterName,"I need a service name for the component!"); - RTL_LOGFILE_CONTEXT( aLog, "ReadThroughComponent" ); + RTL_LOGFILE_CONTEXT( aLog, "ReadThroughComponent" ); // prepare ParserInputSrouce xml::sax::InputSource aParserInput; @@ -232,7 +232,7 @@ sal_Int32 ReadThroughComponent( DBG_ASSERT( xParser.is(), "Can't create parser" ); if( !xParser.is() ) return SD_XML_READERROR; - RTL_LOGFILE_CONTEXT_TRACE( aLog, "parser created" ); + RTL_LOGFILE_CONTEXT_TRACE( aLog, "parser created" ); // get filter Reference< xml::sax::XDocumentHandler > xFilter( @@ -242,7 +242,7 @@ sal_Int32 ReadThroughComponent( DBG_ASSERT( xFilter.is(), "Can't instantiate filter component." ); if( !xFilter.is() ) return SD_XML_READERROR; - RTL_LOGFILE_CONTEXT_TRACE1( aLog, "%s created", pFilterName ); + RTL_LOGFILE_CONTEXT_TRACE1( aLog, "%s created", pFilterName ); // connect parser and filter xParser->setDocumentHandler( xFilter ); @@ -251,7 +251,7 @@ sal_Int32 ReadThroughComponent( Reference < XImporter > xImporter( xFilter, UNO_QUERY ); xImporter->setTargetDocument( xModelComponent ); // finally, parser the stream - RTL_LOGFILE_CONTEXT_TRACE( aLog, "parsing stream" ); + RTL_LOGFILE_CONTEXT_TRACE( aLog, "parsing stream" ); try { xParser->parseStream( aParserInput ); @@ -280,7 +280,7 @@ sal_Int32 ReadThroughComponent( return ERRCODE_SFX_WRONGPASSWORD; #if OSL_DEBUG_LEVEL > 1 - ByteString aError( "SAX parse exception catched while importing:\n" ); + ByteString aError( "SAX parse exception caught while importing:\n" ); aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US ); DBG_ERROR( aError.GetBuffer() ); #endif @@ -314,7 +314,7 @@ sal_Int32 ReadThroughComponent( return ERRCODE_SFX_WRONGPASSWORD; #if OSL_DEBUG_LEVEL > 1 - ByteString aError( "SAX exception catched while importing:\n" ); + ByteString aError( "SAX exception caught while importing:\n" ); aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US ); DBG_ERROR( aError.GetBuffer() ); #endif @@ -322,9 +322,9 @@ sal_Int32 ReadThroughComponent( } catch( packages::zip::ZipIOException& r ) { - (void)r; + (void)r; #if OSL_DEBUG_LEVEL > 1 - ByteString aError( "Zip exception catched while importing:\n" ); + ByteString aError( "Zip exception caught while importing:\n" ); aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US ); DBG_ERROR( aError.GetBuffer() ); #endif @@ -332,9 +332,9 @@ sal_Int32 ReadThroughComponent( } catch( io::IOException& r ) { - (void)r; + (void)r; #if OSL_DEBUG_LEVEL > 1 - ByteString aError( "IO exception catched while importing:\n" ); + ByteString aError( "IO exception caught while importing:\n" ); aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US ); DBG_ERROR( aError.GetBuffer() ); #endif @@ -342,9 +342,9 @@ sal_Int32 ReadThroughComponent( } catch( uno::Exception& r ) { - (void)r; + (void)r; #if OSL_DEBUG_LEVEL > 1 - ByteString aError( "uno exception catched while importing:\n" ); + ByteString aError( "uno exception caught while importing:\n" ); aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US ); DBG_ERROR( aError.GetBuffer() ); #endif @@ -356,7 +356,7 @@ sal_Int32 ReadThroughComponent( } sal_Int32 ReadThroughComponent( - const uno::Reference < embed::XStorage >& xStorage, + const uno::Reference < embed::XStorage >& xStorage, Reference<XComponent> xModelComponent, const sal_Char* pStreamName, const sal_Char* pCompatibilityStreamName, @@ -366,21 +366,21 @@ sal_Int32 ReadThroughComponent( const OUString& rName, sal_Bool bMustBeSuccessfull ) { - DBG_ASSERT(xStorage.is(), "Need storage!"); + DBG_ASSERT(xStorage.is(), "Need storage!"); DBG_ASSERT(NULL != pStreamName, "Please, please, give me a name!"); // open stream (and set parser input) OUString sStreamName = OUString::createFromAscii(pStreamName); - sal_Bool bContainsStream = sal_False; - try - { - bContainsStream = xStorage->isStreamElement(sStreamName); - } - catch( container::NoSuchElementException& ) - { - } + sal_Bool bContainsStream = sal_False; + try + { + bContainsStream = xStorage->isStreamElement(sStreamName); + } + catch( container::NoSuchElementException& ) + { + } - if (!bContainsStream ) + if (!bContainsStream ) { // stream name not found! Then try the compatibility name. // if no stream can be opened, return immediately with OK signal @@ -414,8 +414,8 @@ sal_Int32 ReadThroughComponent( xInfoSet->setPropertyValue( sPropName, makeAny( sStreamName ) ); } - try - { + try + { // get input stream Reference <io::XStream> xStream = xStorage->openStreamElement( sStreamName, embed::ElementModes::READ ); @@ -445,17 +445,17 @@ sal_Int32 ReadThroughComponent( { return ERRCODE_IO_BROKENPACKAGE; } - catch ( uno::Exception& ) - {} + catch ( uno::Exception& ) + {} - return SD_XML_READERROR; + return SD_XML_READERROR; } // ----------------------------------------------------------------------------- sal_Bool SdXMLFilter::Import( ErrCode& nError ) { - RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sd", "cl93746", "SdXMLFilter::Import" ); + RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sd", "cl93746", "SdXMLFilter::Import" ); #ifdef TIMELOG ByteString aFile( mrMedium.GetName(), RTL_TEXTENCODING_ASCII_US ); RTL_LOGFILE_CONTEXT_TRACE1( aLog, "importing %s", aFile.GetBuffer() ); @@ -700,7 +700,7 @@ sal_Bool SdXMLFilter::Import( ErrCode& nError ) SvXMLGraphicHelper::Destroy( pGraphicHelper ); xGraphicResolver = 0; if( pObjectHelper ) - SvXMLEmbeddedObjectHelper::Destroy( pObjectHelper ); + SvXMLEmbeddedObjectHelper::Destroy( pObjectHelper ); xObjectResolver = 0; if( mxStatusIndicator.is() ) @@ -718,15 +718,15 @@ sal_Bool SdXMLFilter::Import( ErrCode& nError ) // case ERRCODE_SFX_WRONGPASSWORD: break; case SD_XML_READERROR: break; case ERRCODE_IO_BROKENPACKAGE: - if( xStorage.is() ) + if( xStorage.is() ) { - nError = ERRCODE_IO_BROKENPACKAGE; + nError = ERRCODE_IO_BROKENPACKAGE; break; } // fall through intended default: { - // TODO/LATER: this is completely wrong! Filter code should never call ErrorHandler directly! + // TODO/LATER: this is completely wrong! Filter code should never call ErrorHandler directly! ErrorHandler::HandleError( nRet ); if( IsWarning( nRet ) ) nRet = 0; @@ -842,7 +842,7 @@ sal_Bool SdXMLFilter::Import( ErrCode& nError ) sal_Bool SdXMLFilter::Export() { #ifdef TIMELOG - RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sd", "cl93746", "SdXMLFilter::Export" ); + RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sd", "cl93746", "SdXMLFilter::Export" ); ByteString aFile( mrMedium.GetName(), RTL_TEXTENCODING_ASCII_US ); RTL_LOGFILE_CONTEXT_TRACE1( aLog, "exporting %s", aFile.GetBuffer() ); #endif @@ -865,7 +865,7 @@ sal_Bool SdXMLFilter::Export() uno::Reference< lang::XServiceInfo > xServiceInfo( mxModel, uno::UNO_QUERY ); - if( !xServiceInfo.is() || !xServiceInfo->supportsService( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.GenericDrawingDocument" ) ) ) ) + if( !xServiceInfo.is() || !xServiceInfo->supportsService( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.GenericDrawingDocument" ) ) ) ) { DBG_ERROR( "Model is no DrawingDocument in XMLExport" ); return sal_False; diff --git a/main/sd/source/ui/app/sdxfer.cxx b/main/sd/source/ui/app/sdxfer.cxx index 019db83..6dcb15a 100644 --- a/main/sd/source/ui/app/sdxfer.cxx +++ b/main/sd/source/ui/app/sdxfer.cxx @@ -1,5 +1,5 @@ /************************************************************** - * + * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -7,16 +7,16 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * + * *************************************************************/ @@ -119,7 +119,7 @@ SdTransferable::SdTransferable( SdDrawDocument* pSrcDoc, ::sd::View* pWorkView, , mbPageTransferable( sal_False ) , mbPageTransferablePersistent( sal_False ) , mbIsUnoObj( false ) -, maUserData() +, maUserData() { if( mpSourceDoc ) StartListening( *mpSourceDoc ); @@ -127,8 +127,8 @@ SdTransferable::SdTransferable( SdDrawDocument* pSrcDoc, ::sd::View* pWorkView, if( pWorkView ) StartListening( *pWorkView ); - if( !mbLateInit ) - CreateData(); + if( !mbLateInit ) + CreateData(); } // ----------------------------------------------------------------------------- @@ -143,19 +143,19 @@ SdTransferable::~SdTransferable() Application::GetSolarMutex().acquire(); - ObjectReleased(); + ObjectReleased(); - for( void* p = maPageBookmarks.First(); p; p = maPageBookmarks.Next() ) - delete static_cast< String* >( p ); + for( void* p = maPageBookmarks.First(); p; p = maPageBookmarks.Next() ) + delete static_cast< String* >( p ); if( mbOwnView ) delete mpSdViewIntern; - delete mpOLEDataHelper; + delete mpOLEDataHelper; if( maDocShellRef.Is() ) { - SfxObjectShell* pObj = maDocShellRef; + SfxObjectShell* pObj = maDocShellRef; ::sd::DrawDocShell* pDocSh = static_cast< ::sd::DrawDocShell*>(pObj); pDocSh->DoClose(); } @@ -181,7 +181,7 @@ void SdTransferable::CreateObjectReplacement( SdrObject* pObj ) { if( pObj ) { - delete mpOLEDataHelper, mpOLEDataHelper = NULL; + delete mpOLEDataHelper, mpOLEDataHelper = NULL; delete mpGraphic, mpGraphic = NULL; delete mpBookmark, mpBookmark = NULL; delete mpImageMap, mpImageMap = NULL; @@ -374,10 +374,10 @@ void SdTransferable::CreateData() sal_Bool lcl_HasOnlyControls( SdrModel* pModel ) { - sal_Bool bOnlyControls = sal_False; // default if there are no objects + sal_Bool bOnlyControls = sal_False; // default if there are no objects - if ( pModel ) - { + if ( pModel ) + { SdrPage* pPage = pModel->GetPage(0); if (pPage) { @@ -385,7 +385,7 @@ sal_Bool lcl_HasOnlyControls( SdrModel* pModel ) SdrObject* pObj = aIter.Next(); if ( pObj ) { - bOnlyControls = sal_True; // only set if there are any objects at all + bOnlyControls = sal_True; // only set if there are any objects at all while ( pObj ) { if (!pObj->ISA(SdrUnoObj)) @@ -397,20 +397,20 @@ sal_Bool lcl_HasOnlyControls( SdrModel* pModel ) } } } - } + } - return bOnlyControls; + return bOnlyControls; } // ----------------------------------------------------------------------------- bool lcl_HasOnlyOneTable( SdrModel* pModel ) { - if ( pModel ) - { - SdrPage* pPage = pModel->GetPage(0); - if (pPage && pPage->GetObjCount() == 1 ) - { + if ( pModel ) + { + SdrPage* pPage = pModel->GetPage(0); + if (pPage && pPage->GetObjCount() == 1 ) + { if( dynamic_cast< sdr::table::SdrTableObj* >( pPage->GetObj(0) ) != 0 ) return true; } @@ -422,26 +422,26 @@ bool lcl_HasOnlyOneTable( SdrModel* pModel ) void SdTransferable::AddSupportedFormats() { - if( !mbPageTransferable || mbPageTransferablePersistent ) - { - if( !mbLateInit ) - CreateData(); + if( !mbPageTransferable || mbPageTransferablePersistent ) + { + if( !mbLateInit ) + CreateData(); - if( mpObjDesc ) - AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ); + if( mpObjDesc ) + AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ); - if( mpOLEDataHelper ) - { - AddFormat( SOT_FORMATSTR_ID_EMBED_SOURCE ); + if( mpOLEDataHelper ) + { + AddFormat( SOT_FORMATSTR_ID_EMBED_SOURCE ); - DataFlavorExVector aVector( mpOLEDataHelper->GetDataFlavorExVector() ); - DataFlavorExVector::iterator aIter( aVector.begin() ), aEnd( aVector.end() ); + DataFlavorExVector aVector( mpOLEDataHelper->GetDataFlavorExVector() ); + DataFlavorExVector::iterator aIter( aVector.begin() ), aEnd( aVector.end() ); - while( aIter != aEnd ) - AddFormat( *aIter++ ); - } - else if( mpGraphic ) - { + while( aIter != aEnd ) + AddFormat( *aIter++ ); + } + else if( mpGraphic ) + { // #i25616# AddFormat( SOT_FORMATSTR_ID_DRAWING ); @@ -495,7 +495,7 @@ sal_Bool SdTransferable::GetData( const DataFlavor& rFlavor ) sal_uInt32 nFormat = SotExchange::GetFormat( rFlavor ); sal_Bool bOK = sal_False; - CreateData(); + CreateData(); if( nFormat == SOT_FORMAT_RTF && lcl_HasOnlyOneTable( mpSdDrawDocument ) ) { @@ -660,7 +660,7 @@ sal_Bool SdTransferable::WriteObject( SotStorageStreamRef& rxOStm, void* pObject } catch( Exception& ) { - DBG_ERROR( "sd::SdTransferable::WriteObject(), exception catched!" ); + DBG_ERROR( "sd::SdTransferable::WriteObject(), exception caught!" ); bRet = sal_False; } } @@ -740,28 +740,28 @@ void SdTransferable::SetObjectDescriptor( const TransferableObjectDescriptor& rO { delete mpObjDesc; mpObjDesc = new TransferableObjectDescriptor( rObjDesc ); - PrepareOLE( rObjDesc ); + PrepareOLE( rObjDesc ); } // ----------------------------------------------------------------------------- void SdTransferable::SetPageBookmarks( const List& rPageBookmarks, sal_Bool bPersistent ) { - if( mpSourceDoc ) - { - if( mpSdViewIntern ) - mpSdViewIntern->HideSdrPage(); + if( mpSourceDoc ) + { + if( mpSdViewIntern ) + mpSdViewIntern->HideSdrPage(); // #116168# - mpSdDrawDocument->ClearModel(sal_False); + mpSdDrawDocument->ClearModel(sal_False); mpPageDocShell = NULL; - for( void* p = maPageBookmarks.First(); p; p = maPageBookmarks.Next() ) + for( void* p = maPageBookmarks.First(); p; p = maPageBookmarks.Next() ) delete static_cast< String* >( p ); - if( bPersistent ) - { + if( bPersistent ) + { mpSdDrawDocument->CreateFirstPages(mpSourceDoc); mpSdDrawDocument->InsertBookmarkAsPage( const_cast< List* >( &rPageBookmarks ), NULL, sal_False, sal_True, 1, sal_True, mpSourceDoc->GetDocSh(), sal_True, sal_True, sal_False ); } @@ -773,8 +773,8 @@ void SdTransferable::SetPageBookmarks( const List& rPageBookmarks, sal_Bool bPer maPageBookmarks.Insert( new String( *static_cast< String* >( rPageBookmarks.GetObject( i ) ) ), LIST_APPEND ); } - if( mpSdViewIntern && mpSdDrawDocument ) - { + if( mpSdViewIntern && mpSdDrawDocument ) + { SdPage* pPage = mpSdDrawDocument->GetSdPage( 0, PK_STANDARD ); if( pPage ) @@ -784,7 +784,7 @@ void SdTransferable::SetPageBookmarks( const List& rPageBookmarks, sal_Bool bPer } // set flags for page transferable; if ( mbPageTransferablePersistent == sal_False ), - // don't offer any formats => it's just for internal puposes + // don't offer any formats => it's just for internal purposes mbPageTransferable = sal_True; mbPageTransferablePersistent = bPersistent; } @@ -794,16 +794,16 @@ void SdTransferable::SetPageBookmarks( const List& rPageBookmarks, sal_Bool bPer sal_Int64 SAL_CALL SdTransferable::getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw( ::com::sun::star::uno::RuntimeException ) { - sal_Int64 nRet; + sal_Int64 nRet; - if( ( rId.getLength() == 16 ) && - ( 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) ) ) - { + if( ( rId.getLength() == 16 ) && + ( 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) ) ) + { nRet = sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this)); - } - else + } + else { - nRet = 0; + nRet = 0; } return nRet; @@ -814,7 +814,7 @@ sal_Int64 SAL_CALL SdTransferable::getSomething( const ::com::sun::star::uno::Se SdDrawDocument* SdTransferable::GetSourceDoc (void) const { - return mpSourceDoc; + return mpSourceDoc; } @@ -822,7 +822,7 @@ SdDrawDocument* SdTransferable::GetSourceDoc (void) const void SdTransferable::AddUserData (const ::boost::shared_ptr<UserData>& rpData) { - maUserData.push_back(rpData); + maUserData.push_back(rpData); } @@ -830,7 +830,7 @@ void SdTransferable::AddUserData (const ::boost::shared_ptr<UserData>& rpData) void SdTransferable::RemoveUserData (const ::boost::shared_ptr<UserData>& rpData) { - maUserData.erase(::std::find(maUserData.begin(), maUserData.end(), rpData)); + maUserData.erase(::std::find(maUserData.begin(), maUserData.end(), rpData)); } @@ -838,7 +838,7 @@ void SdTransferable::RemoveUserData (const ::boost::shared_ptr<UserData>& rpData sal_Int32 SdTransferable::GetUserDataCount (void) const { - return maUserData.size(); + return maUserData.size(); } @@ -846,10 +846,10 @@ sal_Int32 SdTransferable::GetUserDataCount (void) const ::boost::shared_ptr<SdTransferable::UserData> SdTransferable::GetUserData (const sal_Int32 nIndex) const { - if (nIndex>=0 && nIndex<sal_Int32(maUserData.size())) - return maUserData[nIndex]; - else - return ::boost::shared_ptr<UserData>(); + if (nIndex>=0 && nIndex<sal_Int32(maUserData.size())) + return maUserData[nIndex]; + else + return ::boost::shared_ptr<UserData>(); } @@ -859,30 +859,30 @@ sal_Int32 SdTransferable::GetUserDataCount (void) const const ::com::sun::star::uno::Sequence< sal_Int8 >& SdTransferable::getUnoTunnelId() { - static ::com::sun::star::uno::Sequence< sal_Int8 > aSeq; + static ::com::sun::star::uno::Sequence< sal_Int8 > aSeq; if( !aSeq.getLength() ) { static osl::Mutex aCreateMutex; - osl::MutexGuard aGuard( aCreateMutex ); + osl::MutexGuard aGuard( aCreateMutex ); aSeq.realloc( 16 ); - rtl_createUuid( reinterpret_cast< sal_uInt8* >( aSeq.getArray() ), 0, sal_True ); + rtl_createUuid( reinterpret_cast< sal_uInt8* >( aSeq.getArray() ), 0, sal_True ); } - return aSeq; + return aSeq; } // ----------------------------------------------------------------------------- SdTransferable* SdTransferable::getImplementation( const Reference< XInterface >& rxData ) throw() { - try - { + try + { Reference< ::com::sun::star::lang::XUnoTunnel > xUnoTunnel( rxData, UNO_QUERY_THROW ); return reinterpret_cast<SdTransferable*>(sal::static_int_cast<sal_uIntPtr>(xUnoTunnel->getSomething( SdTransferable::getUnoTunnelId()) ) ); - } - catch( const ::com::sun::star::uno::Exception& ) + } + catch( const ::com::sun::star::uno::Exception& ) { } return NULL; @@ -919,16 +919,16 @@ void SdTransferable::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) sal_Bool SdTransferable::SetTableRTF( SdDrawDocument* pModel, const DataFlavor& rFlavor) { - if ( pModel ) - { - SdrPage* pPage = pModel->GetPage(0); - if (pPage && pPage->GetObjCount() == 1 ) - { + if ( pModel ) + { + SdrPage* pPage = pModel->GetPage(0); + if (pPage && pPage->GetObjCount() == 1 ) + { sdr::table::SdrTableObj* pTableObj = dynamic_cast< sdr::table::SdrTableObj* >( pPage->GetObj(0) ); if( pTableObj ) { SvMemoryStream aMemStm( 65535, 65535 ); - sdr::table::SdrTableObj::ExportAsRTF( aMemStm, *pTableObj ); + sdr::table::SdrTableObj::ExportAsRTF( aMemStm, *pTableObj ); return SetAny( Any( Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( aMemStm.GetData() ), aMemStm.Seek( STREAM_SEEK_TO_END ) ) ), rFlavor ); } } diff --git a/main/sw/source/core/unocore/unoparagraph.cxx b/main/sw/source/core/unocore/unoparagraph.cxx index a9893fb..d34b200 100644 --- a/main/sw/source/core/unocore/unoparagraph.cxx +++ b/main/sw/source/core/unocore/unoparagraph.cxx @@ -1,5 +1,5 @@ /************************************************************** - * + * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -7,18 +7,20 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * + * *************************************************************/ + + // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" @@ -179,9 +181,9 @@ public: uno::RuntimeException); //UUUU - void GetSinglePropertyValue_Impl( + void GetSinglePropertyValue_Impl( const SfxItemPropertySimpleEntry& rEntry, - const SfxItemSet& rSet, + const SfxItemSet& rSet, uno::Any& rAny ) const throw(uno::RuntimeException); @@ -494,9 +496,9 @@ throw (beans::PropertyVetoException, lang::IllegalArgumentException, ---------------------------------------------------------------------------*/ //UUUU Support for DrawingLayer FillStyles for GetPropertyValue() usages -void SwXParagraph::Impl::GetSinglePropertyValue_Impl( +void SwXParagraph::Impl::GetSinglePropertyValue_Impl( const SfxItemPropertySimpleEntry& rEntry, - const SfxItemSet& rSet, + const SfxItemSet& rSet, uno::Any& rAny ) const throw(uno::RuntimeException) { @@ -764,7 +766,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) catch (beans::UnknownPropertyException &) { // should not occur because property was searched for before - DBG_ERROR( "unexpected exception catched" ); + DBG_ERROR( "unexpected exception caught" ); pFailed[ nFailed++ ].Result = beans::TolerantPropertySetResultType::UNKNOWN_PROPERTY; } @@ -892,7 +894,7 @@ throw (uno::RuntimeException) SwPosition aPos( rTxtNode ); SwPaM aPam( aPos ); // handle properties that are not part of the attribute - // and thus only pretendend to be paragraph attributes + // and thus only pretend to be paragraph attributes beans::PropertyState eTemp; const bool bDone = SwUnoCursorHelper::getCrsrPropertyValue( @@ -1100,7 +1102,7 @@ beans::PropertyState lcl_SwXParagraph_getPropertyState( { if(*ppSet) { - if(SFX_ITEM_SET == (*ppSet)->GetItemState(XATTR_FILLBMP_STRETCH, false) + if(SFX_ITEM_SET == (*ppSet)->GetItemState(XATTR_FILLBMP_STRETCH, false) || SFX_ITEM_SET == (*ppSet)->GetItemState(XATTR_FILLBMP_TILE, false)) { eRet = beans::PropertyState_DIRECT_VALUE; diff --git a/main/sw/source/core/unocore/unoport.cxx b/main/sw/source/core/unocore/unoport.cxx index edc112d..0a92f36 100644 --- a/main/sw/source/core/unocore/unoport.cxx +++ b/main/sw/source/core/unocore/unoport.cxx @@ -1,5 +1,5 @@ /************************************************************** - * + * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -7,16 +7,16 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * + * *************************************************************/ @@ -450,9 +450,9 @@ uno::Sequence< uno::Any > SAL_CALL SwXTextPortion::GetPropertyValues_Impl( { SfxItemSet *pSet = 0; - // get startting pount fo the look-up, either the provided one or else + // get starting point for the look-up, either the provided one or else // from the beginning of the map - const SfxItemPropertyMap* pMap = m_pPropSet->getPropertyMap(); + const SfxItemPropertyMap* pMap = m_pPropSet->getPropertyMap(); for(sal_Int32 nProp = 0; nProp < nLength; nProp++) { const SfxItemPropertySimpleEntry* pEntry = pMap->getByName(pPropertyNames[nProp]); @@ -598,13 +598,13 @@ uno::Sequence< beans::SetPropertyTolerantFailed > SAL_CALL SwXTextPortion::setPr const SfxItemPropertySimpleEntry* pEntry = pPropMap->getByName( pProp[i] ); if (!pEntry) - pFailed[ nFailed++ ].Result = beans::TolerantPropertySetResultType::UNKNOWN_PROPERTY; + pFailed[ nFailed++ ].Result = beans::TolerantPropertySetResultType::UNKNOWN_PROPERTY; else { // set property value // (compare to SwXTextPortion::setPropertyValues) if (pEntry->nFlags & beans::PropertyAttribute::READONLY) - pFailed[ nFailed++ ].Result = beans::TolerantPropertySetResultType::PROPERTY_VETO; + pFailed[ nFailed++ ].Result = beans::TolerantPropertySetResultType::PROPERTY_VETO; else { SwUnoCursorHelper::SetPropertyValue( @@ -615,7 +615,7 @@ uno::Sequence< beans::SetPropertyTolerantFailed > SAL_CALL SwXTextPortion::setPr catch (beans::UnknownPropertyException &) { // should not occur because property was searched for before - DBG_ERROR( "unexpected exception catched" ); + DBG_ERROR( "unexpected exception caught" ); pFailed[ nFailed++ ].Result = beans::TolerantPropertySetResultType::UNKNOWN_PROPERTY; } catch (lang::IllegalArgumentException &) @@ -690,7 +690,7 @@ uno::Sequence< beans::GetDirectPropertyTolerantResult > SAL_CALL SwXTextPortion: rPropertyNames, SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION_TOLERANT ); const beans::PropertyState* pPropertyStates = aPropertyStates.getConstArray(); - + std::vector< beans::GetDirectPropertyTolerantResult > aResultVector; for (sal_Int32 i = 0; i < nProps; ++i) { @@ -699,7 +699,7 @@ uno::Sequence< beans::GetDirectPropertyTolerantResult > SAL_CALL SwXTextPortion: { aResult.Name = pProp[i]; if(pPropertyStates[i] == beans::PropertyState_MAKE_FIXED_SIZE) // property unknown? - { + { if( bDirectValuesOnly ) continue; else @@ -708,16 +708,16 @@ uno::Sequence< beans::GetDirectPropertyTolerantResult > SAL_CALL SwXTextPortion: else { const SfxItemPropertySimpleEntry* pEntry = pPropMap->getByName( pProp[i] ); - aResult.State = pPropertyStates[i]; + aResult.State = pPropertyStates[i]; aResult.Result = beans::TolerantPropertySetResultType::UNKNOWN_FAILURE; - //#i104499# ruby portion attributes need special handling: + //#i104499# ruby portion attributes need special handling: if( pEntry->nWID == RES_TXTATR_CJK_RUBY && m_ePortionType == PORTION_RUBY_START ) { aResult.State = beans::PropertyState_DIRECT_VALUE; } - if (!bDirectValuesOnly || beans::PropertyState_DIRECT_VALUE == aResult.State) + if (!bDirectValuesOnly || beans::PropertyState_DIRECT_VALUE == aResult.State) { // get property value // (compare to SwXTextPortion::getPropertyValue(s)) @@ -730,7 +730,7 @@ uno::Sequence< beans::GetDirectPropertyTolerantResult > SAL_CALL SwXTextPortion: catch (beans::UnknownPropertyException &) { // should not occur because property was searched for before - DBG_ERROR( "unexpected exception catched" ); + DBG_ERROR( "unexpected exception caught" ); aResult.Result = beans::TolerantPropertySetResultType::UNKNOWN_PROPERTY; } catch (lang::IllegalArgumentException &) diff --git a/main/sw/source/filter/xml/swxml.cxx b/main/sw/source/filter/xml/swxml.cxx index 79c75e1..dc4dc16 100644 --- a/main/sw/source/filter/xml/swxml.cxx +++ b/main/sw/source/filter/xml/swxml.cxx @@ -1,5 +1,5 @@ /************************************************************** - * + * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -7,18 +7,20 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * + * *************************************************************/ + + // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" @@ -142,7 +144,7 @@ sal_Int32 ReadThroughComponent( DBG_ASSERT(rFactory.is(), "factory missing"); DBG_ASSERT(NULL != pFilterName,"I need a service name for the component!"); - RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "sw", LOGFILE_AUTHOR, "ReadThroughComponent" ); + RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "sw", LOGFILE_AUTHOR, "ReadThroughComponent" ); // prepare ParserInputSrouce xml::sax::InputSource aParserInput; @@ -213,7 +215,7 @@ sal_Int32 ReadThroughComponent( return ERRCODE_SFX_WRONGPASSWORD; #if OSL_DEBUG_LEVEL > 1 - ByteString aError( "SAX parse exception catched while importing:\n" ); + ByteString aError( "SAX parse exception caught while importing:\n" ); aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US ); DBG_ERROR( aError.GetBuffer() ); #endif @@ -237,48 +239,48 @@ sal_Int32 ReadThroughComponent( ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ); } } - catch( xml::sax::SAXException& r) + catch( xml::sax::SAXException& r) { packages::zip::ZipIOException aBrokenPackage; if ( r.WrappedException >>= aBrokenPackage ) return ERRCODE_IO_BROKENPACKAGE; - if( bEncrypted ) + if( bEncrypted ) return ERRCODE_SFX_WRONGPASSWORD; #if OSL_DEBUG_LEVEL > 1 - ByteString aError( "SAX exception catched while importing:\n" ); + ByteString aError( "SAX exception caught while importing:\n" ); aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US ); DBG_ERROR( aError.GetBuffer() ); #endif - + return ERR_SWG_READ_ERROR; } - catch( packages::zip::ZipIOException& r) + catch( packages::zip::ZipIOException& r) { - (void)r; + (void)r; #if OSL_DEBUG_LEVEL > 1 - ByteString aError( "Zip exception catched while importing:\n" ); + ByteString aError( "Zip exception caught while importing:\n" ); aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US ); DBG_ERROR( aError.GetBuffer() ); #endif return ERRCODE_IO_BROKENPACKAGE; } - catch( io::IOException& r) + catch( io::IOException& r) { - (void)r; + (void)r; #if OSL_DEBUG_LEVEL > 1 - ByteString aError( "IO exception catched while importing:\n" ); + ByteString aError( "IO exception caught while importing:\n" ); aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US ); DBG_ERROR( aError.GetBuffer() ); #endif return ERR_SWG_READ_ERROR; } - catch( uno::Exception& r) + catch( uno::Exception& r) { - (void)r; + (void)r; #if OSL_DEBUG_LEVEL > 1 - ByteString aError( "uno exception catched while importing:\n" ); + ByteString aError( "uno exception caught while importing:\n" ); aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US ); DBG_ERROR( aError.GetBuffer() ); #endif @@ -291,7 +293,7 @@ sal_Int32 ReadThroughComponent( /// read a component (storage version) sal_Int32 ReadThroughComponent( - uno::Reference<embed::XStorage> xStorage, + uno::Reference<embed::XStorage> xStorage, uno::Reference<XComponent> xModelComponent, const sal_Char* pStreamName, const sal_Char* pCompatibilityStreamName, @@ -301,21 +303,21 @@ sal_Int32 ReadThroughComponent( const OUString& rName, sal_Bool bMustBeSuccessfull) { - DBG_ASSERT(xStorage.is(), "Need storage!"); + DBG_ASSERT(xStorage.is(), "Need storage!"); DBG_ASSERT(NULL != pStreamName, "Please, please, give me a name!"); // open stream (and set parser input) OUString sStreamName = OUString::createFromAscii(pStreamName); - sal_Bool bContainsStream = sal_False; - try - { - bContainsStream = xStorage->isStreamElement(sStreamName); - } - catch( container::NoSuchElementException& ) - { - } + sal_Bool bContainsStream = sal_False; + try + { + bContainsStream = xStorage->isStreamElement(sStreamName); + } + catch( container::NoSuchElementException& ) + { + } - if (!bContainsStream ) + if (!bContainsStream ) { // stream name not found! Then try the compatibility name. // if no stream can be opened, return immediately with OK signal @@ -368,7 +370,7 @@ sal_Int32 ReadThroughComponent( xInputStream, xModelComponent, sStreamName, rFactory, pFilterName, rFilterArguments, rName, bMustBeSuccessfull, bEncrypted ); - } + } catch ( packages::WrongPasswordException& ) { return ERRCODE_SFX_WRONGPASSWORD; @@ -377,13 +379,13 @@ sal_Int32 ReadThroughComponent( { return ERRCODE_IO_BROKENPACKAGE; } - catch ( uno::Exception& ) - { + catch ( uno::Exception& ) + { OSL_ENSURE( sal_False, "Error on import!\n" ); // TODO/LATER: error handling - } + } - return ERR_SWG_READ_ERROR; + return ERR_SWG_READ_ERROR; } @@ -422,11 +424,11 @@ void lcl_AdjustOutlineStylesForOOo( SwDoc& _rDoc ) for ( sal_uInt16 n = 1; n < rColls.Count(); ++n ) { SwTxtFmtColl* pColl = rColls[ n ]; - //if ( pColl->GetOutlineLevel() != NO_NUMBERING ) //#outline level zhaojianwei + //if ( pColl->GetOutlineLevel() != NO_NUMBERING ) //#outline level zhaojianwei if ( pColl->IsAssignedToListLevelOfOutlineStyle() ) { // aOutlineLevelAssigned[ pColl->GetOutlineLevel() ] = true; - aOutlineLevelAssigned[ pColl->GetAssignedOutlineStyleLevel() ] = true;//<-end,zhaojianwei + aOutlineLevelAssigned[ pColl->GetAssignedOutlineStyleLevel() ] = true; //<-end,zhaojianwei } for ( sal_uInt8 i = 0; i < MAXLEVEL; ++i ) @@ -453,7 +455,7 @@ void lcl_AdjustOutlineStylesForOOo( SwDoc& _rDoc ) ! aCreatedDefaultOutlineStyles[ i ]->IsAssignedToListLevelOfOutlineStyle() ) { // apply outline level at created default outline style - aCreatedDefaultOutlineStyles[i]->AssignToListLevelOfOutlineStyle( i ); //#outline level added by zhaojianwei + aCreatedDefaultOutlineStyles[i]->AssignToListLevelOfOutlineStyle( i ); //#outline level added by zhaojianwei // apply outline numbering rule, if none is set. const SfxPoolItem& rItem = @@ -527,24 +529,24 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPaM, con // get the input stream (storage or stream) uno::Reference<io::XInputStream> xInputStream; - uno::Reference<embed::XStorage> xStorage; + uno::Reference<embed::XStorage> xStorage; if( pMedium ) - xStorage = pMedium->GetStorage(); - else - xStorage = xStg; + xStorage = pMedium->GetStorage(); + else + xStorage = xStg; - if( !xStorage.is() ) + if( !xStorage.is() ) return ERR_SWG_READ_ERROR; - pGraphicHelper = SvXMLGraphicHelper::Create( xStorage, + pGraphicHelper = SvXMLGraphicHelper::Create( xStorage, GRAPHICHELPER_MODE_READ, sal_False ); xGraphicResolver = pGraphicHelper; - SfxObjectShell *pPersist = rDoc.GetPersist(); + SfxObjectShell *pPersist = rDoc.GetPersist(); if( pPersist ) { pObjectHelper = SvXMLEmbeddedObjectHelper::Create( - xStorage, *pPersist, + xStorage, *pPersist, EMBEDDEDOBJECTHELPER_MODE_READ, sal_False ); xObjectResolver = pObjectHelper; @@ -622,10 +624,10 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPaM, con { "OrganizerMode", sizeof("OrganizerMode")-1, 0, &::getBooleanCppuType(), beans::PropertyAttribute::MAYBEVOID, 0 }, - // --> OD 2004-08-10 #i28749# - Add property, which indicates, if the - // shape position attributes are given in horizontal left-to-right layout. - // This is the case for the OpenOffice.org file format. - { "ShapePositionInHoriL2R", sizeof("ShapePositionInHoriL2R")-1, 0, + // --> OD 2004-08-10 #i28749# - Add property, which indicates, if the + // shape position attributes are given in horizontal left-to-right layout. + // This is the case for the OpenOffice.org file format. + { "ShapePositionInHoriL2R", sizeof("ShapePositionInHoriL2R")-1, 0, &::getBooleanCppuType(), beans::PropertyAttribute::MAYBEVOID, 0 }, // <-- @@ -642,8 +644,8 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPaM, con { "TextDocInOOoFileFormat", sizeof("TextDocInOOoFileFormat")-1, 0, &::getBooleanCppuType(), beans::PropertyAttribute::MAYBEVOID, 0 }, - // <-- - { NULL, 0, 0, NULL, 0, 0 } + // <-- + { NULL, 0, 0, NULL, 0, 0 } }; uno::Reference< beans::XPropertySet > xInfoSet( comphelper::GenericPropertySet_CreateInstance( @@ -669,19 +671,19 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPaM, con // try to get an XStatusIndicator from the Medium uno::Reference<task::XStatusIndicator> xStatusIndicator; - if (pDocSh->GetMedium()) - { - SfxItemSet* pSet = pDocSh->GetMedium()->GetItemSet(); - if (pSet) - { + if (pDocSh->GetMedium()) + { + SfxItemSet* pSet = pDocSh->GetMedium()->GetItemSet(); + if (pSet) + { const SfxUnoAnyItem* pItem = static_cast<const SfxUnoAnyItem*>( pSet->GetItem(SID_PROGRESS_STATUSBAR_CONTROL) ); if (pItem) { pItem->GetValue() >>= xStatusIndicator; } - } - } + } + } // set progress range and start status indicator @@ -695,13 +697,13 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPaM, con OUString sProgressRange(RTL_CONSTASCII_USTRINGPARAM("ProgressRange")); xInfoSet->setPropertyValue(sProgressRange, aProgRange); - ::comphelper::ComponentContext aContext( xServiceFactory ); - Reference< container::XNameAccess > xLateInitSettings( - aContext.createComponent( "com.sun.star.document.NamedPropertyValues" ), UNO_QUERY_THROW ); - beans::NamedValue aLateInitSettings( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LateInitSettings" ) ), - makeAny( xLateInitSettings ) - ); + ::comphelper::ComponentContext aContext( xServiceFactory ); + Reference< container::XNameAccess > xLateInitSettings( + aContext.createComponent( "com.sun.star.document.NamedPropertyValues" ), UNO_QUERY_THROW ); + beans::NamedValue aLateInitSettings( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LateInitSettings" ) ), + makeAny( xLateInitSettings ) + ); // prepare filter arguments, WARNING: the order is important! Sequence<Any> aFilterArgs( 5 ); @@ -710,7 +712,7 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPaM, con *pArgs++ <<= xStatusIndicator; *pArgs++ <<= xGraphicResolver; *pArgs++ <<= xObjectResolver; - *pArgs++ <<= aLateInitSettings; + *pArgs++ <<= aLateInitSettings; Sequence<Any> aEmptyArgs( 3 ); pArgs = aEmptyArgs.getArray(); @@ -758,18 +760,18 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPaM, con } else if( bInsertMode ) { - const uno::Reference<text::XTextRange> xInsertTextRange = - SwXTextRange::CreateXTextRange(rDoc, *rPaM.GetPoint(), 0); + const uno::Reference<text::XTextRange> xInsertTextRange = + SwXTextRange::CreateXTextRange(rDoc, *rPaM.GetPoint(), 0); OUString sTextInsertModeRange( RTL_CONSTASCII_USTRINGPARAM("TextInsertModeRange")); xInfoSet->setPropertyValue( sTextInsertModeRange, makeAny(xInsertTextRange) ); } - else - { - rPaM.GetBound(true).nContent.Assign(0, 0); - rPaM.GetBound(false).nContent.Assign(0, 0); - } + else + { + rPaM.GetBound(true).nContent.Assign(0, 0); + rPaM.GetBound(false).nContent.Assign(0, 0); + } if( IsBlockMode() ) { @@ -796,12 +798,12 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPaM, con SfxMedium* pMedDescrMedium = pMedium ? pMedium : pDocSh->GetMedium(); OSL_ENSURE( pMedDescrMedium, "There is no medium to get MediaDescriptor from!\n" ); - ::rtl::OUString aBaseURL( rBaseURL ); + ::rtl::OUString aBaseURL( rBaseURL ); OUString sPropName( RTL_CONSTASCII_USTRINGPARAM("BaseURI") ); xInfoSet->setPropertyValue( sPropName, makeAny( aBaseURL ) ); // TODO/LATER: separate links from usual embedded objects - ::rtl::OUString StreamPath; + ::rtl::OUString StreamPath; if( SFX_CREATE_MODE_EMBEDDED == rDoc.GetDocShell()->GetCreateMode() ) { if ( pMedDescrMedium && pMedDescrMedium->GetItemSet() ) @@ -843,11 +845,11 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPaM, con // force redline mode to "none" - rDoc.SetRedlineMode_intern( nsRedlineMode_t::REDLINE_NONE ); + rDoc.SetRedlineMode_intern( nsRedlineMode_t::REDLINE_NONE ); - const sal_Bool bOASIS = ( SotStorage::GetVersion( xStorage ) > SOFFICE_FILEFORMAT_60 ); - // --> OD 2004-08-10 #i28749# - set property <ShapePositionInHoriL2R> - { + const sal_Bool bOASIS = ( SotStorage::GetVersion( xStorage ) > SOFFICE_FILEFORMAT_60 ); + // --> OD 2004-08-10 #i28749# - set property <ShapePositionInHoriL2R> + { const sal_Bool bShapePositionInHoriL2R = !bOASIS; xInfoSet->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("ShapePositionInHoriL2R")), @@ -863,10 +865,10 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPaM, con } // <-- - sal_uInt32 nWarnRDF = 0; - if ( !(IsOrganizerMode() || IsBlockMode() || aOpt.IsFmtsOnly() || + sal_uInt32 nWarnRDF = 0; + if ( !(IsOrganizerMode() || IsBlockMode() || aOpt.IsFmtsOnly() || bInsertMode) ) - { + { // RDF metadata - must be read before styles/content // N.B.: embedded documents have their own manifest.rdf! try @@ -896,12 +898,12 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPaM, con { nWarnRDF = WARN_SWG_FEATURES_LOST; // uhh... something went wrong? } - } + } // read storage streams - // #i103539#: always read meta.xml for generator - sal_uInt32 const nWarn = ReadThroughComponent( + // #i103539#: always read meta.xml for generator + sal_uInt32 const nWarn = ReadThroughComponent( xStorage, xModelComp, "meta.xml", "Meta.xml", xServiceFactory, (bOASIS ? "com.sun.star.comp.Writer.XMLOasisMetaImporter" : "com.sun.star.comp.Writer.XMLMetaImporter"), @@ -935,26 +937,26 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPaM, con aOpt.IsFmtsOnly() ) ) { OUString sStreamName( RTL_CONSTASCII_USTRINGPARAM("layout-cache") ); - try - { + try + { uno::Reference < io::XStream > xStm = xStorage->openStreamElement( sStreamName, embed::ElementModes::READ ); SvStream* pStrm2 = utl::UcbStreamHelper::CreateStream( xStm ); if( !pStrm2->GetError() ) rDoc.ReadLayoutCache( *pStrm2 ); delete pStrm2; - } - catch ( uno::Exception& ) - { - } + } + catch ( uno::Exception& ) + { + } } - // Notify math objects - if( bInsertMode ) - rDoc.PrtOLENotify( sal_False ); - else if ( rDoc.IsOLEPrtNotifyPending() ) - rDoc.PrtOLENotify( sal_True ); + // Notify Math objects + if( bInsertMode ) + rDoc.PrtOLENotify( sal_False ); + else if ( rDoc.IsOLEPrtNotifyPending() ) + rDoc.PrtOLENotify( sal_True ); - nRet = nRet ? nRet : (nWarn ? nWarn : (nWarn2 ? nWarn2 : nWarnRDF ) ); + nRet = nRet ? nRet : (nWarn ? nWarn : (nWarn2 ? nWarn2 : nWarnRDF ) ); aOpt.ResetAllFmtsOnly(); @@ -965,69 +967,69 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPaM, con rDoc.SetRedlinePassword( aKey ); // restore redline mode from import info property set - sal_Int16 nRedlineMode = nsRedlineMode_t::REDLINE_SHOW_INSERT; + sal_Int16 nRedlineMode = nsRedlineMode_t::REDLINE_SHOW_INSERT; aAny = xInfoSet->getPropertyValue( sShowChanges ); if ( *(sal_Bool*)aAny.getValue() ) - nRedlineMode |= nsRedlineMode_t::REDLINE_SHOW_DELETE; + nRedlineMode |= nsRedlineMode_t::REDLINE_SHOW_DELETE; aAny = xInfoSet->getPropertyValue( sRecordChanges ); if ( *(sal_Bool*)aAny.getValue() || (aKey.getLength() > 0) ) - nRedlineMode |= nsRedlineMode_t::REDLINE_ON; + nRedlineMode |= nsRedlineMode_t::REDLINE_ON; else - nRedlineMode |= nsRedlineMode_t::REDLINE_NONE; + nRedlineMode |= nsRedlineMode_t::REDLINE_NONE; // ... restore redline mode // (First set bogus mode to make sure the mode in SetRedlineMode() - // is different from it's previous mode.) + // is different from its previous mode.) rDoc.SetRedlineMode_intern((RedlineMode_t)( ~nRedlineMode )); rDoc.SetRedlineMode( (RedlineMode_t)( nRedlineMode )); - // #103728# move Pam into valid content - lcl_EnsureValidPam( rPaM ); + // #103728# move Pam into valid content + lcl_EnsureValidPam( rPaM ); if( pGraphicHelper ) SvXMLGraphicHelper::Destroy( pGraphicHelper ); xGraphicResolver = 0; if( pObjectHelper ) - SvXMLEmbeddedObjectHelper::Destroy( pObjectHelper ); + SvXMLEmbeddedObjectHelper::Destroy( pObjectHelper ); xObjectResolver = 0; rDoc.release(); - if ( !bOASIS ) - { - // --> OD 2005-09-06 #i44177# - assure that for documents in OpenOffice.org - // file format the relation between outline numbering rule and styles is - // filled-up accordingly. - // Note: The OpenOffice.org file format, which has no content that applys - // a certain style, which is related to the outline numbering rule, - // has lost the information, that this certain style is related to - // the outline numbering rule. - // --> OD 2008-12-17 #i70748# - only for templates - if ( pMedium && pMedium->GetFilter() && - pMedium->GetFilter()->IsOwnTemplateFormat() ) - { - lcl_AdjustOutlineStylesForOOo( rDoc ); - } - // <-- - // Fix #i58251#: Unfortunately is the static default different to SO7 behaviour, - // so we have to set a dynamic default after importing SO7 - rDoc.SetDefault( SfxBoolItem( RES_ROW_SPLIT, sal_False ) ); - } - // <-- + if ( !bOASIS ) + { + // --> OD 2005-09-06 #i44177# - assure that for documents in OpenOffice.org + // file format the relation between outline numbering rule and styles is + // filled-up accordingly. + // Note: The OpenOffice.org file format, which has no content that applies + // a certain style, which is related to the outline numbering rule, + // has lost the information, that this certain style is related to + // the outline numbering rule. + // --> OD 2008-12-17 #i70748# - only for templates + if ( pMedium && pMedium->GetFilter() && + pMedium->GetFilter()->IsOwnTemplateFormat() ) + { + lcl_AdjustOutlineStylesForOOo( rDoc ); + } + // <-- + // Fix #i58251#: Unfortunately is the static default different to SO7 behavior, + // so we have to set a dynamic default after importing SO7 + rDoc.SetDefault( SfxBoolItem( RES_ROW_SPLIT, sal_False ) ); + } + // <-- - rDoc.PropagateOutlineRule(); + rDoc.PropagateOutlineRule(); - // --> OD 2006-03-14 #i62875# - if ( rDoc.get(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE) && !docfunc::ExistsDrawObjs( rDoc ) ) - { - rDoc.set(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false); - } - // <-- + // --> OD 2006-03-14 #i62875# + if ( rDoc.get(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE) && !docfunc::ExistsDrawObjs( rDoc ) ) + { + rDoc.set(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false); + } + // <-- - // --> OD 2006-02-22 #b6382898# - // Convert all instances of <SdrOle2Obj> into <SdrGrafObj>, because the - // Writer doesn't support such objects. - lcl_ConvertSdrOle2ObjsToSdrGrafObjs( rDoc ); - // <-- + // --> OD 2006-02-22 #b6382898# + // Convert all instances of <SdrOle2Obj> into <SdrGrafObj>, because the + // Writer doesn't support such objects. + lcl_ConvertSdrOle2ObjsToSdrGrafObjs( rDoc ); + // <-- // set BuildId on XModel for later OLE object loading if( xInfoSet.is() ) @@ -1049,7 +1051,7 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPaM, con xStatusIndicator->end(); } - rDoc.GetIStyleAccess().clearCaches(); // Clear Automatic-Style-Caches(shared_pointer!) + rDoc.GetIStyleAccess().clearCaches(); // Clear Automatic-Style-Caches(shared_pointer!) return nRet; } @@ -1062,8 +1064,8 @@ sal_uInt16 XMLReader::GetSectionList( SfxMedium& rMedium, comphelper::getProcessServiceFactory(); ASSERT( xServiceFactory.is(), "XMLReader::Read: got no service manager" ); - uno::Reference < embed::XStorage > xStg2; - if( xServiceFactory.is() && ( xStg2 = rMedium.GetStorage() ).is() ) + uno::Reference < embed::XStorage > xStg2; + if( xServiceFactory.is() && ( xStg2 = rMedium.GetStorage() ).is() ) { try { @@ -1072,7 +1074,7 @@ sal_uInt16 XMLReader::GetSectionList( SfxMedium& rMedium, OUString sDocName( RTL_CONSTASCII_USTRINGPARAM( "content.xml" ) ); aParserInput.sSystemId = sDocName; - uno::Reference < io::XStream > xStm = xStg2->openStreamElement( sDocName, embed::ElementModes::READ ); + uno::Reference < io::XStream > xStm = xStg2->openStreamElement( sDocName, embed::ElementModes::READ ); aParserInput.aInputStream = xStm->getInputStream(); // get parser @@ -1094,11 +1096,11 @@ sal_uInt16 XMLReader::GetSectionList( SfxMedium& rMedium, xParser->parseStream( aParserInput ); } } - catch( xml::sax::SAXParseException& ) + catch( xml::sax::SAXParseException& ) { // re throw ? } - catch( xml::sax::SAXException& ) + catch( xml::sax::SAXException& ) { // re throw ? } diff --git a/main/xmlhelp/source/cxxhelp/test/searchdemo.cxx b/main/xmlhelp/source/cxxhelp/test/searchdemo.cxx index 002dd56..0e4a60b 100644 --- a/main/xmlhelp/source/cxxhelp/test/searchdemo.cxx +++ b/main/xmlhelp/source/cxxhelp/test/searchdemo.cxx @@ -1,5 +1,5 @@ /************************************************************** - * + * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -7,16 +7,16 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * + * *************************************************************/ @@ -52,10 +52,10 @@ void print_rtl_OUString( const rtl::OUString bla ) rtl::OString bluber = rtl::OString( bla.getStr(),bla.getLength(),RTL_TEXTENCODING_UTF8 ); char* bluberChr = new char[ 1+bluber.getLength() ]; const sal_Char* jux = bluber.getStr(); - + for( int i = 0; i < bluber.getLength(); ++i ) bluberChr[i] = jux[i]; - + bluberChr[ bluber.getLength() ] = 0; printf( "%s\n",bluberChr ); delete[] bluberChr; @@ -70,27 +70,27 @@ int main( int argc,char* argv[] ) { QueryResults* queryResults = 0; - + try - { + { rtl::OUString installDir = rtl::OUString::createFromAscii( "//./e|/index/" ); QueryProcessor queryProcessor( installDir ); - + std::vector<rtl::OUString> Query(2); Query[0] = rtl::OUString::createFromAscii( "text*" ); Query[1] = rtl::OUString::createFromAscii( "abbildung" ); rtl::OUString Scope = rtl::OUString::createFromAscii( "headingheading" ); int HitCount = 40; - + QueryStatement queryStatement( HitCount,Query,Scope ); queryResults = queryProcessor.processQuery( queryStatement ); - + rtl::OUString translations[2]; translations[0] = rtl::OUString::createFromAscii( "#HLP#" ); translations[1] = rtl::OUString::createFromAscii( "vnd.sun.star.help://" ); - - PrefixTranslator* translator = PrefixTranslator::makePrefixTranslator( translations,2 ); - + + PrefixTranslator* translator = PrefixTranslator::makePrefixTranslator( translations,2 ); + QueryHitIterator* it = queryResults->makeQueryHitIterator(); sal_Int32 j = 0; while( j < 10 && it->next() ) @@ -101,13 +101,14 @@ int main( int argc,char* argv[] ) print_rtl_OUString( qhd->getDocument() ); ++j; } - + delete it; - } + } catch( ... ) - { - printf( "catched exception" ); + { + printf( "caught exception" ); throw; - } + } return 0; } +