configure.ac | 1 desktop/source/app/officeipcthread.cxx | 7 + desktop/source/deployment/registry/package/dp_package.cxx | 7 + desktop/source/migration/services/basicmigration.cxx | 12 +-- desktop/source/migration/services/jvmfwk.cxx | 13 --- desktop/source/migration/services/oo3extensionmigration.cxx | 12 +-- desktop/source/migration/services/wordbookmigration.cxx | 12 +-- desktop/source/offacc/acceptor.cxx | 8 +- sal/rtl/source/strtmpl.cxx | 3 sw/inc/docary.hxx | 2 sw/source/core/docnode/nodedump.cxx | 46 ++++++++++++ 11 files changed, 77 insertions(+), 46 deletions(-)
New commits: commit 015739132e0260ccaa18ea286b2ab2ee4a7e162f Author: Miklos Vajna <[email protected]> Date: Sat Feb 16 12:20:08 2013 +0100 sw: include SwFldTypes in doc model dump Change-Id: I62a86c1615ccddb23e658e01423dce8634156ffe diff --git a/sw/inc/docary.hxx b/sw/inc/docary.hxx index 7212c06..3ce50c0 100644 --- a/sw/inc/docary.hxx +++ b/sw/inc/docary.hxx @@ -44,6 +44,7 @@ namespace com { namespace sun { namespace star { namespace i18n { }}}} #include <swtypes.hxx> +#include <ndarr.hxx> /** provides some methods for generic operations on lists that contain SwFmt* subclasses. */ @@ -114,6 +115,7 @@ public: /// the destructor will free all objects still in the vector ~SwFldTypes(); sal_uInt16 GetPos(const SwFieldType* pFieldType) const; + void dumpAsXml(xmlTextWriterPtr w); }; class SwTOXTypes : public std::vector<SwTOXType*> { diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx index e4e43a3..81b3566 100644 --- a/sw/source/core/docnode/nodedump.cxx +++ b/sw/source/core/docnode/nodedump.cxx @@ -29,6 +29,10 @@ #include "doc.hxx" #include "ndtxt.hxx" #include "MarkManager.hxx" +#include "docary.hxx" +#include "switerator.hxx" +#include "fmtfld.hxx" +#include "docufld.hxx" #include <libxml/encoding.h> #include <libxml/xmlwriter.h> @@ -117,6 +121,7 @@ void SwDoc::dumpAsXml( xmlTextWriterPtr w ) writer.writeFormatAttribute( "ptr", "%p", this ); m_pNodes->dumpAsXml( writer ); pMarkManager->dumpAsXml( writer ); + pFldTypes->dumpAsXml( writer ); writer.endElement(); } @@ -145,6 +150,45 @@ void MarkManager::dumpAsXml( xmlTextWriterPtr w ) } // namespace mark } // namespace sw +void SwFldTypes::dumpAsXml( xmlTextWriterPtr w ) +{ + WriterHelper writer(w); + writer.startElement("swfldtypes"); + sal_uInt16 nCount = size(); + for (sal_uInt16 nType = 0; nType < nCount; ++nType) + { + const SwFieldType *pCurType = (*this)[nType]; + SwIterator<SwFmtFld, SwFieldType> aIter(*pCurType); + for (const SwFmtFld* pCurFldFmt = aIter.First(); pCurFldFmt; pCurFldFmt = aIter.Next()) + { + writer.startElement("swfmtfld"); + writer.writeFormatAttribute("ptr", "%p", pCurFldFmt); + writer.writeFormatAttribute("pTxtAttr", "%p", pCurFldFmt->GetTxtFld()); + const char* name = "???"; + switch(pCurFldFmt->GetFld()->GetTyp()->Which()) + { + case RES_POSTITFLD: + name = "swpostitfield"; + break; + default: + SAL_INFO("sw.core", "unhandled field type " << pCurFldFmt->GetFld()->GetTyp()->Which()); + break; + } + writer.startElement(name); + writer.writeFormatAttribute("ptr", "%p", pCurFldFmt->GetFld()); + if (pCurFldFmt->GetFld()->GetTyp()->Which() == RES_POSTITFLD) + { + const SwPostItField* pField = dynamic_cast<const SwPostItField*>(pCurFldFmt->GetFld()); + OString txt8 = OUStringToOString(pField->GetName(), RTL_TEXTENCODING_UTF8); + writer.writeFormatAttribute("name", "%s", BAD_CAST( txt8.getStr())); + } + writer.endElement(); + writer.endElement(); + } + } + writer.endElement(); +} + void SwNodes::dumpAsXml( xmlTextWriterPtr w ) { WriterHelper writer( w ); commit 48796657514ac9c82e95def273ab4b0fa2cb248f Author: Miklos Vajna <[email protected]> Date: Fri Feb 15 22:58:15 2013 +0100 MarkManager::dumpAsXml: dump fieldmark names as well Change-Id: I28683f11380a04051926e6c048686bde6fefdc61 diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx index 4c92e6a..e4e43a3 100644 --- a/sw/source/core/docnode/nodedump.cxx +++ b/sw/source/core/docnode/nodedump.cxx @@ -135,6 +135,8 @@ void MarkManager::dumpAsXml( xmlTextWriterPtr w ) writer.writeFormatAttribute("startOffset", "%d", pMark->GetMarkStart().nContent.GetIndex()); writer.writeFormatAttribute("endNode", "%lu", pMark->GetMarkEnd().nNode.GetIndex()); writer.writeFormatAttribute("endOffset", "%d", pMark->GetMarkEnd().nContent.GetIndex()); + OString txt8 = OUStringToOString(pMark->GetName(), RTL_TEXTENCODING_UTF8); + writer.writeFormatAttribute("name", "%s", BAD_CAST( txt8.getStr())); writer.endElement(); } writer.endElement(); commit c240c73c34b50f4447107ccb0b0dbb21c1f28a74 Author: Stephan Bergmann <[email protected]> Date: Sat Feb 16 12:22:21 2013 +0100 Remove mis-optimization Assume thread t1 creates OUString s, then spawns thread t2, then t2 acquires s, then t2 signals via a channel that does not necessarily involve memory synchronization (e.g., writes a byte into a pipe which t1 reads), then t1 releases s and can still see a refCount of 1 instead of 2. Change-Id: I31047a1a6cc8fccc401a87849f5c3cee3642d803 diff --git a/sal/rtl/source/strtmpl.cxx b/sal/rtl/source/strtmpl.cxx index f5cbddd..5f59795 100644 --- a/sal/rtl/source/strtmpl.cxx +++ b/sal/rtl/source/strtmpl.cxx @@ -1103,8 +1103,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( release )( IMPL_RTL_STRINGDATA* pThis ) } #endif - if ( pThis->refCount == 1 || - !osl_atomic_decrement( &(pThis->refCount) ) ) + if ( !osl_atomic_decrement( &(pThis->refCount) ) ) { RTL_LOG_STRING_DELETE( pThis ); rtl_freeMemory( pThis ); commit 15003612ae3a7fc5ca994548d9792349787c68d1 Author: Stephan Bergmann <[email protected]> Date: Sat Feb 16 12:20:44 2013 +0100 Clean up some supportsService implementations Change-Id: Ib74400765a6e0ef203e751afa5433a01c8564fee diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx index 129e884..d26cf08 100644 --- a/desktop/source/app/officeipcthread.cxx +++ b/desktop/source/app/officeipcthread.cxx @@ -38,6 +38,7 @@ #include <rtl/bootstrap.hxx> #include <rtl/strbuf.hxx> #include <comphelper/processfactory.hxx> +#include <cppuhelper/supportsservice.hxx> #include <osl/file.hxx> #include <rtl/process.h> #include "tools/getprocessworkingdir.hxx" @@ -310,10 +311,10 @@ throw ( RuntimeException ) return OUString( "com.sun.star.comp.OfficeIPCThreadController" ); } -sal_Bool SAL_CALL OfficeIPCThreadController::supportsService( const OUString& ) -throw ( RuntimeException ) +sal_Bool OfficeIPCThreadController::supportsService( + OUString const & ServiceName) throw (css::uno::RuntimeException) { - return sal_False; + return cppu::supportsService(this, ServiceName); } Sequence< OUString > SAL_CALL OfficeIPCThreadController::getSupportedServiceNames() diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx index fde4eed..3d5c236 100644 --- a/desktop/source/deployment/registry/package/dp_package.cxx +++ b/desktop/source/deployment/registry/package/dp_package.cxx @@ -29,6 +29,7 @@ #include "rtl/uri.hxx" #include "cppuhelper/exc_hlp.hxx" #include "cppuhelper/implbase1.hxx" +#include "cppuhelper/supportsservice.hxx" #include "ucbhelper/content.hxx" #include "svl/inettype.hxx" #include "comphelper/anytostring.hxx" @@ -329,10 +330,10 @@ OUString BackendImpl::getImplementationName() throw (RuntimeException) return OUString("com.sun.star.comp.deployment.bundle.PackageRegistryBackend"); } -sal_Bool BackendImpl::supportsService( OUString const& name ) - throw (RuntimeException) +sal_Bool BackendImpl::supportsService(OUString const & ServiceName) + throw (css::uno::RuntimeException) { - return getSupportedServiceNames()[0].equals(name); + return cppu::supportsService(this, ServiceName); } Sequence<OUString> BackendImpl::getSupportedServiceNames() diff --git a/desktop/source/migration/services/basicmigration.cxx b/desktop/source/migration/services/basicmigration.cxx index f153b5f..99bbe76 100644 --- a/desktop/source/migration/services/basicmigration.cxx +++ b/desktop/source/migration/services/basicmigration.cxx @@ -18,6 +18,7 @@ */ #include "basicmigration.hxx" +#include <cppuhelper/supportsservice.hxx> #include <tools/urlobj.hxx> #include <unotools/bootstrap.hxx> @@ -168,15 +169,10 @@ namespace migration // ----------------------------------------------------------------------------- - sal_Bool BasicMigration::supportsService( const ::rtl::OUString& rServiceName ) throw (RuntimeException) + sal_Bool BasicMigration::supportsService(OUString const & ServiceName) + throw (css::uno::RuntimeException) { - Sequence< ::rtl::OUString > aNames( getSupportedServiceNames() ); - const ::rtl::OUString* pNames = aNames.getConstArray(); - const ::rtl::OUString* pEnd = pNames + aNames.getLength(); - for ( ; pNames != pEnd && !pNames->equals( rServiceName ); ++pNames ) - ; - - return pNames != pEnd; + return cppu::supportsService(this, ServiceName); } // ----------------------------------------------------------------------------- diff --git a/desktop/source/migration/services/jvmfwk.cxx b/desktop/source/migration/services/jvmfwk.cxx index db87622..9cb9460 100644 --- a/desktop/source/migration/services/jvmfwk.cxx +++ b/desktop/source/migration/services/jvmfwk.cxx @@ -20,6 +20,7 @@ #include "cppuhelper/implbase4.hxx" #include "cppuhelper/implementationentry.hxx" +#include "cppuhelper/supportsservice.hxx" #include "rtl/ustrbuf.hxx" #include "rtl/ustring.h" #include "rtl/ustring.hxx" @@ -233,18 +234,10 @@ OUString SAL_CALL JavaMigration::getImplementationName() return jvmfwk_getImplementationName(); } -sal_Bool SAL_CALL JavaMigration::supportsService( const OUString & rServiceName ) +sal_Bool JavaMigration::supportsService(OUString const & ServiceName) throw (css::uno::RuntimeException) { - css::uno::Sequence< OUString > const & rSNL = getSupportedServiceNames(); - OUString const * pArray = rSNL.getConstArray(); - for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) - { - if (rServiceName.equals( pArray[ nPos ] )) - return true; - } - return false; - + return cppu::supportsService(this, ServiceName); } css::uno::Sequence< OUString > SAL_CALL JavaMigration::getSupportedServiceNames() diff --git a/desktop/source/migration/services/oo3extensionmigration.cxx b/desktop/source/migration/services/oo3extensionmigration.cxx index a8f1f41..6ca9cc2 100644 --- a/desktop/source/migration/services/oo3extensionmigration.cxx +++ b/desktop/source/migration/services/oo3extensionmigration.cxx @@ -28,6 +28,7 @@ #include <unotools/textsearch.hxx> #include <comphelper/sequence.hxx> #include <comphelper/processfactory.hxx> +#include <cppuhelper/supportsservice.hxx> #include <ucbhelper/content.hxx> #include <com/sun/star/task/XInteractionApprove.hpp> @@ -350,15 +351,10 @@ bool OO3ExtensionMigration::migrateExtension( const ::rtl::OUString& sSourceDir // ----------------------------------------------------------------------------- -sal_Bool OO3ExtensionMigration::supportsService( const ::rtl::OUString& rServiceName ) throw (RuntimeException) +sal_Bool OO3ExtensionMigration::supportsService(OUString const & ServiceName) + throw (css::uno::RuntimeException) { - Sequence< ::rtl::OUString > aNames( getSupportedServiceNames() ); - const ::rtl::OUString* pNames = aNames.getConstArray(); - const ::rtl::OUString* pEnd = pNames + aNames.getLength(); - for ( ; pNames != pEnd && !pNames->equals( rServiceName ); ++pNames ) - ; - - return pNames != pEnd; + return cppu::supportsService(this, ServiceName); } // ----------------------------------------------------------------------------- diff --git a/desktop/source/migration/services/wordbookmigration.cxx b/desktop/source/migration/services/wordbookmigration.cxx index e34c550..717d6ac 100644 --- a/desktop/source/migration/services/wordbookmigration.cxx +++ b/desktop/source/migration/services/wordbookmigration.cxx @@ -18,6 +18,7 @@ */ #include "wordbookmigration.hxx" +#include <cppuhelper/supportsservice.hxx> #include <tools/urlobj.hxx> #include <unotools/bootstrap.hxx> #include <unotools/ucbstreamhelper.hxx> @@ -234,15 +235,10 @@ bool IsUserWordbook( const ::rtl::OUString& rFile ) // ----------------------------------------------------------------------------- - sal_Bool WordbookMigration::supportsService( const ::rtl::OUString& rServiceName ) throw (RuntimeException) + sal_Bool WordbookMigration::supportsService(OUString const & ServiceName) + throw (css::uno::RuntimeException) { - Sequence< ::rtl::OUString > aNames( getSupportedServiceNames() ); - const ::rtl::OUString* pNames = aNames.getConstArray(); - const ::rtl::OUString* pEnd = pNames + aNames.getLength(); - for ( ; pNames != pEnd && !pNames->equals( rServiceName ); ++pNames ) - ; - - return pNames != pEnd; + return cppu::supportsService(this, ServiceName); } // ----------------------------------------------------------------------------- diff --git a/desktop/source/offacc/acceptor.cxx b/desktop/source/offacc/acceptor.cxx index 7cfa234..2402a88 100644 --- a/desktop/source/offacc/acceptor.cxx +++ b/desktop/source/offacc/acceptor.cxx @@ -23,6 +23,7 @@ #include <com/sun/star/uno/XNamingService.hpp> #include <comphelper/processfactory.hxx> #include <cppuhelper/factory.hxx> +#include <cppuhelper/supportsservice.hxx> namespace desktop { @@ -205,10 +206,11 @@ Sequence<OUString> SAL_CALL Acceptor::getSupportedServiceNames() { return Acceptor::impl_getSupportedServiceNames(); } -sal_Bool SAL_CALL Acceptor::supportsService( const OUString&) - throw (RuntimeException) + +sal_Bool Acceptor::supportsService(OUString const & ServiceName) + throw (css::uno::RuntimeException) { - return sal_False; + return cppu::supportsService(this, ServiceName); } // Factory commit 5f5504a0c132fcfafe83927452d8280858eef16b Author: Stephan Bergmann <[email protected]> Date: Sat Feb 16 12:15:02 2013 +0100 Remove unnecessary line Change-Id: I4b9e11e2a790e00e9a4acc5eb81485b59ce15da2 diff --git a/configure.ac b/configure.ac index 8e7fde6..5b0853415 100644 --- a/configure.ac +++ b/configure.ac @@ -5774,7 +5774,6 @@ fi dnl =================================================================== dnl Check for C++11 perfect forwarding support dnl =================================================================== -HAVE_CXX11_PERFECT_FORWARDING= AC_MSG_CHECKING([whether $CXX supports C++11 perfect forwarding]) save_CXXFLAGS=$CXXFLAGS CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11" _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
