diff options
-rw-r--r-- | compilerplugins/clang/mergeclasses.results | 1 | ||||
-rw-r--r-- | editeng/source/editeng/eertfpar.cxx | 2 | ||||
-rw-r--r-- | editeng/source/editeng/eertfpar.hxx | 19 | ||||
-rw-r--r-- | editeng/source/rtf/svxrtf.cxx | 8 | ||||
-rw-r--r-- | include/editeng/svxrtf.hxx | 31 |
5 files changed, 25 insertions, 36 deletions
diff --git a/compilerplugins/clang/mergeclasses.results b/compilerplugins/clang/mergeclasses.results index 2f84a3da9eb9..2a09a6a8964a 100644 --- a/compilerplugins/clang/mergeclasses.results +++ b/compilerplugins/clang/mergeclasses.results @@ -75,7 +75,6 @@ merge SfxUndoListener with framework::UndoManagerHelper_Impl merge StarSymbolToMSMultiFont with StarSymbolToMSMultiFontImpl merge StgReader with WW8Reader merge SvListView with SvTreeListBox -merge SvxPosition with EditPosition merge SvxShapeMaster with SdXShape merge SvxUnoDrawMSFactory with SvxFmMSFactory merge SwXParaFrameEnumeration with SwXParaFrameEnumerationImpl diff --git a/editeng/source/editeng/eertfpar.cxx b/editeng/source/editeng/eertfpar.cxx index 44491edea3a6..3a28f1801d1c 100644 --- a/editeng/source/editeng/eertfpar.cxx +++ b/editeng/source/editeng/eertfpar.cxx @@ -615,7 +615,7 @@ EditNodeIdx* EditNodeIdx::Clone() const EditPosition::EditPosition(EditEngine* pEE, EditSelection* pSel) : mpEditEngine(pEE), mpCurSel(pSel) {} -SvxPosition* EditPosition::Clone() const +EditPosition* EditPosition::Clone() const { return new EditPosition(mpEditEngine, mpCurSel); } diff --git a/editeng/source/editeng/eertfpar.hxx b/editeng/source/editeng/eertfpar.hxx index b0a577cff97d..bcbbf5d71dcd 100644 --- a/editeng/source/editeng/eertfpar.hxx +++ b/editeng/source/editeng/eertfpar.hxx @@ -26,26 +26,7 @@ class EditEngine; -class EditPosition : public SvxPosition -{ -private: - EditEngine* mpEditEngine; - EditSelection* mpCurSel; - -public: - EditPosition(EditEngine* pIEE, EditSelection* pSel); - - virtual sal_Int32 GetNodeIdx() const SAL_OVERRIDE; - virtual sal_Int32 GetCntIdx() const SAL_OVERRIDE; - - // clone - virtual SvxPosition* Clone() const SAL_OVERRIDE; - - // clone NodeIndex - virtual EditNodeIdx* MakeNodeIdx() const SAL_OVERRIDE; -}; -#define ACTION_INSERTTEXT 1 #define ACTION_INSERTPARABRK 2 class EditRTFParser : public SvxRTFParser diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx index 1f8349cf0c10..653c44ced022 100644 --- a/editeng/source/rtf/svxrtf.cxx +++ b/editeng/source/rtf/svxrtf.cxx @@ -99,7 +99,7 @@ SvxRTFParser::~SvxRTFParser() delete pDfltColor; } -void SvxRTFParser::SetInsPos( const SvxPosition& rNew ) +void SvxRTFParser::SetInsPos( const EditPosition& rNew ) { delete pInsPos; pInsPos = rNew.Clone(); @@ -1137,7 +1137,7 @@ SvxRTFStyleType::SvxRTFStyleType( SfxItemPool& rPool, const sal_uInt16* pWhichRa SvxRTFItemStackType::SvxRTFItemStackType( SfxItemPool& rPool, const sal_uInt16* pWhichRange, - const SvxPosition& rPos ) + const EditPosition& rPos ) : aAttrSet( rPool, pWhichRange ) , m_pChildList( nullptr ) , nStyleNo( 0 ) @@ -1150,7 +1150,7 @@ SvxRTFItemStackType::SvxRTFItemStackType( SvxRTFItemStackType::SvxRTFItemStackType( const SvxRTFItemStackType& rCpy, - const SvxPosition& rPos, + const EditPosition& rPos, bool const bCopyAttr ) : aAttrSet( *rCpy.aAttrSet.GetPool(), rCpy.aAttrSet.GetRanges() ) , m_pChildList( nullptr ) @@ -1182,7 +1182,7 @@ void SvxRTFItemStackType::Add(std::unique_ptr<SvxRTFItemStackType> pIns) m_pChildList->push_back(std::move(pIns)); } -void SvxRTFItemStackType::SetStartPos( const SvxPosition& rPos ) +void SvxRTFItemStackType::SetStartPos( const EditPosition& rPos ) { if (pSttNd != pEndNd) delete pEndNd; diff --git a/include/editeng/svxrtf.hxx b/include/editeng/svxrtf.hxx index b0d257b3995d..efd406391143 100644 --- a/include/editeng/svxrtf.hxx +++ b/include/editeng/svxrtf.hxx @@ -69,18 +69,27 @@ private: ContentNode* mpNode; }; -class SvxPosition +class EditSelection; +class EditPosition { +private: + EditEngine* mpEditEngine; + EditSelection* mpCurSel; + public: - virtual ~SvxPosition() {} + EditPosition(EditEngine* pIEE, EditSelection* pSel); + + sal_Int32 GetNodeIdx() const; + sal_Int32 GetCntIdx() const; - virtual sal_Int32 GetNodeIdx() const = 0; - virtual sal_Int32 GetCntIdx() const = 0; + // clone + EditPosition* Clone() const; - virtual SvxPosition* Clone() const = 0; // Cloning itself - virtual EditNodeIdx* MakeNodeIdx() const = 0; // Cloning NodeIndex + // clone NodeIndex + EditNodeIdx* MakeNodeIdx() const; }; +#define ACTION_INSERTTEXT 1 typedef std::map<short, std::unique_ptr<vcl::Font>> SvxRTFFontTbl; typedef std::map<sal_uInt16, std::unique_ptr<SvxRTFStyleType>> SvxRTFStyleTbl; @@ -187,7 +196,7 @@ class EDITENG_DLLPUBLIC SvxRTFParser : public SvRTFParser std::vector<sal_uInt16> aWhichMap; OUString sBaseURL; - SvxPosition* pInsPos; + EditPosition* pInsPos; SfxItemPool* pAttrPool; Color* pDfltColor; vcl::Font* pDfltFont; @@ -295,7 +304,7 @@ protected: void SetCalcValue( bool bFlag ) { bCalcValue = bFlag; } // Query/Set the current insert position - void SetInsPos( const SvxPosition& rNew ); + void SetInsPos( const EditPosition& rNew ); SvxRTFStyleTbl& GetStyleTbl() { return m_StyleTable; } public: @@ -340,19 +349,19 @@ class EDITENG_DLLPUBLIC SvxRTFItemStackType void operator=(SvxRTFItemStackType const&) = delete; SvxRTFItemStackType( SfxItemPool&, const sal_uInt16* pWhichRange, - const SvxPosition& ); + const EditPosition& ); void Add(std::unique_ptr<SvxRTFItemStackType>); void Compress( const SvxRTFParser& ); public: - SvxRTFItemStackType( const SvxRTFItemStackType&, const SvxPosition&, + SvxRTFItemStackType( const SvxRTFItemStackType&, const EditPosition&, bool bCopyAttr = false ); ~SvxRTFItemStackType(); //cmc, I'm very suspicios about SetStartPos, it doesn't change //its children's starting position, and the implementation looks //bad, consider this deprecated. - void SetStartPos( const SvxPosition& rPos ); + void SetStartPos( const EditPosition& rPos ); void MoveFullNode(const EditNodeIdx &rOldNode, const EditNodeIdx &rNewNode); |