compilerplugins/clang/salbool.cxx | 2 sd/inc/Outliner.hxx | 2 sd/inc/drawdoc.hxx | 4 sd/inc/sdmod.hxx | 2 sd/source/core/drawdoc.cxx | 2 sd/source/filter/sdfilter.cxx | 2 sd/source/ui/accessibility/AccessibleOutlineView.cxx | 2 sd/source/ui/annotations/annotationtag.hxx | 2 sd/source/ui/dlg/dlgass.cxx | 2 sd/source/ui/framework/factories/BasicPaneFactory.cxx | 10 sd/source/ui/framework/factories/ChildWindowPane.cxx | 8 sd/source/ui/framework/factories/ChildWindowPane.hxx | 4 sd/source/ui/inc/AccessibleSlideSorterView.hxx | 2 sd/source/ui/inc/DrawController.hxx | 2 sd/source/ui/inc/DrawViewShell.hxx | 6 sd/source/ui/inc/EventMultiplexer.hxx | 2 sd/source/ui/inc/MasterPageObserver.hxx | 2 sd/source/ui/inc/OutlineView.hxx | 2 sd/source/ui/inc/PreviewRenderer.hxx | 4 sd/source/ui/inc/View.hxx | 2 sd/source/ui/inc/ViewShell.hxx | 18 sd/source/ui/inc/ViewShellImplementation.hxx | 4 sd/source/ui/inc/ViewShellManager.hxx | 2 sd/source/ui/inc/filedlg.hxx | 2 sd/source/ui/inc/taskpane/ControlContainer.hxx | 2 sd/source/ui/inc/taskpane/ScrollPanel.hxx | 4 sd/source/ui/inc/taskpane/TaskPaneControlFactory.hxx | 2 sd/source/ui/inc/taskpane/TaskPaneTreeNode.hxx | 2 sd/source/ui/inc/taskpane/TitleBar.hxx | 4 sd/source/ui/inc/taskpane/TitledControl.hxx | 4 sd/source/ui/inc/taskpane/ToolPanelViewShell.hxx | 2 sd/source/ui/inc/tools/AsynchronousCall.hxx | 2 sd/source/ui/inc/tools/IconCache.hxx | 2 sd/source/ui/inc/tools/SdGlobalResourceContainer.hxx | 8 sd/source/ui/sidebar/AllMasterPagesSelector.hxx | 2 sd/source/ui/sidebar/MasterPageContainer.cxx | 3 sd/source/ui/sidebar/MasterPageContainerFiller.hxx | 2 sd/source/ui/sidebar/MasterPageDescriptor.cxx | 6 sd/source/ui/sidebar/MasterPageDescriptor.hxx | 2 sd/source/ui/sidebar/MasterPageObserver.cxx | 2 sd/source/ui/sidebar/MasterPagesSelector.cxx | 10 sd/source/ui/sidebar/MasterPagesSelector.hxx | 2 sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx | 2 sd/source/ui/sidebar/SidebarFocusManager.hxx | 2 sd/source/ui/slideshow/slideshowimpl.hxx | 2 sd/source/ui/slideshow/slideshowviewimpl.hxx | 8 sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx | 6 sd/source/ui/slidesorter/cache/SlsBitmapCache.hxx | 4 sd/source/ui/slidesorter/cache/SlsCacheCompactor.cxx | 10 sd/source/ui/slidesorter/cache/SlsCacheCompactor.hxx | 4 sd/source/ui/slidesorter/inc/cache/SlsPageCacheManager.hxx | 4 sd/source/ui/slidesorter/inc/model/SlsEnumeration.hxx | 2 sd/source/ui/slidesorter/inc/model/SlsPageEnumeration.hxx | 12 sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx | 2 sd/source/ui/slidesorter/model/SlsPageEnumeration.cxx | 30 sd/source/ui/slidesorter/view/SlsFontProvider.cxx | 2 sd/source/ui/tools/AsynchronousCall.cxx | 6 sd/source/ui/tools/EventMultiplexer.cxx | 2 sd/source/ui/tools/IconCache.cxx | 2 sd/source/ui/tools/PreviewRenderer.cxx | 1 sd/source/ui/tools/SdGlobalResourceContainer.cxx | 8 sd/source/ui/unoidl/DrawController.cxx | 1 sd/source/ui/view/ToolBarManager.cxx | 23 sd/source/ui/view/drviews7.cxx | 16 shell/source/tools/lngconvex/defs.hxx | 4 slideshow/source/engine/shapes/viewmediashape.cxx | 1 slideshow/source/engine/shapes/viewmediashape.hxx | 2 svl/source/misc/inettype.cxx | 17 sw/inc/doc.hxx | 2 sw/inc/ndtxt.hxx | 2 sw/inc/node.hxx | 2 sw/inc/shellio.hxx | 2 sw/inc/swtable.hxx | 2 sw/inc/unoparagraph.hxx | 2 sw/source/core/crsr/swcrsr.cxx | 8 sw/source/core/doc/docbm.cxx | 18 sw/source/core/inc/UndoAttribute.hxx | 46 sw/source/core/inc/UndoBookmark.hxx | 2 sw/source/core/inc/UndoInsert.hxx | 2 sw/source/core/inc/UndoSection.hxx | 12 sw/source/core/inc/rolbck.hxx | 22 sw/source/core/inc/swthreadmanager.hxx | 2 sw/source/core/inc/unometa.hxx | 10 sw/source/core/inc/unoport.hxx | 10 sw/source/core/undo/rolbck.cxx | 2 sw/source/core/undo/unattr.cxx | 18 sw/source/core/undo/unsect.cxx | 17 sw/source/core/unocore/unoframe.cxx | 7 sw/source/core/unocore/unoftn.cxx | 8 sw/source/core/unocore/unoidx.cxx | 4 sw/source/core/unocore/unoobj.cxx | 28 sw/source/core/unocore/unoobj2.cxx | 32 sw/source/core/unocore/unoport.cxx | 8 sw/source/core/unocore/unoportenum.cxx | 24 sw/source/core/unocore/unoredline.cxx | 16 sw/source/core/unocore/unorefmk.cxx | 20 sw/source/core/unocore/unosect.cxx | 42 sw/source/core/unocore/unotbl.cxx | 5 sw/source/core/unocore/unotext.cxx | 29 sw/source/filter/html/svxcss1.cxx | 6 sw/source/filter/ww8/ww8toolbar.hxx | 2 sw/source/ui/dialog/uiregionsw.cxx | 1 sw/source/uibase/inc/regionsw.hxx | 2 ucb/source/ucp/tdoc/tdoc_stgelems.hxx | 2 ucb/source/ucp/tdoc/tdoc_storage.cxx | 2 ucb/source/ucp/webdav-neon/ContentProperties.cxx | 4 ucb/source/ucp/webdav-neon/ContentProperties.hxx | 4 ucb/source/ucp/webdav-neon/DAVSession.hxx | 7 ucb/source/ucp/webdav-neon/DAVSessionFactory.cxx | 2 ucb/source/ucp/webdav-neon/DAVSessionFactory.hxx | 2 ucb/source/ucp/webdav-neon/webdavcontent.cxx | 72 ucb/source/ucp/webdav-neon/webdavcontent.hxx | 12 ucb/source/ucp/webdav-neon/webdavcontentcaps.cxx | 10 ucb/source/ucp/webdav/DAVAuthListener.hxx | 4 ucb/source/ucp/webdav/DAVAuthListenerImpl.hxx | 4 ucb/source/ucp/webdav/DAVException.hxx | 2 ucb/source/ucp/webdav/DAVResourceAccess.cxx | 30 ucb/source/ucp/webdav/DAVResourceAccess.hxx | 8 ucb/source/ucp/webdav/DAVSession.hxx | 10 ucb/source/ucp/webdav/DAVSessionFactory.cxx | 2 ucb/source/ucp/webdav/DAVSessionFactory.hxx | 2 ucb/source/ucp/webdav/SerfSession.cxx | 26 ucb/source/ucp/webdav/SerfSession.hxx | 10 ucb/source/ucp/webdav/SerfUri.hxx | 4 ucb/source/ucp/webdav/webdavcontentcaps.cxx | 64 ucb/workben/cachemap/cachemapobject1.cxx | 79 ucb/workben/cachemap/cachemapobject1.hxx | 92 ucb/workben/cachemap/cachemapobject2.hxx | 34 ucb/workben/cachemap/cachemapobject3.cxx | 94 ucb/workben/cachemap/cachemapobject3.hxx | 91 ucb/workben/cachemap/cachemapobjectcontainer2.cxx | 60 ucb/workben/cachemap/cachemapobjectcontainer2.hxx | 64 ucb/workben/cachemap/cachemaptest.cxx | 159 ucb/workben/cachemap/makefile.mk | 43 ucb/workben/ucb/makefile.mk | 71 ucb/workben/ucb/srcharg.cxx | 478 -- ucb/workben/ucb/srcharg.hxx | 34 ucb/workben/ucb/ucbdemo.cxx | 2336 ------------- unoxml/source/dom/attr.hxx | 2 unoxml/source/dom/document.hxx | 2 writerfilter/inc/resourcemodel/WW8ResourceModel.hxx | 8 xmlscript/source/xml_helper/xml_impctx.cxx | 2 142 files changed, 424 insertions(+), 4247 deletions(-)
New commits: commit 389beae2ff13286e455488d7e77d14f7aa770818 Author: Stephan Bergmann <sberg...@redhat.com> Date: Wed Oct 1 17:21:00 2014 +0200 xmlscript: std::auto_ptr -> std::unique_ptr Change-Id: I203b84180d3614a440b37af87223bbf5a6a0f21a diff --git a/xmlscript/source/xml_helper/xml_impctx.cxx b/xmlscript/source/xml_helper/xml_impctx.cxx index f38d210..aae936a 100644 --- a/xmlscript/source/xml_helper/xml_impctx.cxx +++ b/xmlscript/source/xml_helper/xml_impctx.cxx @@ -496,7 +496,7 @@ void DocumentHandlerImpl::startElement( Reference< xml::input::XAttributes > xAttributes; sal_Int32 nUid; OUString aLocalName; - ::std::auto_ptr< ElementEntry > elementEntry( new ElementEntry ); + ::std::unique_ptr< ElementEntry > elementEntry( new ElementEntry ); { // guard start: MGuard aGuard( m_pMutex ); commit 557737b748e4d1ffc548123a58b4fbcb4879999b Author: Stephan Bergmann <sberg...@redhat.com> Date: Wed Oct 1 17:20:16 2014 +0200 writerfilter: std::auto_ptr -> std::unique_ptr Change-Id: I57f010076f73758bd5bdcf78b58553baa257df08 diff --git a/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx b/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx index 63fe0a5..b72f9f7 100644 --- a/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx +++ b/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx @@ -297,9 +297,7 @@ public: /** Pointer to a value. */ - SAL_WNODEPRECATED_DECLARATIONS_PUSH - typedef std::auto_ptr<Value> Pointer_t; - SAL_WNODEPRECATED_DECLARATIONS_POP + typedef std::unique_ptr<Value> Pointer_t; virtual ~Value() {} @@ -348,9 +346,7 @@ public: class Sprm { public: - SAL_WNODEPRECATED_DECLARATIONS_PUSH - typedef std::auto_ptr<Sprm> Pointer_t; - SAL_WNODEPRECATED_DECLARATIONS_POP + typedef std::unique_ptr<Sprm> Pointer_t; /** Returns id of the SPRM. commit 701d024e41e9f085040fd3e9c07e2737464ae4f2 Author: Stephan Bergmann <sberg...@redhat.com> Date: Wed Oct 1 17:18:17 2014 +0200 unoxml: std::auto_ptr -> std::unique_ptr Change-Id: Ib7da2401529bbff92611abdab44d26ff009e38b3 diff --git a/unoxml/source/dom/attr.hxx b/unoxml/source/dom/attr.hxx index eb85df9..5046e9d 100644 --- a/unoxml/source/dom/attr.hxx +++ b/unoxml/source/dom/attr.hxx @@ -46,7 +46,7 @@ namespace DOM private: xmlAttrPtr m_aAttrPtr; - ::std::auto_ptr< stringpair_t > m_pNamespace; + ::std::unique_ptr< stringpair_t > m_pNamespace; protected: CAttr(CDocument const& rDocument, ::osl::Mutex const& rMutex, diff --git a/unoxml/source/dom/document.hxx b/unoxml/source/dom/document.hxx index aef573f..a4ef13a 100644 --- a/unoxml/source/dom/document.hxx +++ b/unoxml/source/dom/document.hxx @@ -83,7 +83,7 @@ namespace DOM ::std::pair< css::uno::WeakReference<css::xml::dom::XNode>, CNode* > > nodemap_t; nodemap_t m_NodeMap; - ::std::auto_ptr<events::CEventDispatcher> const m_pEventDispatcher; + ::std::unique_ptr<events::CEventDispatcher> const m_pEventDispatcher; CDocument(xmlDocPtr const pDocPtr); commit ee8e81ad860f70a8c2467eaba79df93fe32e9c17 Author: Stephan Bergmann <sberg...@redhat.com> Date: Wed Oct 1 17:16:02 2014 +0200 ucb: std::auto_ptr -> std::unique_ptr Change-Id: I779b7a172cecd927f7d18fcbbc0f898f18089d0a diff --git a/ucb/source/ucp/tdoc/tdoc_stgelems.hxx b/ucb/source/ucp/tdoc/tdoc_stgelems.hxx index f44e424..8be3935 100644 --- a/ucb/source/ucp/tdoc/tdoc_stgelems.hxx +++ b/ucb/source/ucp/tdoc/tdoc_stgelems.hxx @@ -301,7 +301,7 @@ private: StorageElementFactory::StorageMap::iterator m_aContainerIt; friend class StorageElementFactory; - friend class std::auto_ptr< Storage >; + friend class std::unique_ptr< Storage >; }; diff --git a/ucb/source/ucp/tdoc/tdoc_storage.cxx b/ucb/source/ucp/tdoc/tdoc_storage.cxx index d226000..a1a2689 100644 --- a/ucb/source/ucp/tdoc/tdoc_storage.cxx +++ b/ucb/source/ucp/tdoc/tdoc_storage.cxx @@ -180,7 +180,7 @@ StorageElementFactory::createStorage( const OUString & rUri, bool bWritable = ( ( eMode == READ_WRITE_NOCREATE ) || ( eMode == READ_WRITE_CREATE ) ); - std::auto_ptr< Storage > xElement( + std::unique_ptr< Storage > xElement( new Storage( m_xContext, this, aUriKey, xParentStorage, xStorage ) ); aIt = m_aMap.insert( diff --git a/ucb/source/ucp/webdav-neon/ContentProperties.cxx b/ucb/source/ucp/webdav-neon/ContentProperties.cxx index 6e6416e..de70572 100644 --- a/ucb/source/ucp/webdav-neon/ContentProperties.cxx +++ b/ucb/source/ucp/webdav-neon/ContentProperties.cxx @@ -581,9 +581,7 @@ CachableContentProperties::CachableContentProperties( void CachableContentProperties::addProperties( const ContentProperties & rProps ) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - const std::auto_ptr< PropertyValueMap > & props = rProps.getProperties(); - SAL_WNODEPRECATED_DECLARATIONS_POP + const std::unique_ptr< PropertyValueMap > & props = rProps.getProperties(); PropertyValueMap::const_iterator it = props->begin(); const PropertyValueMap::const_iterator end = props->end(); diff --git a/ucb/source/ucp/webdav-neon/ContentProperties.hxx b/ucb/source/ucp/webdav-neon/ContentProperties.hxx index 07fecee..0a3cf70 100644 --- a/ucb/source/ucp/webdav-neon/ContentProperties.hxx +++ b/ucb/source/ucp/webdav-neon/ContentProperties.hxx @@ -158,12 +158,12 @@ public: // Not good to expose implementation details, but this is actually an // internal class. - const std::auto_ptr< PropertyValueMap > & getProperties() const + const std::unique_ptr< PropertyValueMap > & getProperties() const { return m_xProps; } private: OUString m_aEscapedTitle; - std::auto_ptr< PropertyValueMap > m_xProps; + std::unique_ptr< PropertyValueMap > m_xProps; bool m_bTrailingSlash; static com::sun::star::uno::Any m_aEmptyAny; diff --git a/ucb/source/ucp/webdav-neon/DAVSession.hxx b/ucb/source/ucp/webdav-neon/DAVSession.hxx index 033cb37..c75ce7e 100644 --- a/ucb/source/ucp/webdav-neon/DAVSession.hxx +++ b/ucb/source/ucp/webdav-neon/DAVSession.hxx @@ -210,12 +210,7 @@ private: oslInterlockedCount m_nRefCount; friend class DAVSessionFactory; -#if defined ( _MSC_VER ) && _MSC_VER < 1310 - friend struct std::auto_ptr< DAVSession >; - // work around compiler bug... -#else // WNT - friend class std::auto_ptr< DAVSession >; -#endif // WNT + friend struct std::default_delete< DAVSession >; }; } // namespace webdav_ucp diff --git a/ucb/source/ucp/webdav-neon/DAVSessionFactory.cxx b/ucb/source/ucp/webdav-neon/DAVSessionFactory.cxx index 5132a4f..0c650ab 100644 --- a/ucb/source/ucp/webdav-neon/DAVSessionFactory.cxx +++ b/ucb/source/ucp/webdav-neon/DAVSessionFactory.cxx @@ -66,7 +66,7 @@ rtl::Reference< DAVSession > DAVSessionFactory::createDAVSession( { NeonUri aURI( inUri ); - std::auto_ptr< DAVSession > xElement( + std::unique_ptr< DAVSession > xElement( new NeonSession( this, inUri, rFlags, *m_xProxyDecider.get() ) ); aIt = m_aMap.insert( Map::value_type( inUri, xElement.get() ) ).first; diff --git a/ucb/source/ucp/webdav-neon/DAVSessionFactory.hxx b/ucb/source/ucp/webdav-neon/DAVSessionFactory.hxx index 8dde567..f23bb0d 100644 --- a/ucb/source/ucp/webdav-neon/DAVSessionFactory.hxx +++ b/ucb/source/ucp/webdav-neon/DAVSessionFactory.hxx @@ -73,7 +73,7 @@ private: Map m_aMap; osl::Mutex m_aMutex; - std::auto_ptr< ucbhelper::InternetProxyDecider > m_xProxyDecider; + std::unique_ptr< ucbhelper::InternetProxyDecider > m_xProxyDecider; ::uno::Reference< ::uno::XComponentContext > m_xContext; diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx b/ucb/source/ucp/webdav-neon/webdavcontent.cxx index ea8ecb4..84a2e6c 100644 --- a/ucb/source/ucp/webdav-neon/webdavcontent.cxx +++ b/ucb/source/ucp/webdav-neon/webdavcontent.cxx @@ -545,9 +545,7 @@ uno::Any SAL_CALL Content::execute( // { try { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr< DAVResourceAccess > xResAccess; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr< DAVResourceAccess > xResAccess; { osl::Guard< osl::Mutex > aGuard( m_aMutex ); xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); @@ -736,9 +734,7 @@ void SAL_CALL Content::abort( sal_Int32 /*CommandId*/ ) { try { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr< DAVResourceAccess > xResAccess; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr< DAVResourceAccess > xResAccess; { osl::MutexGuard aGuard( m_aMutex ); xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); @@ -827,9 +823,7 @@ void Content::addProperty( const ucb::PropertyCommandArgument& aCmdArg, try { // Set property value at server. - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr< DAVResourceAccess > xResAccess; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr< DAVResourceAccess > xResAccess; { osl::Guard< osl::Mutex > aGuard( m_aMutex ); xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); @@ -919,9 +913,7 @@ void Content::removeProperty( const OUString& Name, aProppatchValues.push_back( aValue ); // Remove property value from server. - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr< DAVResourceAccess > xResAccess; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr< DAVResourceAccess > xResAccess; { osl::Guard< osl::Mutex > aGuard( m_aMutex ); xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); @@ -1203,9 +1195,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( else { // Append all standard UCB, DAV and HTTP properties. - SAL_WNODEPRECATED_DECLARATIONS_PUSH - const std::auto_ptr< PropertyValueMap > & xProps = rData.getProperties(); - SAL_WNODEPRECATED_DECLARATIONS_POP + const std::unique_ptr< PropertyValueMap > & xProps = rData.getProperties(); PropertyValueMap::const_iterator it = xProps->begin(); PropertyValueMap::const_iterator end = xProps->end(); @@ -1238,11 +1228,9 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( const uno::Reference< ucb::XCommandEnvironment >& xEnv ) throw ( uno::Exception, std::exception ) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr< ContentProperties > xProps; - std::auto_ptr< ContentProperties > xCachedProps; - std::auto_ptr< DAVResourceAccess > xResAccess; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr< ContentProperties > xProps; + std::unique_ptr< ContentProperties > xCachedProps; + std::unique_ptr< DAVResourceAccess > xResAccess; OUString aUnescapedTitle; bool bHasAll = false; uno::Reference< ucb::XContentIdentifier > xIdentifier; @@ -1551,9 +1539,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( uno::Reference< ucb::XContentIdentifier > xIdentifier; rtl::Reference< ContentProvider > xProvider; bool bTransient; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr< DAVResourceAccess > xResAccess; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr< DAVResourceAccess > xResAccess; { osl::Guard< osl::Mutex > aGuard( m_aMutex ); @@ -2013,9 +1999,7 @@ uno::Any Content::open( // PUSH: write data try { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr< DAVResourceAccess > xResAccess; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr< DAVResourceAccess > xResAccess; { osl::MutexGuard aGuard( m_aMutex ); @@ -2061,9 +2045,7 @@ uno::Any Content::open( // PULL: wait for client read try { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr< DAVResourceAccess > xResAccess; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr< DAVResourceAccess > xResAccess; { osl::MutexGuard aGuard( m_aMutex ); @@ -2135,9 +2117,7 @@ void Content::post( { try { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr< DAVResourceAccess > xResAccess; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr< DAVResourceAccess > xResAccess; { osl::MutexGuard aGuard( m_aMutex ); xResAccess.reset( @@ -2171,9 +2151,7 @@ void Content::post( { try { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr< DAVResourceAccess > xResAccess; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr< DAVResourceAccess > xResAccess; { osl::MutexGuard aGuard( m_aMutex ); xResAccess.reset( @@ -2272,9 +2250,7 @@ void Content::insert( { bool bTransient, bCollection; OUString aEscapedTitle; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr< DAVResourceAccess > xResAccess; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr< DAVResourceAccess > xResAccess; { osl::Guard< osl::Mutex > aGuard( m_aMutex ); @@ -2515,9 +2491,7 @@ void Content::transfer( { uno::Reference< ucb::XContentIdentifier > xIdentifier; uno::Reference< ucb::XContentProvider > xProvider; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr< DAVResourceAccess > xResAccess; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr< DAVResourceAccess > xResAccess; { osl::Guard< osl::Mutex > aGuard( m_aMutex ); @@ -2802,9 +2776,7 @@ void Content::lock( { try { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr< DAVResourceAccess > xResAccess; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr< DAVResourceAccess > xResAccess; { osl::Guard< osl::Mutex > aGuard( m_aMutex ); xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); @@ -2845,9 +2817,7 @@ void Content::unlock( { try { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr< DAVResourceAccess > xResAccess; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr< DAVResourceAccess > xResAccess; { osl::Guard< osl::Mutex > aGuard( m_aMutex ); xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); @@ -3153,7 +3123,7 @@ void Content::cancelCommandExecution( SAL_WNODEPRECATED_DECLARATIONS_PUSH const OUString -Content::getBaseURI( const std::auto_ptr< DAVResourceAccess > & rResAccess ) +Content::getBaseURI( const std::unique_ptr< DAVResourceAccess > & rResAccess ) { osl::Guard< osl::Mutex > aGuard( m_aMutex ); @@ -3184,7 +3154,7 @@ Content::getBaseURI( const std::auto_ptr< DAVResourceAccess > & rResAccess ) Content::ResourceType Content::getResourceType( const uno::Reference< ucb::XCommandEnvironment >& xEnv, - const std::auto_ptr< DAVResourceAccess > & rResAccess, + const std::unique_ptr< DAVResourceAccess > & rResAccess, bool * networkAccessAllowed) throw ( uno::Exception, std::exception ) { @@ -3272,9 +3242,7 @@ Content::ResourceType Content::getResourceType( const uno::Reference< ucb::XCommandEnvironment >& xEnv ) throw ( uno::Exception, std::exception ) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr< DAVResourceAccess > xResAccess; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr< DAVResourceAccess > xResAccess; { osl::MutexGuard aGuard( m_aMutex ); xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.hxx b/ucb/source/ucp/webdav-neon/webdavcontent.hxx index 7705c4e..6e95407 100644 --- a/ucb/source/ucp/webdav-neon/webdavcontent.hxx +++ b/ucb/source/ucp/webdav-neon/webdavcontent.hxx @@ -84,8 +84,8 @@ class Content : public ::ucbhelper::ContentImplHelper, DAV }; - std::auto_ptr< DAVResourceAccess > m_xResAccess; - std::auto_ptr< CachableContentProperties > + std::unique_ptr< DAVResourceAccess > m_xResAccess; + std::unique_ptr< CachableContentProperties > m_xCachedProps; // locally cached props OUString m_aEscapedTitle; ResourceType m_eResourceType; @@ -131,24 +131,20 @@ private: exchangeIdentity( const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContentIdentifier >& xNewId ); - SAL_WNODEPRECATED_DECLARATIONS_PUSH const OUString - getBaseURI( const std::auto_ptr< DAVResourceAccess > & rResAccess ); - SAL_WNODEPRECATED_DECLARATIONS_POP + getBaseURI( const std::unique_ptr< DAVResourceAccess > & rResAccess ); ResourceType getResourceType( const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >& xEnv ) throw ( ::com::sun::star::uno::Exception, std::exception ); - SAL_WNODEPRECATED_DECLARATIONS_PUSH ResourceType getResourceType( const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >& xEnv, - const std::auto_ptr< DAVResourceAccess > & rResAccess, + const std::unique_ptr< DAVResourceAccess > & rResAccess, bool * networkAccessAllowed = 0) throw ( ::com::sun::star::uno::Exception, std::exception ); - SAL_WNODEPRECATED_DECLARATIONS_POP // Command "open" com::sun::star::uno::Any open( diff --git a/ucb/source/ucp/webdav-neon/webdavcontentcaps.cxx b/ucb/source/ucp/webdav-neon/webdavcontentcaps.cxx index f052e06..98ad9fc 100644 --- a/ucb/source/ucp/webdav-neon/webdavcontentcaps.cxx +++ b/ucb/source/ucp/webdav-neon/webdavcontentcaps.cxx @@ -299,10 +299,8 @@ uno::Sequence< beans::Property > Content::getProperties( const uno::Reference< ucb::XCommandEnvironment > & xEnv ) { bool bTransient; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr< DAVResourceAccess > xResAccess; - std::auto_ptr< ContentProperties > xCachedProps; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr< DAVResourceAccess > xResAccess; + std::unique_ptr< ContentProperties > xCachedProps; rtl::Reference< ContentProvider > xProvider; { @@ -481,10 +479,8 @@ uno::Sequence< beans::Property > Content::getProperties( const std::set< OUString >::const_iterator set_end = aPropSet.end(); - SAL_WNODEPRECATED_DECLARATIONS_PUSH - const std::auto_ptr< PropertyValueMap > & xProps + const std::unique_ptr< PropertyValueMap > & xProps = xCachedProps->getProperties(); - SAL_WNODEPRECATED_DECLARATIONS_POP PropertyValueMap::const_iterator map_it = xProps->begin(); const PropertyValueMap::const_iterator map_end = xProps->end(); diff --git a/ucb/source/ucp/webdav/DAVSession.hxx b/ucb/source/ucp/webdav/DAVSession.hxx index bc8f8dd..45a1383 100644 --- a/ucb/source/ucp/webdav/DAVSession.hxx +++ b/ucb/source/ucp/webdav/DAVSession.hxx @@ -203,7 +203,7 @@ private: oslInterlockedCount m_nRefCount; friend class DAVSessionFactory; - friend class std::auto_ptr< DAVSession >; + friend struct std::default_delete< DAVSession >; }; } // namespace http_dav_ucp diff --git a/ucb/source/ucp/webdav/DAVSessionFactory.cxx b/ucb/source/ucp/webdav/DAVSessionFactory.cxx index cab6d86..abb74ee 100644 --- a/ucb/source/ucp/webdav/DAVSessionFactory.cxx +++ b/ucb/source/ucp/webdav/DAVSessionFactory.cxx @@ -54,7 +54,7 @@ rtl::Reference< DAVSession > DAVSessionFactory::createDAVSession( { SerfUri aURI( inUri ); - std::auto_ptr< DAVSession > xElement( + std::unique_ptr< DAVSession > xElement( new SerfSession( this, inUri, *m_xProxyDecider.get() ) ); aIt = m_aMap.insert( Map::value_type( inUri, xElement.get() ) ).first; diff --git a/ucb/source/ucp/webdav/DAVSessionFactory.hxx b/ucb/source/ucp/webdav/DAVSessionFactory.hxx index 18d2119..55e01f2 100644 --- a/ucb/source/ucp/webdav/DAVSessionFactory.hxx +++ b/ucb/source/ucp/webdav/DAVSessionFactory.hxx @@ -61,7 +61,7 @@ private: Map m_aMap; osl::Mutex m_aMutex; - std::auto_ptr< ucbhelper::InternetProxyDecider > m_xProxyDecider; + std::unique_ptr< ucbhelper::InternetProxyDecider > m_xProxyDecider; void releaseElement( DAVSession * pElement ); commit b0f43c629b23432008eccb78e6b2d6ef50d03103 Author: Stephan Bergmann <sberg...@redhat.com> Date: Wed Oct 1 17:10:42 2014 +0200 Fix warnings in ucb/source/ucp/webdav/ (--with-webdav=serf) Change-Id: I6e45a8b00952dc3ef54f29536cf333bfdcee787d diff --git a/ucb/source/ucp/webdav/DAVAuthListener.hxx b/ucb/source/ucp/webdav/DAVAuthListener.hxx index 0510d50d..b57ed1a 100644 --- a/ucb/source/ucp/webdav/DAVAuthListener.hxx +++ b/ucb/source/ucp/webdav/DAVAuthListener.hxx @@ -38,8 +38,8 @@ class DAVAuthListener : public salhelper::SimpleReferenceObject const OUString & inHostName, OUString & inoutUserName, OUString & outPassWord, - sal_Bool bCanUseSystemCredentials, - sal_Bool bUsePreviousCredentials = sal_True ) = 0; + bool bCanUseSystemCredentials, + bool bUsePreviousCredentials = true ) = 0; }; } // namespace http_dav_ucp diff --git a/ucb/source/ucp/webdav/DAVAuthListenerImpl.hxx b/ucb/source/ucp/webdav/DAVAuthListenerImpl.hxx index 2975be6..4256952 100644 --- a/ucb/source/ucp/webdav/DAVAuthListenerImpl.hxx +++ b/ucb/source/ucp/webdav/DAVAuthListenerImpl.hxx @@ -55,8 +55,8 @@ namespace http_dav_ucp const OUString & inHostName, OUString & inoutUserName, OUString & outPassWord, - sal_Bool bCanUseSystemCredentials, - sal_Bool bUsePreviousCredentials = sal_True ) SAL_OVERRIDE; + bool bCanUseSystemCredentials, + bool bUsePreviousCredentials = true ) SAL_OVERRIDE; private: const com::sun::star::uno::Reference< diff --git a/ucb/source/ucp/webdav/DAVException.hxx b/ucb/source/ucp/webdav/DAVException.hxx index 0d9e561..c4f241e 100644 --- a/ucb/source/ucp/webdav/DAVException.hxx +++ b/ucb/source/ucp/webdav/DAVException.hxx @@ -157,7 +157,7 @@ class DAVException : public std::exception , mData( rData ) , mStatusCode( nStatusCode ) {}; - ~DAVException( ) {}; + virtual ~DAVException( ) {}; const ExceptionCode & getError() const { return mExceptionCode; } const OUString & getData() const { return mData; } diff --git a/ucb/source/ucp/webdav/DAVResourceAccess.cxx b/ucb/source/ucp/webdav/DAVResourceAccess.cxx index 1135605..021d80b 100644 --- a/ucb/source/ucp/webdav/DAVResourceAccess.cxx +++ b/ucb/source/ucp/webdav/DAVResourceAccess.cxx @@ -46,8 +46,8 @@ int DAVAuthListener_Impl::authenticate( const OUString & inHostName, OUString & inoutUserName, OUString & outPassWord, - sal_Bool bCanUseSystemCredentials, - sal_Bool bUsePreviousCredentials ) + bool bCanUseSystemCredentials, + bool bUsePreviousCredentials ) { if ( m_xEnv.is() ) { @@ -88,7 +88,7 @@ int DAVAuthListener_Impl::authenticate( ucbhelper::InteractionSupplyAuthentication > & xSupp = xRequest->getAuthenticationSupplier(); - sal_Bool bUseSystemCredentials = sal_False; + bool bUseSystemCredentials = false; if ( bCanUseSystemCredentials ) bUseSystemCredentials @@ -794,7 +794,7 @@ void DAVResourceAccess::MKCOL( void DAVResourceAccess::COPY( const OUString & rSourcePath, const OUString & rDestinationURI, - sal_Bool bOverwrite, + bool bOverwrite, const uno::Reference< ucb::XCommandEnvironment > & xEnv ) throw( DAVException ) { @@ -836,7 +836,7 @@ void DAVResourceAccess::COPY( void DAVResourceAccess::MOVE( const OUString & rSourcePath, const OUString & rDestinationURI, - sal_Bool bOverwrite, + bool bOverwrite, const uno::Reference< ucb::XCommandEnvironment > & xEnv ) throw( DAVException ) { @@ -1127,7 +1127,7 @@ void DAVResourceAccess::getUserRequestHeaders( } -sal_Bool DAVResourceAccess::detectRedirectCycle( +bool DAVResourceAccess::detectRedirectCycle( const OUString& rRedirectURL ) throw ( DAVException ) { @@ -1141,12 +1141,12 @@ sal_Bool DAVResourceAccess::detectRedirectCycle( while ( it != end ) { if ( aUri == (*it) ) - return sal_True; + return true; ++it; } - return sal_False; + return false; } @@ -1165,7 +1165,7 @@ void DAVResourceAccess::resetUri() } -sal_Bool DAVResourceAccess::handleException( DAVException & e, int errorCount ) +bool DAVResourceAccess::handleException( DAVException & e, int errorCount ) throw ( DAVException ) { switch ( e.getError() ) @@ -1176,9 +1176,9 @@ sal_Bool DAVResourceAccess::handleException( DAVException & e, int errorCount ) // set new URL and path. setURL( e.getData() ); initialize(); - return sal_True; + return true; } - return sal_False; + return false; // --> tkr #67048# copy & paste images doesn't display. // if we have a bad connection try again. Up to three times. case DAVException::DAV_HTTP_ERROR: @@ -1187,16 +1187,16 @@ sal_Bool DAVResourceAccess::handleException( DAVException & e, int errorCount ) e.getStatus() == 413 ) && errorCount < 3 ) { - return sal_True; + return true; } - return sal_False; + return false; // <-- // --> tkr: if connection has said retry then retry! case DAVException::DAV_HTTP_RETRY: - return sal_True; + return true; // <-- default: - return sal_False; // Abort + return false; // Abort } } diff --git a/ucb/source/ucp/webdav/DAVResourceAccess.hxx b/ucb/source/ucp/webdav/DAVResourceAccess.hxx index 53c2466..52a337b 100644 --- a/ucb/source/ucp/webdav/DAVResourceAccess.hxx +++ b/ucb/source/ucp/webdav/DAVResourceAccess.hxx @@ -179,7 +179,7 @@ public: void COPY( const OUString & rSourcePath, const OUString & rDestinationURI, - sal_Bool bOverwrite, + bool bOverwrite, const com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment > & xEnv ) throw ( DAVException ); @@ -187,7 +187,7 @@ public: void MOVE( const OUString & rSourcePath, const OUString & rDestinationURI, - sal_Bool bOverwrite, + bool bOverwrite, const com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment > & xEnv ) throw ( DAVException ); @@ -233,9 +233,9 @@ public: private: const OUString & getRequestURI() const; - sal_Bool detectRedirectCycle( const OUString& rRedirectURL ) + bool detectRedirectCycle( const OUString& rRedirectURL ) throw ( DAVException ); - sal_Bool handleException( DAVException & e, int errorCount ) + bool handleException( DAVException & e, int errorCount ) throw ( DAVException ); void initialize() throw ( DAVException ); diff --git a/ucb/source/ucp/webdav/DAVSession.hxx b/ucb/source/ucp/webdav/DAVSession.hxx index 47df3a9..bc8f8dd 100644 --- a/ucb/source/ucp/webdav/DAVSession.hxx +++ b/ucb/source/ucp/webdav/DAVSession.hxx @@ -59,9 +59,9 @@ public: } } - virtual sal_Bool CanUse( const OUString & inPath ) = 0; + virtual bool CanUse( const OUString & inPath ) = 0; - virtual sal_Bool UsesProxy() = 0; + virtual bool UsesProxy() = 0; // DAV methods @@ -158,13 +158,13 @@ public: virtual void COPY( const OUString & inSource, const OUString & inDestination, const DAVRequestEnvironment & rEnv, - sal_Bool inOverwrite = false ) + bool inOverwrite = false ) throw( DAVException ) = 0; virtual void MOVE( const OUString & inSource, const OUString & inDestination, const DAVRequestEnvironment & rEnv, - sal_Bool inOverwrite = false ) + bool inOverwrite = false ) throw( DAVException ) = 0; virtual void DESTROY( const OUString & inPath, diff --git a/ucb/source/ucp/webdav/SerfSession.cxx b/ucb/source/ucp/webdav/SerfSession.cxx index a33b0a9..a4d3ed3 100644 --- a/ucb/source/ucp/webdav/SerfSession.cxx +++ b/ucb/source/ucp/webdav/SerfSession.cxx @@ -138,7 +138,7 @@ void SerfSession::Init() // TODO - close_connection callback apr_status_t status = serf_connection_create2( &m_pSerfConnection, m_pSerfContext, - *(m_aUri.getAprUri()), + m_aUri.getAprUri(), Serf_ConnectSetup, this, 0 /* close connection callback */, 0 /* close connection baton */, getAprPool() ); @@ -209,13 +209,13 @@ bool SerfSession::isSSLNeeded() char* SerfSession::getHostinfo() { - return m_aUri.getAprUri()->hostinfo; + return m_aUri.getAprUri().hostinfo; } // virtual -sal_Bool SerfSession::CanUse( const OUString & inUri ) +bool SerfSession::CanUse( const OUString & inUri ) { try { @@ -224,19 +224,19 @@ sal_Bool SerfSession::CanUse( const OUString & inUri ) ( theUri.GetHost() == m_aUri.GetHost() ) && ( theUri.GetScheme() == m_aUri.GetScheme() ) ) { - return sal_True; + return true; } } catch ( DAVException const & ) { - return sal_False; + return false; } - return sal_False; + return false; } // virtual -sal_Bool SerfSession::UsesProxy() +bool SerfSession::UsesProxy() { Init(); return ( m_aProxyName.getLength() > 0 ); @@ -913,7 +913,7 @@ void SerfSession::MKCOL( const OUString & inPath, void SerfSession::COPY( const OUString & inSourceURL, const OUString & inDestinationURL, const DAVRequestEnvironment & rEnv, - sal_Bool inOverWrite ) + bool inOverWrite ) throw ( DAVException ) { osl::Guard< osl::Mutex > theGuard( m_aMutex ); @@ -936,7 +936,7 @@ void SerfSession::COPY( const OUString & inSourceURL, void SerfSession::MOVE( const OUString & inSourceURL, const OUString & inDestinationURL, const DAVRequestEnvironment & rEnv, - sal_Bool inOverWrite ) + bool inOverWrite ) throw ( DAVException ) { osl::Guard< osl::Mutex > theGuard( m_aMutex ); @@ -1461,13 +1461,13 @@ SerfSession::getDataFromInputStream( } -sal_Bool +bool SerfSession::isDomainMatch( const OUString & certHostName ) { OUString hostName = getHostName(); if (hostName.equalsIgnoreAsciiCase( certHostName ) ) - return sal_True; + return true; if ( certHostName.startsWith( "*" ) && hostName.getLength() >= certHostName.getLength() ) @@ -1476,9 +1476,9 @@ SerfSession::isDomainMatch( const OUString & certHostName ) if ( hostName.matchIgnoreAsciiCase( cmpStr, hostName.getLength() - cmpStr.getLength() ) ) - return sal_True; + return true; } - return sal_False; + return false; } /* diff --git a/ucb/source/ucp/webdav/SerfSession.hxx b/ucb/source/ucp/webdav/SerfSession.hxx index 2878fc8..897613c 100644 --- a/ucb/source/ucp/webdav/SerfSession.hxx +++ b/ucb/source/ucp/webdav/SerfSession.hxx @@ -108,9 +108,9 @@ public: serf_connection_t* getSerfConnection(); // DAVSession methods - virtual sal_Bool CanUse( const OUString & inUri ) SAL_OVERRIDE; + virtual bool CanUse( const OUString & inUri ) SAL_OVERRIDE; - virtual sal_Bool UsesProxy() SAL_OVERRIDE; + virtual bool UsesProxy() SAL_OVERRIDE; const DAVRequestEnvironment & getRequestEnvironment() const { return m_aEnv; } @@ -211,14 +211,14 @@ public: COPY( const OUString & inSourceURL, const OUString & inDestinationURL, const DAVRequestEnvironment & rEnv, - sal_Bool inOverWrite ) + bool inOverWrite ) throw ( DAVException ) SAL_OVERRIDE; virtual void MOVE( const OUString & inSourceURL, const OUString & inDestinationURL, const DAVRequestEnvironment & rEnv, - sal_Bool inOverWrite ) + bool inOverWrite ) throw ( DAVException ) SAL_OVERRIDE; virtual void DESTROY( const OUString & inPath, @@ -248,7 +248,7 @@ public: const OUString & getHostName() const { return m_aUri.GetHost(); } int getPort() const { return m_aUri.GetPort(); } - sal_Bool isDomainMatch( const OUString & certHostName ); + bool isDomainMatch( const OUString & certHostName ); private: friend class SerfLockStore; diff --git a/ucb/source/ucp/webdav/SerfUri.hxx b/ucb/source/ucp/webdav/SerfUri.hxx index d867c5a..0236234 100644 --- a/ucb/source/ucp/webdav/SerfUri.hxx +++ b/ucb/source/ucp/webdav/SerfUri.hxx @@ -58,9 +58,9 @@ class SerfUri bool operator!= ( const SerfUri & rOther ) const { return !operator==( rOther ); } - apr_uri_t* getAprUri() + apr_uri_t& getAprUri() { - return &mAprUri; + return mAprUri; } const OUString & GetURI( void ) const { return mURI; }; diff --git a/ucb/source/ucp/webdav/webdavcontentcaps.cxx b/ucb/source/ucp/webdav/webdavcontentcaps.cxx index f5feb22..a8691d0 100644 --- a/ucb/source/ucp/webdav/webdavcontentcaps.cxx +++ b/ucb/source/ucp/webdav/webdavcontentcaps.cxx @@ -274,7 +274,7 @@ bool ContentProvider::getProperty( uno::Sequence< beans::Property > Content::getProperties( const uno::Reference< ucb::XCommandEnvironment > & xEnv ) { - sal_Bool bTransient; + bool bTransient; boost::scoped_ptr< DAVResourceAccess > xResAccess; boost::scoped_ptr< ContentProperties > xCachedProps; rtl::Reference< ContentProvider > xProvider; @@ -314,21 +314,21 @@ uno::Sequence< beans::Property > Content::getProperties( } // Add DAV properties, map DAV properties to UCB properties. - sal_Bool bHasCreationDate = sal_False; // creationdate <-> DateCreated - sal_Bool bHasGetLastModified = sal_False; // getlastmodified <-> DateModified - sal_Bool bHasGetContentType = sal_False; // getcontenttype <-> MediaType - sal_Bool bHasGetContentLength = sal_False; // getcontentlength <-> Size - - sal_Bool bHasContentType = sal_False; - sal_Bool bHasIsDocument = sal_False; - sal_Bool bHasIsFolder = sal_False; - sal_Bool bHasTitle = sal_False; - sal_Bool bHasBaseURI = sal_False; - sal_Bool bHasDateCreated = sal_False; - sal_Bool bHasDateModified = sal_False; - sal_Bool bHasMediaType = sal_False; - sal_Bool bHasSize = sal_False; - sal_Bool bHasCreatableInfos = sal_False; + bool bHasCreationDate = false; // creationdate <-> DateCreated + bool bHasGetLastModified = false; // getlastmodified <-> DateModified + bool bHasGetContentType = false; // getcontenttype <-> MediaType + bool bHasGetContentLength = false; // getcontentlength <-> Size + + bool bHasContentType = false; + bool bHasIsDocument = false; + bool bHasIsFolder = false; + bool bHasTitle = false; + bool bHasBaseURI = false; + bool bHasDateCreated = false; + bool bHasDateModified = false; + bool bHasMediaType = false; + bool bHasSize = false; + bool bHasCreatableInfos = false; { std::set< OUString >::const_iterator it = aPropSet.begin(); @@ -338,62 +338,62 @@ uno::Sequence< beans::Property > Content::getProperties( if ( !bHasCreationDate && ( (*it) == DAVProperties::CREATIONDATE ) ) { - bHasCreationDate = sal_True; + bHasCreationDate = true; } else if ( !bHasGetLastModified && ( (*it) == DAVProperties::GETLASTMODIFIED ) ) { - bHasGetLastModified = sal_True; + bHasGetLastModified = true; } else if ( !bHasGetContentType && ( (*it) == DAVProperties::GETCONTENTTYPE ) ) { - bHasGetContentType = sal_True; + bHasGetContentType = true; } else if ( !bHasGetContentLength && ( (*it) == DAVProperties::GETCONTENTLENGTH ) ) { - bHasGetContentLength = sal_True; + bHasGetContentLength = true; } else if ( !bHasContentType && (*it) == "ContentType" ) { - bHasContentType = sal_True; + bHasContentType = true; } else if ( !bHasIsDocument && (*it) == "IsDocument" ) { - bHasIsDocument = sal_True; + bHasIsDocument = true; } else if ( !bHasIsFolder && (*it) == "IsFolder" ) { - bHasIsFolder = sal_True; + bHasIsFolder = true; } else if ( !bHasTitle && (*it) == "Title" ) { - bHasTitle = sal_True; + bHasTitle = true; } else if ( !bHasBaseURI && (*it) == "BaseURI" ) { - bHasBaseURI = sal_True; + bHasBaseURI = true; } else if ( !bHasDateCreated && (*it) == "DateCreated" ) { - bHasDateCreated = sal_True; + bHasDateCreated = true; } else if ( !bHasDateModified && (*it) == "DateModified" ) { - bHasDateModified = sal_True; + bHasDateModified = true; } else if ( !bHasMediaType && (*it) == "MediaType" ) { - bHasMediaType = sal_True; + bHasMediaType = true; } else if ( !bHasSize && (*it) == "Size" ) { - bHasSize = sal_True; + bHasSize = true; } else if ( !bHasCreatableInfos && (*it) == "CreatableContentsInfo" ) { - bHasCreatableInfos = sal_True; + bHasCreatableInfos = true; } ++it; } @@ -562,7 +562,7 @@ uno::Sequence< ucb::CommandInfo > Content::getCommands( -1, cppu::UnoType<rtl::OUString>::get() ); - sal_Bool bFolder = sal_False; + bool bFolder = false; try { @@ -573,7 +573,7 @@ uno::Sequence< ucb::CommandInfo > Content::getCommands( return aCmdInfo; } - sal_Bool bSupportsLocking = supportsExclusiveWriteLock( xEnv ); + bool bSupportsLocking = supportsExclusiveWriteLock( xEnv ); sal_Int32 nPos = aCmdInfo.getLength(); sal_Int32 nMoreCmds = ( bFolder ? 2 : 0 ) + ( bSupportsLocking ? 2 : 0 ); commit a995f8279931a100713d9fcf57336a2af886e13e Author: Stephan Bergmann <sberg...@redhat.com> Date: Wed Oct 1 16:35:05 2014 +0200 Remove excess [%1 %2] that doesn't match any arguments ...and is apparently a leftover from temporary debug output in e36badb98d0bb5866a297cb51c3e95cdce62d8da "Fix workaround for bug in Clang 3.2 FunctionDecl::isInlined." Change-Id: I3213981c5d236a7b67083014692566f75a2bcd51 diff --git a/compilerplugins/clang/salbool.cxx b/compilerplugins/clang/salbool.cxx index 6e92102..b32c0a7 100644 --- a/compilerplugins/clang/salbool.cxx +++ b/compilerplugins/clang/salbool.cxx @@ -547,7 +547,7 @@ bool SalBool::VisitFunctionDecl(FunctionDecl const * decl) { { report( DiagnosticsEngine::Warning, - "use \"bool\" instead of \"sal_Bool\" as return type%0 [%1 %2]", + "use \"bool\" instead of \"sal_Bool\" as return type%0", loc) << (k == OverrideKind::MAYBE ? (" (unless this member function overrides a dependent" commit 15b45dacbc63f8ebac086d02ccc8ed170cbb75e2 Author: Stephan Bergmann <sberg...@redhat.com> Date: Wed Oct 1 16:20:55 2014 +0200 Tired of seing changes made to effectively dead workben code Change-Id: I437fdceedac57bbeea7fd2a5fb7098bb71e0b259 diff --git a/ucb/workben/cachemap/cachemapobject1.cxx b/ucb/workben/cachemap/cachemapobject1.cxx deleted file mode 100644 index cddc7c9..0000000 --- a/ucb/workben/cachemap/cachemapobject1.cxx +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include "cachemapobject1.hxx" -#include "osl/diagnose.h" -#include "osl/interlck.h" -#include "osl/mutex.hxx" -#include "rtl/ref.hxx" -#include "rtl/ustring.hxx" - -#include <memory> - -using ucb::cachemap::Object1; -using ucb::cachemap::ObjectContainer1; - -inline -Object1::Object1(rtl::Reference< ObjectContainer1 > const & rContainer): - m_xContainer(rContainer), - m_nRefCount(0) -{ - OSL_ASSERT(m_xContainer.is()); -} - -inline Object1::~Object1() -{} - -void ObjectContainer1::releaseElement(Object1 * pElement) -{ - OSL_ASSERT(pElement); - bool bDelete = false; - { - osl::MutexGuard aGuard(m_aMutex); - if (osl_atomic_decrement(&pElement->m_nRefCount) == 0) - { - m_aMap.erase(pElement->m_aContainerIt); - bDelete = true; - } - } - if (bDelete) - delete pElement; -} - -ObjectContainer1::ObjectContainer1() -{} - -ObjectContainer1::~ObjectContainer1() -{} - -rtl::Reference< Object1 > ObjectContainer1::get(OUString const & rKey) -{ - osl::MutexGuard aGuard(m_aMutex); - Map::iterator aIt(m_aMap.find(rKey)); - if (aIt == m_aMap.end()) - { - std::auto_ptr< Object1 > xElement(new Object1(this)); - aIt = m_aMap.insert(Map::value_type(rKey, xElement.get())).first; - aIt->second->m_aContainerIt = aIt; - xElement.release(); - } - return aIt->second; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/ucb/workben/cachemap/cachemapobject1.hxx b/ucb/workben/cachemap/cachemapobject1.hxx deleted file mode 100644 index 65ca92e..0000000 --- a/ucb/workben/cachemap/cachemapobject1.hxx +++ /dev/null @@ -1,92 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_UCB_WORKBEN_CACHEMAP_CACHEMAPOBJECT1_HXX -#define INCLUDED_UCB_WORKBEN_CACHEMAP_CACHEMAPOBJECT1_HXX - -#include "osl/interlck.h" -#include "osl/mutex.hxx" -#include "rtl/ref.hxx" -#include "sal/types.h" -#include "salhelper/simplereferenceobject.hxx" - -#include <map> -#include <memory> - -namespace rtl { class OUString; } -namespace ucb { namespace cachemap { class Object1; } } - -namespace ucb { namespace cachemap { - -class ObjectContainer1: public salhelper::SimpleReferenceObject -{ -public: - ObjectContainer1(); - - virtual ~ObjectContainer1(); - - rtl::Reference< Object1 > get(OUString const & rKey); - -private: - typedef std::map< OUString, Object1 * > Map; - - Map m_aMap; - osl::Mutex m_aMutex; - - void releaseElement(Object1 * pElement); - - friend class Object1; // to access Map, releaseElement() -}; - -class Object1 -{ -public: - inline void acquire() - { osl_atomic_increment(&m_nRefCount); } - - inline void release() - { m_xContainer->releaseElement(this); } - -private: - rtl::Reference< ObjectContainer1 > m_xContainer; - ObjectContainer1::Map::iterator m_aContainerIt; - oslInterlockedCount m_nRefCount; - - inline Object1(rtl::Reference< ObjectContainer1 > const & rContainer); - - inline ~Object1(); - - Object1(Object1 &); // not implemented - void operator =(Object1); // not implemented - - friend class ObjectContainer1; - // to access m_aContainerIt, m_nRefCount, Object1(), ~Object1() -#if defined WNT - friend struct std::auto_ptr< Object1 >; // to access ~Object1() - // work around compiler bug... -#else // WNT - friend class std::auto_ptr< Object1 >; // to access ~Object1() -#endif // WNT -}; - -} } - -#endif // INCLUDED_UCB_WORKBEN_CACHEMAP_CACHEMAPOBJECT1_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/ucb/workben/cachemap/cachemapobject2.hxx b/ucb/workben/cachemap/cachemapobject2.hxx deleted file mode 100644 index a4a42c5..0000000 --- a/ucb/workben/cachemap/cachemapobject2.hxx +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_UCB_WORKBEN_CACHEMAP_CACHEMAPOBJECT2_HXX -#define INCLUDED_UCB_WORKBEN_CACHEMAP_CACHEMAPOBJECT2_HXX - -#include "cppuhelper/weak.hxx" - -namespace ucb { namespace cachemap { - -class Object2: public cppu::OWeakObject -{}; - -} } - -#endif // INCLUDED_UCB_WORKBEN_CACHEMAP_CACHEMAPOBJECT2_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/ucb/workben/cachemap/cachemapobject3.cxx b/ucb/workben/cachemap/cachemapobject3.cxx deleted file mode 100644 index 3b2f9e0..0000000 --- a/ucb/workben/cachemap/cachemapobject3.cxx +++ /dev/null @@ -1,94 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include "cachemapobject3.hxx" -#include "osl/diagnose.h" -#include "osl/interlck.h" -#include "osl/mutex.hxx" -#include "rtl/ref.hxx" -#include "rtl/ustring.hxx" - -#include <memory> - -using ucb::cachemap::Object3; -using ucb::cachemap::ObjectContainer3; - -inline -Object3::Object3(rtl::Reference< ObjectContainer3 > const & rContainer): - m_xContainer(rContainer), - m_nRefCount(0) -{ - OSL_ASSERT(m_xContainer.is()); -} - -inline Object3::~Object3() -{} - -void Object3::release() -{ - if (osl_atomic_decrement(&m_nRefCount) == 0) - { - m_xContainer->releaseElement(this); - delete this; - } -} - -void ObjectContainer3::releaseElement(Object3 * pElement) -{ - OSL_ASSERT(pElement); - osl::MutexGuard aGuard(m_aMutex); - if (pElement->m_aContainerIt != m_aMap.end()) - m_aMap.erase(pElement->m_aContainerIt); -} - -ObjectContainer3::ObjectContainer3() -{} - -ObjectContainer3::~ObjectContainer3() -{} - -rtl::Reference< Object3 > ObjectContainer3::get(OUString const & rKey) -{ - osl::MutexGuard aGuard(m_aMutex); - Map::iterator aIt(m_aMap.find(rKey)); - if (aIt == m_aMap.end()) - { - std::auto_ptr< Object3 > xElement(new Object3(this)); - aIt = m_aMap.insert(Map::value_type(rKey, xElement.get())).first; - aIt->second->m_aContainerIt = aIt; - xElement.release(); - return aIt->second; - } - else if (osl_atomic_increment(&aIt->second->m_nRefCount) > 1) - { - rtl::Reference< Object3 > xElement(aIt->second); - osl_atomic_decrement(&aIt->second->m_nRefCount); - return xElement; - } - else - { - osl_atomic_decrement(&aIt->second->m_nRefCount); - aIt->second->m_aContainerIt = m_aMap.end(); - aIt->second = new Object3(this); - aIt->second->m_aContainerIt = aIt; - return aIt->second; - } -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/ucb/workben/cachemap/cachemapobject3.hxx b/ucb/workben/cachemap/cachemapobject3.hxx deleted file mode 100644 index 7fe5d69..0000000 --- a/ucb/workben/cachemap/cachemapobject3.hxx +++ /dev/null @@ -1,91 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_UCB_WORKBEN_CACHEMAP_CACHEMAPOBJECT3_HXX -#define INCLUDED_UCB_WORKBEN_CACHEMAP_CACHEMAPOBJECT3_HXX - -#include "osl/interlck.h" -#include "osl/mutex.hxx" -#include "rtl/ref.hxx" -#include "sal/types.h" -#include "salhelper/simplereferenceobject.hxx" - -#include <map> -#include <memory> - -namespace rtl { class OUString; } -namespace ucb { namespace cachemap { class Object3; } } - -namespace ucb { namespace cachemap { - -class ObjectContainer3: public salhelper::SimpleReferenceObject -{ -public: - ObjectContainer3(); - - virtual ~ObjectContainer3(); - - rtl::Reference< Object3 > get(OUString const & rKey); - -private: - typedef std::map< OUString, Object3 * > Map; - - Map m_aMap; - osl::Mutex m_aMutex; - - void releaseElement(Object3 * pElement); - - friend class Object3; // to access Map, releaseElement() -}; - -class Object3 -{ -public: - inline void acquire() - { osl_atomic_increment(&m_nRefCount); } - - void release(); - -private: - rtl::Reference< ObjectContainer3 > m_xContainer; - ObjectContainer3::Map::iterator m_aContainerIt; - oslInterlockedCount m_nRefCount; - - inline Object3(rtl::Reference< ObjectContainer3 > const & rContainer); - - inline ~Object3(); - - Object3(Object3 &); // not implemented - void operator =(Object3); // not implemented - - friend class ObjectContainer3; - // to access m_aContainerIt, m_nRefCount, Object3(), ~Object3() -#if defined WNT - friend struct std::auto_ptr< Object3 >; // to access ~Object3() - // work around compiler bug... -#else // WNT - friend class std::auto_ptr< Object3 >; // to access ~Object3() -#endif // WNT -}; - -} } - -#endif // INCLUDED_UCB_WORKBEN_CACHEMAP_CACHEMAPOBJECT3_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/ucb/workben/cachemap/cachemapobjectcontainer2.cxx b/ucb/workben/cachemap/cachemapobjectcontainer2.cxx deleted file mode 100644 index 79e628c..0000000 --- a/ucb/workben/cachemap/cachemapobjectcontainer2.cxx +++ /dev/null @@ -1,60 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include "cachemapobjectcontainer2.hxx" -#include "cachemapobject2.hxx" -#include "com/sun/star/uno/Reference.hxx" -#include "com/sun/star/uno/XWeak.hpp" -#include "cppuhelper/weakref.hxx" -#include "osl/mutex.hxx" -#include "rtl/ref.hxx" -#include "rtl/ustring.hxx" - -using ucb::cachemap::Object2; -using ucb::cachemap::ObjectContainer2; -using namespace com::sun::star; - -ObjectContainer2::ObjectContainer2() -{} - -ObjectContainer2::~ObjectContainer2() -{} - -rtl::Reference< Object2 > ObjectContainer2::get(OUString const & rKey) -{ - rtl::Reference< Object2 > xElement; - { - osl::MutexGuard aGuard(m_aMutex); - Map::iterator aIt(m_aMap.find(rKey)); - if (aIt != m_aMap.end()) - xElement = static_cast< Object2 * >( - uno::Reference< uno::XWeak >( - aIt->second.get(), uno::UNO_QUERY). - get()); - if (!xElement.is()) - { - xElement = new Object2; - m_aMap[rKey] - = uno::WeakReference< Object2 >(xElement.get()); - } - } - return xElement; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/ucb/workben/cachemap/cachemapobjectcontainer2.hxx b/ucb/workben/cachemap/cachemapobjectcontainer2.hxx deleted file mode 100644 index 59e2d3e..0000000 --- a/ucb/workben/cachemap/cachemapobjectcontainer2.hxx +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_UCB_WORKBEN_CACHEMAP_CACHEMAPOBJECTCONTAINER2_HXX -#define INCLUDED_UCB_WORKBEN_CACHEMAP_CACHEMAPOBJECTCONTAINER2_HXX - -#include "cppuhelper/weakref.hxx" -#include "osl/mutex.hxx" -#include "rtl/ref.hxx" -#include "sal/types.h" - -#include <boost/unordered_map.hpp> - -namespace rtl { - class OUString; - struct OUStringHash; -} -namespace ucb { namespace cachemap { class Object2; } } - -namespace ucb { namespace cachemap { - -class ObjectContainer2 -{ -public: - ObjectContainer2(); - - ~ObjectContainer2(); - - rtl::Reference< Object2 > get(OUString const & rKey); - -private: - typedef boost::unordered_map< OUString, - com::sun::star::uno::WeakReference< Object2 >, - OUStringHash > - Map; - - ObjectContainer2(ObjectContainer2 &); // not implemented - void operator =(ObjectContainer2); // not implemented - - Map m_aMap; - osl::Mutex m_aMutex; -}; - -} } - -#endif // INCLUDED_UCB_WORKBEN_CACHEMAP_CACHEMAPOBJECTCONTAINER2_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/ucb/workben/cachemap/cachemaptest.cxx b/ucb/workben/cachemap/cachemaptest.cxx deleted file mode 100644 index dce0434..0000000 --- a/ucb/workben/cachemap/cachemaptest.cxx +++ /dev/null @@ -1,159 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include "cachemapobject1.hxx" -#include "cachemapobject2.hxx" -#include "cachemapobject3.hxx" -#include "cachemapobjectcontainer2.hxx" - -#include "osl/time.h" -#include "rtl/ref.hxx" -#include "rtl/ustring.hxx" - -#include <cstdlib> -#include <memory> -#include <stdio.h> - -using ucb::cachemap::Object1; -using ucb::cachemap::Object2; -using ucb::cachemap::Object3; -using ucb::cachemap::ObjectContainer1; -using ucb::cachemap::ObjectContainer2; -using ucb::cachemap::ObjectContainer3; - -namespace { - -// Give template function a dummy parameter, to work around MSVC++ bug: -template< typename Cont, typename ContRef, typename Obj > -sal_uInt32 test(Obj *) -{ - ContRef xCont(new Cont); - OUString aPrefix("key"); - sal_uInt32 nTimer = osl_getGlobalTimer(); - for (int i = 0; i < 100000; i += 5) - { - OUString - aKey0(aPrefix - + OUString::valueOf(static_cast< sal_Int32 >( - i % 100))); - rtl::Reference< Obj > xObj01(xCont->get(aKey0)); - for (int j = 0; j < 50; ++j) - { - rtl::Reference< Obj > xRef(xObj01); - } - rtl::Reference< Obj > xObj02(xCont->get(aKey0)); - for (int j = 0; j < 50; ++j) - { - rtl::Reference< Obj > xRef(xObj02); - } - - OUString - aKey1(aPrefix - + OUString::valueOf(static_cast< sal_Int32 >( - (i + 1) % 100))); - rtl::Reference< Obj > xObj11(xCont->get(aKey1)); - for (int j = 0; j < 50; ++j) - { - rtl::Reference< Obj > xRef(xObj11); - } - rtl::Reference< Obj > xObj12(xCont->get(aKey1)); - for (int j = 0; j < 50; ++j) - { - rtl::Reference< Obj > xRef(xObj12); - } - - OUString - aKey2(aPrefix - + OUString::valueOf(static_cast< sal_Int32 >( - (i + 2) % 100))); - rtl::Reference< Obj > xObj21(xCont->get(aKey2)); - for (int j = 0; j < 50; ++j) - { - rtl::Reference< Obj > xRef(xObj21); - } - rtl::Reference< Obj > xObj22(xCont->get(aKey2)); - for (int j = 0; j < 50; ++j) - { - rtl::Reference< Obj > xRef(xObj22); - } - - OUString - aKey3(aPrefix - + OUString::valueOf(static_cast< sal_Int32 >( - (i + 3) % 100))); - rtl::Reference< Obj > xObj31(xCont->get(aKey3)); - for (int j = 0; j < 50; ++j) - { - rtl::Reference< Obj > xRef(xObj31); - } - rtl::Reference< Obj > xObj32(xCont->get(aKey3)); - for (int j = 0; j < 50; ++j) - { - rtl::Reference< Obj > xRef(xObj32); - } - - OUString - aKey4(aPrefix - + OUString::valueOf(static_cast< sal_Int32 >( - (i + 4) % 100))); - rtl::Reference< Obj > xObj41(xCont->get(aKey4)); - for (int j = 0; j < 50; ++j) - { - rtl::Reference< Obj > xRef(xObj41); - } - rtl::Reference< Obj > xObj42(xCont->get(aKey4)); - for (int j = 0; j < 50; ++j) - { - rtl::Reference< Obj > xRef(xObj42); - } - } - return osl_getGlobalTimer() - nTimer; -} - -} - -int main() -{ - // Use the second set of measurements, to avoid startup inaccuracies: - for (int i = 0; i < 2; ++i) - printf("Version 1: %lu ms.\nVersion 2: %lu ms.\nVersion 3: %lu ms.\n", - static_cast< unsigned long >( - test< ObjectContainer1, - rtl::Reference< ObjectContainer1 >, - Object1 >(0)), - static_cast< unsigned long >( - test< ObjectContainer2, - std::auto_ptr< ObjectContainer2 >, - Object2 >(0)), - static_cast< unsigned long >( - test< ObjectContainer3, - rtl::Reference< ObjectContainer3 >, - Object3 >(0))); - return EXIT_SUCCESS; -} - -// unxsols3.pro: Version 1: 9137 ms. -// Version 2: 8634 ms. -// Version 3: 3166 ms. - -// wntmsci7.pro: Version 1: 3846 ms. -// Version 2: 5598 ms. -// Version 3: 2704 ms. - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/ucb/workben/cachemap/makefile.mk b/ucb/workben/cachemap/makefile.mk deleted file mode 100644 index 61ab3a3..0000000 --- a/ucb/workben/cachemap/makefile.mk +++ /dev/null @@ -1,43 +0,0 @@ -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This file incorporates work covered by the following license notice: -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed -# with this work for additional information regarding copyright -# ownership. The ASF licenses this file to you under the Apache -# License, Version 2.0 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.apache.org/licenses/LICENSE-2.0 . -# - -PRJ = ..$/.. -PRJNAME = ucb -TARGET = cachemap -TARGETTYPE = CUI -LIBTARGET = NO -ENABLE_EXCEPTIONS = TRUE - -.INCLUDE: settings.mk - -OBJFILES = \ - $(OBJ)$/cachemapobject1.obj \ - $(OBJ)$/cachemapobjectcontainer2.obj \ - $(OBJ)$/cachemapobject3.obj \ - $(OBJ)$/cachemaptest.obj - -APP1TARGET = $(TARGET) -APP1OBJS = $(OBJFILES) -APP1STDLIBS = \ - $(CPPULIB) \ - $(CPPUHELPERLIB) \ - $(SALLIB) \ - $(SALHELPERLIB) -APP1DEF = $(MISC)$/$(APP1TARGET).def - -.INCLUDE: target.mk diff --git a/ucb/workben/ucb/makefile.mk b/ucb/workben/ucb/makefile.mk deleted file mode 100644 index 447591b..0000000 --- a/ucb/workben/ucb/makefile.mk +++ /dev/null @@ -1,71 +0,0 @@ -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This file incorporates work covered by the following license notice: -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed -# with this work for additional information regarding copyright -# ownership. The ASF licenses this file to you under the Apache -# License, Version 2.0 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.apache.org/licenses/LICENSE-2.0 . -# - -PRJ=..$/.. - -PRJNAME=ucb -TARGET=ucbdemo -TARGETTYPE=GUI -LIBTARGET=NO - -ENABLE_EXCEPTIONS=TRUE - -# --- Settings --- - -.INCLUDE : settings.mk - -# --- Files --- - -OBJFILES=\ - $(OBJ)$/srcharg.obj \ - $(OBJ)$/ucbdemo.obj - -# -# UCBDEMO -# -APP1TARGET= ucbdemo -APP1OBJS=\ - $(OBJ)$/srcharg.obj \ - $(OBJ)$/ucbdemo.obj - -.IF "$(COMPHELPERLIB)"=="" - -.IF "$(OS)" != "WNT" -COMPHELPERLIB=-licomphelp2 -.ENDIF # unx - -.IF "$(OS)"=="WNT" -COMPHELPERLIB=icomphelp2.lib -.ENDIF # wnt - -.ENDIF - -APP1STDLIBS=\ - $(SALLIB) \ - $(CPPULIB) \ - $(CPPUHELPERLIB) \ - $(COMPHELPERLIB) \ - $(TOOLSLIB) \ - $(SVTOOLLIB) \ - $(VCLLIB) \ - $(UCBHELPERLIB) - -# --- Targets --- - -.INCLUDE : target.mk - diff --git a/ucb/workben/ucb/srcharg.cxx b/ucb/workben/ucb/srcharg.cxx deleted file mode 100644 index 781f168..0000000 --- a/ucb/workben/ucb/srcharg.cxx +++ /dev/null @@ -1,478 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - - -#include <limits> -#include <com/sun/star/ucb/RuleOperator.hpp> -#include <com/sun/star/ucb/SearchInfo.hpp> -#include <com/sun/star/util/Date.hpp> -#include <tools/date.hxx> -#include <tools/inetmime.hxx> - -#include <srcharg.hxx> - -namespace unnamed_chaos_ucbdemo_srcharg {} -using namespace unnamed_chaos_ucbdemo_srcharg; - // unnamed namespaces don't work well yet... - -using namespace com::sun::star; - - - -// skipWhiteSpace - - - -namespace unnamed_chaos_ucbdemo_srcharg { - -void skipWhiteSpace(sal_Unicode const *& rBegin, sal_Unicode const * pEnd) -{ - while (rBegin != pEnd - && (*rBegin == '\n' || *rBegin == '\t' || *rBegin == ' ')) - ++rBegin; -} - - - -// scanAtom - - - -String scanAtom(sal_Unicode const *& rBegin, sal_Unicode const * pEnd) -{ - sal_Unicode const * pTheBegin = rBegin; - while (rBegin != pEnd && INetMIME::isAlpha(*rBegin)) - ++rBegin; - return String(pTheBegin, rBegin - pTheBegin); -} - - - -// scanProperty - - - -String scanProperty(sal_Unicode const *& rBegin, sal_Unicode const * pEnd) -{ - sal_Unicode const * pTheBegin = rBegin; - while (rBegin != pEnd - && !(*rBegin == '\n' || *rBegin == '\t' || *rBegin == ' ')) - ++rBegin; - return String(pTheBegin, rBegin - pTheBegin); -} - - - -// scanOperator - - - -String scanOperator(sal_Unicode const *& rBegin, sal_Unicode const * pEnd) -{ - sal_Unicode const * pTheBegin = rBegin; - while (rBegin != pEnd - && (INetMIME::isAlpha(*rBegin) || *rBegin == '!' - || *rBegin >= '<' && *rBegin <= '>')) - ++rBegin; - return String(pTheBegin, rBegin - pTheBegin); -} - -} - - - -// parseSearchArgument - - - -bool parseSearchArgument(String const & rInput, ucb::SearchInfo & rInfo) -{ - /* Format of rInput: - - argument = *option [criterion *("OR" criterion)] - - option = ("--RECURSE" "=" ("NONE" / "ONE" / "DEEP")) - / (("--BASE" / "--FOLDERVIEW" / "--DOCVIEW" - / "--INDIRECT") - "=" bool) - - criterion = "EMPTY" / (term *("AND" term)) - - term = text-term / date-term / numeric-term / bool-term - - text-term = property ("CONT" / "!CONT" / ">=" / "<=" / "==" / "!=") - string *("-C" / "-R") - - date-term = property - (((">=" / "<=" / "==" / "!=") date) - / (("OLDER" / "YOUNGER") number)) - - numeric-term = property (">=" / "<=" / "==" / "!=") number - - bool-term = property ("TRUE" / "FALSE") - - property = 1*VCHAR - - string = DQUOTE - *(<any Unicode code point except DQUOTE or "\"> - / ("\" %x75 4HEXDIG) ; \uHHHH - / ("\" (DQUOTE / "\"))) - DQUOTE - - date = 1*2DIGIT "/" 1*2DIGIT "/" 4DIGIT ; mm/dd/yyyy - - number = ["+" / "-"] 1*DIGIT - */ - - sal_Unicode const * p = rInput.GetBuffer(); - sal_Unicode const * pEnd = p + rInput.Len(); - - // Parse options: - rInfo.Recursion = ucb::SearchRecursion_ONE_LEVEL; - rInfo.IncludeBase = true; - rInfo.RespectFolderViewRestrictions = true; - rInfo.RespectDocViewRestrictions = false; - rInfo.FollowIndirections = false; - enum OptionID { OPT_RECURSE, OPT_BASE, OPT_FOLDERVIEW, OPT_DOCVIEW, - OPT_INDIRECT, OPT_Count }; - struct OptionInfo - { - bool m_bSpecified; - sal_Bool * m_pValue; - }; - OptionInfo aOptions[OPT_Count]; - aOptions[OPT_RECURSE].m_bSpecified = false; - aOptions[OPT_RECURSE].m_pValue = 0; - aOptions[OPT_BASE].m_bSpecified = false; - aOptions[OPT_BASE].m_pValue = &rInfo.IncludeBase; - aOptions[OPT_FOLDERVIEW].m_bSpecified = false; - aOptions[OPT_FOLDERVIEW].m_pValue - = &rInfo.RespectFolderViewRestrictions; - aOptions[OPT_DOCVIEW].m_bSpecified = false; - aOptions[OPT_DOCVIEW].m_pValue = &rInfo.RespectDocViewRestrictions; - aOptions[OPT_INDIRECT].m_bSpecified = false; - aOptions[OPT_INDIRECT].m_pValue = &rInfo.FollowIndirections; - while (p != pEnd) - { - sal_Unicode const * q = p; - - skipWhiteSpace(q, pEnd); - if (pEnd - q < 2 || *q++ != '-' || *q++ != '-') - break; - String aOption(scanAtom(q, pEnd)); - OptionID eID; - if (aOption.EqualsIgnoreCaseAscii("recurse")) - eID = OPT_RECURSE; - else if (aOption.EqualsIgnoreCaseAscii("base")) - eID = OPT_BASE; - else if (aOption.EqualsIgnoreCaseAscii("folderview")) - eID = OPT_FOLDERVIEW; - else if (aOption.EqualsIgnoreCaseAscii("docview")) - eID = OPT_DOCVIEW; - else if (aOption.EqualsIgnoreCaseAscii("indirect")) - eID = OPT_INDIRECT; - else - break; - - if (aOptions[eID].m_bSpecified) - break; - aOptions[eID].m_bSpecified = true; - - skipWhiteSpace(q, pEnd); - if (q == pEnd || *q++ != '=') - break; - - skipWhiteSpace(q, pEnd); - String aValue(scanAtom(q, pEnd)); - if (eID == OPT_RECURSE) - { - if (aValue.EqualsIgnoreCaseAscii("none")) - rInfo.Recursion = ucb::SearchRecursion_NONE; - else if (aValue.EqualsIgnoreCaseAscii("one")) - rInfo.Recursion = ucb::SearchRecursion_ONE_LEVEL; - else if (aValue.EqualsIgnoreCaseAscii("deep")) - rInfo.Recursion = ucb::SearchRecursion_DEEP; - else - break; - } - else if (aValue.EqualsIgnoreCaseAscii("true")) - *aOptions[eID].m_pValue = true; - else if (aValue.EqualsIgnoreCaseAscii("false")) - *aOptions[eID].m_pValue = false; - else - break; - - p = q; - } - - // Parse criteria: - ucb::SearchCriterium aCriterium; - for (;;) - { - sal_Unicode const * q = p; - - // Parse either property name or "empty": - skipWhiteSpace(q, pEnd); - String aProperty(scanProperty(q, pEnd)); - sal_Unicode const * pPropertyEnd = q; - - // Parse operator: - skipWhiteSpace(q, pEnd); - String aOperator(scanOperator(q, pEnd)); - struct Operator - { - sal_Char const * m_pName; - sal_Int16 m_nText; - sal_Int16 m_nDate; - sal_Int16 m_nNumeric; - sal_Int16 m_nBool; - }; - static Operator const aOperators[] - = { { "cont", ucb::RuleOperator::CONTAINS, 0, 0, 0 }, - { "!cont", ucb::RuleOperator::CONTAINSNOT, 0, 0, 0 }, - { ">=", ucb::RuleOperator::GREATEREQUAL, - ucb::RuleOperator::GREATEREQUAL, - ucb::RuleOperator::GREATEREQUAL, 0 }, - { "<=", ucb::RuleOperator::LESSEQUAL, - ucb::RuleOperator::LESSEQUAL, ucb::RuleOperator::LESSEQUAL, - 0 }, - { "==", ucb::RuleOperator::EQUAL, ucb::RuleOperator::EQUAL, - ucb::RuleOperator::EQUAL, 0 }, - { "!=", ucb::RuleOperator::NOTEQUAL, - ucb::RuleOperator::NOTEQUAL, ucb::RuleOperator::NOTEQUAL, - 0 }, - { "true", 0, 0, 0, ucb::RuleOperator::VALUE_TRUE }, - { "false", 0, 0, 0, ucb::RuleOperator::VALUE_FALSE } }; - int const nOperatorCount = sizeof aOperators / sizeof (Operator); - Operator const * pTheOperator = 0; - for (int i = 0; i < nOperatorCount; ++i) - if (aOperator.EqualsIgnoreCaseAscii(aOperators[i].m_pName)) - { - pTheOperator = aOperators + i; - break; - } - bool bTerm = pTheOperator != 0; - - sal_Int16 nOperatorID; - uno::Any aTheOperand; - bool bCaseSensitive = false; - bool bRegularExpression = false; - if (bTerm) - { - skipWhiteSpace(q, pEnd); - bool bHasOperand = false; - - // Parse string operand: - if (!bHasOperand && pTheOperator->m_nText) - { - if (q != pEnd && *q == '"') - { - String aString; - for (sal_Unicode const * r = q + 1;;) - { - if (r == pEnd) - break; - sal_Unicode c = *r++; - if (c == '"') - { - bHasOperand = true; - aTheOperand <<= OUString(aString); - nOperatorID = pTheOperator->m_nText; - q = r; - break; - } - if (c == '\\') - { - if (r == pEnd) - break; - c = *r++; - if (c == 'u') - { - if (pEnd - r < 4) - break; - c = 0; - bool bBad = false; - for (int i = 0; i < 4; ++i) - { - int nWeight - = INetMIME::getHexWeight(*r++); - if (nWeight < 0) - { - bBad = false; - break; - } - c = sal_Unicode(c << 4 | nWeight); - } - if (bBad) - break; - } - else if (c != '"' && c != '\\') - break; - } - aString += c; - } - } - - // Parse "-C" and "-R": - if (bHasOperand) - for (;;) - { - skipWhiteSpace(q, pEnd); - if (pEnd - q >= 2 && q[0] == '-' - && (q[1] == 'C' || q[1] == 'c') - && !bCaseSensitive) - { - bCaseSensitive = true; - q += 2; - } - else if (pEnd - q >= 2 && q[0] == '-' - && (q[1] == 'R' || q[1] == 'r') - && !bRegularExpression) - { - bRegularExpression = true; - q += 2; - } - else - break; - } - } - - // Parse date operand: - if (!bHasOperand && pTheOperator->m_nDate != 0) - { - sal_Unicode const * r = q; - bool bOK = true; - USHORT nMonth = 0; - if (bOK && r != pEnd && INetMIME::isDigit(*r)) - nMonth = INetMIME::getWeight(*r++); - else - bOK = false; - if (bOK && r != pEnd && INetMIME::isDigit(*r)) - nMonth = 10 * nMonth + INetMIME::getWeight(*r++); - if (!(bOK && r != pEnd && *r++ == '/')) - bOK = false; - USHORT nDay = 0; - if (bOK && r != pEnd && INetMIME::isDigit(*r)) - nDay = INetMIME::getWeight(*r++); - else - bOK = false; - if (bOK && r != pEnd && INetMIME::isDigit(*r)) - nDay = 10 * nDay + INetMIME::getWeight(*r++); - if (!(bOK && r != pEnd && *r++ == '/')) - bOK = false; - USHORT nYear = 0; - for (int i = 0; bOK && i < 4; ++i) - if (r != pEnd && INetMIME::isDigit(*r)) - nYear = 10 * nYear + INetMIME::getWeight(*r++); - else - bOK = false; - if (bOK && Date(nDay, nMonth, nYear).IsValid()) - { - bHasOperand = true; - aTheOperand <<= util::Date(nDay, nMonth, nYear); - nOperatorID = pTheOperator->m_nDate; - q = r; - } - } - - // Parse number operand: - if (!bHasOperand && pTheOperator->m_nNumeric != 0) - { - sal_Unicode const * r = q; - bool bNegative = false; - if (*r == '+') - ++r; - else if (*r == '-') - { - bNegative = true; - ++r; - } - sal_Int64 nNumber = 0; - bool bDigits = false; - while (r != pEnd && INetMIME::isDigit(*r)) - { - nNumber = 10 * nNumber + INetMIME::getWeight(*r++); - if (nNumber > std::numeric_limits< sal_Int32 >::max()) - { - bDigits = false; - break; - } - } - if (bDigits) - { - bHasOperand = true; - aTheOperand - <<= sal_Int32(bNegative ? -sal_Int32(nNumber) : - sal_Int32(nNumber)); - nOperatorID = pTheOperator->m_nNumeric; - q = r; - } - } - - // Bool operator has no operand: - if (!bHasOperand && pTheOperator->m_nBool != 0) - { - bHasOperand = true; - nOperatorID = pTheOperator->m_nBool; - } - - bTerm = bHasOperand; - } - - bool bEmpty = false; - if (bTerm) - { - aCriterium.Terms.realloc(aCriterium.Terms.getLength() + 1); - aCriterium.Terms[aCriterium.Terms.getLength() - 1] - = ucb::RuleTerm(aProperty, aTheOperand, nOperatorID, - bCaseSensitive, bRegularExpression); - } - else if (aCriterium.Terms.getLength() == 0 - && aProperty.EqualsIgnoreCaseAscii("empty")) - { - bEmpty = true; - q = pPropertyEnd; - } - - if (!(bTerm || bEmpty)) - break; - - p = q; - skipWhiteSpace(p, pEnd); - - q = p; - String aConnection(scanAtom(q, pEnd)); - if (p == pEnd || aConnection.EqualsIgnoreCaseAscii("or")) - { - rInfo.Criteria.realloc(rInfo.Criteria.getLength() + 1); - rInfo.Criteria[rInfo.Criteria.getLength() - 1] = aCriterium; - aCriterium = ucb::SearchCriterium(); - p = q; - } - else if (bTerm && aConnection.EqualsIgnoreCaseAscii("and")) - p = q; - else - break; - } - - skipWhiteSpace(p, pEnd); - return p == pEnd; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/ucb/workben/ucb/srcharg.hxx b/ucb/workben/ucb/srcharg.hxx deleted file mode 100644 index 0b2bbcf..0000000 --- a/ucb/workben/ucb/srcharg.hxx +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_UCB_WORKBEN_UCB_SRCHARG_HXX -#define INCLUDED_UCB_WORKBEN_UCB_SRCHARG_HXX - -class String; -namespace com { namespace sun { namespace star { namespace ucb { - struct SearchInfo; -} } } } - - -bool parseSearchArgument(String const & rInput, - com::sun::star::ucb::SearchInfo & rInfo); - -#endif // INCLUDED_UCB_WORKBEN_UCB_SRCHARG_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/ucb/workben/ucb/ucbdemo.cxx b/ucb/workben/ucb/ucbdemo.cxx deleted file mode 100644 index 335bdd8..0000000 --- a/ucb/workben/ucb/ucbdemo.cxx +++ /dev/null @@ -1,2336 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - - -#include <stack> -#include <rtl/ustrbuf.hxx> -#include <osl/mutex.hxx> -#include <cppuhelper/weak.hxx> -#include <cppuhelper/bootstrap.hxx> -#include <com/sun/star/ucb/ContentAction.hpp> -#include <com/sun/star/ucb/OpenCommandArgument2.hpp> -#include <com/sun/star/ucb/ContentResultSetCapability.hpp> -#include <com/sun/star/ucb/SearchCommandArgument.hpp> -#include <com/sun/star/ucb/NameClash.hpp> -#include <com/sun/star/ucb/TransferInfo.hpp> -#include <com/sun/star/ucb/GlobalTransferCommandArgument.hpp> -#include <com/sun/star/ucb/XContentIdentifierFactory.hpp> -#include <com/sun/star/ucb/CommandInfo.hpp> -#include <com/sun/star/ucb/XContentProviderManager.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/beans/Property.hpp> -#include <com/sun/star/lang/XComponent.hpp> -#include <com/sun/star/ucb/CHAOSProgressStart.hpp> -#include <com/sun/star/ucb/OpenMode.hpp> -#include <com/sun/star/ucb/ResultSetException.hpp> -#include <com/sun/star/io/XOutputStream.hpp> -#include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/beans/XPropertyContainer.hpp> -#include <com/sun/star/ucb/XProgressHandler.hpp> -#include <com/sun/star/ucb/XCommandEnvironment.hpp> -#include <com/sun/star/beans/XPropertiesChangeListener.hpp> -#include <com/sun/star/beans/XPropertiesChangeNotifier.hpp> -#include <com/sun/star/ucb/XCommandProcessor.hpp> -#include <com/sun/star/ucb/XDynamicResultSet.hpp> -#include <com/sun/star/sdbc/XRow.hpp> -#include <com/sun/star/ucb/XContentAccess.hpp> -#include <com/sun/star/ucb/XCommandInfo.hpp> -#include <com/sun/star/beans/PropertyValue.hpp> -#include <com/sun/star/ucb/XSortedDynamicResultSetFactory.hpp> -#include <com/sun/star/bridge/XUnoUrlResolver.hpp> -#include <comphelper/processfactory.hxx> -#include <ucbhelper/configurationkeys.hxx> -#include <ucbhelper/fileidentifierconverter.hxx> -#include <ucbhelper/contentbroker.hxx> -#include <tools/debug.hxx> - -#include "tools/time.hxx" -#include <vcl/wrkwin.hxx> -#include <vcl/toolbox.hxx> -#include <vcl/edit.hxx> -#include <vcl/lstbox.hxx> -#include <vcl/svapp.hxx> -#include <vcl/help.hxx> -#include <srcharg.hxx> - -using ucbhelper::getLocalFileURL; -using ucbhelper::getSystemPathFromFileURL; -using ucbhelper::getFileURLFromSystemPath; - -using namespace com::sun::star; - -/*======================================================================== - * - * MyOutWindow. - * - *======================================================================*/ - -#define MYOUTWINDOW_MAXLINES 4096 - -class MyOutWindow : public ListBox -{ -public: - MyOutWindow( vcl::Window *pParent, WinBits nWinStyle ) - : ListBox ( pParent, nWinStyle | WB_AUTOHSCROLL ) {} - ~MyOutWindow() {} - - void Append( const String &rLine ); -}; - - -void MyOutWindow::Append( const String &rLine ) -{ - OUString aLine( rLine ); - - sal_Int32 nPos = aLine.indexOf( '\n' ); - while ( nPos != -1 ) - { - if ( GetEntryCount() >= MYOUTWINDOW_MAXLINES ) - RemoveEntry( 0 ); - - InsertEntry( aLine.Copy( 0, nPos ) ); - - aLine.Erase( 0, nPos + 1 ); - nPos = aLine.Search( '\n' ); - } - - if ( GetEntryCount() >= MYOUTWINDOW_MAXLINES ) - RemoveEntry( 0 ); - - InsertEntry( aLine ); - - SetTopEntry( MYOUTWINDOW_MAXLINES - 1 ); -} - -/*======================================================================== - * - * MessagePrinter. - * - *=======================================================================*/ - -class MessagePrinter -{ -protected: - MyOutWindow* m_pOutEdit; - -public: - MessagePrinter( MyOutWindow* pOutEdit = NULL ) - : m_pOutEdit( pOutEdit ) {} - void setOutEdit( MyOutWindow* pOutEdit ) - { m_pOutEdit = pOutEdit; } - void print( const sal_Char* pText ); - void print( const OUString& rText ); -}; - - -void MessagePrinter::print( const sal_Char* pText ) -{ - print( OUString::createFromAscii(pText) ); -} - - -void MessagePrinter::print( const OUString& rText ) -{ - SolarMutexGuard aGuard; - - if ( m_pOutEdit ) - { - m_pOutEdit->Append( rText ); - m_pOutEdit->Update(); - } -} - - - -// TestOutputStream - - - -class TestOutputStream: - public cppu::OWeakObject, - public io::XOutputStream -{ - OUString m_sStart; - bool m_bMore; - -public: - TestOutputStream(): m_bMore(false) {} - - virtual uno::Any SAL_CALL queryInterface(const uno::Type & rType) - throw(uno::RuntimeException); - virtual void SAL_CALL acquire() throw () - { OWeakObject::acquire(); } - - virtual void SAL_CALL release() throw () - { OWeakObject::release(); } - - virtual void SAL_CALL writeBytes(const uno::Sequence< sal_Int8 > & rData) - throw(uno::RuntimeException); - - virtual void SAL_CALL flush() throw() {} - - virtual void SAL_CALL closeOutput() throw() {}; - - OUString getStart() const; -}; - - -// virtual -uno::Any SAL_CALL -TestOutputStream::queryInterface(const uno::Type & rType) - throw(uno::RuntimeException) -{ - uno::Any aRet = cppu::queryInterface(rType, - static_cast< io::XOutputStream * >(this)); - return aRet.hasValue() ? aRet : OWeakObject::queryInterface(rType); -} - - -// virtual -void SAL_CALL TestOutputStream::writeBytes( - const uno::Sequence< sal_Int8 > & rData) - throw(uno::RuntimeException) -{ - sal_Int32 nLen = rData.getLength(); - if (m_sStart.getLength() + nLen > 500) - { - nLen = 500 - m_sStart.getLength(); - m_bMore = true; - } - m_sStart - += OUString(reinterpret_cast< const sal_Char * >(rData.getConstArray()), - nLen, RTL_TEXTENCODING_ISO_8859_1); -} - - -OUString TestOutputStream::getStart() const -{ - OUString sResult = m_sStart; - if (m_bMore) - sResult += "..."; - return sResult; -} - -/*======================================================================== - * - * ProgressHandler. - * - *=======================================================================*/ - -class ProgressHandler: - public cppu::OWeakObject, - public ucb::XProgressHandler -{ - MessagePrinter & m_rPrinter; - - OUString toString(const uno::Any & rStatus); - -public: - ProgressHandler(MessagePrinter & rThePrinter): m_rPrinter(rThePrinter) {} - - virtual uno::Any SAL_CALL queryInterface( - const uno::Type & rType) - throw(uno::RuntimeException); - - virtual void SAL_CALL acquire() throw () - { OWeakObject::acquire(); } - - virtual void SAL_CALL release() throw () - { OWeakObject::release(); } - - virtual void SAL_CALL push(const uno::Any & rStatus) - throw (uno::RuntimeException); - - virtual void SAL_CALL update(const uno::Any & rStatus) - throw (uno::RuntimeException); - - virtual void SAL_CALL pop() throw (uno::RuntimeException); -}; - -OUString ProgressHandler::toString(const uno::Any & rStatus) -{ - ucb::CHAOSProgressStart aStart; - if (rStatus >>= aStart) - { - OUString sResult; - if (aStart.Text.getLength() > 0) - { - sResult = aStart.Text + " "; - } - sResult += "["; - sResult += OUString::valueOf(aStart.Minimum); - sResult += ".."; - sResult += OUString::valueOf(aStart.Maximum); - sResult += "]"; - return sResult; - } - - OUString sText; - if (rStatus >>= sText) - return sText; - - sal_Int32 nValue; - if (rStatus >>= nValue) - { - OUString sResult = ".." + OUString::valueOf(nValue) + ".."; - return OUString(sResult); - } - - return OUString("(Unknown object)"); -} - - -// virtual -uno::Any SAL_CALL -ProgressHandler::queryInterface( const uno::Type & rType ) - throw(uno::RuntimeException) -{ - uno::Any aRet = cppu::queryInterface( - rType, - static_cast< ucb::XProgressHandler* >(this)); - return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType ); -} - - -// virtual -void SAL_CALL ProgressHandler::push(const uno::Any & rStatus) - throw (uno::RuntimeException) -{ - OUString sMessage("Status push: "); - sMessage += toString(rStatus); - m_rPrinter.print(sMessage); -} - - -// virtual -void SAL_CALL ProgressHandler::update(const uno::Any & rStatus) - throw (uno::RuntimeException) -{ - OUString sMessage("Status update: "); - sMessage += toString(rStatus); - m_rPrinter.print(sMessage); -} - - -// virtual -void SAL_CALL ProgressHandler::pop() throw (uno::RuntimeException) -{ - m_rPrinter.print("Status pop"); -} - -/*======================================================================== - * - * Ucb. - * - *=======================================================================*/ - -#define UCB_MODULE_NAME "ucb1" - -class Ucb : public MessagePrinter -{ -private: - uno::Reference< lang::XMultiServiceFactory > m_xFac; - uno::Reference< ucb::XContentProvider > m_xProv; - uno::Reference< ucb::XContentIdentifierFactory > m_xIdFac; - OUString m_aConfigurationKey1; - OUString m_aConfigurationKey2; - sal_Bool m_bInited : 1; - -public: - Ucb( uno::Reference< lang::XMultiServiceFactory >& rxFactory, - OUString const & rConfigurationKey1, - OUString const & rConfigurationKey2 ); - ~Ucb(); - - sal_Bool init(); - - uno::Reference< lang::XMultiServiceFactory > getServiceFactory() const - { return m_xFac; } - - uno::Reference< ucb::XContentIdentifierFactory > - getContentIdentifierFactory(); - uno::Reference< ucb::XContentProvider > - getContentProvider(); - - static OUString m_aProtocol; -}; - -// static -OUString Ucb::m_aProtocol; - - -Ucb::Ucb( uno::Reference< lang::XMultiServiceFactory >& rxFactory, - OUString const & rConfigurationKey1, - OUString const & rConfigurationKey2 ) -: m_xFac( rxFactory ), - m_aConfigurationKey1( rConfigurationKey1 ), - m_aConfigurationKey2( rConfigurationKey2 ), - m_bInited( sal_False ) -{ -} - - -Ucb::~Ucb() -{ -} - - -sal_Bool Ucb::init() -{ - if ( m_bInited ) - return sal_True; - - // Create auto configured UCB: - if (m_xFac.is()) - try - { - uno::Sequence< uno::Any > aArgs(2); - aArgs[0] <<= m_aConfigurationKey1; - aArgs[1] <<= m_aConfigurationKey2; - - ::ucbhelper::ContentBroker::initialize( m_xFac, aArgs ); - m_xProv - = ::ucbhelper::ContentBroker::get()->getContentProviderInterface(); - - } - catch (uno::Exception const &) {} - - if (m_xProv.is()) - { - print("UCB initialized"); - uno::Reference< ucb::XContentProviderManager > xProvMgr( - m_xProv, uno::UNO_QUERY); - if (xProvMgr.is()) - { - print("Registered schemes:"); - uno::Sequence< ucb::ContentProviderInfo > - aInfos(xProvMgr->queryContentProviders()); - for (sal_Int32 i = 0; i < aInfos.getLength(); ++i) - { - OUString aText = " " + aInfos[i].Scheme; - print(aText); - } - } - } - else - print("Error initializing UCB"); - - m_bInited = m_xProv.is(); - return m_bInited; -} - - -uno::Reference< ucb::XContentIdentifierFactory > -Ucb::getContentIdentifierFactory() -{ - if ( !m_xIdFac.is() ) - { - if ( init() ) - m_xIdFac = uno::Reference< ucb::XContentIdentifierFactory >( - m_xProv, uno::UNO_QUERY ); - } - - return m_xIdFac; -} - - -uno::Reference< ucb::XContentProvider > Ucb::getContentProvider() -{ - if ( !m_xProv.is() ) - init(); - - return m_xProv; -} - -/*======================================================================== - * - * UcbTaskEnvironment. - * ... etc. - the rest is truncated _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits