[Libreoffice-commits] core.git: officecfg/registry sw/inc sw/source sw/uiconfig

heiko tietze tietze.heiko at gmail.com
Mon Jan 22 12:34:28 UTC 2018


 officecfg/registry/schema/org/openoffice/Office/Writer.xcs |    8 +++
 sw/inc/IDocumentRedlineAccess.hxx                          |    3 +
 sw/inc/modcfg.hxx                                          |   21 ++++++----
 sw/source/core/crsr/crstrvl.cxx                            |    5 ++
 sw/source/core/doc/DocumentRedlineManager.cxx              |   10 ++++
 sw/source/core/edit/edredln.cxx                            |   11 ++++-
 sw/source/core/inc/DocumentRedlineManager.hxx              |    4 +
 sw/source/ui/config/optpage.cxx                            |   13 +++++-
 sw/source/uibase/config/modcfg.cxx                         |   27 ++++++-------
 sw/source/uibase/inc/optpage.hxx                           |    2 
 sw/uiconfig/swriter/ui/optredlinepage.ui                   |   16 +++++++
 11 files changed, 96 insertions(+), 24 deletions(-)

New commits:
commit 86e3f95cff4d3dad48d64e50e0c4b05034fa7064
Author: heiko tietze <tietze.heiko at gmail.com>
Date:   Fri Dec 22 13:00:31 2017 +0100

    tdf#114523 Make inline tooltips for changes optional
    
    Tooltips on tracked changes are not shown when Show track changes
    is switched off; additional property introduced at Tools > Option >
    Writer > Changes to disable the inline tooltip completely
    
    Change-Id: I5b54895bb22d167a383b06627c69326c3c2f5b02
    Reviewed-on: https://gerrit.libreoffice.org/46971
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    Tested-by: Heiko Tietze <tietze.heiko at gmail.com>

diff --git a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
index 7a21b5bbd344..2b6465cdee93 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
@@ -2650,6 +2650,14 @@
           <value>0</value>
         </prop>
       </group>
+      <prop oor:name="ShowInlineTooltip" oor:type="xs:boolean" oor:nillable="false">
+        <!-- UIHints: Tools - Options - Text document - Changes - Show tooltips on changes -->
+        <info>
+          <desc>Specifies whether tooltips for track changes are shown in the document.</desc>
+          <label>Show _tooltips on changes</label>
+        </info>
+        <value>true</value>
+      </prop>
     </group>
     <group oor:name="Comparison">
       <info>
diff --git a/sw/inc/IDocumentRedlineAccess.hxx b/sw/inc/IDocumentRedlineAccess.hxx
index de115fac77e0..7ff58d456ca4 100644
--- a/sw/inc/IDocumentRedlineAccess.hxx
+++ b/sw/inc/IDocumentRedlineAccess.hxx
@@ -239,6 +239,9 @@ public:
     virtual void SetRedlinePassword(
         /*[in]*/const css::uno::Sequence <sal_Int8>& rNewPassword) = 0;
 
+    virtual bool IsHideInlineTooltips() = 0;
+    virtual void SetHideInlineTooltips(bool bSet) = 0;
+
 protected:
      virtual ~IDocumentRedlineAccess() {};
 };
