diff options
-rw-r--r-- | sw/inc/doc.hxx | 12 | ||||
-rw-r--r-- | sw/inc/docsh.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/crsr/findattr.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/crsr/findcoll.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/crsr/findtxt.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/doc/DocumentStateManager.cxx | 12 | ||||
-rw-r--r-- | sw/source/core/swg/SwXMLTextBlocks.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/txtnode/txtatr2.cxx | 8 | ||||
-rw-r--r-- | sw/source/filter/basflt/shellio.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/html/swhtml.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/app/docsh.cxx | 13 | ||||
-rw-r--r-- | sw/source/uibase/app/docshini.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/dochdl/swdtflvr.cxx | 4 |
13 files changed, 35 insertions, 44 deletions
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 1bbca5b19d23..e2966d200c89 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -250,10 +250,10 @@ class SW_DLLPUBLIC SwDoc : friend void _FinitCore(); // private Member - std::unique_ptr<SwNodes> m_pNodes; //< document content (Nodes Array) - SwAttrPool* mpAttrPool; //< the attribute pool - SwPageDescs m_PageDescs; //< PageDescriptors - Link<> maOle2Link; //< OLE 2.0-notification + std::unique_ptr<SwNodes> m_pNodes; //< document content (Nodes Array) + SwAttrPool* mpAttrPool; //< the attribute pool + SwPageDescs m_PageDescs; //< PageDescriptors + Link<bool,void> maOle2Link; //< OLE 2.0-notification /* @@@MAINTAINABILITY-HORROR@@@ Timer should not be members of the model */ @@ -1329,8 +1329,8 @@ public: ::sw::IShellCursorSupplier * GetIShellCursorSupplier(); // OLE 2.0-notification. - inline void SetOle2Link(const Link<>& rLink) {maOle2Link = rLink;} - inline const Link<>& GetOle2Link() const {return maOle2Link;} + inline void SetOle2Link(const Link<bool,void>& rLink) {maOle2Link = rLink;} + inline const Link<bool,void>& GetOle2Link() const {return maOle2Link;} // insert section (the ODF kind of section, not the nodesarray kind) SwSection * InsertSwSection(SwPaM const& rRange, SwSectionData &, diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx index cf35adc33234..097b85083927 100644 --- a/sw/inc/docsh.hxx +++ b/sw/inc/docsh.hxx @@ -174,7 +174,7 @@ public: virtual ~SwDocShell(); /// OLE 2.0-notification. - DECL_LINK( Ole2ModifiedHdl, void * ); + DECL_LINK_TYPED( Ole2ModifiedHdl, bool, void ); /// OLE-stuff. virtual void SetVisArea( const Rectangle &rRect ) SAL_OVERRIDE; diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx index a357a6164543..ff68ce97ccdb 100644 --- a/sw/source/core/crsr/findattr.cxx +++ b/sw/source/core/crsr/findattr.cxx @@ -1226,8 +1226,8 @@ sal_uLong SwCursor::Find( const SfxItemSet& rSet, bool bNoCollections, { // switch off OLE-notifications SwDoc* pDoc = GetDoc(); - Link<> aLnk( pDoc->GetOle2Link() ); - pDoc->SetOle2Link( Link<>() ); + Link<bool,void> aLnk( pDoc->GetOle2Link() ); + pDoc->SetOle2Link( Link<bool,void>() ); bool bReplace = ( pSearchOpt && ( !pSearchOpt->replaceString.isEmpty() || !rSet.Count() ) ) || diff --git a/sw/source/core/crsr/findcoll.cxx b/sw/source/core/crsr/findcoll.cxx index 762e53309f18..5523a25707c1 100644 --- a/sw/source/core/crsr/findcoll.cxx +++ b/sw/source/core/crsr/findcoll.cxx @@ -70,8 +70,8 @@ sal_uLong SwCursor::Find( const SwTextFormatColl& rFormatColl, SwDocPositions nS { // switch off OLE-notifications SwDoc* pDoc = GetDoc(); - Link<> aLnk( pDoc->GetOle2Link() ); - pDoc->SetOle2Link( Link<>() ); + Link<bool,void> aLnk( pDoc->GetOle2Link() ); + pDoc->SetOle2Link( Link<bool,void>() ); bool const bStartUndo = pDoc->GetIDocumentUndoRedo().DoesUndo() && pReplFormatColl; diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx index e859a995b06d..02952b45ec28 100644 --- a/sw/source/core/crsr/findtxt.cxx +++ b/sw/source/core/crsr/findtxt.cxx @@ -710,8 +710,8 @@ sal_uLong SwCursor::Find( const SearchOptions& rSearchOpt, bool bSearchInNotes, { // switch off OLE-notifications SwDoc* pDoc = GetDoc(); - Link<> aLnk( pDoc->GetOle2Link() ); - pDoc->SetOle2Link( Link<>() ); + Link<bool,void> aLnk( pDoc->GetOle2Link() ); + pDoc->SetOle2Link( Link<bool,void>() ); bool const bStartUndo = pDoc->GetIDocumentUndoRedo().DoesUndo() && bReplace; if (bStartUndo) diff --git a/sw/source/core/doc/DocumentStateManager.cxx b/sw/source/core/doc/DocumentStateManager.cxx index 0401fa607d73..ec6286afcea5 100644 --- a/sw/source/core/doc/DocumentStateManager.cxx +++ b/sw/source/core/doc/DocumentStateManager.cxx @@ -40,16 +40,12 @@ DocumentStateManager::DocumentStateManager( SwDoc& i_rSwdoc ) : void DocumentStateManager::SetModified() { m_rDoc.GetDocumentLayoutManager().ClearSwLayouterEntries(); - // give the old and new modified state to the link - // Bit 0: -> old state - // Bit 1: -> new state - sal_IntPtr nCall = mbModified ? 3 : 2; mbModified = true; m_rDoc.GetDocumentStatisticsManager().GetDocStat().bModified = true; if( m_rDoc.GetOle2Link().IsSet() ) { mbInCallModified = true; - m_rDoc.GetOle2Link().Call( reinterpret_cast<void*>(nCall) ); + m_rDoc.GetOle2Link().Call( true ); mbInCallModified = false; } @@ -62,14 +58,14 @@ void DocumentStateManager::ResetModified() // give the old and new modified state to the link // Bit 0: -> old state // Bit 1: -> new state - sal_IntPtr nCall = mbModified ? 1 : 0; + bool bOldModified = mbModified; mbModified = false; m_rDoc.GetDocumentStatisticsManager().GetDocStat().bModified = false; m_rDoc.GetIDocumentUndoRedo().SetUndoNoModifiedPosition(); - if( nCall && m_rDoc.GetOle2Link().IsSet() ) + if( bOldModified && m_rDoc.GetOle2Link().IsSet() ) { mbInCallModified = true; - m_rDoc.GetOle2Link().Call( reinterpret_cast<void*>(nCall) ); + m_rDoc.GetOle2Link().Call( false ); mbInCallModified = false; } } diff --git a/sw/source/core/swg/SwXMLTextBlocks.cxx b/sw/source/core/swg/SwXMLTextBlocks.cxx index c1d678eca5f6..bae58e4439d1 100644 --- a/sw/source/core/swg/SwXMLTextBlocks.cxx +++ b/sw/source/core/swg/SwXMLTextBlocks.cxx @@ -68,7 +68,7 @@ SwXMLTextBlocks::SwXMLTextBlocks( const OUString& rFile ) bReadOnly = true; pDoc = pDocSh->GetDoc(); xDocShellRef = pDocSh; - pDoc->SetOle2Link( Link<>() ); + pDoc->SetOle2Link( Link<bool,void>() ); pDoc->GetIDocumentUndoRedo().DoUndo(false); pDoc->acquire(); uno::Reference< embed::XStorage > refStg; @@ -114,7 +114,7 @@ SwXMLTextBlocks::SwXMLTextBlocks( const uno::Reference < embed::XStorage >& rStg bReadOnly = false; pDoc = pDocSh->GetDoc(); xDocShellRef = pDocSh; - pDoc->SetOle2Link( Link<>() ); + pDoc->SetOle2Link( Link<bool,void>() ); pDoc->GetIDocumentUndoRedo().DoUndo(false); pDoc->acquire(); diff --git a/sw/source/core/txtnode/txtatr2.cxx b/sw/source/core/txtnode/txtatr2.cxx index 34483d974781..e9bbcc449a2a 100644 --- a/sw/source/core/txtnode/txtatr2.cxx +++ b/sw/source/core/txtnode/txtatr2.cxx @@ -141,11 +141,11 @@ SwCharFormat* SwTextINetFormat::GetCharFormat() // JP 10.02.2000, Bug 72806: dont modify the doc for getting the // correct charstyle. bool bResetMod = !pDoc->getIDocumentState().IsModified(); - Link<> aOle2Lnk; + Link<bool,void> aOle2Lnk; if ( bResetMod ) { aOle2Lnk = pDoc->GetOle2Link(); - pDoc->SetOle2Link( Link<>() ); + pDoc->SetOle2Link( Link<bool,void>() ); } pRet = IsPoolUserFormat( nId ) @@ -263,11 +263,11 @@ SwCharFormat* SwTextRuby::GetCharFormat() // JP 10.02.2000, Bug 72806: dont modify the doc for getting the // correct charstyle. const bool bResetMod = !pDoc->getIDocumentState().IsModified(); - Link<> aOle2Lnk; + Link<bool,void> aOle2Lnk; if( bResetMod ) { aOle2Lnk = pDoc->GetOle2Link(); - const_cast<SwDoc*>(pDoc)->SetOle2Link( Link<>() ); + const_cast<SwDoc*>(pDoc)->SetOle2Link( Link<bool,void>() ); } pRet = IsPoolUserFormat( nId ) diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx index 33573cc01cc5..f5dc13a5e8af 100644 --- a/sw/source/filter/basflt/shellio.cxx +++ b/sw/source/filter/basflt/shellio.cxx @@ -87,8 +87,8 @@ sal_uLong SwReader::Read( const Reader& rOptions ) GetDoc(); // while reading, do not call OLE-Modified - Link<> aOLELink( pDoc->GetOle2Link() ); - pDoc->SetOle2Link( Link<>() ); + Link<bool,void> aOLELink( pDoc->GetOle2Link() ); + pDoc->SetOle2Link( Link<bool,void>() ); pDoc->SetInReading( true ); pDoc->SetInXMLImport( 0 != dynamic_cast< XMLReader* >(po) ); @@ -503,7 +503,7 @@ SwDoc* Reader::GetTemplateDoc() if( pDocSh->DoInitNew( 0 ) ) { pTemplate = pDocSh->GetDoc(); - pTemplate->SetOle2Link( Link<>() ); + pTemplate->SetOle2Link( Link<bool,void>() ); // always FALSE pTemplate->GetIDocumentUndoRedo().DoUndo( false ); pTemplate->getIDocumentSettingAccess().set(DocumentSettingId::BROWSE_MODE, bTmplBrowseMode ); diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 22ede3aa4995..4514f5ce9c73 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -605,8 +605,8 @@ void SwHTMLParser::Continue( int nToken ) } // waehrend des einlesens kein OLE-Modified rufen - Link<> aOLELink( pDoc->GetOle2Link() ); - pDoc->SetOle2Link( Link<>() ); + Link<bool,void> aOLELink( pDoc->GetOle2Link() ); + pDoc->SetOle2Link( Link<bool,void>() ); bool bModified = pDoc->getIDocumentState().IsModified(); bool const bWasUndo = pDoc->GetIDocumentUndoRedo().DoesUndo(); diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx index e1237d3c1a69..8b94f66b50f9 100644 --- a/sw/source/uibase/app/docsh.cxx +++ b/sw/source/uibase/app/docsh.cxx @@ -482,8 +482,8 @@ bool SwDocShell::SaveAs( SfxMedium& rMedium ) // (for OLE; after Statement from MM) const bool bIsModified = m_pDoc->getIDocumentState().IsModified(); m_pDoc->GetIDocumentUndoRedo().LockUndoNoModifiedPosition(); - Link<> aOldOLELnk( m_pDoc->GetOle2Link() ); - m_pDoc->SetOle2Link( Link<>() ); + Link<bool,void> aOldOLELnk( m_pDoc->GetOle2Link() ); + m_pDoc->SetOle2Link( Link<bool,void>() ); // Suppress SfxProgress when we are Embedded SW_MOD()->SetEmbeddedLoadSave( @@ -1069,15 +1069,10 @@ void SwDocShell::GetState(SfxItemSet& rSet) } // OLE-Hdls -IMPL_LINK( SwDocShell, Ole2ModifiedHdl, void *, p ) +IMPL_LINK_TYPED( SwDocShell, Ole2ModifiedHdl, bool, bNewStatus, void ) { - // the Status is handed over from Doc (see doc.cxx) - // Bit 0: -> old state - // Bit 1: -> new state - sal_IntPtr nStatus = reinterpret_cast<sal_IntPtr>(p); if( IsEnableSetModified() ) - SetModified( (nStatus & 2) != 0 ); - return 0; + SetModified( bNewStatus ); } // return Pool here, because virtual diff --git a/sw/source/uibase/app/docshini.cxx b/sw/source/uibase/app/docshini.cxx index 70f2c0faa973..a42dde3761ec 100644 --- a/sw/source/uibase/app/docshini.cxx +++ b/sw/source/uibase/app/docshini.cxx @@ -464,7 +464,7 @@ void SwDocShell::RemoveLink() m_xBasePool.clear(); } sal_Int8 nRefCt = static_cast< sal_Int8 >(m_pDoc->release()); - m_pDoc->SetOle2Link(Link<>()); + m_pDoc->SetOle2Link(Link<bool,void>()); m_pDoc->SetDocShell( 0 ); if( !nRefCt ) delete m_pDoc; diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index 21aa11fdbb70..142b02e54eb2 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -3773,8 +3773,8 @@ void SwTrnsfrDdeLink::Disconnect( bool bRemoveDataAdvise ) ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo()); // #i58448# - Link<> aSavedOle2Link( pDoc->GetOle2Link() ); - pDoc->SetOle2Link( Link<>() ); + Link<bool,void> aSavedOle2Link( pDoc->GetOle2Link() ); + pDoc->SetOle2Link( Link<bool,void>() ); bool bIsModified = pDoc->getIDocumentState().IsModified(); |