[Libreoffice-commits] core.git: Branch 'ports/macosx10.5/master' - 477 commits - accessibility/inc accessibility/source android/Bootstrap apple_remote/Library_AppleRemote.mk avmedia/Library_avmedia.mk avmedia/Library_avmediaQuickTime.mk avmedia/Module_avmedia.mk avmedia/source basctl/inc basctl/source basegfx/source basic/source bin/gbuild-to-ide bridges/inc bridges/Library_cpp_uno.mk bridges/source canvas/source chart2/AllLangResTarget_chartcontroller.mk chart2/inc chart2/Library_chartcore.mk chart2/Module_chart2.mk chart2/qa chart2/source chart2/uiconfig chart2/UIConfig_chart2.mk clew/Library_clew.mk clew/Makefile clew/Module_clew.mk clew/source codemaker/source comphelper/inc comphelper/source comphelper/util compilerplugins/clang config_host/config_cups.h.in config_host/config_features.h.in config_host/config_global.h.in config_host/config_version.h.in config_host.mk.in configmgr/source configure.ac connectivity/registry connectivity/source cppcanvas/inc cppuhelper/qa cppuhelper/source cppuhe lper/test cppu/source cui/inc cui/Library_cui.mk cui/source cui/uiconfig dbaccess/inc dbaccess/Module_dbaccess.mk dbaccess/qa dbaccess/source desktop/inc desktop/Library_sofficeapp.mk desktop/Module_desktop.mk desktop/qa desktop/source desktop/test desktop/unx desktop/util desktop/win32 desktop/WinResTarget_sbase.mk desktop/WinResTarget_scalc.mk desktop/WinResTarget_sdraw.mk desktop/WinResTarget_simpress.mk desktop/WinResTarget_smath.mk desktop/WinResTarget_sofficebin.mk desktop/WinResTarget_soffice.mk desktop/WinResTarget_sweb.mk desktop/WinResTarget_swriter.mk download.lst drawinglayer/inc drawinglayer/source editeng/inc editeng/source embeddedobj/source extensions/source external/apache-commons external/beanshell external/breakpad external/cairo external/clew external/curl external/firebird external/graphite external/hsqldb external/icu external/jfreereport external/languagetool external/libxmlsec external/Module_external.mk external/nss external/openssl external/python3 external /rhino filter/Configuration_filter.mk filter/qa filter/source filter/uiconfig forms/inc forms/source formula/source fpicker/Library_fps_aqua.mk fpicker/source framework/inc framework/source helpcompiler/source helpcontent2 hwpfilter/source i18nlangtag/qa i18npool/source i18nutil/source icon-themes/breeze icon-themes/galaxy icon-themes/hicontrast icon-themes/sifr icon-themes/tango idl/inc idl/source include/basegfx include/basic include/canvas include/com include/comphelper include/connectivity include/cppuhelper include/dbaccess include/default.rc include/drawinglayer include/editeng include/formula include/jvmfwk include/oox include/osl include/rtl include/sal include/sax include/sfx2 include/svl include/svtools include/svx include/toolkit include/tools include/ucbhelper include/unotools include/vcl include/version.hrc include/xmloff include/xmlscript instsetoo_native/CustomTarget_install.mk instsetoo_native/CustomTarget_setup.mk instsetoo_native/util jurt/test jvmfwk/Library_jvmfw k.mk jvmfwk/plugins l10ntools/Executable_genlang.mk l10ntools/inc l10ntools/source lingucomponent/source linguistic/source linguistic/workben lotuswordpro/source mysqlc/source odk/CppunitTest_odk_checkapi.mk odk/CustomTarget_settings.mk odk/docs odk/examples odk/Package_odk_headers.mk officecfg/registry oox/source opencl/source package/inc package/source postprocess/CustomTarget_registry.mk postprocess/Module_postprocess.mk postprocess/Rdb_services.mk pyuno/inc pyuno/README pyuno/source readlicense_oo/docs remotebridges/examples reportdesign/inc reportdesign/source RepositoryExternal.mk Repository.mk RepositoryModule_host.mk rsc/inc rsc/source sal/inc sal/Library_sal.mk sal/osl sal/qa sal/rtl sal/textenc sax/qa sax/source scaddins/source sc/CppunitTest_sc_mark_test.mk sc/inc sc/Module_sc.mk sc/qa scripting/java scripting/source sc/source sc/uiconfig sdext/source sd/inc sd/qa sd/source sd/uiconfig setup_native/install_name_patcher.app setup_native/scripts setup_native/source sfx2/Lib rary_sfx.mk sfx2/sdi sfx2/source sfx2/uiconfig shell/inc shell/Library_macbe.mk shell/source slideshow/inc slideshow/Library_slideshow.mk slideshow/Module_slideshow.mk slideshow/source smoketest/smoketest.cxx solenv/bin solenv/gbuild starmath/inc starmath/source stoc/source svgio/qa svgio/source svl/source svtools/inc svtools/source svx/inc svx/Library_svxcore.mk svx/source sw/CppunitTest_sw_ooxmlimport.mk sw/inc sw/JunitTest_sw_complex.mk sw/Module_sw.mk sw/ooxmlexport_setup.mk sw/PythonTest_sw_python.mk sw/qa sw/sdi sw/source sw/uiconfig sw/UIConfig_swriter.mk sysui/CustomTarget_deb.mk sysui/CustomTarget_rpm.mk sysui/desktop testtools/CustomTarget_uno_test.mk toolkit/Library_tk.mk toolkit/source tools/qa tools/source translations ucb/source unotools/source unoxml/source ure/source uui/source vbahelper/inc vbahelper/source vcl/CppunitTest_vcl_bitmap_test.mk vcl/Executable_icontest.mk vcl/Executable_vcldemo.mk vcl/headless vcl/inc vcl/Library_vcl.mk vcl/null vcl/opengl vcl/osx vcl/q a vcl/quartz vcl/source vcl/StaticLibrary_vclmain.mk vcl/uiconfig vcl/UIConfig_vcl.mk vcl/unx vcl/win vcl/workben wizards/source writerfilter/Module_writerfilter.mk writerfilter/source xmloff/inc xmloff/source xmlreader/source xmlsecurity/inc xmlsecurity/source
Douglas Mencken
dougmencken at gmail.com
Sun Apr 3 07:21:32 UTC 2016
Rebased ref, commits from common ancestor:
commit 6f7680000dc5814b0072d1ebd286f43ecc6c9cbe
Author: Douglas Mencken <dougmencken at gmail.com>
Date: Mon Mar 28 23:12:07 2016 -0400
fix that Writer can't save a document in "alien" formats
plus refactor some debug messages
Change-Id: Ief962ea1b978bba5d36d194232962dc0364ef512
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index ee96b67..8a90d8d 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -461,7 +461,7 @@ bool SvxLRSpaceItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
default:
bRet = false;
- OSL_FAIL("unknown MemberId");
+ SAL_WARN( "editeng.items", "unknown MemberId ( " << OUString::number( nMemberId ) << " )" );
}
return bRet;
}
@@ -518,7 +518,7 @@ bool SvxLRSpaceItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
break;
default:
- OSL_FAIL("unknown MemberId");
+ SAL_WARN( "editeng.items", "unknown MemberId ( " << OUString::number( nMemberId ) << " )" );
return false;
}
return true;
@@ -711,7 +711,7 @@ SfxPoolItem* SvxLRSpaceItem::Create( SvStream& rStrm, sal_uInt16 nVersion ) cons
if ( nVersion >= LRSPACE_AUTOFIRST_VERSION )
{
- rStrm.ReadUInt16( left ).ReadUInt16( prpleft ).ReadUInt16( right ).ReadUInt16( prpright ).ReadInt16( firstline ). ReadUInt16( prpfirstline ).ReadUInt16( txtleft ).ReadSChar( autofirst );
+ rStrm.ReadUInt16( left ).ReadUInt16( prpleft ).ReadUInt16( right ).ReadUInt16( prpright ).ReadInt16( firstline ). ReadUInt16( prpfirstline ).ReadUInt16( txtleft ).ReadSChar( autofirst );
sal_Size nPos = rStrm.Tell();
sal_uInt32 nMarker;
@@ -727,11 +727,11 @@ SfxPoolItem* SvxLRSpaceItem::Create( SvStream& rStrm, sal_uInt16 nVersion ) cons
}
else if ( nVersion == LRSPACE_TXTLEFT_VERSION )
{
- rStrm.ReadUInt16( left ).ReadUInt16( prpleft ).ReadUInt16( right ).ReadUInt16( prpright ).ReadInt16( firstline ). ReadUInt16( prpfirstline ).ReadUInt16( txtleft );
+ rStrm.ReadUInt16( left ).ReadUInt16( prpleft ).ReadUInt16( right ).ReadUInt16( prpright ).ReadInt16( firstline ). ReadUInt16( prpfirstline ).ReadUInt16( txtleft );
}
else if ( nVersion == LRSPACE_16_VERSION )
{
- rStrm.ReadUInt16( left ).ReadUInt16( prpleft ).ReadUInt16( right ).ReadUInt16( prpright ).ReadInt16( firstline ). ReadUInt16( prpfirstline );
+ rStrm.ReadUInt16( left ).ReadUInt16( prpleft ).ReadUInt16( right ).ReadUInt16( prpright ).ReadInt16( firstline ). ReadUInt16( prpfirstline );
}
else
{
@@ -912,7 +912,7 @@ bool SvxULSpaceItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
break;
default:
- OSL_FAIL("unknown MemberId");
+ SAL_WARN( "editeng.items", "unknown MemberId ( " << OUString::number( nMemberId ) << " )" );
return false;
}
return true;
@@ -3466,7 +3466,7 @@ bool SvxBrushItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
break;
case MID_GRAPHIC:
- SAL_WARN( "editeng.items", "not implemented" );
+ SAL_WARN( "editeng.items", "MID_GRAPHIC is not implemented" );
break;
case MID_GRAPHIC_TRANSPARENT:
@@ -3570,7 +3570,7 @@ bool SvxBrushItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
rVal >>= sLink;
if( sLink.startsWith( UNO_NAME_GRAPHOBJ_URLPKGPREFIX ) )
{
- OSL_FAIL( "package urls aren't implemented" );
+ SAL_WARN( "editeng.items", "package urls aren't implemented" );
}
else if( sLink.startsWith( UNO_NAME_GRAPHOBJ_URLPREFIX ) )
{
diff --git a/oox/source/docprop/docprophandler.cxx b/oox/source/docprop/docprophandler.cxx
index b71c5ec..2faa888 100644
--- a/oox/source/docprop/docprophandler.cxx
+++ b/oox/source/docprop/docprophandler.cxx
@@ -292,7 +292,7 @@ void SAL_CALL OOXMLDocPropHandler::startFastElement( ::sal_Int32 nElement, const
}
else
{
- OSL_FAIL( "Unexpected file format!" );
+ OSL_FAIL( "Unexpected file format" );
}
}
else if ( m_nState && m_nInBlock == 1 ) // that tag should contain the property name
@@ -485,7 +485,7 @@ void SAL_CALL OOXMLDocPropHandler::characters( const OUString& aChars )
break;
default:
- OSL_FAIL( "Unexpected core property!" );
+ OSL_FAIL( "Unexpected core property" );
}
}
else if ( m_nState == EXTPR_TOKEN( Properties ) )
@@ -599,7 +599,7 @@ void SAL_CALL OOXMLDocPropHandler::characters( const OUString& aChars )
break;
default:
- OSL_FAIL( "Unexpected extended property!" );
+ OSL_FAIL( "Unexpected extended property" );
}
}
else if ( m_nState == CUSTPR_TOKEN( Properties ) )
@@ -655,7 +655,7 @@ void SAL_CALL OOXMLDocPropHandler::characters( const OUString& aChars )
}
else
{
- OSL_FAIL( "Unexpected tag in custom property!" );
+ OSL_FAIL( "Unexpected tag in custom property" );
}
}
}
@@ -671,7 +671,7 @@ void SAL_CALL OOXMLDocPropHandler::characters( const OUString& aChars )
catch( uno::Exception& e )
{
throw xml::sax::SAXException(
- OUString("Error while setting document property!"),
+ OUString( "Error while setting document property" ),
uno::Reference< uno::XInterface >(),
uno::makeAny( e ) );
}
diff --git a/sax/source/tools/fastserializer.cxx b/sax/source/tools/fastserializer.cxx
index b81886e..2702ce6 100644
--- a/sax/source/tools/fastserializer.cxx
+++ b/sax/source/tools/fastserializer.cxx
@@ -133,7 +133,11 @@ namespace sax_fastparser {
void FastSaxSerializer::endDocument()
{
- assert(mbMarkStackEmpty && maMarkStack.empty());
+ if( !mbMarkStackEmpty )
+ SAL_WARN( "sax", "endDocument(): mbMarkStackEmpty is false" );
+ if( !maMarkStack.empty() )
+ SAL_WARN( "sax", "endDocument(): maMarkStack is not empty" );
+
maCachedOutputStream.flush();
}
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index bd2fca7..1d899d0 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -1845,12 +1845,12 @@ void SfxMedium::Transfer_Impl()
// makes sense only in case logic name is set
if ( osl::FileBase::getFileURLFromSystemPath( pImp->m_aName, aNameURL )
!= osl::FileBase::E_None )
- SAL_WARN( "sfx.doc", "The medium name is not convertible!" );
+ SAL_WARN( "sfx.doc", "The medium name is not convertible" );
}
if ( !aNameURL.isEmpty() && ( !pImp->m_eError || (pImp->m_eError & ERRCODE_WARNING_MASK) ) )
{
- SAL_INFO( "sfx.doc", "SfxMedium::Transfer_Impl, copying to target" );
+ SAL_WARN( "sfx.doc", "copying to target" );
Reference < css::ucb::XCommandEnvironment > xEnv;
Reference< XOutputStream > rOutStream;
@@ -1979,7 +1979,7 @@ void SfxMedium::Transfer_Impl()
if ( aFile.open( osl_File_OpenFlag_Write ) == osl::FileBase::E_None )
{
aFile.sync();
- SAL_INFO( "sfx.doc", "fsync'd saved file '" << aDestURL << "'" );
+ SAL_WARN( "sfx.doc", "fsync'd saved file '" << aDestURL << "'" );
aFile.close();
}
}
@@ -2957,6 +2957,7 @@ void SfxMedium::CompleteReOpen()
pImp->bUseInteractionHandler = bUseInteractionHandler;
}
+
SfxMedium::SfxMedium(const OUString &rName, StreamMode nOpenMode, std::shared_ptr<const SfxFilter> pFilter, SfxItemSet *pInSet) :
pImp(new SfxMedium_Impl)
{
@@ -2965,8 +2966,11 @@ SfxMedium::SfxMedium(const OUString &rName, StreamMode nOpenMode, std::shared_pt
pImp->m_aLogicName = rName;
pImp->m_nStorOpenMode = nOpenMode;
Init_Impl();
+
+ SAL_WARN( "sfx.doc", "created SfxMedium \"" << rName << "\"" );
}
+
SfxMedium::SfxMedium(const OUString &rName, const OUString &rReferer, StreamMode nOpenMode, std::shared_ptr<const SfxFilter> pFilter, SfxItemSet *pInSet) :
pImp(new SfxMedium_Impl)
{
@@ -2979,8 +2983,11 @@ SfxMedium::SfxMedium(const OUString &rName, const OUString &rReferer, StreamMode
pImp->m_aLogicName = rName;
pImp->m_nStorOpenMode = nOpenMode;
Init_Impl();
+
+ SAL_WARN( "sfx.doc", "created SfxMedium \"" << rName << "\" with referer \"" << rReferer << "\"" );
}
+
SfxMedium::SfxMedium( const uno::Sequence<beans::PropertyValue>& aArgs ) :
pImp(new SfxMedium_Impl)
{
@@ -3031,7 +3038,7 @@ SfxMedium::SfxMedium( const uno::Sequence<beans::PropertyValue>& aArgs ) :
}
else
{
- SAL_WARN( "sfx.doc", "Can not create a new temporary file for crash recovery!\n" );
+ SAL_WARN( "sfx.doc", "can't create a new temporary file for crash recovery" );
}
}
}
@@ -3046,6 +3053,8 @@ SfxMedium::SfxMedium( const uno::Sequence<beans::PropertyValue>& aArgs ) :
pImp->m_aLogicName = pFileNameItem->GetValue();
pImp->m_nStorOpenMode = readOnly ? SFX_STREAM_READONLY : SFX_STREAM_READWRITE;
Init_Impl();
+
+ SAL_WARN( "sfx.doc", "created SfxMedium from property values, file name item \"" << pFileNameItem->GetValue() << "\"" );
}
@@ -3054,7 +3063,7 @@ SfxMedium::SfxMedium( const uno::Reference < embed::XStorage >& rStor, const OUS
{
OUString aType = SfxFilter::GetTypeFromStorage(rStor);
pImp->m_pFilter = SfxGetpApp()->GetFilterMatcher().GetFilter4EA( aType );
- DBG_ASSERT( pImp->m_pFilter, "No Filter for storage found!" );
+ DBG_ASSERT( pImp->m_pFilter, "no filter for storage found" );
Init_Impl();
pImp->xStorage = rStor;
@@ -3064,6 +3073,8 @@ SfxMedium::SfxMedium( const uno::Reference < embed::XStorage >& rStor, const OUS
GetItemSet()->Put( SfxStringItem( SID_DOC_BASEURL, rBaseURL ) );
if ( p )
GetItemSet()->Put( *p );
+
+ SAL_WARN( "sfx.doc", "created SfxMedium from XStorage: base URL \"" << rBaseURL << "\"" );
}
@@ -3071,7 +3082,7 @@ SfxMedium::SfxMedium( const uno::Reference < embed::XStorage >& rStor, const OUS
pImp(new SfxMedium_Impl)
{
pImp->m_pFilter = SfxGetpApp()->GetFilterMatcher().GetFilter4EA( rTypeName );
- DBG_ASSERT( pImp->m_pFilter, "No Filter for storage found!" );
+ DBG_ASSERT( pImp->m_pFilter, "no filter for storage found" );
Init_Impl();
pImp->xStorage = rStor;
@@ -3081,6 +3092,8 @@ SfxMedium::SfxMedium( const uno::Reference < embed::XStorage >& rStor, const OUS
GetItemSet()->Put( SfxStringItem( SID_DOC_BASEURL, rBaseURL ) );
if ( p )
GetItemSet()->Put( *p );
+
+ SAL_WARN( "sfx.doc", "created SfxMedium from XStorage: base URL \"" << rBaseURL << "\", type name \"" << rTypeName << "\"" );
}
@@ -3094,15 +3107,14 @@ SfxMedium::~SfxMedium()
if( pImp->bIsTemp && !pImp->m_aName.isEmpty() )
{
OUString aTemp;
- if ( osl::FileBase::getFileURLFromSystemPath( pImp->m_aName, aTemp )
- != osl::FileBase::E_None )
+ if ( osl::FileBase::getFileURLFromSystemPath( pImp->m_aName, aTemp ) != osl::FileBase::E_None )
{
- SAL_WARN( "sfx.doc", "Physical name not convertible!");
+ SAL_WARN( "sfx.doc", "physical name not convertible");
}
if ( !::utl::UCBContentHelper::Kill( aTemp ) )
{
- SAL_WARN( "sfx.doc", "Couldn't remove temporary file!");
+ SAL_WARN( "sfx.doc", "couldn't remove temporary file");
}
}
@@ -3196,9 +3208,7 @@ SvKeyValueIterator* SfxMedium::GetHeaderAttributes_Impl()
pImp->xAttributes->Append( SvKeyValue( OUString("content-type"), aContentType ) );
}
- catch ( const css::uno::Exception& )
- {
- }
+ catch ( const css::uno::Exception& ) { }
}
}
@@ -3243,9 +3253,7 @@ uno::Sequence < util::RevisionTag > SfxMedium::GetVersionList( const uno::Refere
{
return xReader->load( xStorage );
}
- catch ( const uno::Exception& )
- {
- }
+ catch ( const uno::Exception& ) { }
return uno::Sequence < util::RevisionTag >();
}
diff --git a/sfx2/source/doc/docinf.cxx b/sfx2/source/doc/docinf.cxx
index 75a4dc6..c693bf6 100644
--- a/sfx2/source/doc/docinf.cxx
+++ b/sfx2/source/doc/docinf.cxx
@@ -268,34 +268,51 @@ bool SaveOlePropertySet(
"_PID_HLINKS" );
}
- uno::Reference<beans::XPropertySet> xUserDefinedProps(
- i_xDocProps->getUserDefinedProperties(), uno::UNO_QUERY_THROW);
- DBG_ASSERT(xUserDefinedProps.is(), "UserDefinedProperties is null");
- uno::Reference<beans::XPropertySetInfo> xPropInfo =
- xUserDefinedProps->getPropertySetInfo();
- DBG_ASSERT(xPropInfo.is(), "UserDefinedProperties Info is null");
- uno::Sequence<beans::Property> props = xPropInfo->getProperties();
- for (sal_Int32 i = 0; i < props.getLength(); ++i)
+ try
{
- try
+ uno::Reference<beans::XPropertySet> xUserDefinedProps(
+ i_xDocProps->getUserDefinedProperties(), uno::UNO_QUERY );
+ if ( xUserDefinedProps.is() )
{
- // skip transient properties
- if (~props[i].Attributes & beans::PropertyAttribute::TRANSIENT)
+ uno::Reference<beans::XPropertySetInfo> xPropInfo =
+ xUserDefinedProps->getPropertySetInfo();
+ if ( xPropInfo.is() )
{
- const OUString name = props[i].Name;
- const sal_Int32 nPropId = rCustomSect.GetFreePropertyId();
- if (rCustomSect.SetAnyValue( nPropId,
- xUserDefinedProps->getPropertyValue(name))) {
- rCustomSect.SetPropertyName( nPropId, name );
+ uno::Sequence<beans::Property> props = xPropInfo->getProperties();
+ for ( sal_Int32 i = 0; i < props.getLength(); ++i )
+ {
+ try
+ {
+ // skip transient properties
+ if ( ~props[i].Attributes & beans::PropertyAttribute::TRANSIENT )
+ {
+ const OUString name = props[i].Name;
+ const sal_Int32 nPropId = rCustomSect.GetFreePropertyId();
+ if (rCustomSect.SetAnyValue( nPropId,
+ xUserDefinedProps->getPropertyValue(name)))
+ {
+ rCustomSect.SetPropertyName( nPropId, name );
+ }
+ }
+ }
+ catch ( ... )
+ {
+ // may happen with concurrent modification
+ SAL_WARN( "sfx", "caught exception" );
+ }
}
}
+ else
+ {
+ SAL_WARN( "sfx", "PropertySetInfo for UserDefinedProperties is nil" );
+ }
}
- catch (const uno::Exception &)
+ else
{
- // may happen with concurrent modification...
- SAL_INFO("sfx", "SavePropertySet: exception");
+ SAL_WARN( "sfx", "UserDefinedProperties is nil" );
}
}
+ catch ( ... ) { }
// save the property set
ErrCode nDocError = aDocSet.SavePropertySet(i_pStorage,
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index c00ed82..42b5293 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -1751,31 +1751,51 @@ void SfxStoringHelper::SetDocInfoState(
try
{
uno::Reference< beans::XPropertySet > const xSet(
- xDocPropsToFill->getUserDefinedProperties(), uno::UNO_QUERY);
- uno::Reference< beans::XPropertyContainer > xContainer( xSet, uno::UNO_QUERY );
- uno::Reference< beans::XPropertySetInfo > xSetInfo = xSet->getPropertySetInfo();
- uno::Sequence< beans::Property > lProps = xSetInfo->getProperties();
- const beans::Property* pProps = lProps.getConstArray();
- sal_Int32 c = lProps.getLength();
- sal_Int32 i = 0;
- for (i=0; i<c; ++i)
+ xDocPropsToFill->getUserDefinedProperties(), uno::UNO_QUERY );
+ if ( xSet.is() )
{
- uno::Any aValue = xPropSet->getPropertyValue( pProps[i].Name );
- if ( pProps[i].Attributes & css::beans::PropertyAttribute::REMOVABLE )
+ uno::Reference< beans::XPropertyContainer > xContainer( xSet, uno::UNO_QUERY );
+ if ( xContainer.is() )
{
- try
+ uno::Reference< beans::XPropertySetInfo > xSetInfo = xSet->getPropertySetInfo();
+ if ( xSetInfo.is() )
{
- // QUESTION: DefaultValue?!
- xContainer->addProperty( pProps[i].Name, pProps[i].Attributes, aValue );
+ uno::Sequence< beans::Property > lProps = xSetInfo->getProperties();
+ const beans::Property* pProps = lProps.getConstArray();
+ sal_Int32 c = lProps.getLength();
+ for ( sal_Int32 i = 0; i < c; ++i )
+ {
+ uno::Any aValue = xPropSet->getPropertyValue( pProps[i].Name );
+ if ( pProps[i].Attributes & css::beans::PropertyAttribute::REMOVABLE )
+ {
+ try
+ {
+ // QUESTION: DefaultValue?
+ xContainer->addProperty( pProps[i].Name, pProps[i].Attributes, aValue );
+ }
+ catch (beans::PropertyExistException const&) { }
+ try
+ {
+ // it is possible that the propertysets from XML and binary files differ; shouldn't break then
+ xSet->setPropertyValue( pProps[i].Name, aValue );
+ }
+ catch ( const uno::Exception& ) { }
+ }
+ }
}
- catch (beans::PropertyExistException const&) {}
- try
+ else
{
- // it is possible that the propertysets from XML and binary files differ; we shouldn't break then
- xSet->setPropertyValue( pProps[i].Name, aValue );
+ SAL_WARN( "sfx.doc", "PropertySetInfo is nil" );
}
- catch ( const uno::Exception& ) {}
}
+ else
+ {
+ SAL_WARN( "sfx.doc", "PropertyContainer is nil" );
+ }
+ }
+ else
+ {
+ SAL_WARN( "sfx.doc", "PropertySet is nil" );
}
// sigh... have to set these manually I'm afraid... wonder why
@@ -1798,9 +1818,9 @@ void SfxStoringHelper::SetDocInfoState(
xDocPropsToFill->setEditingDuration(i_xOldDocProps->getEditingDuration());
// other attributes e.g. DocumentStatistics are not editable from dialog
}
- catch (const uno::Exception& e)
+ catch ( const uno::Exception& e )
{
- SAL_INFO("sfx.doc", "SetDocInfoState: caught exception: " << e.Message);
+ SAL_WARN( "sfx.doc", "SetDocInfoState: caught exception: " << e.Message );
}
// set the modified flag back if required
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index e6c0ee9..3753b2a 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -446,7 +446,7 @@ void SfxObjectShell::UpdateFromTemplate_Impl( )
}
catch (const Exception& e)
{
- SAL_INFO("sfx.doc", "caught exception" << e.Message);
+ SAL_WARN( "sfx.doc", "caught exception: " << e.Message );
}
// if modify date was read successfully
@@ -653,7 +653,7 @@ bool SfxObjectShell::IsModifyPasswordEntered()
void SfxObjectShell::libreOfficeKitCallback(int /*nType*/, const char* /*pPayload*/) const
{
- SAL_INFO("sfx.tiledrendering", "SfxObjectShell::libreOfficeKitCallback interface not overridden for SfxObjectShell subclass typeId: " << typeid(*this).name());
+ SAL_WARN( "sfx.tiledrendering", OSL_THIS_FUNC << "interface not overridden for SfxObjectShell subclass typeId: " << typeid(*this).name() );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 169423a..8b6cf11 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -267,7 +267,7 @@ void SfxObjectShell::EnableSetModified( bool bEnable )
{
#ifdef DBG_UTIL
if ( bEnable == pImp->m_bEnableSetModified )
- SAL_INFO( "sfx", "SFX_PERSIST: EnableSetModified 2x called with the same value" );
+ SAL_WARN( "sfx", "SFX_PERSIST: EnableSetModified 2x called with the same value" );
#endif
pImp->m_bEnableSetModified = bEnable;
}
@@ -325,7 +325,7 @@ void SfxObjectShell::SetModified( bool bModifiedP )
{
#ifdef DBG_UTIL
if ( !bModifiedP && !IsEnableSetModified() )
- SAL_INFO( "sfx", "SFX_PERSIST: SetModified( sal_False ), although IsEnableSetModified() == sal_False" );
+ SAL_WARN( "sfx", "SFX_PERSIST: SetModified( sal_False ) although IsEnableSetModified() is sal_False" );
#endif
if( !IsEnableSetModified() )
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 5158884..8c0ef6b 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -315,14 +315,14 @@ SotClipboardFormatId GetChartVersion( sal_Int32 nVersion, bool bTemplate )
{
if (bTemplate)
{
- SAL_WARN("sfx", "no chart template support yet");
+ SAL_WARN( "sfx", "no support for chart templates yet" );
return SotClipboardFormatId::STARCHART_8;
}
else
return SotClipboardFormatId::STARCHART_8;
}
- SAL_WARN("sfx", "unsupported version");
+ SAL_WARN( "sfx", "unsupported version" );
return SotClipboardFormatId::NONE;
}
@@ -1081,11 +1081,11 @@ bool SfxObjectShell::SaveTo_Impl
*/
{
- SAL_INFO( "sfx.doc", "saving \"" << rMedium.GetName() << "\"" );
+ SAL_WARN( "sfx.doc", "saving \"" << rMedium.GetName() << "\"" );
UpdateDocInfoForSave();
- AddLog( OSL_LOG_PREFIX "Begin" );
+ SAL_WARN( "sfx.doc", "[ Begin ]" );
ModifyBlocker_Impl aMod(this);
@@ -1124,7 +1124,7 @@ bool SfxObjectShell::SaveTo_Impl
|| pImp->nScriptingSignatureState == SignatureState::NOTVALIDATED
|| pImp->nScriptingSignatureState == SignatureState::INVALID ) )
{
- AddLog( OSL_LOG_PREFIX "MacroSignaturePreserving" );
+ SAL_WARN( "sfx.doc", "[ MacroSignaturePreserving ]" );
// the checking of the library modified state iterates over the libraries, should be done only when required
// currently the check is commented out since it is broken, we have to check the signature every time we save
@@ -1170,7 +1170,7 @@ bool SfxObjectShell::SaveTo_Impl
&& ::utl::UCBContentHelper::EqualURLs( pMedium->GetName(), rMedium.GetName() ) )
{
bStoreToSameLocation = true;
- AddLog( OSL_LOG_PREFIX "Save" );
+ SAL_WARN( "sfx.doc", "[ Save ]" );
if ( pMedium->DocNeedsFileDateCheck() )
rMedium.CheckFileDate( pMedium->GetInitFileDate( false ) );
@@ -1186,7 +1186,7 @@ bool SfxObjectShell::SaveTo_Impl
const bool bDoBackup = SvtSaveOptions().IsBackup();
if ( bDoBackup )
{
- AddLog( OSL_LOG_PREFIX "DoBackup" );
+ SAL_WARN( "sfx.doc", "[ DoBackup ]" );
rMedium.DoBackup_Impl();
if ( rMedium.GetError() )
{
@@ -1214,7 +1214,7 @@ bool SfxObjectShell::SaveTo_Impl
// if the last step is failed the stream should stay to be transacted and should be committed on any flush
// so we can forget the stream in any way and the next storage commit will flush it
- AddLog( OSL_LOG_PREFIX "Save: Own to Own" );
+ SAL_WARN( "sfx.doc", "[ Save: Own to Own ]" );
bNeedsDisconnectionOnFail = DisconnectStorage_Impl(
*pMedium, rMedium );
@@ -1237,7 +1237,7 @@ bool SfxObjectShell::SaveTo_Impl
// just disconnect the stream from the source format
// so that the target medium can use it
- AddLog( OSL_LOG_PREFIX "Save: Alien to Alien" );
+ SAL_WARN( "sfx.doc", "[ Save: Alien to Alien ]" );
pMedium->CloseAndRelease();
rMedium.CloseAndRelease();
@@ -1250,7 +1250,7 @@ bool SfxObjectShell::SaveTo_Impl
// format is an own one so just disconnect the source
// medium
- AddLog( OSL_LOG_PREFIX "Save: Alien to Own" );
+ SAL_WARN( "sfx.doc", "[ Save: Alien to Own ]" );
pMedium->CloseAndRelease();
rMedium.CloseAndRelease();
@@ -1262,7 +1262,7 @@ bool SfxObjectShell::SaveTo_Impl
// an alien format, just connect the source to temporary
// storage
- AddLog( OSL_LOG_PREFIX "Save: Own to Alien" );
+ SAL_WARN( "sfx.doc", "[ Save: Own to Alien ]" );
bNeedsDisconnectionOnFail = DisconnectStorage_Impl(
*pMedium, rMedium );
@@ -1284,7 +1284,7 @@ bool SfxObjectShell::SaveTo_Impl
// but for now the framework has to be ready for it
// TODO/LATER: let the medium be prepared for alien formats as well
- AddLog( OSL_LOG_PREFIX "SaveAs/Export" );
+ SAL_WARN( "sfx.doc", "[ SaveAs/Export ]" );
rMedium.CloseAndRelease();
if ( bStorageBasedTarget )
@@ -1300,7 +1300,7 @@ bool SfxObjectShell::SaveTo_Impl
return false;
}
- AddLog( OSL_LOG_PREFIX "Locking" );
+ SAL_WARN( "sfx.doc", "[ Locking ]" );
rMedium.LockOrigFileOnDemand( false, false );
@@ -1353,14 +1353,14 @@ bool SfxObjectShell::SaveTo_Impl
// TODO/LATER: get rid of bOk
if (bOwnTarget && pFilter && !(pFilter->GetFilterFlags() & SfxFilterFlags::STARONEFILTER))
{
- AddLog( OSL_LOG_PREFIX "Storing in own format." );
+ SAL_WARN( "sfx.doc", "[ Storing in own format ]" );
uno::Reference< embed::XStorage > xMedStorage = rMedium.GetStorage();
if ( !xMedStorage.is() )
{
// no saving without storage, unlock UI and return
Lock_Impl( this, false );
pImp->bForbidReload = bOldStat;
- AddLog( OSL_LOG_PREFIX "Storing failed, still no error set." );
+ SAL_WARN( "sfx.doc", "[ Storing failed, still no error set ]" );
return false;
}
@@ -1390,22 +1390,19 @@ bool SfxObjectShell::SaveTo_Impl
if ( bOk )
{
bOk = false;
- // currently the case that the storage is the same should be impossible
if ( xMedStorage == GetStorage() )
{
- OSL_ENSURE( !pVersionItem, "This scenario is impossible currently!\n" );
- AddLog( OSL_LOG_PREFIX "Should be impossible." );
- // usual save procedure
- bOk = Save();
+ OSL_ENSURE( !pVersionItem, "storage is the same, currently this scenario is impossible" );
+ bOk = Save(); // usual save
}
else
{
// save to target
- AddLog( OSL_LOG_PREFIX "Save as own format." );
+ SAL_WARN( "sfx.doc", "[ Save as own format ]" );
bOk = SaveAsOwnFormat( rMedium );
if ( bOk && pVersionItem )
{
- AddLog( OSL_LOG_PREFIX "pVersionItem != NULL" );
+ SAL_WARN( "sfx.doc", "pVersionItem is not nil" );
aTmpVersionURL = CreateTempCopyOfStorage_Impl( xMedStorage );
bOk = !aTmpVersionURL.isEmpty();
}
@@ -1418,13 +1415,13 @@ bool SfxObjectShell::SaveTo_Impl
{
// store the thumbnail representation image
// the thumbnail is not stored in case of encrypted document
- AddLog( OSL_LOG_PREFIX "Thumbnail creation." );
+ SAL_WARN( "sfx.doc", "[ Thumbnail creation ]" );
if ( !GenerateAndStoreThumbnail( bPasswdProvided,
pFilter->IsOwnTemplateFormat(),
xMedStorage ) )
{
// TODO: error handling
- SAL_WARN( "sfx.doc", "Couldn't store thumbnail representation!" );
+ SAL_WARN( "sfx.doc", "couldn't store thumbnail representation" );
}
}
@@ -1432,7 +1429,7 @@ bool SfxObjectShell::SaveTo_Impl
{
if ( pImp->bIsSaving || pImp->bPreserveVersions )
{
- AddLog( OSL_LOG_PREFIX "Preserve versions." );
+ SAL_WARN( "sfx.doc", "[ Preserve versions ]" );
try
{
Sequence < util::RevisionTag > aVersions = rMedium.GetVersionList();
@@ -1462,8 +1459,7 @@ bool SfxObjectShell::SaveTo_Impl
}
catch( uno::Exception& )
{
- AddLog( OSL_LOG_PREFIX "Preserve versions has failed." );
- SAL_WARN( "sfx.doc", "Couldn't copy versions!" );
+ SAL_WARN( "sfx.doc", "Preserve versions has failed, couldn't copy versions" );
bOk = false;
// TODO/LATER: a specific error could be set
}
@@ -1513,12 +1509,27 @@ bool SfxObjectShell::SaveTo_Impl
}
else
{
- AddLog( OSL_LOG_PREFIX "Storing in alien format." );
// it's a "SaveAs" in an alien format
+ SAL_WARN( "sfx.doc", "[ Storing in alien format ]" );
+
if ( rMedium.GetFilter() && ( rMedium.GetFilter()->GetFilterFlags() & SfxFilterFlags::STARONEFILTER ) )
- bOk = ExportTo( rMedium );
+ {
+ SAL_WARN( "sfx.doc", "[ Going ExportTo ]" );
+ try
+ {
+ bOk = ExportTo( rMedium );
+ } catch ( ... ) { }
+ SAL_WARN( "sfx.doc", "[ " << ( bOk ? "ExportTo okay" : "ExportTo problem" ) << " ]" );
+ }
else
- bOk = ConvertTo( rMedium );
+ {
+ SAL_WARN( "sfx.doc", "[ Going ConvertTo ]" );
+ try
+ {
+ bOk = ConvertTo( rMedium );
+ } catch ( ... ) { }
+ SAL_WARN( "sfx.doc", "[ " << ( bOk ? "ConvertTo okay" : "ConvertTo problem" ) << " ]" );
+ }
// after saving the document, the temporary object storage must be updated
// if the old object storage was not a temporary one, it will be updated also, because it will be used
@@ -1544,7 +1555,7 @@ bool SfxObjectShell::SaveTo_Impl
uno::Reference< security::XDocumentDigitalSignatures > xDDSigns;
if ( bOk && bTryToPreserveScriptSignature )
{
- AddLog( OSL_LOG_PREFIX "Copying scripting signature." );
+ SAL_WARN( "sfx.doc", "[ Copying scripting signature ]" );
// if the scripting code was not changed and it is signed the signature should be preserved
// unfortunately at this point we have only information whether the basic code has changed or not
@@ -1616,9 +1627,8 @@ bool SfxObjectShell::SaveTo_Impl
}
else
{
- // it should not happen, the copies signature is invalid!
- // throw the changes away
- SAL_WARN( "sfx.doc", "An invalid signature was copied!" );
+ // it should not happen, the signature is invalid
+ SAL_WARN( "sfx.doc", "an invalid signature was copied" );
}
}
}
@@ -1631,7 +1641,7 @@ bool SfxObjectShell::SaveTo_Impl
rMedium.CloseZipStorage_Impl();
}
- AddLog( OSL_LOG_PREFIX "Medium commit." );
+ SAL_WARN( "sfx.doc", "[ Commit medium ]" );
OUString sName( rMedium.GetName( ) );
bOk = rMedium.Commit();
@@ -1642,7 +1652,7 @@ bool SfxObjectShell::SaveTo_Impl
if ( bOk )
{
- AddLog( OSL_LOG_PREFIX "Storing is successful." );
+ SAL_WARN( "sfx.doc", "[ Storing is successful ]" );
// if the target medium is an alien format and the "old" medium was an own format and the "old" medium
// has a name, the object storage must be exchanged, because now we need a new temporary storage
@@ -1663,7 +1673,7 @@ bool SfxObjectShell::SaveTo_Impl
// copy storage of old medium to new temporary storage and take this over
if( !ConnectTmpStorage_Impl( pMedium->GetStorage(), pMedium ) )
{
- AddLog( OSL_LOG_PREFIX "Process after storing has failed." );
+ SAL_WARN( "sfx.doc", "process after storing has failed" );
bOk = false;
}
}
@@ -1671,7 +1681,7 @@ bool SfxObjectShell::SaveTo_Impl
}
else
{
- AddLog( OSL_LOG_PREFIX "Storing has failed." );
+ SAL_WARN( "sfx.doc", "[ Storing has failed ]" );
// in case the document storage was connected to backup temporarely it must be disconnected now
if ( bNeedsDisconnectionOnFail )
@@ -2298,6 +2308,8 @@ bool SfxObjectShell::ImportFrom(SfxMedium& rMedium,
bool SfxObjectShell::ExportTo( SfxMedium& rMedium )
{
OUString aFilterName( rMedium.GetFilter()->GetFilterName() );
+ SAL_WARN( "sfx.doc", "@ ExportTo: filter name is \"" << aFilterName << "\"" );
+
uno::Reference< document::XExporter > xExporter;
{
@@ -2315,9 +2327,10 @@ bool SfxObjectShell::ExportTo( SfxMedium& rMedium )
for ( sal_Int32 nFilterProp = 0; nFilterProp<nFilterProps; nFilterProp++ )
{
const beans::PropertyValue& rFilterProp = aProps[nFilterProp];
- if (rFilterProp.Name == "FilterService")
+ if ( rFilterProp.Name == "FilterService" )
{
rFilterProp.Value >>= aFilterImplName;
+ SAL_WARN( "sfx.doc", "@ ExportTo: filter implementation name is \"" << aFilterImplName << "\"" );
break;
}
}
@@ -2328,8 +2341,8 @@ bool SfxObjectShell::ExportTo( SfxMedium& rMedium )
{
xExporter.set( xFilterFact->createInstanceWithArguments( aFilterName, uno::Sequence < uno::Any >() ), uno::UNO_QUERY );
}
- catch(const uno::Exception&)
- {
+ catch( ... ) {
+ SAL_WARN( "sfx.doc", "exception in xExporter.set()" );
xExporter.clear();
}
}
@@ -2337,10 +2350,22 @@ bool SfxObjectShell::ExportTo( SfxMedium& rMedium )
if ( xExporter.is() )
{
- try{
- uno::Reference< lang::XComponent > xComp( GetModel(), uno::UNO_QUERY_THROW );
- uno::Reference< document::XFilter > xFilter( xExporter, uno::UNO_QUERY_THROW );
- xExporter->setSourceDocument( xComp );
+ try {
+ uno::Reference< lang::XComponent > xComp( GetModel(), uno::UNO_QUERY );
+ if ( xComp.is() )
+ xExporter->setSourceDocument( xComp );
+ else
+ {
+ SAL_WARN( "sfx.doc", "can't create XComponent" );
+ return false;
+ }
+
+ uno::Reference< document::XFilter > xFilter( xExporter, uno::UNO_QUERY );
+ if ( ! xFilter.is() )
+ {
+ SAL_WARN( "sfx.doc", "can't create XFilter" );
+ return false;
+ }
css::uno::Sequence < css::beans::PropertyValue > aOldArgs;
SfxItemSet* pItems = rMedium.GetItemSet();
@@ -2405,8 +2430,7 @@ bool SfxObjectShell::ExportTo( SfxMedium& rMedium )
}
return xFilter->filter( aArgs );
- }catch(const uno::Exception&)
- {}
+ } catch ( ... ) { }
}
return false;
@@ -3000,7 +3024,7 @@ void SfxObjectShell::SetSecurityOptOpenReadOnly( bool _b )
bool SfxObjectShell::LoadOwnFormat( SfxMedium& rMedium )
{
- SAL_INFO( "sfx.doc", "loading \" " << rMedium.GetName() << "\"" );
+ SAL_WARN( "sfx.doc", "loading \" " << rMedium.GetName() << "\"" );
uno::Reference< embed::XStorage > xStorage = rMedium.GetStorage();
if ( ! xStorage.is() )
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 682220f..0083329 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -3161,15 +3161,17 @@ void SfxBaseModel::postEvent_Impl( const OUString& aName, const Reference< frame
if ( impl_isDisposed() )
return;
- DBG_ASSERT( !aName.isEmpty(), "Empty event name!" );
- if (aName.isEmpty())
+ if ( aName.isEmpty() )
+ {
+ SAL_WARN( "sfx.doc", "event name is empty" );
return;
+ }
::cppu::OInterfaceContainerHelper* pIC =
m_pData->m_aInterfaceContainer.getContainer( cppu::UnoType<document::XDocumentEventListener>::get());
if ( pIC )
{
- SAL_INFO("sfx.doc", "SfxDocumentEvent: " + aName);
+ SAL_WARN( "sfx.doc", "SfxDocumentEvent: " + aName );
document::DocumentEvent aDocumentEvent( static_cast<frame::XModel*>(this), aName, xController, Any() );
@@ -3182,7 +3184,7 @@ void SfxBaseModel::postEvent_Impl( const OUString& aName, const Reference< frame
pIC = m_pData->m_aInterfaceContainer.getContainer( cppu::UnoType<document::XEventListener>::get());
if ( pIC )
{
- SAL_INFO("sfx.doc", "SfxEvent: " + aName);
+ SAL_WARN( "sfx.doc", "SfxEvent: " + aName );
document::EventObject aEvent( static_cast<frame::XModel*>(this), aName );
@@ -3747,7 +3749,7 @@ void SAL_CALL SfxBaseModel::storeToStorage( const Reference< embed::XStorage >&
Exception,
RuntimeException, std::exception )
{
- SAL_INFO( "sfx2.doc", "entering >>SfxBaseModel::storeToStorage<<" );
+ SAL_WARN( "sfx2.doc", "entering " << OSL_THIS_FUNC );
SfxModelGuard aGuard( *this );
diff --git a/sw/inc/dbgoutsw.hxx b/sw/inc/dbgoutsw.hxx
index 5fcf8af..58d7362 100644
--- a/sw/inc/dbgoutsw.hxx
+++ b/sw/inc/dbgoutsw.hxx
@@ -19,8 +19,6 @@
#ifndef INCLUDED_SW_INC_DBGOUTSW_HXX
#define INCLUDED_SW_INC_DBGOUTSW_HXX
-#ifdef DBG_UTIL
-
#include <rtl/ustring.hxx>
#include <tox.hxx>
#include <cstdio>
@@ -108,7 +106,7 @@ const char * dbg_out(const std::unordered_map<tKey, tMember, fHashFunction> & rM
}
SW_DLLPUBLIC const char * dbg_out(const SwFormToken & rToken);
SW_DLLPUBLIC const char * dbg_out(const SwFormTokens & rTokens);
-#endif // DBG_UTIL
+
#endif // INCLUDED_SW_INC_DBGOUTSW_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx
index 8c671de..bcc0cb2 100644
--- a/sw/source/core/attr/calbck.cxx
+++ b/sw/source/core/attr/calbck.cxx
@@ -168,7 +168,11 @@ void SwModify::Add( SwClient* pDepend )
{
for(auto& rIter : sw::ClientIteratorBase::our_pClientIters->GetRingContainer())
{
- SAL_WARN_IF(&rIter.m_rRoot == m_pWriterListeners, "sw.core", "a " << typeid(*pDepend).name() << " client added as listener to a " << typeid(*this).name() << " during client iteration.");
+ SAL_WARN_IF (
+ &rIter.m_rRoot == m_pWriterListeners,
+ "sw.core",
+ "a " << typeid(*pDepend).name() << " client added as listener to a " << typeid(*this).name() << " during client iteration"
+ );
}
}
#endif
diff --git a/sw/source/core/bastyp/index.cxx b/sw/source/core/bastyp/index.cxx
index 218fd6a..18dbee2 100644
--- a/sw/source/core/bastyp/index.cxx
+++ b/sw/source/core/bastyp/index.cxx
@@ -223,7 +223,8 @@ SwIndexReg::SwIndexReg()
SwIndexReg::~SwIndexReg()
{
- assert(!m_pFirst && !m_pLast && "There are still indices registered");
+ if ( ( m_pFirst != nullptr ) || ( m_pLast != nullptr ) )
+ SAL_WARN( "sw.core", "There are still indices registered" );
}
void SwIndexReg::Update(
diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx
index b07da5a..c4606fb 100644
--- a/sw/source/core/doc/dbgoutsw.cxx
+++ b/sw/source/core/doc/dbgoutsw.cxx
@@ -17,8 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifdef DBG_UTIL
-
#include <rtl/ustring.hxx>
#include <svl/poolitem.hxx>
#include <svl/itemiter.hxx>
@@ -1003,6 +1001,4 @@ const char * dbg_out(const SwNodeRange & rRange)
return dbg_out(lcl_dbg_out(rRange));
}
-#endif // DEBUG
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/rdfhelper.cxx b/sw/source/core/doc/rdfhelper.cxx
index 7f93813..968c488 100644
--- a/sw/source/core/doc/rdfhelper.cxx
+++ b/sw/source/core/doc/rdfhelper.cxx
@@ -25,30 +25,52 @@ using namespace com::sun::star;
std::map<OUString, OUString> SwRDFHelper::getTextNodeStatements(const OUString& rType, const SwTextNode& rNode)
{
+ SAL_WARN( "sw.doc", "at SwRDFHelper::getTextNodeStatements" );
+
std::map<OUString, OUString> aRet;
- // We only read the node, but CreateXParagraph() needs a non-cost one.
+ // CreateXParagraph() needs a non-cost one
SwTextNode& rTextNode = const_cast<SwTextNode&>(rNode);
+ css::uno::Reference< css::frame::XModel > xModel = rTextNode.GetDoc()->GetDocShell()->GetBaseModel();
+ if ( ! xModel.is() )
+ {
+ SAL_WARN( "sw.doc", "can't get base XModel" );
+ return aRet;
+ }
+
+ try {
+ uno::Reference<rdf::XDocumentMetadataAccess> xDocumentMetadataAccess( xModel, uno::UNO_QUERY_THROW );
+
uno::Reference<uno::XComponentContext> xComponentContext(comphelper::getProcessComponentContext());
uno::Reference<rdf::XURI> xType = rdf::URI::create(xComponentContext, rType);
- uno::Reference<rdf::XDocumentMetadataAccess> xDocumentMetadataAccess(rTextNode.GetDoc()->GetDocShell()->GetBaseModel(), uno::UNO_QUERY);
- uno::Sequence< uno::Reference<rdf::XURI> > aGraphNames = xDocumentMetadataAccess->getMetadataGraphsWithType(xType);
- if (!aGraphNames.hasElements())
- return aRet;
- uno::Reference<rdf::XResource> xTextNode(SwXParagraph::CreateXParagraph(*rTextNode.GetDoc(), &rTextNode), uno::UNO_QUERY);
- for (const uno::Reference<rdf::XURI>& xGraphName : aGraphNames)
+ if ( xDocumentMetadataAccess.is() && xType.is() )
{
- uno::Reference<rdf::XNamedGraph> xGraph = xDocumentMetadataAccess->getRDFRepository()->getGraph(xGraphName);
- uno::Reference<container::XEnumeration> xStatements = xGraph->getStatements(xTextNode, uno::Reference<rdf::XURI>(), uno::Reference<rdf::XURI>());
- while (xStatements->hasMoreElements())
+ uno::Sequence< uno::Reference< rdf::XURI >> aGraphNames = xDocumentMetadataAccess->getMetadataGraphsWithType(xType);
+ if ( !aGraphNames.hasElements() )
+ return aRet;
+
+ uno::Reference<rdf::XResource> xTextNode(SwXParagraph::CreateXParagraph(*rTextNode.GetDoc(), &rTextNode), uno::UNO_QUERY);
+ if ( xTextNode.is() )
{
- rdf::Statement aStatement = xStatements->nextElement().get<rdf::Statement>();
- aRet[aStatement.Predicate->getStringValue()] = aStatement.Object->getStringValue();
- }
+ for ( const uno::Reference<rdf::XURI>& xGraphName : aGraphNames )
+ {
+ uno::Reference<rdf::XNamedGraph> xGraph = xDocumentMetadataAccess->getRDFRepository()->getGraph(xGraphName);
+ uno::Reference<container::XEnumeration> xStatements = xGraph->getStatements(xTextNode, uno::Reference<rdf::XURI>(), uno::Reference<rdf::XURI>());
+ while ( xStatements->hasMoreElements() )
+ {
+ rdf::Statement aStatement = xStatements->nextElement().get< rdf::Statement >();
+ aRet[aStatement.Predicate->getStringValue()] = aStatement.Object->getStringValue();
+ }
+ }
+ } else
+ SAL_WARN( "sw.doc", "No xTextNode" );
}
+ }
+ catch ( ... ) { SAL_WARN( "sw.doc", "caught exception" ); }
+ SAL_WARN( "sw.doc", "leaving SwRDFHelper::getTextNodeStatements" );
return aRet;
}
diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx
index 9bd1868..e75b1f0 100644
--- a/sw/source/core/view/vnew.cxx
+++ b/sw/source/core/view/vnew.cxx
@@ -354,14 +354,14 @@ SwViewShell::~SwViewShell()
delete mpOpt;
- // resize format cache.
+ // resize format cache
if ( SwTextFrame::GetTextCache()->GetCurMax() > 250 )
SwTextFrame::GetTextCache()->DecreaseMax( 100 );
// Remove from PaintQueue if necessary
SwPaintQueue::Remove( this );
- OSL_ENSURE( !mnStartAction, "EndAction() pending." );
+ OSL_ENSURE( !mnStartAction, "EndAction() pending" );
}
if ( mpDoc )
diff --git a/sw/source/filter/ww8/WW8TableInfo.cxx b/sw/source/filter/ww8/WW8TableInfo.cxx
index cfc0fad..2ec19761 100644
--- a/sw/source/filter/ww8/WW8TableInfo.cxx
+++ b/sw/source/filter/ww8/WW8TableInfo.cxx
@@ -342,10 +342,8 @@ RowSpansPtr WW8TableNodeInfoInner::getRowSpansOfRow()
pResult = pCellGrid->getRowSpansOfRow(this);
return pResult;
- }
-
+}
-#ifdef DBG_UTIL
::std::string WW8TableNodeInfoInner::toString() const
{
static char buffer[256];
@@ -367,7 +365,6 @@ RowSpansPtr WW8TableNodeInfoInner::getRowSpansOfRow()
return ::std::string(buffer);
}
-#endif
WW8TableNodeInfo::WW8TableNodeInfo(WW8TableInfo * pParent,
const SwNode * pNode)
@@ -383,7 +380,6 @@ WW8TableNodeInfo::~WW8TableNodeInfo()
{
}
-#ifdef DBG_UTIL
::std::string WW8TableNodeInfo::toString() const
{
static char buffer[1024];
@@ -408,7 +404,6 @@ WW8TableNodeInfo::~WW8TableNodeInfo()
return sResult;
}
-#endif
void WW8TableNodeInfo::setDepth(sal_uInt32 nDepth)
{
@@ -427,9 +422,7 @@ void WW8TableNodeInfo::setEndOfLine(bool bEndOfLine)
WW8TableNodeInfoInner::Pointer_t pInner = getInnerForDepth(mnDepth);
pInner->setEndOfLine(bEndOfLine);
-#ifdef DBG_UTIL
- SAL_INFO( "sw.ww8", "<endOfLine depth=\"" << mnDepth << "\">" << toString() << "</endOfLine>" );
-#endif
+ SAL_WARN( "sw.ww8", "<endOfLine depth=\"" << mnDepth << "\">" << toString() << "</endOfLine>" );
}
void WW8TableNodeInfo::setEndOfCell(bool bEndOfCell)
@@ -437,9 +430,7 @@ void WW8TableNodeInfo::setEndOfCell(bool bEndOfCell)
WW8TableNodeInfoInner::Pointer_t pInner = getInnerForDepth(mnDepth);
pInner->setEndOfCell(bEndOfCell);
-#ifdef DBG_UTIL
- SAL_INFO( "sw.ww8", "<endOfCell depth=\"" << mnDepth << "\">" << toString() << "</endOfCell>" );
-#endif
+ SAL_WARN( "sw.ww8", "<endOfCell depth=\"" << mnDepth << "\">" << toString() << "</endOfCell>" );
}
void WW8TableNodeInfo::setFirstInTable(bool bFirstInTable)
@@ -448,9 +439,7 @@ void WW8TableNodeInfo::setFirstInTable(bool bFirstInTable)
pInner->setFirstInTable(bFirstInTable);
-#ifdef DBG_UTIL
- SAL_INFO( "sw.ww8", "<firstInTable depth=\"" << mnDepth << "\">" << toString() << "</firstInTable>" );
-#endif
+ SAL_WARN( "sw.ww8", "<firstInTable depth=\"" << mnDepth << "\">" << toString() << "</firstInTable>" );
}
void WW8TableNodeInfo::setVertMerge(bool bVertMerge)
@@ -459,9 +448,7 @@ void WW8TableNodeInfo::setVertMerge(bool bVertMerge)
pInner->setVertMerge(bVertMerge);
-#ifdef DBG_UTIL
- SAL_INFO( "sw.ww8", "<vertMerge depth=\"" << mnDepth << "\">" << toString() << "</vertMerge>" );
-#endif
+ SAL_WARN( "sw.ww8", "<vertMerge depth=\"" << mnDepth << "\">" << toString() << "</vertMerge>" );
}
void WW8TableNodeInfo::setTableBox(const SwTableBox * pTableBox)
@@ -478,9 +465,7 @@ void WW8TableNodeInfo::setNext(WW8TableNodeInfo * pNext)
{
mpNext = pNext;
-#ifdef DBG_UTIL
- SAL_INFO( "sw.ww8", "<setnext><from>" << toString() << "</from><to>" << pNext->toString() << "</to></setnext>" );
-#endif
+ SAL_WARN( "sw.ww8", "<setnext><from>" << toString() << "</from><to>" << pNext->toString() << "</to></setnext>" );
}
void WW8TableNodeInfo::setNextNode(const SwNode * pNode)
@@ -578,8 +563,8 @@ WW8TableInfo::processSwTableByLayout(const SwTable * pTable, RowEndInners_t &rLa
{
SwRect aRect = aTableCellInfo.getRect();
- SAL_INFO( "sw.ww8", "<CellFrame>" );
- SAL_INFO( "sw.ww8", "<rect top=\"" << aRect.Top() << "\" bottom=\"" << aRect.Bottom()
+ SAL_WARN( "sw.ww8", "<CellFrame>" );
+ SAL_WARN( "sw.ww8", "<rect top=\"" << aRect.Top() << "\" bottom=\"" << aRect.Bottom()
<< "\" left=\"" << aRect.Left() << "\" right=\"" << aRect.Right() << "\"/>" );
const SwTableBox * pTableBox = aTableCellInfo.getTableBox();
const SwStartNode * pSttNd = pTableBox->GetSttNd();
@@ -609,7 +594,7 @@ WW8TableInfo::processSwTableByLayout(const SwTable * pTable, RowEndInners_t &rLa
while (!bDone);
}
- SAL_INFO( "sw.ww8", "</CellFrame>" );
+ SAL_WARN( "sw.ww8", "</CellFrame>" );
}
return reorderByLayout(pTable, rLastRowEnds);
@@ -617,7 +602,7 @@ WW8TableInfo::processSwTableByLayout(const SwTable * pTable, RowEndInners_t &rLa
void WW8TableInfo::processSwTable(const SwTable * pTable)
{
- SAL_INFO( "sw.ww8", "<processSwTable>" );
+ SAL_WARN( "sw.ww8", "<processSwTable>" );
WW8TableNodeInfo * pPrev = nullptr;
RowEndInners_t aLastRowEnds;
@@ -625,9 +610,8 @@ void WW8TableInfo::processSwTable(const SwTable * pTable)
if (pTable->IsTableComplex() && pTable->HasLayout())
{
pPrev = processSwTableByLayout(pTable, aLastRowEnds);
-#ifdef DBG_UTIL
- SAL_INFO( "sw.ww8", getCellGridForTable(pTable)->toString());
-#endif
+
+ SAL_WARN( "sw.ww8", getCellGridForTable(pTable)->toString());
}
else
{
@@ -654,7 +638,7 @@ void WW8TableInfo::processSwTable(const SwTable * pTable)
a.second->setFinalEndOfLine(true);
}
}
- SAL_INFO( "sw.ww8", "</processSwTable>" );
+ SAL_WARN( "sw.ww8", "</processSwTable>" );
}
WW8TableNodeInfo *
@@ -665,7 +649,7 @@ WW8TableInfo::processTableLine(const SwTable * pTable,
WW8TableNodeInfo * pPrev,
RowEndInners_t &rLastRowEnds)
{
- SAL_INFO( "sw.ww8", "<processTableLine row=\"" << nRow << "\" depth=\"" << nDepth << "\">" );
+ SAL_WARN( "sw.ww8", "<processTableLine row=\"" << nRow << "\" depth=\"" << nDepth << "\">" );
const SwTableBoxes & rBoxes = pTableLine->GetTabBoxes();
@@ -678,7 +662,7 @@ WW8TableInfo::processTableLine(const SwTable * pTable,
pPrev = processTableBox(pTable, pBox, nRow, static_cast<sal_uInt32>(n), nDepth, n == rBoxes.size() - 1, pPrev, rLastRowEnds);
}
- SAL_INFO( "sw.ww8", "</processTableLine>" );
+ SAL_WARN( "sw.ww8", "</processTableLine>" );
return pPrev;
}
@@ -691,7 +675,7 @@ WW8TableInfo::processTableBoxLines(const SwTableBox * pBox,
sal_uInt32 nCell,
sal_uInt32 nDepth)
{
- SAL_INFO( "sw.ww8", "<processTableBoxLines depth=\"" << nDepth << "\" row=\"" << nRow
+ SAL_WARN( "sw.ww8", "<processTableBoxLines depth=\"" << nDepth << "\" row=\"" << nRow
<< "\" cell=\"" << nCell << "\">" );
const SwTableLines & rLines = pBox->GetTabLines();
@@ -729,7 +713,7 @@ WW8TableInfo::processTableBoxLines(const SwTableBox * pBox,
}
}
- SAL_INFO( "sw.ww8", "</processTableBoxLines>" );
+ SAL_WARN( "sw.ww8", "</processTableBoxLines>" );
return pNodeInfo;
}
@@ -754,7 +738,7 @@ WW8TableInfo::processTableBox(const SwTable * pTable,
WW8TableNodeInfo * pPrev,
RowEndInners_t &rLastRowEnds)
{
- SAL_INFO( "sw.ww8", "<processTableBox row=\"" << nRow << "\" cell=\"" << nCell
+ SAL_WARN( "sw.ww8", "<processTableBox row=\"" << nRow << "\" cell=\"" << nCell
<< "\" depth=\"" << nDepth << "\">" );
WW8TableNodeInfo::Pointer_t pNodeInfo;
@@ -837,7 +821,7 @@ WW8TableInfo::processTableBox(const SwTable * pTable,
}
}
- SAL_INFO( "sw.ww8", "</processTableBox>" );
+ SAL_WARN( "sw.ww8", "</processTableBox>" );
return pPrev;
}
@@ -886,9 +870,8 @@ WW8TableNodeInfo::Pointer_t WW8TableInfo::insertTableNodeInfo
pNodeInfo->setRect(*pRect);
}
-#ifdef DBG_UTIL
- SAL_INFO( "sw.ww8", pNodeInfo->toString());
-#endif
+ SAL_WARN( "sw.ww8", pNodeInfo->toString());
+
return pNodeInfo;
}
@@ -1005,7 +988,6 @@ bool CellInfo::operator < (const CellInfo & aCellInfo) const
return aRet;
}
-#ifdef DBG_UTIL
::std::string CellInfo::toString() const
{
static char sBuffer[256];
@@ -1024,15 +1006,12 @@ bool CellInfo::operator < (const CellInfo & aCellInfo) const
return sBuffer;
}
-#endif
WW8TableNodeInfo * WW8TableInfo::reorderByLayout(const SwTable * pTable, RowEndInners_t &rLastRowEnds)
{
WW8TableCellGrid::Pointer_t pCellGrid = getCellGridForTable(pTable);
-#ifdef DBG_UTIL
- SAL_INFO( "sw.ww8", pCellGrid->toString());
-#endif
+ SAL_WARN( "sw.ww8", pCellGrid->toString());
pCellGrid->addShadowCells();
return pCellGrid->connectCells(rLastRowEnds);
@@ -1102,16 +1081,15 @@ void WW8TableCellGrid::insert(const SwRect & rRect,
void WW8TableCellGrid::addShadowCells()
{
- SAL_INFO( "sw.ww8", "<addShadowCells>" );
+ SAL_WARN( "sw.ww8", "<addShadowCells>" );
RowTops_t::const_iterator aTopsIt = getRowTopsBegin();
while (aTopsIt != getRowTopsEnd())
{
-#ifdef DBG_UTIL
- long nTop = *aTopsIt;
- (void) nTop;
-#endif
+ ///long nTop = *aTopsIt;
+ ///(void) nTop;
+
CellInfoMultiSet::const_iterator aCellIt = getCellsBegin(*aTopsIt);
CellInfoMultiSet::const_iterator aCellEndIt = getCellsEnd(*aTopsIt);
@@ -1175,7 +1153,8 @@ void WW8TableCellGrid::addShadowCells()
++aTopsIt;
}
- SAL_INFO( "sw.ww8", "</addShadowCells>" );
+
+ SAL_WARN( "sw.ww8", "</addShadowCells>" );
}
WW8TableNodeInfo * WW8TableCellGrid::connectCells(RowEndInners_t &rLastRowEnds)
@@ -1288,7 +1267,6 @@ WW8TableNodeInfo * WW8TableCellGrid::connectCells(RowEndInners_t &rLastRowEnds)
return pLastNodeInfo;
}
-#ifdef DBG_UTIL
::std::string WW8TableCellGrid::toString()
{
::std::string sResult = "<WW8TableCellGrid>";
@@ -1368,7 +1346,6 @@ WW8TableNodeInfo * WW8TableCellGrid::connectCells(RowEndInners_t &rLastRowEnds)
return sResult;
}
-#endif
TableBoxVectorPtr WW8TableCellGrid::getTableBoxesOfRow
(WW8TableNodeInfoInner * pNodeInfoInner)
@@ -1430,9 +1407,7 @@ void WW8TableCellGridRow::insert(const CellInfo & rCellInfo)
{
m_pCellInfos->insert(rCellInfo);
-#ifdef DBG_UTIL
- SAL_INFO( "sw.ww8", "<gridRowInsert>" << rCellInfo.toString() << "</gridRowInsert>" );
-#endif
+ SAL_WARN( "sw.ww8", "<gridRowInsert>" << rCellInfo.toString() << "</gridRowInsert>" );
}
CellInfoMultiSet::const_iterator WW8TableCellGridRow::begin() const
diff --git a/sw/source/filter/ww8/WW8TableInfo.hxx b/sw/source/filter/ww8/WW8TableInfo.hxx
index 24f7cae..fda8bd6 100644
--- a/sw/source/filter/ww8/WW8TableInfo.hxx
+++ b/sw/source/filter/ww8/WW8TableInfo.hxx
@@ -107,9 +107,7 @@ public:
GridColsPtr getGridColsOfRow(AttributeOutputBase & rBase, bool calculateColumnsFromAllRows = false);
RowSpansPtr getRowSpansOfRow();
-#ifdef DBG_UTIL
::std::string toString() const;
-#endif
};
class CellInfo
@@ -151,9 +149,7 @@ public:
m_nFormatFrameWidth = nFormatFrameWidth;
}
-#ifdef DBG_UTIL
::std::string toString() const;
-#endif
};
typedef ::std::multiset<CellInfo, ::std::less<CellInfo> > CellInfoMultiSet;
@@ -211,9 +207,7 @@ public:
sal_uInt32 getCell() const;
sal_uInt32 getRow() const;
-#ifdef DBG_UTIL
::std::string toString() const;
-#endif
bool operator < (const WW8TableNodeInfo & rInfo) const;
};
@@ -280,9 +274,7 @@ public:
void addShadowCells();
WW8TableNodeInfo *connectCells(RowEndInners_t &rLastRowEnds);
-#ifdef DBG_UTIL
::std::string toString();
-#endif
TableBoxVectorPtr getTableBoxesOfRow(WW8TableNodeInfoInner * pNodeInfo);
WidthsPtr getWidthsOfRow(WW8TableNodeInfoInner * pNodeInfo);
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 4a4035a..ee959de 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -248,6 +248,8 @@ static bool lcl_isOnelinerSdt(const OUString& rName)
void DocxAttributeOutput::StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo )
{
+ SAL_WARN( "sw.ww8", "<StartParagraph>" );
+
if ( m_nColBreakStatus == COLBRK_POSTPONE )
m_nColBreakStatus = COLBRK_WRITE;
@@ -336,6 +338,8 @@ void DocxAttributeOutput::StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pText
m_bParagraphOpened = true;
m_bIsFirstParagraph = false;
+
+ SAL_WARN( "sw.ww8", "</StartParagraph>" );
}
static void lcl_deleteAndResetTheLists( uno::Reference<sax_fastparser::FastAttributeList>& pSdtPrTokenChildren, uno::Reference<sax_fastparser::FastAttributeList>& pSdtPrDataBindingAttrs, OUString& rSdtPrAlias)
@@ -350,6 +354,7 @@ static void lcl_deleteAndResetTheLists( uno::Reference<sax_fastparser::FastAttri
void DocxAttributeOutput::PopulateFrameProperties(const SwFrameFormat* pFrameFormat, const Size& rSize)
{
+ SAL_WARN( "sw.ww8", "<PopulateFrameProperties>" );
sax_fastparser::FastAttributeList* attrList = FastSerializerHelper::createAttrList();
@@ -416,6 +421,8 @@ void DocxAttributeOutput::PopulateFrameProperties(const SwFrameFormat* pFrameFor
sax_fastparser::XFastAttributeListRef xAttrList(attrList);
m_pSerializer->singleElementNS( XML_w, XML_framePr, xAttrList );
+
+ SAL_WARN( "sw.ww8", "</PopulateFrameProperties>" );
}
bool DocxAttributeOutput::TextBoxIsFramePr(const SwFrameFormat& rFrameFormat)
@@ -834,6 +841,8 @@ void DocxAttributeOutput::SectionBreaks(const SwNode& rNode)
void DocxAttributeOutput::StartParagraphProperties()
{
+ SAL_WARN( "sw.ww8", "<StartParagraphProperties>" );
+
m_pSerializer->mark(Tag_StartParagraphProperties);
m_pSerializer->startElementNS( XML_w, XML_pPr, FSEND );
@@ -846,6 +855,8 @@ void DocxAttributeOutput::StartParagraphProperties()
}
InitCollectedParagraphProperties();
+
+ SAL_WARN( "sw.ww8", "</StartParagraphProperties>" );
}
void DocxAttributeOutput::InitCollectedParagraphProperties()
@@ -905,6 +916,8 @@ void DocxAttributeOutput::InitCollectedParagraphProperties()
void DocxAttributeOutput::WriteCollectedParagraphProperties()
{
+ SAL_INFO( "sw.ww8", "<WriteCollectedParagraphProperties>" );
+
if ( m_rExport.SdrExporter().getFlyAttrList().is() )
{
XFastAttributeListRef xAttrList( m_rExport.SdrExporter().getFlyAttrList() );
@@ -928,6 +941,8 @@ void DocxAttributeOutput::WriteCollectedParagraphProperties()
m_pSerializer->singleElementNS( XML_w, XML_shd, xAttrList );
}
+
+ SAL_INFO( "sw.ww8", "</WriteCollectedParagraphProperties>" );
}
namespace
@@ -968,6 +983,8 @@ void lcl_writeParagraphMarkerProperties(DocxAttributeOutput& rAttributeOutput, c
void DocxAttributeOutput::EndParagraphProperties(const SfxItemSet& rParagraphMarkerProperties, const SwRedlineData* pRedlineData, const SwRedlineData* pRedlineParagraphMarkerDeleted, const SwRedlineData* pRedlineParagraphMarkerInserted)
{
+ SAL_WARN( "sw.ww8", "<EndParagraphProperties>" );
+
// Call the 'Redline' function. This will add redline (change-tracking) information that regards to paragraph properties.
// This includes changes like 'Bold', 'Underline', 'Strikethrough' etc.
@@ -1020,7 +1037,7 @@ void DocxAttributeOutput::EndParagraphProperties(const SfxItemSet& rParagraphMar
EndRedline( pRedlineParagraphMarkerInserted );
}
- // mergeTopMarks() after paragraph mark properties child elements.
+ // mergeTopMarks() after paragraph mark properties child elements
m_pSerializer->mergeTopMarks(Tag_InitCollectedRunProperties);
m_pSerializer->endElementNS( XML_w, XML_rPr );
@@ -1036,10 +1053,10 @@ void DocxAttributeOutput::EndParagraphProperties(const SfxItemSet& rParagraphMar
m_pSerializer->endElementNS( XML_w, XML_pPr );
- // RDF metadata for this text node.
+ // RDF metadata for this text node
SwTextNode* pTextNode = m_rExport.m_pCurPam->GetNode().GetTextNode();
std::map<OUString, OUString> aStatements = SwRDFHelper::getTextNodeStatements("urn:bails", *pTextNode);
- if (!aStatements.empty())
+ if ( !aStatements.empty() )
{
m_pSerializer->startElementNS(XML_w, XML_smartTag,
FSNS(XML_w, XML_uri), "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
@@ -1054,6 +1071,8 @@ void DocxAttributeOutput::EndParagraphProperties(const SfxItemSet& rParagraphMar
m_pSerializer->endElementNS(XML_w, XML_smartTagPr);
m_pSerializer->endElementNS(XML_w, XML_smartTag);
}
+ else
+ SAL_WARN( "sw.ww8", "RDF metadata is empty" );
if ( m_nColBreakStatus == COLBRK_WRITE )
{
@@ -1068,6 +1087,8 @@ void DocxAttributeOutput::EndParagraphProperties(const SfxItemSet& rParagraphMar
// merge the properties _before_ the run (strictly speaking, just
// after the start of the paragraph)
m_pSerializer->mergeTopMarks(Tag_StartParagraphProperties, sax_fastparser::MergeMarks::PREPEND);
+
+ SAL_WARN( "sw.ww8", "</EndParagraphProperties>" );
}
void DocxAttributeOutput::SetStateOfFlyFrame( FlyProcessingState nStateOfFlyFrame )
@@ -1730,6 +1751,8 @@ void DocxAttributeOutput::StartRunProperties()
void DocxAttributeOutput::InitCollectedRunProperties()
{
+ SAL_INFO( "sw.ww8", "<InitCollectedRunProperties>" );
+
m_pFontsAttrList = nullptr;
m_pEastAsianLayoutAttrList = nullptr;
m_pCharLangAttrList = nullptr;
@@ -1799,6 +1822,8 @@ void DocxAttributeOutput::InitCollectedRunProperties()
aSeqOrder[i] = aOrder[i];
m_pSerializer->mark(Tag_InitCollectedRunProperties, aSeqOrder);
+
+ SAL_INFO( "sw.ww8", "</InitCollectedRunProperties>" );
}
namespace
@@ -1966,6 +1991,8 @@ void lclProcessRecursiveGrabBag(sal_Int32 aElementId, const css::uno::Sequence<c
void DocxAttributeOutput::WriteCollectedRunProperties()
{
+ SAL_INFO( "sw.ww8", "<WriteCollectedRunProperties>" );
+
// Write all differed properties
if ( m_pFontsAttrList.is() )
{
@@ -2010,6 +2037,8 @@ void DocxAttributeOutput::WriteCollectedRunProperties()
}
m_aTextEffectsGrabBag.clear();
}
+
+ SAL_INFO( "sw.ww8", "</WriteCollectedRunProperties>" );
}
void DocxAttributeOutput::EndRunProperties( const SwRedlineData* pRedlineData )
@@ -2206,7 +2235,6 @@ void DocxAttributeOutput::RawText(const OUString& /*rText*/, rtl_TextEncoding /*
void DocxAttributeOutput::StartRuby( const SwTextNode& rNode, sal_Int32 nPos, const SwFormatRuby& rRuby )
{
- OSL_TRACE("TODO DocxAttributeOutput::StartRuby( const SwTextNode& rNode, const SwFormatRuby& rRuby )" );
EndRun(); // end run before starting ruby to avoid nested runs, and overlap
assert(!m_closeHyperlinkInThisRun); // check that no hyperlink overlaps ruby
assert(!m_closeHyperlinkInPreviousRun);
@@ -2270,7 +2298,6 @@ void DocxAttributeOutput::StartRuby( const SwTextNode& rNode, sal_Int32 nPos, co
void DocxAttributeOutput::EndRuby()
{
- OSL_TRACE( "TODO DocxAttributeOutput::EndRuby()" );
EndRun( );
m_pSerializer->endElementNS( XML_w, XML_rubyBase );
m_pSerializer->endElementNS( XML_w, XML_ruby );
@@ -2589,9 +2616,11 @@ void DocxAttributeOutput::FormatDrop( const SwTextNode& /*rNode*/, const SwForma
void DocxAttributeOutput::ParagraphStyle( sal_uInt16 nStyle )
{
+ SAL_WARN( "sw.ww8", "<ParagraphStyle>" );
OString aStyleId(m_rExport.m_pStyles->GetStyleId(nStyle));
m_pSerializer->singleElementNS( XML_w, XML_pStyle, FSNS( XML_w, XML_val ), aStyleId.getStr(), FSEND );
+ SAL_WARN( "sw.ww8", "</ParagraphStyle>" );
}
static void impl_borderLine( FSHelperPtr pSerializer, sal_Int32 elementToken, const SvxBorderLine* pBorderLine, sal_uInt16 nDist,
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index 0ccfe9c..de3400a 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -86,17 +86,29 @@ using sw::mark::IMark;
AttributeOutputBase& DocxExport::AttrOutput() const
{
- return *m_pAttrOutput;
+ if ( m_pAttrOutput )
+ return *m_pAttrOutput;
+ else
+ SAL_WARN( "sw.ww8", "m_pAttrOutput is nil" );
+ throw css::uno::RuntimeException( "m_pAttrOutput is nil" );
}
DocxAttributeOutput& DocxExport::DocxAttrOutput() const
{
- return *m_pAttrOutput;
+ if ( m_pAttrOutput )
+ return *m_pAttrOutput;
+ else
+ SAL_WARN( "sw.ww8", "m_pAttrOutput is nil" );
+ throw css::uno::RuntimeException( "m_pAttrOutput is nil" );
}
MSWordSections& DocxExport::Sections() const
{
- return *m_pSections;
+ if ( m_pSections )
+ return *m_pSections;
+ else
+ SAL_WARN( "sw.ww8", "m_pSections is nil" );
+ throw css::uno::RuntimeException( "m_pSections is nil" );
}
bool DocxExport::CollapseScriptsforWordOk( sal_uInt16 nScript, sal_uInt16 nWhich )
@@ -400,7 +412,7 @@ OString DocxExport::WriteOLEObject(SwOLEObj& rObject, OUString & io_rProgID)
}
catch (uno::Exception const& e)
{
- SAL_WARN("sw.ww8", "DocxExport::WriteOLEObject: exception: " << e.Message);
+ SAL_WARN("sw.ww8", "WriteOLEObject: exception: " << e.Message);
return OString();
}
@@ -428,6 +440,8 @@ void DocxExport::OutputDML(uno::Reference<drawing::XShape>& xShape)
void DocxExport::ExportDocument_Impl()
{
+ SAL_WARN( "sw.ww8", "ExportDocument_Impl()" );
+
// Set the 'Track Revisions' flag in the settings structure
m_aSettings.trackRevisions = 0 != ( nsRedlineMode_t::REDLINE_ON & m_nOrigRedlineMode );
@@ -562,6 +576,8 @@ void DocxExport::PrepareNewPageDesc( const SfxItemSet* pSet,
void DocxExport::InitStyles()
{
+ SAL_WARN( "sw.ww8", "InitStyles()" );
+
m_pStyles = new MSWordStyles( *this, /*bListStyles =*/ true );
// setup word/styles.xml and the relations + content type
@@ -581,10 +597,14 @@ void DocxExport::InitStyles()
// switch the serializer back
m_pAttrOutput->SetSerializer( m_pDocumentFS );
+
+ SAL_WARN( "sw.ww8", "done InitStyles()" );
}
void DocxExport::WriteFootnotesEndnotes()
{
+ SAL_WARN( "sw.ww8", "WriteFootnotesEndnotes()" );
+
if ( m_pAttrOutput->HasFootnotes() )
{
// setup word/styles.xml and the relations + content type
@@ -630,6 +650,8 @@ void DocxExport::WriteFootnotesEndnotes()
void DocxExport::WritePostitFields()
{
+ SAL_WARN( "sw.ww8", "WritePostitFields()" );
+
if ( m_pAttrOutput->HasPostitFields() )
{
m_pFilter->addRelation( m_pDocumentFS->getOutputStream(),
@@ -650,6 +672,8 @@ void DocxExport::WritePostitFields()
void DocxExport::WriteNumbering()
{
+ SAL_WARN( "sw.ww8", "WriteNumbering()" );
+
if ( !m_pUsedNumTable )
return; // no numbering is used
@@ -684,6 +708,8 @@ void DocxExport::WriteNumbering()
void DocxExport::WriteHeaderFooter( const SwFormat& rFormat, bool bHeader, const char* pType )
{
+ SAL_WARN( "sw.ww8", "WriteHeaderFooter()" );
+
// setup the xml stream
OUString aRelId;
::sax_fastparser::FSHelperPtr pFS;
@@ -762,6 +788,8 @@ void DocxExport::WriteHeaderFooter( const SwFormat& rFormat, bool bHeader, const
void DocxExport::WriteFonts()
{
+ SAL_WARN( "sw.ww8", "WriteFonts()" );
+
m_pFilter->addRelation( m_pDocumentFS->getOutputStream(),
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable",
"fontTable.xml" );
@@ -804,6 +832,8 @@ void DocxExport::WriteProperties( )
void DocxExport::WriteSettings()
{
+ SAL_WARN( "sw.ww8", "WriteSettings()" );
+
SwViewShell *pViewShell(m_pDoc->getIDocumentLayoutAccess().GetCurrentViewShell());
if( !pViewShell && !m_aSettings.hasData() && !m_pAttrOutput->HasFootnotes() && !m_pAttrOutput->HasEndnotes())
return;
@@ -958,6 +988,8 @@ void DocxExport::WriteSettings()
void DocxExport::WriteTheme()
{
+ SAL_WARN( "sw.ww8", "WriteTheme()" );
+
uno::Reference< beans::XPropertySet > xPropSet( m_pDoc->GetDocShell()->GetBaseModel(), uno::UNO_QUERY_THROW );
uno::Reference< beans::XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo();
@@ -996,6 +1028,8 @@ void DocxExport::WriteTheme()
void DocxExport::WriteGlossary()
{
+ SAL_WARN( "sw.ww8", "WriteGlossary()" );
+
uno::Reference< beans::XPropertySet > xPropSet( m_pDoc->GetDocShell()->GetBaseModel(), uno::UNO_QUERY_THROW );
uno::Reference< beans::XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo();
@@ -1067,6 +1101,8 @@ void DocxExport::WriteGlossary()
void DocxExport::WriteCustomXml()
{
+ SAL_WARN( "sw.ww8", "WriteCustomXml()" );
+
uno::Reference< beans::XPropertySet > xPropSet( m_pDoc->GetDocShell()->GetBaseModel(), uno::UNO_QUERY_THROW );
uno::Reference< beans::XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo();
@@ -1138,6 +1174,8 @@ void DocxExport::WriteCustomXml()
void DocxExport::WriteActiveX()
{
+ SAL_WARN( "sw.ww8", "WriteActiveX()" );
+
uno::Reference< beans::XPropertySet > xPropSet( m_pDoc->GetDocShell()->GetBaseModel(), uno::UNO_QUERY_THROW );
uno::Reference< beans::XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo();
@@ -1232,6 +1270,8 @@ void DocxExport::WriteActiveX()
void DocxExport::WriteEmbeddings()
{
+ SAL_WARN( "sw.ww8", "WriteEmbeddings()" );
+
uno::Reference< beans::XPropertySet > xPropSet( m_pDoc->GetDocShell()->GetBaseModel(), uno::UNO_QUERY_THROW );
uno::Reference< beans::XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo();
@@ -1310,6 +1350,8 @@ bool DocxExport::isMirroredMargin()
void DocxExport::WriteMainText()
{
+ SAL_WARN( "sw.ww8", "WriteMainText()" );
+
// setup the namespaces
m_pDocumentFS->startElementNS( XML_w, XML_document, MainXmlNamespaces());
@@ -1346,6 +1388,8 @@ void DocxExport::WriteMainText()
// finish body and document
m_pDocumentFS->endElementNS( XML_w, XML_body );
m_pDocumentFS->endElementNS( XML_w, XML_document );
+
+ SAL_WARN( "sw.ww8", "done WriteMainText()" );
}
XFastAttributeListRef DocxExport::MainXmlNamespaces()
@@ -1462,6 +1506,8 @@ DocxExport::DocxExport( DocxExportFilter *pFilter, SwDoc *pDocument, SwPaM *pCur
// the related drawing export
m_pSdrExport = new DocxSdrExport( *this, m_pDocumentFS, m_pDrawingML );
+
+ SAL_WARN( "sw.ww8", "created DocxExport" );
}
DocxExport::~DocxExport()
diff --git a/sw/source/filter/ww8/docxexportfilter.cxx b/sw/source/filter/ww8/docxexportfilter.cxx
index 64a5edd..5db20d6 100644
--- a/sw/source/filter/ww8/docxexportfilter.cxx
+++ b/sw/source/filter/ww8/docxexportfilter.cxx
@@ -39,27 +39,32 @@ DocxExportFilter::DocxExportFilter( const uno::Reference< uno::XComponentContext
bool DocxExportFilter::exportDocument()
{
- OSL_TRACE( "DocxExportFilter::exportDocument()\n" ); // DEBUG remove me
+ SAL_WARN( "sw.ww8", "DocxExportFilter::exportDocument()" );
// get SwDoc*
uno::Reference< uno::XInterface > xIfc( getModel(), uno::UNO_QUERY );
SwXTextDocument *pTextDoc = dynamic_cast< SwXTextDocument * >( xIfc.get() );
if ( !pTextDoc )
+ {
+ SAL_WARN( "sw.ww8", "can't get SwXTextDocument" );
return false;
+ }
SwDoc *pDoc = pTextDoc->GetDocShell()->GetDoc();
if ( !pDoc )
+ {
+ SAL_WARN( "sw.ww8", "can't get SwDoc" );
return false;
+ }
// update layout (if present), for SwWriteTable
SwViewShell* pViewShell = pDoc->getIDocumentLayoutAccess().GetCurrentViewShell();
- if (pViewShell != nullptr)
+ if ( pViewShell )
pViewShell->CalcLayout();
// get SwPaM*
- // FIXME so far we get SwPaM for the entire document; probably we should
- // be able to output just the selection as well - though no idea how to
- // get the correct SwPaM* then...
+ // FIXME so far we get SwPaM for the entire document; probably it's possible
+ // to output just the selection as well, though no idea how to get the correct SwPaM* then
SwPaM aPam( pDoc->GetNodes().GetEndOfContent() );
aPam.SetMark();
aPam.Move( fnMoveBackward, fnGoDoc );
@@ -68,10 +73,15 @@ bool DocxExportFilter::exportDocument()
// export the document
// (in a separate block so that it's destructed before the commit)
+ try
{
DocxExport aExport( this, pDoc, pCurPam, &aPam );
aExport.ExportDocument( true ); // FIXME support exporting selection only
}
+ catch ( ... ) {
+ SAL_WARN( "sw.ww8", "exception during export" );
+ return false;
+ }
commitStorage();
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 5717ae4..dded81f 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -655,6 +655,7 @@ FlyProcessingState SwWW8AttrIter::OutFlys(sal_Int32 nSwPos)
}
++maFlyIter;
}
+
return ( m_rExport.AttrOutput().IsFlyProcessingPostponed() ? FLY_POSTPONED : FLY_PROCESSED ) ;
}
@@ -1407,6 +1408,7 @@ const SwRedlineData* SwWW8AttrIter::GetParagraphLevelRedline( )
}
}
}
+
return nullptr;
}
@@ -2036,7 +2038,8 @@ void MSWordExportBase::GetSortedBookmarks( const SwTextNode& rNode, sal_Int32 nA
void MSWordExportBase::OutputTextNode( const SwTextNode& rNode )
{
- SAL_INFO( "sw.ww8", "<OutWW8_SwTextNode>" );
+ SAL_WARN( "sw.ww8", "<OutputTextNode>" );
+ SAL_WARN( "sw.ww8", "\"" << rNode.GetText() << "\"" );
ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo( m_pTableInfo->getTableNodeInfo( &rNode ) );
@@ -2106,6 +2109,7 @@ void MSWordExportBase::OutputTextNode( const SwTextNode& rNode )
{
OUString sBkmkName = "_toc" + OUString::number( rNode.GetIndex() );
AppendWordBookmark( sBkmkName );
+ SAL_WARN( "sw.ww8", "appended bookmark" );
}
OUString aStr( rNode.GetText() );
@@ -2118,7 +2122,7 @@ void MSWordExportBase::OutputTextNode( const SwTextNode& rNode )
OUString aStringForImage("\001");
ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner;
- if ( pTextNodeInfo.get() != nullptr )
+ if ( pTextNodeInfo.get() )
{
pTextNodeInfoInner = pTextNodeInfo->getFirstInner();
if ( pTextNodeInfoInner && pTextNodeInfoInner->isEndOfCell() ) {
@@ -2127,6 +2131,8 @@ void MSWordExportBase::OutputTextNode( const SwTextNode& rNode )
}
do {
+ SAL_WARN( "sw.ww8", OUString::number( nAktPos ) << " = nAktPos" );
+
const SwRedlineData* pRedlineData = aAttrIter.GetRunLevelRedline( nAktPos );
FlyProcessingState nStateOfFlyFrame = FLY_PROCESSED;
bool bPostponeWritingText = false ;
@@ -2442,11 +2448,9 @@ void MSWordExportBase::OutputTextNode( const SwTextNode& rNode )
if ( m_pParentFrame && IsInTable() ) // Fly-Attrs
OutputFormat( m_pParentFrame->GetFrameFormat(), false, false, true );
- if ( pTextNodeInfo.get() != nullptr )
+ if ( pTextNodeInfo.get() )
{
-#ifdef DBG_UTIL
- SAL_INFO( "sw.ww8", pTextNodeInfo->toString());
-#endif
+ SAL_WARN( "sw.ww8", "TextNodeInfo \"" << pTextNodeInfo->toString() << "\"" );
AttrOutput().TableInfoCell( pTextNodeInfoInner );
if (pTextNodeInfoInner->isFirstInTable())
@@ -2454,13 +2458,15 @@ void MSWordExportBase::OutputTextNode( const SwTextNode& rNode )
const SwTable * pTable = pTextNodeInfoInner->getTable();
const SwTableFormat* pTabFormat = pTable->GetFrameFormat();
- if (pTabFormat != nullptr)
+ if ( pTabFormat )
{
if (pTabFormat->GetBreak().GetBreak() == SVX_BREAK_PAGE_BEFORE)
AttrOutput().PageBreakBefore(true);
}
}
}
+ else
+ SAL_WARN( "sw.ww8", "no TextNodeInfo" );
if ( !bFlyInTable )
{
@@ -2775,9 +2781,9 @@ void MSWordExportBase::OutputTextNode( const SwTextNode& rNode )
// then properties on character 8 are for the paragraph marker
if( (endPos) && (startPos == *endPos ) && (*endPos == rNode.GetText().getLength()) )
{
- SAL_INFO( "sw.ww8", startPos << "startPos == endPos" << *endPos);
+ SAL_WARN( "sw.ww8", startPos << " startPos == endPos " << *endPos );
sal_uInt16 nWhich = pHt->GetAttr().Which();
- SAL_INFO( "sw.ww8", "nWhich" << nWhich);
+ SAL_WARN( "sw.ww8", "nWhich = " << nWhich );
if (nWhich == RES_TXTATR_AUTOFMT || nWhich == RES_TXTATR_CHARFMT)
aParagraphMarkerProperties.Put(pHt->GetAttr());
if (nWhich != RES_TXTATR_CHARFMT)
@@ -2796,7 +2802,7 @@ void MSWordExportBase::OutputTextNode( const SwTextNode& rNode )
AttrOutput().EndParagraph( pTextNodeInfoInner );
- SAL_INFO( "sw.ww8", "</OutWW8_SwTextNode>" );
+ SAL_INFO( "sw.ww8", "</OutputTextNode>" );
}
// Tables
@@ -3067,24 +3073,29 @@ void WW8AttributeOutput::Redline( const SwRedlineData* pRedline )
void MSWordExportBase::OutputContentNode( const SwContentNode& rNode )
{
+ SAL_WARN( "sw.ww8", "<OutputContentNode>" );
switch ( rNode.GetNodeType() )
{
case ND_TEXTNODE:
- {
- const SwTextNode& rTextNode = *rNode.GetTextNode();
- OutputTextNode( rTextNode );
- }
- break;
+ SAL_WARN( "sw.ww8", "it's TextNode" );
+ {
+ const SwTextNode* rTextNode = rNode.GetTextNode();
+ OutputTextNode( *rTextNode );
+ }
+ break;
case ND_GRFNODE:
+ SAL_WARN( "sw.ww8", "it's GrfNode" );
OutputGrfNode( *rNode.GetGrfNode() );
break;
case ND_OLENODE:
+ SAL_WARN( "sw.ww8", "it's OLENode" );
OutputOLENode( *rNode.GetOLENode() );
break;
default:
- OSL_TRACE("Unhandled node, type == %d", rNode.GetNodeType() );
+ SAL_WARN( "sw.ww8", "unhandled node of type " << OUString::number( rNode.GetNodeType() ) );
break;
}
+ SAL_WARN( "sw.ww8", "</OutputContentNode>" );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index f945e32..9945644 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -518,13 +518,18 @@ void MSWordStyles::WriteProperties( const SwFormat* pFormat, bool bParProp, sal_
{
m_rExport.AttrOutput().StartStyleProperties( bParProp, nPos );
- OSL_ENSURE( m_rExport.m_pCurrentStyle == nullptr, "Current style not NULL" ); // set current style before calling out
+ if ( m_rExport.m_pCurrentStyle )
+ {
+ // set current style before calling out
+ SAL_WARN( "sw.ww8", "current style is not nil" );
+ }
+
m_rExport.m_pCurrentStyle = pFormat;
m_rExport.OutputFormat( *pFormat, bParProp, !bParProp );
OSL_ENSURE( m_rExport.m_pCurrentStyle == pFormat, "current style was changed" );
- // reset current style...
+ // reset current style
m_rExport.m_pCurrentStyle = nullptr;
if ( bInsDefCharSiz ) // not derived from other Style
@@ -641,53 +646,70 @@ void MSWordStyles::OutputStyle( SwFormat* pFormat, sal_uInt16 nPos )
void WW8AttributeOutput::StartStyles()
{
+ SAL_WARN( "sw.ww8", "<StartStyles>" );
+
WW8Fib& rFib = *m_rWW8Export.pFib;
sal_uLong nCurPos = m_rWW8Export.pTableStrm->Tell();
if ( nCurPos & 1 ) // Start auf gerader
{
- m_rWW8Export.pTableStrm->WriteChar( (char)0 ); // Address
+ m_rWW8Export.pTableStrm->WriteChar( 0 ); // Address
++nCurPos;
}
rFib.fcStshfOrig = rFib.fcStshf = nCurPos;
m_nStyAnzPos = nCurPos + 2; // Anzahl wird nachgetragen
- static sal_uInt8 aStShi[] = {
- 0x12, 0x00,
- 0x0F, 0x00, 0x0A, 0x00, 0x01, 0x00, 0x5B, 0x00,
- 0x0F, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
+ // STSHI structure stores style sheet information
+ static sal_uInt8 aStShi_Blob[] = {
+ 0x12, 0x00, /* ushort cbStshi Size of the following STSHI structure */
+ 0x0F, 0x00, /* ushort cstd Count of styles in stylesheet */
+ 0x0A, 0x00, /* ushort cbSTDBaseInFile Length of STD Base as stored in a file */
+ 0x01, 0x00, /* ushort fStdStylenamesWritten : 1 // Are built-in stylenames stored? */
+ /* ushort spareFlags : 15 */
+ 0x5B, 0x00, /* ushort stiMaxWhenSaved Max sti known when this file was written */
+ 0x0F, 0x00, /* ushort istdMaxFixedWhenSaved How many fixed-index istds are there? */
+ 0x02, 0x00, /* ushort nVerBuiltInNamesWhenSaved Current version of built-in stylenames */
+ 0x00, 0x00,
+ 0x00, 0x00,
0x00, 0x00 };
- m_rWW8Export.pTableStrm->Write( &aStShi, sizeof( aStShi ) );
+ m_rWW8Export.pTableStrm->Write( &aStShi_Blob, sizeof( aStShi_Blob ) );
+
+ SAL_WARN( "sw.ww8", "</StartStyles>" );
}
void WW8AttributeOutput::EndStyles( sal_uInt16 nNumberOfStyles )
{
+ SAL_WARN( "sw.ww8", "<EndStyles>" );
+
WW8Fib& rFib = *m_rWW8Export.pFib;
rFib.lcbStshfOrig = rFib.lcbStshf = m_rWW8Export.pTableStrm->Tell() - rFib.fcStshf;
SwWW8Writer::WriteShort( *m_rWW8Export.pTableStrm, m_nStyAnzPos, nNumberOfStyles );
+
+ SAL_WARN( "sw.ww8", "</EndStyles>" );
}
void MSWordStyles::OutputStylesTable()
{
+ SAL_WARN( "sw.ww8", "<OutputStylesTable>" );
+
m_rExport.m_bStyDef = true;
m_rExport.AttrOutput().StartStyles();
- sal_uInt16 n;
// HACK
// Ms Office seems to have an internal limitation of 4091 styles
// and refuses to load .docx with more, even though the spec seems to allow that;
// so simply if there are more styles, don't export those
// Implementing check for all exports DOCX, DOC, RTF
sal_uInt16 nLimit = MSWORD_MAX_STYLES_LIMIT;
- m_nUsedSlots = (nLimit > m_nUsedSlots)? m_nUsedSlots : nLimit;
+ m_nUsedSlots = ( nLimit > m_nUsedSlots ) ? m_nUsedSlots : nLimit;
- for ( n = 0; n < m_nUsedSlots; n++ )
+ for ( sal_uInt16 n = 0; n < m_nUsedSlots; n++ )
{
- if (m_aNumRules.find(n) != m_aNumRules.end())
- OutputStyle(m_aNumRules[n], n);
+ if ( m_aNumRules.find(n) != m_aNumRules.end() )
+ OutputStyle( m_aNumRules[n], n );
else
OutputStyle( m_pFormatA[n], n );
}
@@ -695,6 +717,8 @@ void MSWordStyles::OutputStylesTable()
m_rExport.AttrOutput().EndStyles( m_nUsedSlots );
m_rExport.m_bStyDef = false;
+
+ SAL_WARN( "sw.ww8", "</OutputStylesTable>" );
}
const SwNumRule* MSWordStyles::GetSwNumRule(sal_uInt16 nId) const
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 3fbc18b..ba0afa0 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -119,6 +119,8 @@
#include "fmtclds.hxx"
#include "rdfhelper.hxx"
+///#include <swdebug.hxx>
+
using namespace css;
using namespace sw::util;
using namespace sw::types;
@@ -762,16 +764,15 @@ void WW8Export::ExportDopTypography(WW8DopTypography &rTypo)
rTypo.iJustification = m_pDoc->getIDocumentSettingAccess().getCharacterCompressionType();
}
-// It can only be found something with this method, if it is used within
+// It can only be found something with this method if it is used within
// WW8_SwAttrIter::OutAttr() and WW8Export::OutputItemSet()
const SfxPoolItem* MSWordExportBase::HasItem( sal_uInt16 nWhich ) const
{
- const SfxPoolItem* pItem=nullptr;
+ const SfxPoolItem* pItem = nullptr;
if (m_pISet)
{
- // if write a EditEngine text, then the WhichIds are greater as
- // ourer own Ids. So the Id have to translate from our into the
- // EditEngine Range
+ // if write a EditEngine text, then WhichIds are bigger than own Ids
+ // So translate from own into the EditEngine range
nWhich = sw::hack::GetSetWhichFromSwDocWhich(*m_pISet, *m_pDoc, nWhich);
if (nWhich && SfxItemState::SET != m_pISet->GetItemState(nWhich, true, &pItem))
pItem = nullptr;
@@ -780,16 +781,26 @@ const SfxPoolItem* MSWordExportBase::HasItem( sal_uInt16 nWhich ) const
pItem = m_pChpIter->HasTextItem( nWhich );
else
{
- OSL_ENSURE( false, "Where is my ItemSet / pChpIter ?" );
- pItem = nullptr;
+ ///print_stacktrace( );
+ /* SAL_WARN( "sw.ww8", "HasItem"
+ << "( " << OUString::number( nWhich ) << " ): "
+ << "Where is my ItemSet / AttrIter ?" ); */
}
+
return pItem;
}
const SfxPoolItem& MSWordExportBase::GetItem(sal_uInt16 nWhich) const
{
- assert((m_pISet || m_pChpIter) && "Where is my ItemSet / pChpIter ?");
- if (m_pISet)
+ ///SAL_WARN( "sw.ww8", "GetItem" << "( " << OUString::number( nWhich ) << " )" );
+ if ( !m_pISet && !m_pChpIter )
+ {
+ SAL_WARN( "sw.ww8", "GetItem"
+ << "( " << OUString::number( nWhich ) << " ): "
+ << "Where is my item set / attribute iterator ?" );
+ throw css::uno::RuntimeException( "m_pISet & m_pChpIter are both nil" );
+ }
+ if ( m_pISet )
{
// if write a EditEngine text, then the WhichIds are greater as
// ourer own Ids. So the Id have to translate from our into the
@@ -798,6 +809,8 @@ const SfxPoolItem& MSWordExportBase::GetItem(sal_uInt16 nWhich) const
OSL_ENSURE(nWhich != 0, "All broken, Impossible");
return m_pISet->Get(nWhich);
}
+
+ ///SAL_WARN( "sw.ww8", "done GetItem" << "( " << OUString::number( nWhich ) << " )" );
return m_pChpIter->GetItem( nWhich );
}
@@ -1842,7 +1855,7 @@ void WW8Export::OutSwString(const OUString& rStr, sal_Int32 nStt,
sal_Int32 const nLen)
{
- SAL_INFO( "sw.ww8.level2", "<OutSwString>" );
+ SAL_WARN( "sw.ww8", "<OutSwString>" );
if( nLen )
{
@@ -1850,25 +1863,23 @@ void WW8Export::OutSwString(const OUString& rStr, sal_Int32 nStt,
{
OUString sOut( rStr.copy( nStt, nLen ) );
- SAL_INFO( "sw.ww8.level2", sOut );
-
+ SAL_WARN( "sw.ww8", sOut );
SwWW8Writer::WriteString16(Strm(), sOut, false);
}
else
{
- SAL_INFO( "sw.ww8.level2", rStr );
-
+ SAL_WARN( "sw.ww8", rStr );
SwWW8Writer::WriteString16(Strm(), rStr, false);
}
}
- SAL_INFO( "sw.ww8.level2", "</OutSwString>" );
+ SAL_WARN( "sw.ww8", "</OutSwString>" );
}
void WW8Export::WriteCR(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner)
{
- if (pTableTextNodeInfoInner.get() != nullptr && pTableTextNodeInfoInner->getDepth() == 1 && pTableTextNodeInfoInner->isEndOfCell())
- WriteChar('\007');
+ if ( pTableTextNodeInfoInner.get() && pTableTextNodeInfoInner->getDepth() == 1 && pTableTextNodeInfoInner->isEndOfCell() )
+ WriteChar( '\007' );
else
WriteChar( '\015' );
@@ -2370,7 +2381,7 @@ void WW8AttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t
else
WW8Export::Out_SwFormatTableBox( *m_rWW8Export.pO, nullptr); // 8/16 Byte
- SAL_INFO( "sw.ww8.level2", "<tclength>" << ( m_rWW8Export.pO->size() - npOCount ) << "</tclength>" );
+ SAL_WARN( "sw.ww8", "<tclength>" << ( m_rWW8Export.pO->size() - npOCount ) << "</tclength>" );
}
}
@@ -2440,7 +2451,6 @@ void AttributeOutputBase::GetTablePageSize( ww8::WW8TableNodeInfoInner * pTableT
const SvxLRSpaceItem &rLR = pFormat->GetLRSpace();
nPageSize -= (rLR.GetLeft() + rLR.GetRight());
}
-
}
if ( nWidthPercent )
@@ -2599,11 +2609,13 @@ private:
SwPaM *m_pCurPam;
sal_uLong m_nStart, m_nEnd;
public:
- TrackContentToExport(SwPaM *pCurPam, sal_uLong nCurStart, sal_uLong nCurEnd)
+ TrackContentToExport( SwPaM *pCurPam, sal_uLong nCurStart, sal_uLong nCurEnd )
: m_pCurPam(pCurPam)
, m_nStart(nCurStart)
, m_nEnd(nCurEnd)
{
+ SAL_WARN( "sw.ww8", "created TrackContentToExport ( nCurStart = " << OUString::number( nCurStart )
+ << ", nCurEnd = " << OUString::number( nCurEnd ) << " )" );
}
bool contentRemainsToExport(ww8::WW8TableInfo *pTableInfo)
@@ -2637,17 +2649,23 @@ public:
void MSWordExportBase::WriteText()
{
- TrackContentToExport aContentTracking(m_pCurPam, m_nCurStart, m_nCurEnd);
+ SAL_WARN( "sw.ww8", "<WriteText>" );
+
+ TrackContentToExport aContentTracking( m_pCurPam, m_nCurStart, m_nCurEnd );
while (aContentTracking.contentRemainsToExport(m_pTableInfo.get()))
{
SwNode& rNd = m_pCurPam->GetNode();
if ( rNd.IsTextNode() )
+ {
+ SAL_WARN( "sw.ww8", "got text node" );
SectionBreaksAndFrames( *rNd.GetTextNode() );
+ }
// output the various types of nodes
if ( rNd.IsContentNode() )
{
+ SAL_WARN( "sw.ww8", "got content node" );
SwContentNode* pCNd = static_cast<SwContentNode*>(&rNd);
const SwPageDesc* pTemp = rNd.FindPageDesc();
@@ -2659,10 +2677,14 @@ void MSWordExportBase::WriteText()
}
else if ( rNd.IsTableNode() )
{
+ SAL_WARN( "sw.ww8", "got table node" );
m_pTableInfo->processSwTable( &rNd.GetTableNode()->GetTable() );
}
else if ( rNd.IsSectionNode() && TXT_MAINTEXT == m_nTextTyp )
+ {
+ SAL_WARN( "sw.ww8", "got section node" );
OutputSectionNode( *rNd.GetSectionNode() );
+ }
else if ( TXT_MAINTEXT == m_nTextTyp && rNd.IsEndNode() &&
rNd.StartOfSectionNode()->IsSectionNode() )
{
@@ -2673,11 +2695,15 @@ void MSWordExportBase::WriteText()
SwNodeIndex aIdx( rNd, 1 );
if ( aIdx.GetNode().IsEndNode() && aIdx.GetNode().StartOfSectionNode()->IsSectionNode() )
- ;
+ {
+ SAL_WARN( "sw.ww8", "aIdx.GetNode().IsEndNode() && aIdx.GetNode().StartOfSectionNode()->IsSectionNode()" );
+ }
else if ( aIdx.GetNode().IsSectionNode() )
- ;
+ {
+ SAL_WARN( "sw.ww8", "aIdx.GetNode().IsSectionNode()" );
+ }
else if ( !IsInTable()
- && (rSect.GetType() != TOX_CONTENT_SECTION && rSect.GetType() != TOX_HEADER_SECTION )) //No sections in table
+ && ( rSect.GetType() != TOX_CONTENT_SECTION && rSect.GetType() != TOX_HEADER_SECTION ) ) //No sections in table
{
//#120140# Do not need to insert a page/section break after a section end. Check this case first
bool bNeedExportBreakHere = true;
@@ -2730,10 +2756,12 @@ void MSWordExportBase::WriteText()
}
else if ( rNd.IsStartNode() )
{
+ SAL_WARN( "sw.ww8", "got start node" );
OutputStartNode( *rNd.GetStartNode() );
}
else if ( rNd.IsEndNode() )
{
+ SAL_WARN( "sw.ww8", "got end node" );
OutputEndNode( *rNd.GetEndNode() );
}
@@ -2743,27 +2771,28 @@ void MSWordExportBase::WriteText()
const SwNode * pCurrentNode = &m_pCurPam->GetPoint()->nNode.GetNode();
const SwNode * pNextNode = m_pTableInfo->getNextNode(pCurrentNode);
- if (pCurrentNode == pNextNode)
+ if ( pCurrentNode == pNextNode )
{
- SAL_WARN("sw.ww8", "loop in TableInfo");
+ SAL_WARN( "sw.ww8", "loop in TableInfo" );
pNextNode = nullptr;
}
- if (pNextNode != nullptr)
+ if ( pNextNode )
m_pCurPam->GetPoint()->nNode = SwNodeIndex(*pNextNode);
else
++m_pCurPam->GetPoint()->nNode;
sal_uLong nPos = m_pCurPam->GetPoint()->nNode.GetIndex();
+ SAL_WARN( "sw.ww8", OUString::number( nPos ) << " = nPos" );
::SetProgressState( nPos, m_pCurPam->GetDoc()->GetDocShell() );
}
- SAL_INFO( "sw.ww8.level2", "</WriteText>" );
+ SAL_WARN( "sw.ww8", "</WriteText>" );
}
void WW8Export::WriteMainText()
{
- SAL_INFO( "sw.ww8.level2", "<WriteMainText>" );
+ SAL_WARN( "sw.ww8", "<WriteMainText>" );
pFib->fcMin = Strm().Tell();
@@ -2786,22 +2815,22 @@ void WW8Export::WriteMainText()
if( pLastNd )
m_nLastFormatId = GetId( static_cast<SwTextFormatColl&>(pLastNd->GetAnyFormatColl()) );
- SAL_INFO( "sw.ww8.level2", "</WriteMainText>" );
+ SAL_WARN( "sw.ww8", "</WriteMainText>" );
}
bool MSWordExportBase::IsInTable() const
{
bool bResult = false;
- if (m_pCurPam != nullptr)
+ if ( m_pCurPam )
{
SwNode& rNode = m_pCurPam->GetNode();
- if (m_pTableInfo.get() != nullptr)
+ if ( m_pTableInfo.get() )
{
ww8::WW8TableNodeInfo::Pointer_t pTableNodeInfo = m_pTableInfo->getTableNodeInfo(&rNode);
- if (pTableNodeInfo.get() != nullptr && pTableNodeInfo->getDepth() > 0)
+ if ( pTableNodeInfo.get() && pTableNodeInfo->getDepth() > 0)
{
bResult = true;
}
@@ -3140,7 +3169,7 @@ bool SwWW8Writer::InitStd97CodecUpdateMedium( ::msfilter::MSCodec_Std97& rCodec
const SfxUnoAnyItem* pEncryptionDataItem = SfxItemSet::GetItem<SfxUnoAnyItem>(mpMedium->GetItemSet(), SID_ENCRYPTIONDATA, false);
if ( pEncryptionDataItem && ( pEncryptionDataItem->GetValue() >>= aEncryptionData ) && !rCodec.InitCodec( aEncryptionData ) )
{
- OSL_ENSURE( false, "Unexpected EncryptionData!" );
+ SAL_WARN( "sw.ww8", "unexpected EncryptionData" );
aEncryptionData.realloc( 0 );
}
@@ -3379,28 +3408,36 @@ void WW8Export::PrepareStorage()
const sal_uInt8* pData;
const char* pName;
+ SAL_WARN( "sw.ww8", "<PrepareStorage>" );
+
static const char aUserName[] = "Microsoft Word-Document";
- static const sal_uInt8 aCompObj[] =
+ static const sal_uInt8 aCompObj_Blob[] =
{
0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0x06, 0x09, 0x02, 0x00,
0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x46, 0x18, 0x00, 0x00, 0x00,
- 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66,
- 0x74, 0x20, 0x57, 0x6F, 0x72, 0x64, 0x2D, 0x44,
- 0x6F, 0x6B, 0x75, 0x6D, 0x65, 0x6E, 0x74, 0x00,
- 0x0A, 0x00, 0x00, 0x00, 0x4D, 0x53, 0x57, 0x6F,
- 0x72, 0x64, 0x44, 0x6F, 0x63, 0x00, 0x10, 0x00,
- 0x00, 0x00, 0x57, 0x6F, 0x72, 0x64, 0x2E, 0x44,
- 0x6F, 0x63, 0x75, 0x6D, 0x65, 0x6E, 0x74, 0x2E,
- 0x38, 0x00, 0xF4, 0x39, 0xB2, 0x71, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00
+ 0x00, 0x00, 0x00, 0x46,
+
+ 0x18, 0x00, 0x00, 0x00,
+ 'M', 'i', 'c', 'r', 'o', 's', 'o', 'f',
+ 't', ' ', 'W', 'o', 'r', 'd', '-', 'D',
+ 'o', 'k', 'u', 'm', 'e', 'n', 't', 0x00,
+
+ 0x0A, 0x00, 0x00, 0x00,
+ 'M', 'S', 'W', 'o', 'r', 'd', 'D', 'o',
+ 'c', 0x00,
+
+ 0x10, 0x00, 0x00, 0x00,
+ 'W', 'o', 'r', 'd', '.', 'D', 'o', 'c',
+ 'u', 'm', 'e', 'n', 't', '.', '8', 0x00,
+
+ 0xF4, 0x39, 0xB2, 0x71, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
pName = aUserName;
- pData = aCompObj;
- nLen = sizeof( aCompObj );
+ pData = aCompObj_Blob;
+ nLen = sizeof( aCompObj_Blob );
SvGlobalName aGName(MSO_WW8_CLASSID);
GetWriter().GetStorage().SetClass( aGName, SotClipboardFormatId::NONE, OUString::createFromAscii( pName ));
@@ -3408,16 +3445,18 @@ void WW8Export::PrepareStorage()
xStor->Write( pData, nLen );
SwDocShell* pDocShell = m_pDoc->GetDocShell ();
- OSL_ENSURE(pDocShell, "no SwDocShell");
-
- if (pDocShell) {
+ if ( pDocShell ) {
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
- pDocShell->GetModel(), uno::UNO_QUERY_THROW);
- uno::Reference<document::XDocumentProperties> xDocProps(
- xDPS->getDocumentProperties());
- OSL_ENSURE(xDocProps.is(), "DocumentProperties is null");
+ pDocShell->GetModel(), uno::UNO_QUERY );
+ if ( ! xDPS.is() )
+ {
+ SAL_WARN( "sw.ww8", "no DocumentPropertiesSupplier" );
+ return;
+ }
- if (xDocProps.is())
+ uno::Reference<document::XDocumentProperties> xDocProps(
+ xDPS->getDocumentProperties() );
+ if ( xDocProps.is() )
{
if ( SvtFilterOptions::Get().IsEnableWordPreview() )
{
@@ -3430,14 +3469,20 @@ void WW8Export::PrepareStorage()
else
sfx2::SaveOlePropertySet( xDocProps, &GetWriter().GetStorage() );
}
+ else
+ SAL_WARN( "sw.ww8", "DocumentProperties is null" );
}
+ else
+ SAL_WARN( "sw.ww8", "no SwDocShell" );
+
+ SAL_WARN( "sw.ww8", "</PrepareStorage>" );
}
sal_uLong SwWW8Writer::WriteStorage()
{
// #i34818# - update layout (if present), for SwWriteTable
SwViewShell* pViewShell = pDoc->getIDocumentLayoutAccess().GetCurrentViewShell();
- if( pViewShell != nullptr )
+ if( pViewShell )
pViewShell->CalcLayout();
long nMaxNode = pDoc->GetNodes().Count();
@@ -3739,7 +3784,7 @@ void WW8Export::WriteFormData( const ::sw::mark::IFieldmark& rFieldmark )
OSL_ENSURE(rFieldmark.GetFieldname() == ODF_FORMTEXT ||
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list