diff --git a/sw/inc/modcfg.hxx b/sw/inc/modcfg.hxx
index 2091957eedf4..bd9fa3b25c70 100644
--- a/sw/inc/modcfg.hxx
+++ b/sw/inc/modcfg.hxx
@@ -65,14 +65,15 @@ class SwRevisionConfig : public utl::ConfigItem
 {
     friend class SwModuleOptions;
 
-    AuthorCharAttr  aInsertAttr;    //Revision/TextDisplay/Insert/Attribute  // Redlining: author character attributes
-                                    //Revision/TextDisplay/Insert/Color
-    AuthorCharAttr  aDeletedAttr;   //Revision/TextDisplay/Delete/Attribute
-                                    //Revision/TextDisplay/Delete/Color
-    AuthorCharAttr  aFormatAttr;    //Revision/TextDisplay/ChangeAttribute/Attribute
-                                    //Revision/TextDisplay/ChangeAttribute/Color
-    sal_uInt16          nMarkAlign;     //Revision/LinesChanged/Mark
-    Color           aMarkColor;     //Revision/LinesChanged/Color
+    AuthorCharAttr  aInsertAttr;        //Revision/TextDisplay/Insert/Attribute  // Redlining: author character attributes
+                                        //Revision/TextDisplay/Insert/Color
+    AuthorCharAttr  aDeletedAttr;       //Revision/TextDisplay/Delete/Attribute
+                                        //Revision/TextDisplay/Delete/Color
+    AuthorCharAttr  aFormatAttr;        //Revision/TextDisplay/ChangeAttribute/Attribute
+                                        //Revision/TextDisplay/ChangeAttribute/Color
+    sal_uInt16      nMarkAlign;         //Revision/LinesChanged/Mark
+    Color           aMarkColor;         //Revision/LinesChanged/Color
+    bool            bShowInlineTooltip; //ShowInlineTooltip
 
     static const css::uno::Sequence<OUString>& GetPropertyNames();
 
@@ -254,6 +255,10 @@ public:
     void        SetFormatAuthorAttr( AuthorCharAttr const &rAttr ) {  aRevisionConfig.aFormatAttr = rAttr;
                                                                       aRevisionConfig.SetModified();}
 
+    bool        IsShowInlineTooltip() const { return aRevisionConfig.bShowInlineTooltip; }
+    void        SetShowInlineTooltip( bool bSet ) {  aRevisionConfig.bShowInlineTooltip = bSet;
+                                                      aRevisionConfig.SetModified(); }
+
     sal_uInt16          GetMarkAlignMode()  const               { return aRevisionConfig.nMarkAlign; }
     void            SetMarkAlignMode(sal_uInt16 nMode)          { aRevisionConfig.nMarkAlign = nMode;
                                                               aRevisionConfig.SetModified();}
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index c55970bdfe1e..6f8b26f55c19 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -1116,6 +1116,11 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt,
     SET_CURR_SHELL( this );
     bool bRet = false;
 
+    const bool bHideInlineTooltips = GetDoc()->getIDocumentRedlineAccess().IsHideInlineTooltips();
+    const bool bShowTrackChanges = IDocumentRedlineAccess::IsShowChanges( GetDoc()->getIDocumentRedlineAccess().GetRedlineFlags() );
+
+    if (bHideInlineTooltips || !bShowTrackChanges) return bRet;
+
     if( !IsTableMode() )
     {
         Point aPt( rPt );
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx
index 6aad179ab11e..d43b5f1cb855 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -2717,6 +2717,16 @@ void DocumentRedlineManager::checkRedlining(RedlineFlags& _rReadlineMode)
     }
 }
 
+bool DocumentRedlineManager::IsHideInlineTooltips()
+{
+    return bHideInlineTooltips;
+}
+
+void DocumentRedlineManager::SetHideInlineTooltips(bool bSet)
+{
+    bHideInlineTooltips = bSet;
+}
+
 DocumentRedlineManager::~DocumentRedlineManager()
 {
 }
diff --git a/sw/source/core/edit/edredln.cxx b/sw/source/core/edit/edredln.cxx
index e99aa5c36ae3..eb1db63666e7 100644
--- a/sw/source/core/edit/edredln.cxx
+++ b/sw/source/core/edit/edredln.cxx
@@ -25,6 +25,7 @@
 #include <editsh.hxx>
 #include <edimp.hxx>
 #include <frmtool.hxx>
+#include <officecfg/Office/Writer.hxx>
 
 RedlineFlags SwEditShell::GetRedlineFlags() const
 {
@@ -130,7 +131,15 @@ void SwEditShell::UpdateRedlineAttr()
         SET_CURR_SHELL( this );
         StartAllAction();
 
-        GetDoc()->getIDocumentRedlineAccess().UpdateRedlineAttr();
+        // issue when the changes the inline option when IsShow is off
+        SwDoc& rDoc = *GetDoc();
+        bool bShowInlineTooltip = officecfg::Office::Writer::Revision::ShowInlineTooltip::get();
+        if (bShowInlineTooltip != rDoc.getIDocumentRedlineAccess().IsHideInlineTooltips() )
+        {
+           rDoc.getIDocumentRedlineAccess().SetHideInlineTooltips( bShowInlineTooltip );
+        }
+
+        rDoc.getIDocumentRedlineAccess().UpdateRedlineAttr();
 
         EndAllAction();
     }
