sw/inc/PostItMgr.hxx                      |   41 ------------------------------
 sw/source/uibase/docvw/AnnotationWin2.cxx |    3 +-
 sw/source/uibase/docvw/PostItMgr.cxx      |    9 ------
 3 files changed, 3 insertions(+), 50 deletions(-)

New commits:
commit fb443c6d4d210d73795bdb3b7cb392765726f3a1
Author:     Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>
AuthorDate: Thu Jan 4 15:04:06 2024 +0100
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>
CommitDate: Thu Jan 11 12:44:39 2024 +0100

    Use officecfg instead of utl::ConfigItem
    
    Change-Id: If6fa84bcdb56873df288d216b157ad669c45bca1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161622
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>

diff --git a/sw/inc/PostItMgr.hxx b/sw/inc/PostItMgr.hxx
index 510a4fa55a2a..ec6604c43a23 100644
--- a/sw/inc/PostItMgr.hxx
+++ b/sw/inc/PostItMgr.hxx
@@ -82,45 +82,6 @@ struct FieldShadowState
     }
 };
 
-class SwNoteProps final : public utl::ConfigItem
-{
-    private:
-        bool m_bIsShowAnchor;
-
-        virtual void ImplCommit() override;
-
-    public:
-        SwNoteProps()
-            : ConfigItem("Office.Writer/Notes")
-            , m_bIsShowAnchor(false)
-        {
-            const css::uno::Sequence< OUString >& rNames = GetPropertyNames();
-            css::uno::Sequence< css::uno::Any > aValues = 
GetProperties(rNames);
-            const css::uno::Any* pValues = aValues.getConstArray();
-            SAL_WARN_IF(aValues.getLength() != rNames.getLength(), "sw", 
"GetProperties failed");
-            if (aValues.hasElements())
-                    pValues[0]>>=m_bIsShowAnchor;
-        }
-
-        bool IsShowAnchor() const
-        {
-            return m_bIsShowAnchor;
-        }
-        static css::uno::Sequence< OUString >& GetPropertyNames()
-        {
-            static css::uno::Sequence< OUString > aNames;
-            if(!aNames.hasElements())
-            {
-                aNames.realloc(1);
-                OUString* pNames = aNames.getArray();
-                pNames[0] = "ShowAnkor";
-            }
-            return aNames;
-        }
-
-    virtual void Notify( const css::uno::Sequence< OUString >& aPropertyNames 
) override;
-};
-
 class SAL_DLLPUBLIC_RTTI SwPostItMgr final : public SfxListener
 {
     private:
@@ -140,7 +101,6 @@ class SAL_DLLPUBLIC_RTTI SwPostItMgr final : public 
SfxListener
         FieldShadowState                mShadowState;
         std::optional<OutlinerParaObject> mpAnswer;
         OUString                        maAnswerText;
-        bool                            mbIsShowAnchor;
 
         // data structure to collect the <SwAnnotationWin> instances for 
certain <SwFrame> instances.
         std::unique_ptr<sw::sidebarwindows::SwFrameSidebarWinContainer> 
mpFrameSidebarWinContainer;
@@ -190,7 +150,6 @@ class SAL_DLLPUBLIC_RTTI SwPostItMgr final : public 
SfxListener
         bool ShowScrollbar(const tools::ULong aPage) const;
         bool HasNotes() const ;
         bool ShowNotes() const;
-        bool IsShowAnchor() const { return mbIsShowAnchor;}
         void SetSidebarWidth(sal_uInt16 nPx);
         tools::ULong GetSidebarWidth(bool bPx = false) const;
         tools::ULong GetSidebarBorderWidth(bool bPx = false) const;
diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx 
b/sw/source/uibase/docvw/AnnotationWin2.cxx
index e3bc460d941c..5588b9cc2644 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -79,6 +79,7 @@
 
 #include <drawinglayer/processor2d/baseprocessor2d.hxx>
 #include <drawinglayer/processor2d/processor2dtools.hxx>
+#include <officecfg/Office/Writer.hxx>
 #include <osl/diagnose.h>
 #include <unotools/localedatawrapper.hxx>
 #include <unotools/syslocale.hxx>
@@ -953,7 +954,7 @@ void SwAnnotationWin::HideNote()
         Window::Hide();
     if (mpAnchor)
     {
-        if (mrMgr.IsShowAnchor())
+        if (officecfg::Office::Writer::Notes::ShowAnkor::get())
             mpAnchor->SetAnchorState(AnchorState::Tri);
         else
             mpAnchor->setVisible(false);
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx 
b/sw/source/uibase/docvw/PostItMgr.cxx
index e50641a9176e..24abcc14a2a5 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -56,7 +56,6 @@
 #include <SwRewriter.hxx>
 #include <tools/color.hxx>
 #include <unotools/datetime.hxx>
-#include <officecfg/Office/Writer.hxx>
 
 #include <swmodule.hxx>
 #include <strings.hrc>
@@ -77,6 +76,7 @@
 
 #include <comphelper/lok.hxx>
 #include <comphelper/string.hxx>
+#include <officecfg/Office/Writer.hxx>
 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
 
 #include <annotsh.hxx>
@@ -205,14 +205,10 @@ SwPostItMgr::SwPostItMgr(SwView* pView)
     , mbLayouting(false)
     , mbReadOnly(mpView->GetDocShell()->IsReadOnly())
     , mbDeleteNote(true)
-    , mbIsShowAnchor( false )
 {
     if(!mpView->GetDrawView() )
         mpView->GetWrtShell().MakeDrawView();
 
-    SwNoteProps aProps;
-    mbIsShowAnchor = aProps.IsShowAnchor();
-
     //make sure we get the colour yellow always, even if not the first one of 
comments or redlining
     SW_MOD()->GetRedlineAuthor();
 
@@ -2548,7 +2544,4 @@ void SwPostItMgr::UpdateResolvedStatus(const 
sw::annotation::SwAnnotationWin* to
     }
 }
 
-void SwNoteProps::ImplCommit() {}
-void SwNoteProps::Notify( const css::uno::Sequence< OUString >& ) {}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Reply via email to