diff options
author | heiko tietze <tietze.heiko@gmail.com> | 2018-04-08 12:35:58 +0200 |
---|---|---|
committer | Heiko Tietze <tietze.heiko@gmail.com> | 2018-04-10 00:47:22 +0200 |
commit | 8b34efff7a7ed13553dfe87cd2413d01c76dec1d (patch) | |
tree | fea585bfae98b6af5270b0aef2491b445c1a2004 /sw | |
parent | c7b8dacab8fafdcf89311f780493a896e7350454 (diff) |
tdf#114523 Make inline tooltips for changes optional
Revert redline shenanigans from change 46971; option is now set with view
Change-Id: I55fcfef8a40ad621630dfcefed9e50fdafa94005
Reviewed-on: https://gerrit.libreoffice.org/52586
Reviewed-by: Heiko Tietze <tietze.heiko@gmail.com>
Tested-by: Heiko Tietze <tietze.heiko@gmail.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/IDocumentRedlineAccess.hxx | 3 | ||||
-rw-r--r-- | sw/inc/cmdid.h | 1 | ||||
-rw-r--r-- | sw/inc/modcfg.hxx | 5 | ||||
-rw-r--r-- | sw/inc/viewopt.hxx | 9 | ||||
-rw-r--r-- | sw/sdi/_viewsh.sdi | 9 | ||||
-rw-r--r-- | sw/sdi/swriter.sdi | 17 | ||||
-rw-r--r-- | sw/source/core/crsr/crstrvl.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/doc/DocumentRedlineManager.cxx | 11 | ||||
-rw-r--r-- | sw/source/core/edit/edredln.cxx | 11 | ||||
-rw-r--r-- | sw/source/core/inc/DocumentRedlineManager.hxx | 4 | ||||
-rw-r--r-- | sw/source/ui/config/optpage.cxx | 16 | ||||
-rw-r--r-- | sw/source/uibase/config/cfgitems.cxx | 8 | ||||
-rw-r--r-- | sw/source/uibase/config/modcfg.cxx | 8 | ||||
-rw-r--r-- | sw/source/uibase/config/usrpref.cxx | 7 | ||||
-rw-r--r-- | sw/source/uibase/docvw/edtwin2.cxx | 20 | ||||
-rw-r--r-- | sw/source/uibase/inc/cfgitems.hxx | 1 | ||||
-rw-r--r-- | sw/source/uibase/inc/optpage.hxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/uiview/view0.cxx | 9 | ||||
-rw-r--r-- | sw/source/uibase/uno/unomod.cxx | 3 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/optredlinepage.ui | 24 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/viewoptionspage.ui | 48 |
21 files changed, 105 insertions, 119 deletions
diff --git a/sw/inc/IDocumentRedlineAccess.hxx b/sw/inc/IDocumentRedlineAccess.hxx index 2050ee2ec3cc..a3ed714e6cb1 100644 --- a/sw/inc/IDocumentRedlineAccess.hxx +++ b/sw/inc/IDocumentRedlineAccess.hxx @@ -236,9 +236,6 @@ 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/cmdid.h b/sw/inc/cmdid.h index 4604eee0c4e1..a385ecde1300 100644 --- a/sw/inc/cmdid.h +++ b/sw/inc/cmdid.h @@ -180,6 +180,7 @@ #define FN_SCROLL_PREV (FN_VIEW + 57) /* uno:ScrollToPrevious */ #define FN_SCROLL_NEXT (FN_VIEW + 58) /* uno:ScrollToNext */ #define FN_VIEW_HIDE_WHITESPACE (FN_VIEW + 59) /* Hide header, footer, and pagebreak */ +#define FN_SHOW_INLINETOOLTIPS (FN_VIEW + 60) /* Show tooltips for tracked changes */ // Region: Insert #define FN_INSERT_BOOKMARK (FN_INSERT + 2 ) /* Bookmark */ diff --git a/sw/inc/modcfg.hxx b/sw/inc/modcfg.hxx index c20296a9f951..3490337dcb90 100644 --- a/sw/inc/modcfg.hxx +++ b/sw/inc/modcfg.hxx @@ -70,7 +70,6 @@ class SwRevisionConfig : public utl::ConfigItem //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(); @@ -252,10 +251,6 @@ 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/inc/viewopt.hxx b/sw/inc/viewopt.hxx index 92da82a55b54..6b4bbd1de9fc 100644 --- a/sw/inc/viewopt.hxx +++ b/sw/inc/viewopt.hxx @@ -57,11 +57,12 @@ enum class ViewOptFlags1 { Synchronize = 0x01000000, GridVisible = 0x02000000, OnlineSpell = 0x04000000, + ShowInlineTooltips = 0x10000000, //tooltips on tracked changes ViewMetachars = 0x20000000, Pageback = 0x40000000 }; namespace o3tl { - template<> struct typed_flags<ViewOptFlags1> : is_typed_flags<ViewOptFlags1, 0x67dfcdfe> {}; + template<> struct typed_flags<ViewOptFlags1> : is_typed_flags<ViewOptFlags1, 0x77dfcdfe> {}; } enum class ViewOptCoreFlags2 { @@ -260,6 +261,12 @@ public: bool bIsScript ); static sal_uInt16 GetPostItsWidth( const OutputDevice *pOut ); + //show/hide tooltips on tracked changes + bool IsShowInlineTooltips() const + { return bool(m_nCoreOptions & ViewOptFlags1::ShowInlineTooltips); } + void SetShowInlineTooltips( bool b ) + { b ? (m_nCoreOptions |= ViewOptFlags1::ShowInlineTooltips ) : ( m_nCoreOptions &= ~ViewOptFlags1::ShowInlineTooltips); } + bool IsShowHiddenChar(bool bHard = false) const { return !m_bReadonly && (m_nCoreOptions & ViewOptFlags1::CharHidden) && ((m_nCoreOptions & ViewOptFlags1::ViewMetachars)||bHard); } diff --git a/sw/sdi/_viewsh.sdi b/sw/sdi/_viewsh.sdi index 099033a1a278..d61142d9bfde 100644 --- a/sw/sdi/_viewsh.sdi +++ b/sw/sdi/_viewsh.sdi @@ -906,5 +906,14 @@ interface BaseTextEditView ExecMethod = ExecViewOptions ; StateMethod = StateViewOptions ; ] + + FN_SHOW_INLINETOOLTIPS + [ + ExecMethod = ExecViewOptions ; + StateMethod = StateViewOptions ; + Export = FALSE; + MenuConfig , AccelConfig , ToolBoxConfig ; + ] + } diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi index cc560ff1b0ac..058fc4bc09f6 100644 --- a/sw/sdi/swriter.sdi +++ b/sw/sdi/swriter.sdi @@ -7633,3 +7633,20 @@ SfxVoidItem NavElement FN_NAV_ELEMENT ToolBoxConfig = TRUE, GroupId = SfxGroupId::Navigator; ] + +SfxBoolItem ShowInlineTooltips FN_SHOW_INLINETOOLTIPS +() +[ + AutoUpdate = FALSE, + FastCall = FALSE, + ReadOnlyDoc = TRUE, + Toggle = TRUE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + + AccelConfig = TRUE, + MenuConfig = TRUE, + ToolBoxConfig = TRUE, + GroupId = SfxGroupId::View; +] diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index 6218f5a460d3..aa467d0f87d8 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -1137,11 +1137,6 @@ 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 ); @@ -1488,6 +1483,7 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt, if( !bRet && IsAttrAtPos::Redline & rContentAtPos.eContentAtPos ) { const SwRangeRedline* pRedl = GetDoc()->getIDocumentRedlineAccess().GetRedline(aPos, nullptr); + if( pRedl ) { rContentAtPos.aFnd.pRedl = pRedl; diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index 923bb541952c..4f12cd39d827 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -616,7 +616,6 @@ DocumentRedlineManager::DocumentRedlineManager(SwDoc& i_rSwdoc) , mbIsRedlineMove(false) , mbReadlineChecked(false) , mnAutoFormatRedlnCommentNo(0) - , m_bHideInlineTooltips(false) { } @@ -2721,16 +2720,6 @@ void DocumentRedlineManager::checkRedlining(RedlineFlags& _rReadlineMode) } } -bool DocumentRedlineManager::IsHideInlineTooltips() -{ - return m_bHideInlineTooltips; -} - -void DocumentRedlineManager::SetHideInlineTooltips(bool bSet) -{ - m_bHideInlineTooltips = bSet; -} - DocumentRedlineManager::~DocumentRedlineManager() { } diff --git a/sw/source/core/edit/edredln.cxx b/sw/source/core/edit/edredln.cxx index eb1db63666e7..e99aa5c36ae3 100644 --- a/sw/source/core/edit/edredln.cxx +++ b/sw/source/core/edit/edredln.cxx @@ -25,7 +25,6 @@ #include <editsh.hxx> #include <edimp.hxx> #include <frmtool.hxx> -#include <officecfg/Office/Writer.hxx> RedlineFlags SwEditShell::GetRedlineFlags() const { @@ -131,15 +130,7 @@ void SwEditShell::UpdateRedlineAttr() SET_CURR_SHELL( this ); StartAllAction(); - // 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(); + GetDoc()->getIDocumentRedlineAccess().UpdateRedlineAttr(); EndAllAction(); } diff --git a/sw/source/core/inc/DocumentRedlineManager.hxx b/sw/source/core/inc/DocumentRedlineManager.hxx index 52be64fa7d28..1a410a15b6ba 100644 --- a/sw/source/core/inc/DocumentRedlineManager.hxx +++ b/sw/source/core/inc/DocumentRedlineManager.hxx @@ -111,9 +111,6 @@ 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; /** Set comment-text for Redline. It then comes in via AppendRedLine. @@ -142,7 +139,6 @@ private: sal_uInt16 mnAutoFormatRedlnCommentNo; /**< SeqNo for conjoining of AutoFormat-Redlines. by the UI. Managed by SwAutoFormat! */ css::uno::Sequence <sal_Int8 > maRedlinePasswd; - bool m_bHideInlineTooltips : 1; }; } diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index 115043bd30c1..e2a9039adf5c 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -116,6 +116,8 @@ SwContentOptPage::SwContentOptPage( vcl::Window* pParent, get (m_pMetricLabel, "measureunitlabel"); get (m_pMetricLB, "measureunit"); + get (m_pShowInlineTooltips,"changestooltip"); + /* This part is visible only with Writer/Web->View dialogue. */ const SfxPoolItem* pItem; if (! (SfxItemState::SET == rCoreSet.GetItemState(SID_HTML_MODE, false, &pItem ) @@ -192,6 +194,7 @@ void SwContentOptPage::dispose() m_pSettingsLabel.clear(); m_pMetricLabel.clear(); m_pMetricLB.clear(); + m_pShowInlineTooltips.clear(); SfxTabPage::dispose(); } @@ -237,6 +240,7 @@ void SwContentOptPage::Reset(const SfxItemSet* rSet) m_pVRulerCBox->Check (pElemAttr->bVertRuler); m_pVRulerRightCBox->Check (pElemAttr->bVertRulerRight); m_pSmoothCBox->Check (pElemAttr->bSmoothScroll); + m_pShowInlineTooltips->Check (pElemAttr->bShowInlineTooltips); } m_pMetricLB->SetNoSelection(); lcl_SelectMetricLB(m_pMetricLB, SID_ATTR_METRIC, *rSet); @@ -259,6 +263,7 @@ bool SwContentOptPage::FillItemSet(SfxItemSet* rSet) aElem.bVertRuler = m_pVRulerCBox->IsChecked(); aElem.bVertRulerRight = m_pVRulerRightCBox->IsChecked(); aElem.bSmoothScroll = m_pSmoothCBox->IsChecked(); + aElem.bShowInlineTooltips = m_pShowInlineTooltips->IsChecked(); bool bRet = !pOldAttr || aElem != *pOldAttr; if(bRet) @@ -290,6 +295,7 @@ bool SwContentOptPage::FillItemSet(SfxItemSet* rSet) rSet->Put( SfxUInt16Item( FN_VSCROLL_METRIC, nFieldUnit ) ); bRet = true; } + return bRet; } @@ -1754,7 +1760,6 @@ 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()); @@ -1813,7 +1818,6 @@ void SwRedlineOptionsTabPage::dispose() m_pMarkPosLB.clear(); m_pMarkColorLB.clear(); m_pMarkPreviewWN.clear(); - m_pShowChangesTooltip.clear(); SfxTabPage::dispose(); } @@ -1835,8 +1839,6 @@ bool SwRedlineOptionsTabPage::FillItemSet( SfxItemSet* ) AuthorCharAttr aOldDeletedAttr(pOpt->GetDeletedAuthorAttr()); AuthorCharAttr aOldChangedAttr(pOpt->GetFormatAuthorAttr()); - const bool bOldShowInlineTooltips = pOpt->IsShowInlineTooltip(); - Color nOldMarkColor = pOpt->GetMarkAlignColor(); sal_uInt16 nOldMarkMode = pOpt->GetMarkAlignMode(); @@ -1881,14 +1883,12 @@ bool SwRedlineOptionsTabPage::FillItemSet( SfxItemSet* ) } pOpt->SetMarkAlignMode(nPos); pOpt->SetMarkAlignColor(m_pMarkColorLB->GetSelectEntryColor()); - pOpt->SetShowInlineTooltip( m_pShowChangesTooltip->IsChecked() ); if (!(aInsertedAttr == aOldInsertAttr) || !(aDeletedAttr == aOldDeletedAttr) || !(aChangedAttr == aOldChangedAttr) || nOldMarkColor != pOpt->GetMarkAlignColor() || - nOldMarkMode != pOpt->GetMarkAlignMode() || - bOldShowInlineTooltips != pOpt->IsShowInlineTooltip() ) + nOldMarkMode != pOpt->GetMarkAlignMode() ) { // update all documents SwDocShell* pDocShell = static_cast<SwDocShell*>(SfxObjectShell::GetFirst(checkSfxObjectShell<SwDocShell>)); @@ -1927,8 +1927,6 @@ 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/cfgitems.cxx b/sw/source/uibase/config/cfgitems.cxx index f029eda606c0..98dc29eba68e 100644 --- a/sw/source/uibase/config/cfgitems.cxx +++ b/sw/source/uibase/config/cfgitems.cxx @@ -107,6 +107,7 @@ SwElemItem::SwElemItem() : bDrawing = bFieldName = bNotes = false; + bShowInlineTooltips = true; } SwElemItem::SwElemItem(const SwViewOption& rVOpt) : @@ -121,6 +122,7 @@ SwElemItem::SwElemItem(const SwViewOption& rVOpt) : bDrawing = rVOpt.IsDraw() && rVOpt.IsControl(); bFieldName = rVOpt.IsFieldName(); bNotes = rVOpt.IsPostIts(); + bShowInlineTooltips = rVOpt.IsShowInlineTooltips(); } @@ -143,7 +145,8 @@ bool SwElemItem::operator==( const SfxPoolItem& rAttr ) const bGraphic == rItem.bGraphic && bDrawing == rItem.bDrawing && bFieldName == rItem.bFieldName && - bNotes == rItem.bNotes ); + bNotes == rItem.bNotes && + bShowInlineTooltips == rItem.bShowInlineTooltips ); } void SwElemItem::FillViewOptions( SwViewOption& rVOpt) const @@ -156,8 +159,9 @@ void SwElemItem::FillViewOptions( SwViewOption& rVOpt) const rVOpt.SetGraphic (bGraphic ); rVOpt.SetDraw (bDrawing ); rVOpt.SetControl (bDrawing ); - rVOpt.SetFieldName (bFieldName ); + rVOpt.SetFieldName (bFieldName ); rVOpt.SetPostIts (bNotes ); + rVOpt.SetShowInlineTooltips( bShowInlineTooltips ); } // CTOR for empty Item diff --git a/sw/source/uibase/config/modcfg.cxx b/sw/source/uibase/config/modcfg.cxx index f0d9f010b7ab..aeabf55f9c6e 100644 --- a/sw/source/uibase/config/modcfg.cxx +++ b/sw/source/uibase/config/modcfg.cxx @@ -221,7 +221,7 @@ const Sequence<OUString>& SwRevisionConfig::GetPropertyNames() static Sequence<OUString> aNames; if(!aNames.getLength()) { - const int nCount = 9; + const int nCount = 8; aNames.realloc(nCount); static const char* aPropNames[] = { @@ -232,8 +232,7 @@ const Sequence<OUString>& SwRevisionConfig::GetPropertyNames() "TextDisplay/ChangedAttribute/Attribute", // 4 "TextDisplay/ChangedAttribute/Color", // 5 "LinesChanged/Mark", // 6 - "LinesChanged/Color", // 7 - "ShowInlineTooltip" // 8 + "LinesChanged/Color" // 7 }; OUString* pNames = aNames.getArray(); for(int i = 0; i < nCount; i++) @@ -255,7 +254,6 @@ SwRevisionConfig::SwRevisionConfig() : aFormatAttr.m_nItemId = SID_ATTR_CHAR_WEIGHT; aFormatAttr.m_nAttr = WEIGHT_BOLD; aFormatAttr.m_nColor = COL_BLACK; - bShowInlineTooltip = true; Load(); } @@ -309,7 +307,6 @@ void SwRevisionConfig::ImplCommit() case 5 : pValues[nProp] <<= aFormatAttr.m_nColor; break; case 6 : pValues[nProp] <<= nMarkAlign; break; case 7 : pValues[nProp] <<= aMarkColor; break; - case 8 : pValues[nProp] <<= bShowInlineTooltip; break; } } PutProperties(aNames, aValues); @@ -363,7 +360,6 @@ void SwRevisionConfig::Load() case 5 : aFormatAttr.m_nColor = Color(nVal); break; case 6 : nMarkAlign = sal::static_int_cast< sal_uInt16, sal_Int32>(nVal); break; case 7 : aMarkColor = Color(nVal); break; - case 8 : bShowInlineTooltip = *o3tl::doAccess<bool>(pValues[nProp]); } } } diff --git a/sw/source/uibase/config/usrpref.cxx b/sw/source/uibase/config/usrpref.cxx index 3fe97f702a8e..68b4602b4f6f 100644 --- a/sw/source/uibase/config/usrpref.cxx +++ b/sw/source/uibase/config/usrpref.cxx @@ -103,10 +103,11 @@ Sequence<OUString> SwContentViewConfig::GetPropertyNames() "NonprintingCharacter/HiddenCharacter", // 15 "Update/Link", // 16 "Update/Field", // 17 - "Update/Chart" // 18 + "Update/Chart", // 18 + "Display/ShowInlineTooltips" //19 }; - const int nCount = bWeb ? 12 : 19; + const int nCount = bWeb ? 12 : 20; Sequence<OUString> aNames(nCount); OUString* pNames = aNames.getArray(); for(int i = 0; i < nCount; i++) @@ -165,6 +166,7 @@ void SwContentViewConfig::ImplCommit() case 16: pValues[nProp] <<= rParent.GetUpdateLinkMode(); break;// "Update/Link", case 17: bVal = rParent.IsUpdateFields(); break;// "Update/Field", case 18: bVal = rParent.IsUpdateCharts(); break;// "Update/Chart" + case 19: bVal = rParent.IsShowInlineTooltips(); break;// "Display/ShowInlineTooltips" } if(nProp != 16) pValues[nProp] <<= bVal; @@ -212,6 +214,7 @@ void SwContentViewConfig::Load() break;// "Update/Link", case 17: rParent.SetUpdateFields(bSet); break;// "Update/Field", case 18: rParent.SetUpdateCharts(bSet); break;// "Update/Chart" + case 19: rParent.SetShowInlineTooltips(bSet); break;// "Display/ShowInlineTooltips" } } } diff --git a/sw/source/uibase/docvw/edtwin2.cxx b/sw/source/uibase/docvw/edtwin2.cxx index 670d9244fa7d..9e4658eacf4a 100644 --- a/sw/source/uibase/docvw/edtwin2.cxx +++ b/sw/source/uibase/docvw/edtwin2.cxx @@ -260,8 +260,13 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) break; case IsAttrAtPos::Redline: - sText = lcl_GetRedlineHelp(*aContentAtPos.aFnd.pRedl, bBalloon); - break; + { + const bool bShowTrackChanges = IDocumentRedlineAccess::IsShowChanges( m_rView.GetDocShell()->GetDoc()->getIDocumentRedlineAccess().GetRedlineFlags() ); + const bool bShowInlineTooltips = rSh.GetViewOptions()->IsShowInlineTooltips(); + if ( bShowTrackChanges && bShowInlineTooltips ) + sText = lcl_GetRedlineHelp(*aContentAtPos.aFnd.pRedl, bBalloon); + } + break; case IsAttrAtPos::ToxMark: sText = aContentAtPos.sStr; @@ -361,9 +366,14 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) if( sText.isEmpty() ) { - aContentAtPos.eContentAtPos = IsAttrAtPos::Redline; - if( rSh.GetContentAtPos( aPos, aContentAtPos, false, &aFieldRect ) ) - sText = lcl_GetRedlineHelp(*aContentAtPos.aFnd.pRedl, bBalloon); + const bool bShowTrackChanges = IDocumentRedlineAccess::IsShowChanges( m_rView.GetDocShell()->GetDoc()->getIDocumentRedlineAccess().GetRedlineFlags() ); + const bool bShowInlineTooltips = rSh.GetViewOptions()->IsShowInlineTooltips(); + if ( bShowTrackChanges && bShowInlineTooltips ) + { + aContentAtPos.eContentAtPos = IsAttrAtPos::Redline; + if( rSh.GetContentAtPos( aPos, aContentAtPos, false, &aFieldRect ) ) + sText = lcl_GetRedlineHelp(*aContentAtPos.aFnd.pRedl, bBalloon); + } } } } diff --git a/sw/source/uibase/inc/cfgitems.hxx b/sw/source/uibase/inc/cfgitems.hxx index 149cd77e7ac0..79c2fb7780bf 100644 --- a/sw/source/uibase/inc/cfgitems.hxx +++ b/sw/source/uibase/inc/cfgitems.hxx @@ -79,6 +79,7 @@ class SW_DLLPUBLIC SwElemItem : public SfxPoolItem bool bDrawing :1; bool bFieldName :1; bool bNotes :1; + bool bShowInlineTooltips :1; friend class SwContentOptPage; diff --git a/sw/source/uibase/inc/optpage.hxx b/sw/source/uibase/inc/optpage.hxx index cd6552ea108e..7efa595467c4 100644 --- a/sw/source/uibase/inc/optpage.hxx +++ b/sw/source/uibase/inc/optpage.hxx @@ -61,6 +61,8 @@ class SwContentOptPage : public SfxTabPage VclPtr<FixedText> m_pMetricLabel; VclPtr<ListBox> m_pMetricLB; + VclPtr<CheckBox> m_pShowInlineTooltips; + DECL_LINK(VertRulerHdl, Button*, void); public: SwContentOptPage( vcl::Window* pParent, const SfxItemSet& rSet); @@ -328,8 +330,6 @@ 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/source/uibase/uiview/view0.cxx b/sw/source/uibase/uiview/view0.cxx index 4cf1fbf78329..b5292557ae8a 100644 --- a/sw/source/uibase/uiview/view0.cxx +++ b/sw/source/uibase/uiview/view0.cxx @@ -324,6 +324,8 @@ void SwView::StateViewOptions(SfxItemSet &rSet) else aBool.SetValue( pOpt->IsShadowCursor() ); break; + case FN_SHOW_INLINETOOLTIPS: + aBool.SetValue( pOpt->IsShowInlineTooltips() ); } @@ -540,6 +542,13 @@ void SwView::ExecViewOptions(SfxRequest &rReq) pOpt->SetShadowCursor(bSet); break; + case FN_SHOW_INLINETOOLTIPS: + if( STATE_TOGGLE == eState ) + bFlag = !pOpt->IsShowInlineTooltips(); + + pOpt->SetShowInlineTooltips( bFlag ); + break; + default: OSL_FAIL("wrong request method"); return; diff --git a/sw/source/uibase/uno/unomod.cxx b/sw/source/uibase/uno/unomod.cxx index 16fabb29760a..c33f0b9f5f49 100644 --- a/sw/source/uibase/uno/unomod.cxx +++ b/sw/source/uibase/uno/unomod.cxx @@ -89,6 +89,7 @@ enum SwViewSettingsPropertyHandles HANDLE_VIEWSET_HORI_RULER_METRIC, HANDLE_VIEWSET_VERT_RULER_METRIC, HANDLE_VIEWSET_SCROLLBAR_TIPS, + HANDLE_VIEWSET_INLINECHANGES_TIPS, HANDLE_VIEWSET_HIDE_WHITESPACE }; @@ -124,6 +125,7 @@ static ChainablePropertySetInfo * lcl_createViewSettingsInfo() { OUString( "IsSnapToRaster"), HANDLE_VIEWSET_IS_SNAP_TO_RASTER, cppu::UnoType<bool>::get(), PROPERTY_NONE}, { OUString( "IsVertRulerRightAligned"),HANDLE_VIEWSET_VRULER_RIGHT , cppu::UnoType<bool>::get(), PROPERTY_NONE}, { OUString( "ShowContentTips" ), HANDLE_VIEWSET_SHOW_CONTENT_TIPS , cppu::UnoType<bool>::get(), PROPERTY_NONE}, + { OUString( "ShowInlineTooltips" ), HANDLE_VIEWSET_INLINECHANGES_TIPS , cppu::UnoType<bool>::get(), PROPERTY_NONE}, { OUString( "RasterResolutionX"), HANDLE_VIEWSET_RASTER_RESOLUTION_X, cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE}, { OUString( "RasterResolutionY"), HANDLE_VIEWSET_RASTER_RESOLUTION_Y, cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE}, { OUString( "RasterSubdivisionX"), HANDLE_VIEWSET_RASTER_SUBDIVISION_X, cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE}, @@ -592,6 +594,7 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c case HANDLE_VIEWSET_IS_RASTER_VISIBLE : mpViewOption->SetGridVisible(*o3tl::doAccess<bool>(rValue)); break; case HANDLE_VIEWSET_IS_SNAP_TO_RASTER : mpViewOption->SetSnap(*o3tl::doAccess<bool>(rValue)); break; case HANDLE_VIEWSET_SCROLLBAR_TIPS : mpViewOption->SetShowScrollBarTips(*o3tl::doAccess<bool>(rValue)); break; + case HANDLE_VIEWSET_INLINECHANGES_TIPS : mpViewOption->SetShowInlineTooltips(*o3tl::doAccess<bool>(rValue)); break; case HANDLE_VIEWSET_RASTER_RESOLUTION_X : { sal_Int32 nTmp = 0; diff --git a/sw/uiconfig/swriter/ui/optredlinepage.ui b/sw/uiconfig/swriter/ui/optredlinepage.ui index 14e8e56f1556..b223e253dbe5 100644 --- a/sw/uiconfig/swriter/ui/optredlinepage.ui +++ b/sw/uiconfig/swriter/ui/optredlinepage.ui @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.20.0 --> +<!-- Generated with glade 3.22.1 --> <interface domain="sw"> <requires lib="gtk+" version="3.18"/> <requires lib="LibreOffice" version="1.0"/> @@ -105,7 +105,7 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="hexpand">True</property> - <property name="text" translatable="yes" context="optredlinepage|insertedpreview">Insert</property> + <property name="text">Insert</property> </object> <packing> <property name="left_attach">2</property> @@ -216,7 +216,7 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="hexpand">True</property> - <property name="text" translatable="yes" context="optredlinepage|deletedpreview">Delete</property> + <property name="text">Delete</property> </object> <packing> <property name="left_attach">2</property> @@ -327,7 +327,7 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="hexpand">True</property> - <property name="text" translatable="yes" context="optredlinepage|changedpreview">Attributes</property> + <property name="text">Attributes</property> </object> <packing> <property name="left_attach">2</property> @@ -472,22 +472,6 @@ <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> diff --git a/sw/uiconfig/swriter/ui/viewoptionspage.ui b/sw/uiconfig/swriter/ui/viewoptionspage.ui index 3a62a8b030ea..e0fdc782709f 100644 --- a/sw/uiconfig/swriter/ui/viewoptionspage.ui +++ b/sw/uiconfig/swriter/ui/viewoptionspage.ui @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.16.1 --> +<!-- Generated with glade 3.22.1 --> <interface domain="sw"> <requires lib="gtk+" version="3.18"/> <object class="GtkBox" id="ViewOptionsPage"> @@ -50,8 +50,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> </object> @@ -105,8 +103,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -122,8 +118,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -139,8 +133,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">2</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -156,8 +148,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">3</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -173,8 +163,19 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">4</property> - <property name="width">1</property> - <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="changestooltip"> + <property name="label" translatable="yes" context="viewoptionspage|changestooltip">_Tooltips on tracked changes</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">5</property> </packing> </child> </object> @@ -202,8 +203,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -242,8 +241,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -264,8 +261,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -276,8 +271,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -288,8 +281,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -307,7 +298,6 @@ <property name="left_attach">0</property> <property name="top_attach">2</property> <property name="width">2</property> - <property name="height">1</property> </packing> </child> <child> @@ -322,16 +312,12 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> </object> <packing> <property name="left_attach">0</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> </object> @@ -380,8 +366,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -393,8 +377,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> </object> @@ -422,8 +404,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> </object> |