diff --git a/sw/source/core/inc/DocumentRedlineManager.hxx b/sw/source/core/inc/DocumentRedlineManager.hxx
index 88487f8dbdc6..26c8050dbb2c 100644
--- a/sw/source/core/inc/DocumentRedlineManager.hxx
+++ b/sw/source/core/inc/DocumentRedlineManager.hxx
@@ -30,6 +30,8 @@ namespace sw
 
 class DocumentRedlineManager : public IDocumentRedlineAccess
 {
+    bool bHideInlineTooltips : 1;
+
 public:
     DocumentRedlineManager( SwDoc& i_rSwdoc );
 
@@ -111,6 +113,8 @@ public:
     virtual void SetRedlinePassword(
         /*[in]*/const css::uno::Sequence <sal_Int8>& rNewPassword) override;
 
+    virtual bool IsHideInlineTooltips() override;
+    virtual void SetHideInlineTooltips(bool bSet) override;
 
     //Non Interface methods;
 
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 9c856f4a8f55..e929ebf10901 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -32,6 +32,8 @@
 #include <docsh.hxx>
 #include <IDocumentDeviceAccess.hxx>
 #include <IDocumentSettingAccess.hxx>
+#include <IDocumentRedlineAccess.hxx>
+
 #include <swmodule.hxx>
 #include <wrtsh.hxx>
 #include <uitool.hxx>
@@ -1752,6 +1754,7 @@ SwRedlineOptionsTabPage::SwRedlineOptionsTabPage( vcl::Window* pParent,
     get(m_pMarkPosLB,"markpos");
     get(m_pMarkColorLB,"markcolor");
     get(m_pMarkPreviewWN,"markpreview");
+    get(m_pShowChangesTooltip,"changestooltip");
 
     m_pInsertedPreviewWN->set_height_request(aPreviewSize.Height());
     m_pDeletedPreviewWN->set_height_request(aPreviewSize.Height());
@@ -1810,6 +1813,7 @@ void SwRedlineOptionsTabPage::dispose()
     m_pMarkPosLB.clear();
     m_pMarkColorLB.clear();
     m_pMarkPreviewWN.clear();
+    m_pShowChangesTooltip.clear();
     SfxTabPage::dispose();
 }
 
@@ -1831,6 +1835,8 @@ bool SwRedlineOptionsTabPage::FillItemSet( SfxItemSet* )
     AuthorCharAttr aOldDeletedAttr(pOpt->GetDeletedAuthorAttr());
     AuthorCharAttr aOldChangedAttr(pOpt->GetFormatAuthorAttr());
 
+    const bool bOldShowInlineTooltips = pOpt->IsShowInlineTooltip();
+
     ColorData nOldMarkColor = pOpt->GetMarkAlignColor().GetColor();
     sal_uInt16 nOldMarkMode = pOpt->GetMarkAlignMode();
 
@@ -1874,14 +1880,15 @@ bool SwRedlineOptionsTabPage::FillItemSet( SfxItemSet* )
         case 4: nPos = text::HoriOrientation::INSIDE;     break;
     }
     pOpt->SetMarkAlignMode(nPos);
-
     pOpt->SetMarkAlignColor(m_pMarkColorLB->GetSelectEntryColor());
+    pOpt->SetShowInlineTooltip( m_pShowChangesTooltip->IsChecked() );
 
     if (!(aInsertedAttr == aOldInsertAttr) ||
         !(aDeletedAttr == aOldDeletedAttr) ||
         !(aChangedAttr == aOldChangedAttr) ||
        nOldMarkColor != pOpt->GetMarkAlignColor().GetColor() ||
-       nOldMarkMode != pOpt->GetMarkAlignMode())
+       nOldMarkMode != pOpt->GetMarkAlignMode() ||
+       bOldShowInlineTooltips != pOpt->IsShowInlineTooltip() )
     {
         // update all documents
         SwDocShell* pDocShell = static_cast<SwDocShell*>(SfxObjectShell::GetFirst(checkSfxObjectShell<SwDocShell>));
@@ -1920,6 +1927,8 @@ void SwRedlineOptionsTabPage::Reset( const SfxItemSet*  )
 
     m_pMarkColorLB->SelectEntry(pOpt->GetMarkAlignColor());
 
+    m_pShowChangesTooltip->Check( pOpt->IsShowInlineTooltip() );
+
     m_pInsertLB->SelectEntryPos(0);
     m_pDeletedLB->SelectEntryPos(0);
     m_pChangedLB->SelectEntryPos(0);
diff --git a/sw/source/uibase/config/modcfg.cxx b/sw/source/uibase/config/modcfg.cxx
index 3b7e19a82206..97ec5719c6bc 100644
--- a/sw/source/uibase/config/modcfg.cxx
+++ b/sw/source/uibase/config/modcfg.cxx
@@ -224,7 +224,7 @@ const Sequence<OUString>& SwRevisionConfig::GetPropertyNames()
     static Sequence<OUString> aNames;
     if(!aNames.getLength())
     {
-        const int nCount = 8;
+        const int nCount = 9;
         aNames.realloc(nCount);
         static const char* aPropNames[] =
         {
@@ -235,7 +235,8 @@ const Sequence<OUString>& SwRevisionConfig::GetPropertyNames()
             "TextDisplay/ChangedAttribute/Attribute",   // 4
             "TextDisplay/ChangedAttribute/Color",       // 5
             "LinesChanged/Mark",                        // 6
-            "LinesChanged/Color"                        // 7
+            "LinesChanged/Color",                       // 7
+            "ShowInlineTooltip"                         // 8
         };
         OUString* pNames = aNames.getArray();
         for(int i = 0; i < nCount; i++)
@@ -257,7 +258,7 @@ SwRevisionConfig::SwRevisionConfig() :
     aFormatAttr.m_nItemId = SID_ATTR_CHAR_WEIGHT;
     aFormatAttr.m_nAttr = WEIGHT_BOLD;
     aFormatAttr.m_nColor = COL_BLACK;
-
+    bShowInlineTooltip = true;
     Load();
 }
 
@@ -301,19 +302,18 @@ void SwRevisionConfig::ImplCommit()
 
     for(int nProp = 0; nProp < aNames.getLength(); nProp++)
     {
-        sal_Int32 nVal = -1;
         switch(nProp)
         {
-            case 0 : nVal = lcl_ConvertAttrToCfg(aInsertAttr); break;
-            case 1 : nVal = aInsertAttr.m_nColor  ; break;
-            case 2 : nVal = lcl_ConvertAttrToCfg(aDeletedAttr); break;
-            case 3 : nVal = aDeletedAttr.m_nColor ; break;
-            case 4 : nVal = lcl_ConvertAttrToCfg(aFormatAttr); break;
-            case 5 : nVal = aFormatAttr.m_nColor  ; break;
-            case 6 : nVal = nMarkAlign          ; break;
-            case 7 : nVal = aMarkColor.GetColor(); break;
+            case 0 : pValues[nProp] <<= lcl_ConvertAttrToCfg(aInsertAttr); break;
+            case 1 : pValues[nProp] <<= aInsertAttr.m_nColor;   break;
+            case 2 : pValues[nProp] <<= lcl_ConvertAttrToCfg(aDeletedAttr); break;
+            case 3 : pValues[nProp] <<= aDeletedAttr.m_nColor;  break;
+            case 4 : pValues[nProp] <<= lcl_ConvertAttrToCfg(aFormatAttr); break;
+            case 5 : pValues[nProp] <<= aFormatAttr.m_nColor;   break;
+            case 6 : pValues[nProp] <<= nMarkAlign;             break;
+            case 7 : pValues[nProp] <<= aMarkColor.GetColor();  break;
+            case 8 : pValues[nProp] <<= bShowInlineTooltip;     break;
         }
-        pValues[nProp] <<= nVal;
     }
     PutProperties(aNames, aValues);
 }
