diff options
author | Valentin Kettner <vakevk+libreoffice@gmail.com> | 2014-07-16 22:19:33 +0200 |
---|---|---|
committer | Valentin Kettner <vakevk+libreoffice@gmail.com> | 2014-08-12 23:26:36 +0200 |
commit | 274f1811b92b870b8d450423d9b280b0889ca130 (patch) | |
tree | 3a917bc576cc1ae8fdcc02074da08696e475a6ce /sw/source/uibase/uno | |
parent | b513f288275ae96f55e232f07bf94294c66e95a1 (diff) |
Refactored IDocumentRedlineAccess out of SwDoc.
Into the new class DocumentRedlineManager.
Added an non const version of GetRedlineTbl to the interface.
Also Moved SetAutoFmtRedlineComment which is not part of interface.
Change-Id: I600d5821d5d5831557f5fc5375fb1203fe67a295
Diffstat (limited to 'sw/source/uibase/uno')
-rw-r--r-- | sw/source/uibase/uno/SwXDocumentSettings.cxx | 9 | ||||
-rw-r--r-- | sw/source/uibase/uno/unoatxt.cxx | 5 | ||||
-rw-r--r-- | sw/source/uibase/uno/unotxdoc.cxx | 21 |
3 files changed, 19 insertions, 16 deletions
diff --git a/sw/source/uibase/uno/SwXDocumentSettings.cxx b/sw/source/uibase/uno/SwXDocumentSettings.cxx index b515077f484b..c8494ac4a1fe 100644 --- a/sw/source/uibase/uno/SwXDocumentSettings.cxx +++ b/sw/source/uibase/uno/SwXDocumentSettings.cxx @@ -28,6 +28,7 @@ #include <doc.hxx> #include <IDocumentSettingAccess.hxx> #include <IDocumentDeviceAccess.hxx> +#include <IDocumentRedlineAccess.hxx> #include <docsh.hxx> #include <fldupde.hxx> #include <linkenum.hxx> @@ -594,12 +595,12 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf Sequence <sal_Int8> aNew; if(rValue >>= aNew) { - mpDoc->SetRedlinePassword(aNew); + mpDoc->getIDocumentRedlineAccess().SetRedlinePassword(aNew); if(aNew.getLength()) { - sal_uInt16 eMode = mpDoc->GetRedlineMode(); + sal_uInt16 eMode = mpDoc->getIDocumentRedlineAccess().GetRedlineMode(); eMode = eMode|nsRedlineMode_t::REDLINE_ON; - mpDoc->SetRedlineMode((RedlineMode_t)( eMode )); + mpDoc->getIDocumentRedlineAccess().SetRedlineMode((RedlineMode_t)( eMode )); } } } @@ -1041,7 +1042,7 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf break; case HANDLE_CHANGES_PASSWORD: { - rValue <<= mpDoc->GetRedlinePassword(); + rValue <<= mpDoc->getIDocumentRedlineAccess().GetRedlinePassword(); } break; case HANDLE_CONSIDER_WRAP_ON_OBJPOS: diff --git a/sw/source/uibase/uno/unoatxt.cxx b/sw/source/uibase/uno/unoatxt.cxx index 5c640246a362..0c98fc4aafb5 100644 --- a/sw/source/uibase/uno/unoatxt.cxx +++ b/sw/source/uibase/uno/unoatxt.cxx @@ -40,6 +40,7 @@ #include <unocrsr.hxx> #include <IMark.hxx> #include <IDocumentContentOperations.hxx> +#include <IDocumentRedlineAccess.hxx> #include <unoprnms.hxx> #include <docsh.hxx> #include <swmodule.hxx> @@ -409,9 +410,9 @@ uno::Reference< text::XAutoTextEntry > SwXAutoTextGroup::insertNewByName(const pGlosGroup->ClearDoc(); if( pGlosGroup->BeginPutDoc( sShortName, sLongName ) ) { - pGDoc->SetRedlineMode_intern( nsRedlineMode_t::REDLINE_DELETE_REDLINES ); + pGDoc->getIDocumentRedlineAccess().SetRedlineMode_intern( nsRedlineMode_t::REDLINE_DELETE_REDLINES ); lcl_CopySelToDoc( pGDoc, pxCursor, pxRange ); - pGDoc->SetRedlineMode_intern((RedlineMode_t)( 0 )); + pGDoc->getIDocumentRedlineAccess().SetRedlineMode_intern((RedlineMode_t)( 0 )); nRet = pGlosGroup->PutDoc(); } } diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 1dc5f54656d8..9c78bdc5c014 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -99,6 +99,7 @@ #include <IDocumentDrawModelAccess.hxx> #include <IDocumentChartDataProviderAccess.hxx> #include <IDocumentLinksAdministration.hxx> +#include <IDocumentRedlineAccess.hxx> #include <editeng/forbiddencharacterstable.hxx> #include <svl/zforlist.hxx> #include <drawdoc.hxx> @@ -1848,7 +1849,7 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName, const Any& case WID_DOC_CHANGES_SHOW: { bool bSet = *(sal_Bool*)aValue.getValue(); - sal_uInt16 eMode = pDocShell->GetDoc()->GetRedlineMode(); + sal_uInt16 eMode = pDocShell->GetDoc()->getIDocumentRedlineAccess().GetRedlineMode(); if(WID_DOC_CHANGES_SHOW == pEntry->nWID) { eMode &= ~(nsRedlineMode_t::REDLINE_SHOW_INSERT | nsRedlineMode_t::REDLINE_SHOW_DELETE); @@ -1860,7 +1861,7 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName, const Any& { eMode = bSet ? eMode|nsRedlineMode_t::REDLINE_ON : eMode&~nsRedlineMode_t::REDLINE_ON; } - pDocShell->GetDoc()->SetRedlineMode( (RedlineMode_t)(eMode )); + pDocShell->GetDoc()->getIDocumentRedlineAccess().SetRedlineMode( (RedlineMode_t)(eMode )); } break; case WID_DOC_CHANGES_PASSWORD: @@ -1869,12 +1870,12 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName, const Any& if(aValue >>= aNew) { SwDoc* pDoc = pDocShell->GetDoc(); - pDoc->SetRedlinePassword(aNew); + pDoc->getIDocumentRedlineAccess().SetRedlinePassword(aNew); if(aNew.getLength()) { - sal_uInt16 eMode = pDoc->GetRedlineMode(); + sal_uInt16 eMode = pDoc->getIDocumentRedlineAccess().GetRedlineMode(); eMode = eMode|nsRedlineMode_t::REDLINE_ON; - pDoc->SetRedlineMode( (RedlineMode_t)(eMode )); + pDoc->getIDocumentRedlineAccess().SetRedlineMode( (RedlineMode_t)(eMode )); } } } @@ -1891,7 +1892,7 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName, const Any& break; case WID_DOC_REDLINE_DISPLAY: { - sal_Int16 eRedMode = pDocShell->GetDoc()->GetRedlineMode(); + sal_Int16 eRedMode = pDocShell->GetDoc()->getIDocumentRedlineAccess().GetRedlineMode(); eRedMode = eRedMode & (~nsRedlineMode_t::REDLINE_SHOW_MASK); sal_Int16 nSet = 0; aValue >>= nSet; @@ -1905,7 +1906,7 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName, const Any& break; default: throw IllegalArgumentException(); } - pDocShell->GetDoc()->SetRedlineMode(eRedMode); + pDocShell->GetDoc()->getIDocumentRedlineAccess().SetRedlineMode(eRedMode); } break; case WID_DOC_TWO_DIGIT_YEAR: @@ -2032,7 +2033,7 @@ Any SwXTextDocument::getPropertyValue(const OUString& rPropertyName) case WID_DOC_CHANGES_RECORD: case WID_DOC_CHANGES_SHOW: { - const sal_uInt16 eMode = pDocShell->GetDoc()->GetRedlineMode(); + const sal_uInt16 eMode = pDocShell->GetDoc()->getIDocumentRedlineAccess().GetRedlineMode(); bool bSet = false; if(WID_DOC_CHANGES_SHOW == pEntry->nWID) { @@ -2050,7 +2051,7 @@ Any SwXTextDocument::getPropertyValue(const OUString& rPropertyName) case WID_DOC_CHANGES_PASSWORD: { SwDoc* pDoc = pDocShell->GetDoc(); - aAny <<= pDoc->GetRedlinePassword(); + aAny <<= pDoc->getIDocumentRedlineAccess().GetRedlinePassword(); } break; case WID_DOC_AUTO_MARK_URL : @@ -2064,7 +2065,7 @@ Any SwXTextDocument::getPropertyValue(const OUString& rPropertyName) break; case WID_DOC_REDLINE_DISPLAY: { - sal_Int16 eRedMode = pDocShell->GetDoc()->GetRedlineMode(); + sal_Int16 eRedMode = pDocShell->GetDoc()->getIDocumentRedlineAccess().GetRedlineMode(); eRedMode = eRedMode & nsRedlineMode_t::REDLINE_SHOW_MASK; sal_Int16 nRet = RedlineDisplayType::NONE; if(nsRedlineMode_t::REDLINE_SHOW_INSERT == eRedMode) |