@@ -366,6 +366,7 @@ void SwRevisionConfig::Load()
                 case 5 : aFormatAttr.m_nColor     = nVal; break;
                 case 6 : nMarkAlign = sal::static_int_cast< sal_uInt16, sal_Int32>(nVal); break;
                 case 7 : aMarkColor.SetColor(nVal); break;
+                case 8 : bShowInlineTooltip = *o3tl::doAccess<bool>(pValues[nProp]);
             }
         }
     }
diff --git a/sw/source/uibase/inc/optpage.hxx b/sw/source/uibase/inc/optpage.hxx
index 85dc244aed38..cd6552ea108e 100644
--- a/sw/source/uibase/inc/optpage.hxx
+++ b/sw/source/uibase/inc/optpage.hxx
@@ -328,6 +328,8 @@ class SwRedlineOptionsTabPage : public SfxTabPage
     VclPtr<SvxColorListBox>     m_pMarkColorLB;
     VclPtr<SwMarkPreview>       m_pMarkPreviewWN;
 
+    VclPtr<CheckBox>            m_pShowChangesTooltip;
+
     DECL_LINK(AttribHdl, ListBox&, void);
     void ChangedMaskPrev();
     DECL_LINK(ChangedMaskPrevHdl, ListBox&, void);
diff --git a/sw/uiconfig/swriter/ui/optredlinepage.ui b/sw/uiconfig/swriter/ui/optredlinepage.ui
index 4962e493af86..5c9896213e1e 100644
--- a/sw/uiconfig/swriter/ui/optredlinepage.ui
+++ b/sw/uiconfig/swriter/ui/optredlinepage.ui
@@ -472,6 +472,22 @@
         <property name="top_attach">3</property>
       </packing>
     </child>
+    <child>
+      <object class="GtkCheckButton" id="changestooltip">
+        <property name="label" translatable="yes" context="optredlinepage|changestooltip">Show _tooltips on changes</property>
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
+        <property name="receives_default">False</property>
+        <property name="halign">start</property>
+        <property name="hexpand">True</property>
+        <property name="use_underline">True</property>
+        <property name="draw_indicator">True</property>
+      </object>
+      <packing>
+        <property name="left_attach">0</property>
+        <property name="top_attach">4</property>
+      </packing>
+    </child>
   </object>
   <object class="GtkSizeGroup" id="sizegroup1">
     <widgets>


More information about the Libreoffice-commits mailing list