From f40dc496a511ae06a308dd0859bc3aad28a8ec7e Mon Sep 17 00:00:00 2001 From: Heiko Tietze Date: Thu, 7 Nov 2024 16:12:56 +0100 Subject: [PATCH] Resolves tdf#163856 - Disentangle boundaries options * Boundary toggles removed from app colors * Object boundaries completely removed (color replaced with DOCBOUNDARIES; Impress placeholder on/off now an expert option) * Toggle options added under formatting aids * Individual UNO commands marked deprecated * New command added to show all boundaries * Frames follow sections now in state and color * Kind of wrapping doesn't matter anmymore Change-Id: I7bbec20831dcb95abef6523884d84b05a1a7df0a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176242 Tested-by: Jenkins Reviewed-by: Rafael Lima --- cui/source/options/optcolor.cxx | 9 +- cui/uiconfig/ui/colorconfigwin.ui | 151 +-------- include/svtools/colorcfg.hxx | 1 - .../data/org/openoffice/Office/UI.xcu | 17 - .../openoffice/Office/UI/WriterCommands.xcu | 20 +- .../schema/org/openoffice/Office/Impress.xcs | 7 + .../schema/org/openoffice/Office/UI.xcs | 34 -- .../schema/org/openoffice/Office/Writer.xcs | 33 +- sd/source/ui/dlg/headerfooterdlg.cxx | 2 +- sd/source/ui/view/sdview.cxx | 312 +++++++++--------- .../ui/notebookbar_groupedbar_compact.ui | 9 +- .../ui/notebookbar_groupedbar_compact.ui | 9 +- svtools/source/config/colorcfg.cxx | 8 +- .../contact/viewobjectcontactofpageobj.cxx | 2 +- .../primitive2d/sdrolecontentprimitive2d.cxx | 2 +- svx/source/svdraw/svdoole2.cxx | 2 +- sw/inc/cmdid.h | 2 + sw/inc/viewopt.hxx | 49 +-- sw/qa/uitest/options/tdf78133.py | 8 +- sw/sdi/_viewsh.sdi | 6 + sw/sdi/swriter.sdi | 34 +- sw/source/core/layout/paintfrm.cxx | 88 ++--- sw/source/ui/config/optpage.cxx | 30 ++ sw/source/uibase/config/cfgitems.cxx | 12 + sw/source/uibase/config/usrpref.cxx | 20 +- sw/source/uibase/config/viewopt.cxx | 32 +- sw/source/uibase/inc/cfgitems.hxx | 4 + sw/source/uibase/inc/optpage.hxx | 6 + sw/source/uibase/uiview/view0.cxx | 30 +- sw/source/uibase/uno/unomod.cxx | 8 +- sw/uiconfig/sglobal/menubar/menubar.xml | 3 +- sw/uiconfig/sweb/menubar/menubar.xml | 2 +- sw/uiconfig/swform/menubar/menubar.xml | 3 +- sw/uiconfig/swreport/menubar/menubar.xml | 3 +- sw/uiconfig/swriter/menubar/menubar.xml | 4 +- sw/uiconfig/swriter/ui/notebookbar.ui | 16 +- sw/uiconfig/swriter/ui/notebookbar_compact.ui | 16 +- .../ui/notebookbar_groupedbar_compact.ui | 32 +- .../swriter/ui/notebookbar_groupedbar_full.ui | 32 +- sw/uiconfig/swriter/ui/optformataidspage.ui | 108 ++++-- sw/uiconfig/swxform/menubar/menubar.xml | 3 +- 41 files changed, 515 insertions(+), 654 deletions(-) diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx index e9ef0c7800aa..67cb2462b0d2 100644 --- a/cui/source/options/optcolor.cxx +++ b/cui/source/options/optcolor.cxx @@ -108,10 +108,9 @@ const vEntryInfo[] = // The list of these entries (enum ColorConfigEntry) are in colorcfg.hxx. { Group_General, IDS(doccolor), std::u16string_view(u"/DocColor") }, - { Group_General, IDS_CB(docboundaries), std::u16string_view(u"/DocBoundaries") }, + { Group_General, IDS(docboundaries), std::u16string_view(u"/DocBoundaries") }, { Group_General, IDS(appback), std::u16string_view(u"/AppBackground") }, - { Group_General, IDS_CB(objboundaries), std::u16string_view(u"/ObjectBoundaries") }, - { Group_General, IDS_CB(tblboundaries), std::u16string_view(u"/TableBoundaries") }, + { Group_General, IDS(tblboundaries), std::u16string_view(u"/TableBoundaries") }, { Group_General, IDS(font), std::u16string_view(u"/FontColor") }, { Group_General, IDS_CB(unvisitedlinks), std::u16string_view(u"/Links") }, { Group_General, IDS_CB(visitedlinks), std::u16string_view(u"/LinksVisited") }, @@ -125,7 +124,7 @@ const vEntryInfo[] = { Group_Writer, IDS_CB(index), std::u16string_view(u"/WriterIdxShadings") }, { Group_Writer, IDS(direct), std::u16string_view(u"/WriterDirectCursor") }, { Group_Writer, IDS(script), std::u16string_view(u"/WriterScriptIndicator") }, - { Group_Writer, IDS_CB(section), std::u16string_view(u"/WriterSectionBoundaries") }, + { Group_Writer, IDS(section), std::u16string_view(u"/WriterSectionBoundaries") }, { Group_Writer, IDS(hdft), std::u16string_view(u"/WriterHeaderFooterMark") }, { Group_Writer, IDS(pagebreak), std::u16string_view(u"/WriterPageBreaks") }, { Group_Writer, IDS(nonprintchars), std::u16string_view(u"/WriterNonPrintChars") }, @@ -485,7 +484,7 @@ void ColorConfigWindow_Impl::CreateEntries() // get it to align its contents with that of a CheckBox { OUString sSampleText(u"XXXXXX"_ustr); - std::unique_ptr xCheckBox(m_xBuilder->weld_check_button(u"docboundaries"_ustr)); + std::unique_ptr xCheckBox(m_xBuilder->weld_check_button(u"unvisitedlinks"_ustr)); std::unique_ptr xFixedText(m_xBuilder->weld_label(u"doccolor"_ustr)); OUString sOrigCheck(xCheckBox->get_label()); OUString sOrigFixed(xFixedText->get_label()); diff --git a/cui/uiconfig/ui/colorconfigwin.ui b/cui/uiconfig/ui/colorconfigwin.ui index 91243182fdb6..5baa136e7757 100644 --- a/cui/uiconfig/ui/colorconfigwin.ui +++ b/cui/uiconfig/ui/colorconfigwin.ui @@ -18,7 +18,7 @@ 0 none - + True False @@ -50,7 +50,6 @@ True 0 True - @@ -61,14 +60,12 @@ - + Text boundaries True True - False start center - True @@ -86,7 +83,6 @@ end 0 True - @@ -127,7 +123,6 @@ end 0 True - @@ -138,65 +133,19 @@ - - Object boundaries - True - True - False - start - center - True - - - - - - 0 - 3 - - - - - True - True - False - end - 0 - True - - - - - - - - - - Object boundaries color - - - - - 1 - 3 - - - - + Table boundaries True True - False start center - True 0 - 4 + 3 @@ -207,7 +156,6 @@ end 0 True - @@ -222,7 +170,7 @@ 1 - 4 + 3 @@ -237,7 +185,7 @@ 0 - 5 + 4 @@ -248,14 +196,13 @@ end 0 True - 1 - 5 + 4 @@ -273,7 +220,7 @@ 0 - 6 + 5 @@ -284,7 +231,6 @@ end 0 True - @@ -299,7 +245,7 @@ 1 - 6 + 5 @@ -317,7 +263,7 @@ 0 - 7 + 6 @@ -328,7 +274,6 @@ end 0 True - @@ -343,7 +288,7 @@ 1 - 7 + 6 @@ -358,7 +303,7 @@ 0 - 8 + 7 @@ -369,14 +314,13 @@ end 0 True - 1 - 8 + 7 @@ -391,7 +335,7 @@ 0 - 9 + 8 @@ -402,14 +346,13 @@ end 0 True - 1 - 9 + 8 @@ -427,7 +370,7 @@ 0 - 10 + 9 @@ -438,7 +381,6 @@ end 0 True - @@ -453,7 +395,7 @@ 1 - 10 + 9 @@ -514,7 +456,6 @@ True 0 True - @@ -550,7 +491,6 @@ end 0 True - @@ -594,7 +534,6 @@ end 0 True - @@ -635,7 +574,6 @@ end 0 True - @@ -646,14 +584,12 @@ - + Section boundaries True True - False start center - True @@ -671,7 +607,6 @@ end 0 True - @@ -712,7 +647,6 @@ end 0 True - @@ -745,7 +679,6 @@ end 0 True - @@ -778,7 +711,6 @@ end 0 True - @@ -811,7 +743,6 @@ end 0 True - @@ -844,7 +775,6 @@ end 0 True - @@ -912,7 +842,6 @@ True 0 True - @@ -945,7 +874,6 @@ end 0 True - @@ -978,7 +906,6 @@ end 0 True - @@ -1011,7 +938,6 @@ end 0 True - @@ -1044,7 +970,6 @@ end 0 True - @@ -1062,7 +987,6 @@ end 0 True - @@ -1095,7 +1019,6 @@ end 0 True - @@ -1128,7 +1051,6 @@ end 0 True - @@ -1161,7 +1083,6 @@ end 0 True - @@ -1194,7 +1115,6 @@ end 0 True - @@ -1227,7 +1147,6 @@ end 0 True - @@ -1260,7 +1179,6 @@ end 0 True - @@ -1311,7 +1229,6 @@ end 0 True - @@ -1355,7 +1272,6 @@ end 0 True - @@ -1381,7 +1297,6 @@ end 0 True - @@ -1435,7 +1350,6 @@ True 0 True - @@ -1493,7 +1407,6 @@ True 0 True - @@ -1576,7 +1489,6 @@ True 0 True - @@ -1610,7 +1522,6 @@ True 0 True - @@ -1644,7 +1555,6 @@ True 0 True - @@ -1678,7 +1588,6 @@ True 0 True - @@ -1712,7 +1621,6 @@ True 0 True - @@ -1746,7 +1654,6 @@ True 0 True - @@ -1780,7 +1687,6 @@ True 0 True - @@ -1814,7 +1720,6 @@ True 0 True - @@ -1848,7 +1753,6 @@ True 0 True - @@ -1901,7 +1805,6 @@ True 0 True - @@ -1934,7 +1837,6 @@ end 0 True - @@ -1967,7 +1869,6 @@ end 0 True - @@ -2000,7 +1901,6 @@ end 0 True - @@ -2033,7 +1933,6 @@ end 0 True - @@ -2066,7 +1965,6 @@ end 0 True - @@ -2099,7 +1997,6 @@ end 0 True - @@ -2132,7 +2029,6 @@ end 0 True - @@ -2200,7 +2096,6 @@ True 0 True - @@ -2233,7 +2128,6 @@ end 0 True - @@ -2266,7 +2160,6 @@ end 0 True - @@ -2299,7 +2192,6 @@ end 0 True - @@ -2332,7 +2224,6 @@ end 0 True - @@ -2365,7 +2256,6 @@ end 0 True - @@ -2398,7 +2288,6 @@ end 0 True - @@ -2466,7 +2355,6 @@ True 0 True - @@ -2514,7 +2402,6 @@ end 0 True - @@ -2547,7 +2434,6 @@ end 0 True - @@ -2580,7 +2466,6 @@ end 0 True - diff --git a/include/svtools/colorcfg.hxx b/include/svtools/colorcfg.hxx index 6cc4483cd40d..5e4e774826d7 100644 --- a/include/svtools/colorcfg.hxx +++ b/include/svtools/colorcfg.hxx @@ -32,7 +32,6 @@ enum ColorConfigEntry : int DOCCOLOR , DOCBOUNDARIES , APPBACKGROUND , - OBJECTBOUNDARIES , TABLEBOUNDARIES , FONTCOLOR , LINKS , diff --git a/officecfg/registry/data/org/openoffice/Office/UI.xcu b/officecfg/registry/data/org/openoffice/Office/UI.xcu index 942d15fe1f9e..f4e82ec18ecc 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI.xcu @@ -145,9 +145,6 @@ - - true - @@ -157,18 +154,7 @@ - - - true - - - - - - - true - @@ -252,9 +238,6 @@ - - true - diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu index d75dd6c83946..b92f978d5c09 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu @@ -3010,7 +3010,7 @@ - Te~xt Boundaries + Te~xt Boundaries (deprecated) 1 @@ -3018,7 +3018,7 @@ - Sec~tion Boundaries + Sec~tion Boundaries (deprecated) 1 @@ -3186,7 +3186,21 @@ - Table Boundaries + Table Boundaries (deprecated) + + + 1 + + + + + Show Boundaries + + + Boundaries + + + Show boundaries for all types depending on settings at formatting aids. 1 diff --git a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs index 001ee08d2a64..c4de6da82393 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs @@ -577,6 +577,13 @@ false + + + Indicates whether placeholder get a virtual frame. + + + true + diff --git a/officecfg/registry/schema/org/openoffice/Office/UI.xcs b/officecfg/registry/schema/org/openoffice/Office/UI.xcs index dfe27c0d4a73..afb965c541cb 100644 --- a/officecfg/registry/schema/org/openoffice/Office/UI.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/UI.xcs @@ -55,12 +55,6 @@ Specifies the settings for the documents boundaries. - - - Specifies the visibility of anchors (true = visible). - - true - Specifies the color used for of the document boundaries. @@ -77,32 +71,10 @@ - - - Specifies the settings for object boundaries. - - - - Specifies the visibility of object boundaries (true = visible). - - true - - - - Specifies the color used for object boundaries. - - - Specifies the settings for table boundaries. - - - Specifies the visibility of table boundaries (true = visible). - - true - Specifies the color used for table boundaries. @@ -269,12 +241,6 @@ Specifies the settings for section boundaries in Writer. - - - Specifies the visibility of section boundaries (true = visible). - - true - Specifies the color used for section boundaries. diff --git a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs index d1cd0b52d309..1ca15926fec9 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs @@ -901,13 +901,44 @@ 1 - + + + Shows text boundaries, if enabled. + + + true + + + Shows text boundaries as full frame (true) or crop marks (false), if enabled. false + + + + Shows section boundaries, if enabled. + + + true + + + + + Shows table boundaries, if enabled. + + + true + + + + Toggle all boundaries on/off. + + + false + diff --git a/sd/source/ui/dlg/headerfooterdlg.cxx b/sd/source/ui/dlg/headerfooterdlg.cxx index 440664ae1176..c2936d014faa 100644 --- a/sd/source/ui/dlg/headerfooterdlg.cxx +++ b/sd/source/ui/dlg/headerfooterdlg.cxx @@ -689,7 +689,7 @@ void PresLayoutPreview::Paint(vcl::RenderContext& rRenderContext, SdrTextObj con // determine line color svtools::ColorConfig aColorConfig; - svtools::ColorConfigValue aColor( aColorConfig.GetColorValue( bVisible ? svtools::FONTCOLOR : svtools::OBJECTBOUNDARIES ) ); + svtools::ColorConfigValue aColor( aColorConfig.GetColorValue( bVisible ? svtools::FONTCOLOR : svtools::DOCBOUNDARIES ) ); // paint at OutDev rRenderContext.SetLineColor(aColor.nColor); diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index 4087b209db2e..189d3050bbf8 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -39,6 +39,7 @@ #include #include +#include #include #include #include @@ -255,188 +256,187 @@ void ViewRedirector::createRedirectedPrimitive2DSequence( bCreateOutline = true; } } + if (bCreateOutline) + bCreateOutline = officecfg::Office::Impress::Misc::TextObject::ShowBoundary::get(); if(bCreateOutline) { // empty presentation objects get a gray frame const svtools::ColorConfig aColorConfig; - const svtools::ColorConfigValue aColor( aColorConfig.GetColorValue( svtools::OBJECTBOUNDARIES ) ); + const svtools::ColorConfigValue aColor( aColorConfig.GetColorValue( svtools::DOCBOUNDARIES ) ); - if( aColor.bIsVisible ) + // get basic object transformation + const basegfx::BColor aRGBColor(aColor.nColor.getBColor()); + basegfx::B2DHomMatrix aObjectMatrix; + basegfx::B2DPolyPolygon aObjectPolyPolygon; + pObject->TRGetBaseGeometry(aObjectMatrix, aObjectPolyPolygon); + + // create dashed border { - // get basic object transformation - const basegfx::BColor aRGBColor(aColor.nColor.getBColor()); - basegfx::B2DHomMatrix aObjectMatrix; - basegfx::B2DPolyPolygon aObjectPolyPolygon; - pObject->TRGetBaseGeometry(aObjectMatrix, aObjectPolyPolygon); + // create object polygon + basegfx::B2DPolygon aPolygon(basegfx::utils::createUnitPolygon()); + aPolygon.transform(aObjectMatrix); - // create dashed border + // create line and stroke attribute + ::std::vector< double > aDotDashArray { 160.0, 80.0 }; + + const double fFullDotDashLen(::std::accumulate(aDotDashArray.begin(), aDotDashArray.end(), 0.0)); + const drawinglayer::attribute::LineAttribute aLine(aRGBColor); + drawinglayer::attribute::StrokeAttribute aStroke(std::move(aDotDashArray), fFullDotDashLen); + + // create primitive and add + const drawinglayer::primitive2d::Primitive2DReference xRef(new drawinglayer::primitive2d::PolygonStrokePrimitive2D( + std::move(aPolygon), + aLine, + std::move(aStroke))); + rVisitor.visit(xRef); + } + + // now paint the placeholder description, but only when masterpage + // is displayed as page directly (MasterPage view) + if(!bSubContentProcessing && bIsMasterPageObject) + { + OUString aObjectString; + + switch( eKind ) { - // create object polygon - basegfx::B2DPolygon aPolygon(basegfx::utils::createUnitPolygon()); - aPolygon.transform(aObjectMatrix); + case PresObjKind::Title: + { + if(pObjectsSdPage && pObjectsSdPage->GetPageKind() == PageKind::Standard) + { + static OUString aTitleAreaStr(SdResId(STR_PLACEHOLDER_DESCRIPTION_TITLE)); + aObjectString = aTitleAreaStr; + } - // create line and stroke attribute - ::std::vector< double > aDotDashArray { 160.0, 80.0 }; - - const double fFullDotDashLen(::std::accumulate(aDotDashArray.begin(), aDotDashArray.end(), 0.0)); - const drawinglayer::attribute::LineAttribute aLine(aRGBColor); - drawinglayer::attribute::StrokeAttribute aStroke(std::move(aDotDashArray), fFullDotDashLen); - - // create primitive and add - const drawinglayer::primitive2d::Primitive2DReference xRef(new drawinglayer::primitive2d::PolygonStrokePrimitive2D( - std::move(aPolygon), - aLine, - std::move(aStroke))); - rVisitor.visit(xRef); + break; + } + case PresObjKind::Outline: + { + static OUString aOutlineAreaStr(SdResId(STR_PLACEHOLDER_DESCRIPTION_OUTLINE)); + aObjectString = aOutlineAreaStr; + break; + } + case PresObjKind::Footer: + { + static OUString aFooterAreaStr(SdResId(STR_PLACEHOLDER_DESCRIPTION_FOOTER)); + aObjectString = aFooterAreaStr; + break; + } + case PresObjKind::Header: + { + static OUString aHeaderAreaStr(SdResId(STR_PLACEHOLDER_DESCRIPTION_HEADER)); + aObjectString = aHeaderAreaStr; + break; + } + case PresObjKind::DateTime: + { + static OUString aDateTimeStr(SdResId(STR_PLACEHOLDER_DESCRIPTION_DATETIME)); + aObjectString = aDateTimeStr; + break; + } + case PresObjKind::Notes: + { + static OUString aDateTimeStr(SdResId(STR_PLACEHOLDER_DESCRIPTION_NOTES)); + aObjectString = aDateTimeStr; + break; + } + case PresObjKind::SlideNumber: + { + if(pObjectsSdPage && pObjectsSdPage->GetPageKind() == PageKind::Standard) + { + static OUString aSlideAreaStr(SdResId(STR_PLACEHOLDER_DESCRIPTION_SLIDE)); + aObjectString = aSlideAreaStr; + } + else + { + static OUString aNumberAreaStr(SdResId(STR_PLACEHOLDER_DESCRIPTION_NUMBER)); + aObjectString = aNumberAreaStr; + } + break; + } + default: + { + break; + } } - // now paint the placeholder description, but only when masterpage - // is displayed as page directly (MasterPage view) - if(!bSubContentProcessing && bIsMasterPageObject) + if( !aObjectString.isEmpty() ) { - OUString aObjectString; + // decompose object matrix to be able to place text correctly + basegfx::B2DTuple aScale; + basegfx::B2DTuple aTranslate; + double fRotate, fShearX; + aObjectMatrix.decompose(aScale, aTranslate, fRotate, fShearX); - switch( eKind ) - { - case PresObjKind::Title: - { - if(pObjectsSdPage && pObjectsSdPage->GetPageKind() == PageKind::Standard) - { - static OUString aTitleAreaStr(SdResId(STR_PLACEHOLDER_DESCRIPTION_TITLE)); - aObjectString = aTitleAreaStr; - } + // create font + SdrTextObj* pTextObj = DynCastSdrTextObj( pObject ); + const SdrTextVertAdjust eTVA(pTextObj ? pTextObj->GetTextVerticalAdjust() : SDRTEXTVERTADJUST_CENTER); + vcl::Font aScaledVclFont; - break; - } - case PresObjKind::Outline: - { - static OUString aOutlineAreaStr(SdResId(STR_PLACEHOLDER_DESCRIPTION_OUTLINE)); - aObjectString = aOutlineAreaStr; - break; - } - case PresObjKind::Footer: - { - static OUString aFooterAreaStr(SdResId(STR_PLACEHOLDER_DESCRIPTION_FOOTER)); - aObjectString = aFooterAreaStr; - break; - } - case PresObjKind::Header: - { - static OUString aHeaderAreaStr(SdResId(STR_PLACEHOLDER_DESCRIPTION_HEADER)); - aObjectString = aHeaderAreaStr; - break; - } - case PresObjKind::DateTime: - { - static OUString aDateTimeStr(SdResId(STR_PLACEHOLDER_DESCRIPTION_DATETIME)); - aObjectString = aDateTimeStr; - break; - } - case PresObjKind::Notes: - { - static OUString aDateTimeStr(SdResId(STR_PLACEHOLDER_DESCRIPTION_NOTES)); - aObjectString = aDateTimeStr; - break; - } - case PresObjKind::SlideNumber: - { - if(pObjectsSdPage && pObjectsSdPage->GetPageKind() == PageKind::Standard) - { - static OUString aSlideAreaStr(SdResId(STR_PLACEHOLDER_DESCRIPTION_SLIDE)); - aObjectString = aSlideAreaStr; - } - else - { - static OUString aNumberAreaStr(SdResId(STR_PLACEHOLDER_DESCRIPTION_NUMBER)); - aObjectString = aNumberAreaStr; - } - break; - } - default: - { - break; - } - } + // use a text size factor to get more reliable text sizes from the text layouter + // (and from vcl), tipp from HDU + static const sal_uInt32 nTextSizeFactor(100); - if( !aObjectString.isEmpty() ) - { - // decompose object matrix to be able to place text correctly - basegfx::B2DTuple aScale; - basegfx::B2DTuple aTranslate; - double fRotate, fShearX; - aObjectMatrix.decompose(aScale, aTranslate, fRotate, fShearX); + // use a factor to get more linear text size calculations + aScaledVclFont.SetFontHeight( 500 * nTextSizeFactor ); - // create font - SdrTextObj* pTextObj = DynCastSdrTextObj( pObject ); - const SdrTextVertAdjust eTVA(pTextObj ? pTextObj->GetTextVerticalAdjust() : SDRTEXTVERTADJUST_CENTER); - vcl::Font aScaledVclFont; + // get basic geometry and get text size + drawinglayer::primitive2d::TextLayouterDevice aTextLayouter; + aTextLayouter.setFont(aScaledVclFont); + const sal_Int32 nTextLength(aObjectString.getLength()); - // use a text size factor to get more reliable text sizes from the text layouter - // (and from vcl), tipp from HDU - static const sal_uInt32 nTextSizeFactor(100); + // do not forget to use the factor again to get the width for the 500 + const double fTextWidth(aTextLayouter.getTextWidth(aObjectString, 0, nTextLength) * (1.0 / nTextSizeFactor)); + const double fTextHeight(aTextLayouter.getTextHeight() * (1.0 / nTextSizeFactor)); - // use a factor to get more linear text size calculations - aScaledVclFont.SetFontHeight( 500 * nTextSizeFactor ); + // calculate text primitive position. If text is at bottom, use top for + // the extra text and vice versa + const double fHorDist(125); + const double fVerDist(125); + const double fPosX((aTranslate.getX() + aScale.getX()) - fTextWidth - fHorDist); + const double fPosY((SDRTEXTVERTADJUST_BOTTOM == eTVA) + ? aTranslate.getY() - fVerDist + fTextHeight + : (aTranslate.getY() + aScale.getY()) - fVerDist); - // get basic geometry and get text size - drawinglayer::primitive2d::TextLayouterDevice aTextLayouter; - aTextLayouter.setFont(aScaledVclFont); - const sal_Int32 nTextLength(aObjectString.getLength()); + // get font attributes; use normally scaled font + vcl::Font aVclFont; + basegfx::B2DVector aTextSizeAttribute; - // do not forget to use the factor again to get the width for the 500 - const double fTextWidth(aTextLayouter.getTextWidth(aObjectString, 0, nTextLength) * (1.0 / nTextSizeFactor)); - const double fTextHeight(aTextLayouter.getTextHeight() * (1.0 / nTextSizeFactor)); + aVclFont.SetFontHeight( 500 ); - // calculate text primitive position. If text is at bottom, use top for - // the extra text and vice versa - const double fHorDist(125); - const double fVerDist(125); - const double fPosX((aTranslate.getX() + aScale.getX()) - fTextWidth - fHorDist); - const double fPosY((SDRTEXTVERTADJUST_BOTTOM == eTVA) - ? aTranslate.getY() - fVerDist + fTextHeight - : (aTranslate.getY() + aScale.getY()) - fVerDist); + drawinglayer::attribute::FontAttribute aFontAttribute( + drawinglayer::primitive2d::getFontAttributeFromVclFont( + aTextSizeAttribute, + aVclFont, + false, + false)); - // get font attributes; use normally scaled font - vcl::Font aVclFont; - basegfx::B2DVector aTextSizeAttribute; + // fill text matrix + const basegfx::B2DHomMatrix aTextMatrix(basegfx::utils::createScaleShearXRotateTranslateB2DHomMatrix( + aTextSizeAttribute.getX(), aTextSizeAttribute.getY(), + fShearX, + fRotate, + fPosX, fPosY)); - aVclFont.SetFontHeight( 500 ); + // create DXTextArray (can be empty one) + ::std::vector< double > aDXArray{}; - drawinglayer::attribute::FontAttribute aFontAttribute( - drawinglayer::primitive2d::getFontAttributeFromVclFont( - aTextSizeAttribute, - aVclFont, - false, - false)); + // create locale; this may need some more information in the future + css::lang::Locale aLocale; - // fill text matrix - const basegfx::B2DHomMatrix aTextMatrix(basegfx::utils::createScaleShearXRotateTranslateB2DHomMatrix( - aTextSizeAttribute.getX(), aTextSizeAttribute.getY(), - fShearX, - fRotate, - fPosX, fPosY)); - - // create DXTextArray (can be empty one) - ::std::vector< double > aDXArray{}; - - // create locale; this may need some more information in the future - css::lang::Locale aLocale; - - // create primitive and add - const drawinglayer::primitive2d::Primitive2DReference xRef( - new drawinglayer::primitive2d::TextSimplePortionPrimitive2D( - aTextMatrix, - aObjectString, - 0, - nTextLength, - std::move(aDXArray), - {}, - std::move(aFontAttribute), - std::move(aLocale), - aRGBColor)); - rVisitor.visit(xRef); - } + // create primitive and add + const drawinglayer::primitive2d::Primitive2DReference xRef( + new drawinglayer::primitive2d::TextSimplePortionPrimitive2D( + aTextMatrix, + aObjectString, + 0, + nTextLength, + std::move(aDXArray), + {}, + std::move(aFontAttribute), + std::move(aLocale), + aRGBColor)); + rVisitor.visit(xRef); } } } diff --git a/sd/uiconfig/sdraw/ui/notebookbar_groupedbar_compact.ui b/sd/uiconfig/sdraw/ui/notebookbar_groupedbar_compact.ui index 2c98c6214e1d..99cd512de694 100644 --- a/sd/uiconfig/sdraw/ui/notebookbar_groupedbar_compact.ui +++ b/sd/uiconfig/sdraw/ui/notebookbar_groupedbar_compact.ui @@ -1257,14 +1257,7 @@ True False - .uno:ViewBounds - - - - - True - False - .uno:TableBoundaries + .uno:ShowBoundaries diff --git a/sd/uiconfig/simpress/ui/notebookbar_groupedbar_compact.ui b/sd/uiconfig/simpress/ui/notebookbar_groupedbar_compact.ui index 4f91bf2a2790..c854c27e1c82 100644 --- a/sd/uiconfig/simpress/ui/notebookbar_groupedbar_compact.ui +++ b/sd/uiconfig/simpress/ui/notebookbar_groupedbar_compact.ui @@ -1237,14 +1237,7 @@ True False - .uno:ViewBounds - - - - - True - False - .uno:TableBoundaries + .uno:ShowBoundaries diff --git a/svtools/source/config/colorcfg.cxx b/svtools/source/config/colorcfg.cxx index c75c8986130d..1065f3fbf876 100644 --- a/svtools/source/config/colorcfg.cxx +++ b/svtools/source/config/colorcfg.cxx @@ -113,10 +113,9 @@ uno::Sequence< OUString> GetPropertyNames(std::u16string_view rScheme) static const ColorConfigEntryData_Impl cNames[] = { { std::u16string_view(u"/DocColor") ,false }, - { std::u16string_view(u"/DocBoundaries") ,true }, + { std::u16string_view(u"/DocBoundaries") ,false }, { std::u16string_view(u"/AppBackground") ,false }, - { std::u16string_view(u"/ObjectBoundaries"),true }, - { std::u16string_view(u"/TableBoundaries") ,true }, + { std::u16string_view(u"/TableBoundaries") ,false }, { std::u16string_view(u"/FontColor") ,false }, { std::u16string_view(u"/Links") ,true }, { std::u16string_view(u"/LinksVisited") ,true }, @@ -129,7 +128,7 @@ uno::Sequence< OUString> GetPropertyNames(std::u16string_view rScheme) { std::u16string_view(u"/WriterIdxShadings") ,true }, { std::u16string_view(u"/WriterDirectCursor") ,true }, { std::u16string_view(u"/WriterScriptIndicator") ,false }, - { std::u16string_view(u"/WriterSectionBoundaries") ,true }, + { std::u16string_view(u"/WriterSectionBoundaries") ,false }, { std::u16string_view(u"/WriterHeaderFooterMark") ,false }, { std::u16string_view(u"/WriterPageBreaks") ,false }, { std::u16string_view(u"/WriterNonPrintChars") ,false }, @@ -549,7 +548,6 @@ Color ColorConfig::GetDefaultColor(ColorConfigEntry eEntry, int nMod) { COL_WHITE, Color(0x1C1C1C) }, // DOCCOLOR { COL_LIGHTGRAY, Color(0x808080) }, // DOCBOUNDARIES { Color(0xDFDFDE), Color(0x333333) }, // APPBACKGROUND - { COL_LIGHTGRAY, Color(0x808080) }, // OBJECTBOUNDARIES { COL_LIGHTGRAY, Color(0x808080) }, // TABLEBOUNDARIES { COL_BLACK, COL_BLACK }, // FONTCOLOR { COL_BLUE, Color(0x1D99F3) }, // LINKS diff --git a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx index 9430ac55ba3e..46dca806420b 100644 --- a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx @@ -287,7 +287,7 @@ void ViewObjectContactOfPageObj::createPrimitive2DSequence(const DisplayInfo& /* // add a gray outline frame, except not when printing if(bCreateGrayFrame) { - const Color aFrameColor(aColorConfig.GetColorValue(svtools::OBJECTBOUNDARIES).nColor); + const Color aFrameColor(aColorConfig.GetColorValue(svtools::DOCBOUNDARIES).nColor); basegfx::B2DPolygon aOwnOutline(basegfx::utils::createUnitPolygon()); aOwnOutline.transform(aPageObjectTransform); diff --git a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx index 7868303c5c08..9bbb06dde830 100644 --- a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx @@ -117,7 +117,7 @@ namespace drawinglayer::primitive2d return new GroupPrimitive2D(std::move(aContainer)); const svtools::ColorConfig aColorConfig; - const svtools::ColorConfigValue aColor(aColorConfig.GetColorValue(svtools::OBJECTBOUNDARIES)); + const svtools::ColorConfigValue aColor(aColorConfig.GetColorValue(svtools::DOCBOUNDARIES)); if(aColor.bIsVisible) { diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx index e744fc613a27..2d123a6a360e 100644 --- a/svx/source/svdraw/svdoole2.cxx +++ b/svx/source/svdraw/svdoole2.cxx @@ -1317,7 +1317,7 @@ rtl::Reference SdrOle2Obj::createSdrGrafObjReplacement(bool bAddText) // gray outline pClone->SetMergedItem(XLineStyleItem(css::drawing::LineStyle_SOLID)); const svtools::ColorConfig aColorConfig; - const svtools::ColorConfigValue aColor(aColorConfig.GetColorValue(svtools::OBJECTBOUNDARIES)); + const svtools::ColorConfigValue aColor(aColorConfig.GetColorValue(svtools::DOCBOUNDARIES)); pClone->SetMergedItem(XLineColorItem(OUString(), aColor.nColor)); // bitmap fill diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h index 02d06446328b..e6bef505a03c 100644 --- a/sw/inc/cmdid.h +++ b/sw/inc/cmdid.h @@ -157,6 +157,7 @@ class SwUINumRuleItem; #define FN_DRAW_WRAP_DLG TypedWhichId(FN_VIEW + 3) /* Draw wrapping dlg */ #define FN_RULER (FN_VIEW + 11) /* Horizontal ruler */ +#define FN_VIEW_BOUNDARIES (FN_VIEW + 12) /* View text, section, table boundaries */ #define FN_VIEW_GRAPHIC (FN_VIEW + 13) /* View graphic */ #define FN_VIEW_BOUNDS (FN_VIEW + 14) /* View bounds */ #define FN_VIEW_FIELDS (FN_VIEW + 15) /* View fields */ @@ -164,6 +165,7 @@ class SwUINumRuleItem; #define FN_VSCROLLBAR (FN_VIEW + 17) /* Vertical Scrollbar */ #define FN_HSCROLLBAR (FN_VIEW + 18) /* Horizontal Scrollbar */ #define FN_VIEW_SECTION_BOUNDARIES (FN_VIEW + 19) /* View section boundaries */ +// slot number 20220 conflicts with FN_BUL_NUM_RULE_INDEX! #define FN_VIEW_META_CHARS (FN_VIEW + 24) /* View meta chars */ #define FN_VIEW_MARKS (FN_VIEW + 25) /* View marks */ diff --git a/sw/inc/viewopt.hxx b/sw/inc/viewopt.hxx index 1aedb38d243b..1a9139ecc8d8 100644 --- a/sw/inc/viewopt.hxx +++ b/sw/inc/viewopt.hxx @@ -69,7 +69,11 @@ struct ViewOptFlags1 bool bShowOutlineContentVisibilityButton : 1; bool bShowChangesInMargin : 1; //tracked deletions in margin bool bShowChangesInMargin2 : 1; //tracked insertions in margin + bool bTextBoundaries : 1; // text boundaries bool bTextBoundariesFull : 1; // true = frame around text, false = crop marks at edges + bool bSectionBoundaries : 1; // section boundaries + bool bTableBoundaries : 1; // table boundaries + bool bShowBoundaries : 1; // show all boundaries ViewOptFlags1() : bUseHeaderFooterMenu(false) @@ -103,7 +107,11 @@ struct ViewOptFlags1 , bShowOutlineContentVisibilityButton(false) , bShowChangesInMargin(false) , bShowChangesInMargin2(false) + , bTextBoundaries(true) , bTextBoundariesFull(false) + , bSectionBoundaries(true) + , bTableBoundaries(true) + , bShowBoundaries(false) {} bool operator==(const ViewOptFlags1& rOther) const @@ -139,7 +147,11 @@ struct ViewOptFlags1 && bShowOutlineContentVisibilityButton == rOther.bShowOutlineContentVisibilityButton && bShowChangesInMargin == rOther.bShowChangesInMargin && bShowChangesInMargin2 == rOther.bShowChangesInMargin2 - && bTextBoundariesFull == rOther.bTextBoundariesFull; + && bTextBoundaries == rOther.bTextBoundaries + && bTextBoundariesFull == rOther.bTextBoundariesFull + && bSectionBoundaries == rOther.bSectionBoundaries + && bTableBoundaries == rOther.bTableBoundaries + && bShowBoundaries == rOther.bShowBoundaries; } void dumpAsXml(xmlTextWriterPtr pWriter) const; @@ -185,15 +197,11 @@ namespace o3tl { // Appearance flags. enum class ViewOptFlags { NONE = 0x0000, - DocBoundaries = 0x0001, - ObjectBoundaries = 0x0002, - TableBoundaries = 0x0004, - IndexShadings = 0x0008, - Links = 0x0010, - VisitedLinks = 0x0020, - FieldShadings = 0x0040, - SectionBoundaries = 0x0080, - Shadow = 0x0100, + IndexShadings = 0x0001, + Links = 0x0002, + VisitedLinks = 0x0004, + FieldShadings = 0x0008, + Shadow = 0x0010, }; namespace o3tl { template<> struct typed_flags : is_typed_flags {}; @@ -207,7 +215,6 @@ struct SwViewColors { return m_aDocColor == rOther.m_aDocColor && m_aDocBoundColor == rOther.m_aDocBoundColor - && m_aObjectBoundColor == rOther.m_aObjectBoundColor && m_aAppBackgroundColor == rOther.m_aAppBackgroundColor && m_aTableBoundColor == rOther.m_aTableBoundColor && m_aFontColor == rOther.m_aFontColor @@ -229,7 +236,6 @@ struct SwViewColors } Color m_aDocColor; // color of document boundaries Color m_aDocBoundColor; // color of document boundaries - Color m_aObjectBoundColor; // color of object boundaries Color m_aAppBackgroundColor; // application background Color m_aTableBoundColor; // color of table boundaries Color m_aFontColor; @@ -665,9 +671,21 @@ public: bool IsMultipageView() const { return IsViewLayoutBookMode() || GetViewLayoutColumns() == 0; } + bool IsTextBoundaries() const { return m_nCoreOptions.bTextBoundaries; } + void SetTextBoundaries( bool b) { m_nCoreOptions.bTextBoundaries = b; } + bool IsTextBoundariesFull() const { return m_nCoreOptions.bTextBoundariesFull; } void SetTextBoundariesFull( bool b) { m_nCoreOptions.bTextBoundariesFull = b; } + bool IsSectionBoundaries() const { return m_nCoreOptions.bSectionBoundaries; } + void SetSectionBoundaries( bool b) { m_nCoreOptions.bSectionBoundaries = b; } + + bool IsTableBoundaries() const { return m_nCoreOptions.bTableBoundaries; } + void SetTableBoundaries( bool b) { m_nCoreOptions.bTableBoundaries = b; } + + bool IsShowBoundaries() const { return m_nCoreOptions.bShowBoundaries; } + void SetShowBoundaries( bool b ) { m_nCoreOptions.bShowBoundaries = b; } + #ifdef DBG_UTIL // Correspond to statements in ui/config/cfgvw.src. bool IsTest1() const { return m_bTest1; } @@ -842,7 +860,6 @@ public: SW_DLLPUBLIC const Color& GetDocColor() const; SW_DLLPUBLIC const Color& GetDocBoundariesColor() const; const Color& GetAppBackgroundColor() const; - const Color& GetObjectBoundariesColor() const; const Color& GetTableBoundariesColor() const; const Color& GetIndexShadingsColor() const; const Color& GetLinksColor() const; @@ -861,20 +878,14 @@ public: bool IsAppearanceFlag(ViewOptFlags nFlag) const; - bool IsDocBoundaries() const {return IsAppearanceFlag(ViewOptFlags::DocBoundaries);} - bool IsObjectBoundaries() const {return IsAppearanceFlag(ViewOptFlags::ObjectBoundaries);} - bool IsTableBoundaries() const {return IsAppearanceFlag(ViewOptFlags::TableBoundaries);} bool IsIndexShadings() const {return IsAppearanceFlag(ViewOptFlags::IndexShadings);} bool IsLinks() const {return IsAppearanceFlag(ViewOptFlags::Links);} bool IsVisitedLinks() const {return IsAppearanceFlag(ViewOptFlags::VisitedLinks);} bool IsFieldShadings() const {return IsAppearanceFlag(ViewOptFlags::FieldShadings);} - bool IsSectionBoundaries() const {return IsAppearanceFlag(ViewOptFlags::SectionBoundaries);} bool IsShadow() const {return IsAppearanceFlag(ViewOptFlags::Shadow);} void SetAppearanceFlag(ViewOptFlags nFlag, bool bSet, bool bSaveInConfig = false); - void SetDocBoundaries(bool bSet) {SetAppearanceFlag(ViewOptFlags::DocBoundaries, bSet);} - // get/set default anchor (0..2); use GetDefaultAnchorType() to convert into RndStdIds::FLY_* sal_Int32 GetDefaultAnchor() const { return m_nDefaultAnchor; } diff --git a/sw/qa/uitest/options/tdf78133.py b/sw/qa/uitest/options/tdf78133.py index d1d504523a90..3c650cad8401 100644 --- a/sw/qa/uitest/options/tdf78133.py +++ b/sw/qa/uitest/options/tdf78133.py @@ -27,8 +27,8 @@ class tdf78133(UITestCase): xLoAppColorsEntry = xLOEntry.getChild('8') xLoAppColorsEntry.executeAction("SELECT", tuple()) #Applications Colors #change text boundaries checkbox, save - docboundaries = xDialog.getChild("docboundaries") - docboundaries.executeAction("CLICK", tuple()) + shadows = xDialog.getChild("shadows") + shadows.executeAction("CLICK", tuple()) #verify - reopen dialog and check if "text boundaries" is still unchecked with self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") as xDialog: @@ -38,7 +38,7 @@ class tdf78133(UITestCase): xLoAppColorsEntry = xLOEntry.getChild('8') xLoAppColorsEntry.executeAction("SELECT", tuple()) #Applications Colors #change text boundaries checkbox, save - docboundaries = xDialog.getChild("docboundaries") - self.assertEqual(get_state_as_dict(docboundaries)["Selected"], "false") + shadows = xDialog.getChild("shadows") + self.assertEqual(get_state_as_dict(shadows)["Selected"], "false") # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sw/sdi/_viewsh.sdi b/sw/sdi/_viewsh.sdi index 1ec913474a44..ba6ae5f6775d 100644 --- a/sw/sdi/_viewsh.sdi +++ b/sw/sdi/_viewsh.sdi @@ -889,6 +889,12 @@ interface BaseTextEditView StateMethod = StateViewOptions ; ] + FN_VIEW_BOUNDARIES // status() + [ + ExecMethod = ExecViewOptions ; + StateMethod = StateViewOptions ; + ] + FN_VIEW_GRAPHIC // status() [ ExecMethod = ExecViewOptions ; diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi index 0bc5e6e58952..caa91ab74f94 100644 --- a/sw/sdi/swriter.sdi +++ b/sw/sdi/swriter.sdi @@ -6366,7 +6366,7 @@ SfxVoidItem SynchronizeLabelsDlg FN_SYNC_LABELS GroupId = SfxGroupId::Edit; ] -SfxBoolItem TableBoundaries FN_VIEW_TABLEGRID +SfxBoolItem TableBoundaries FN_VIEW_TABLEGRID // deprecated 25.2 [ AutoUpdate = FALSE, @@ -6376,7 +6376,21 @@ SfxBoolItem TableBoundaries FN_VIEW_TABLEGRID Container = FALSE, RecordAbsolute = FALSE, RecordPerSet; + AccelConfig = FALSE, + MenuConfig = FALSE, + ToolBoxConfig = FALSE, + GroupId = SfxGroupId::View; +] +SfxBoolItem ShowBoundaries FN_VIEW_BOUNDARIES +[ + AutoUpdate = TRUE, + FastCall = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; AccelConfig = TRUE, MenuConfig = TRUE, @@ -6785,8 +6799,7 @@ SfxVoidItem UpdateInputFields FN_UPDATE_INPUTFIELDS GroupId = SfxGroupId::Edit; ] -SfxBoolItem ViewBounds FN_VIEW_BOUNDS - +SfxBoolItem ViewBounds FN_VIEW_BOUNDS // deprecated 25.2 [ AutoUpdate = FALSE, FastCall = FALSE, @@ -6797,14 +6810,13 @@ SfxBoolItem ViewBounds FN_VIEW_BOUNDS RecordPerSet; - AccelConfig = TRUE, - MenuConfig = TRUE, - ToolBoxConfig = TRUE, + AccelConfig = FALSE, + MenuConfig = FALSE, + ToolBoxConfig = FALSE, GroupId = SfxGroupId::View; ] -SfxBoolItem SectionBoundaries FN_VIEW_SECTION_BOUNDARIES - +SfxBoolItem SectionBoundaries FN_VIEW_SECTION_BOUNDARIES // deprecated 25.2 [ AutoUpdate = FALSE, FastCall = FALSE, @@ -6815,9 +6827,9 @@ SfxBoolItem SectionBoundaries FN_VIEW_SECTION_BOUNDARIES RecordPerSet; - AccelConfig = TRUE, - MenuConfig = TRUE, - ToolBoxConfig = TRUE, + AccelConfig = FALSE, + MenuConfig = FALSE, + ToolBoxConfig = FALSE, GroupId = SfxGroupId::View; ] diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 24803baf1c89..5e1bb1392638 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -333,51 +333,12 @@ struct SwPaintProperties { static SwPaintProperties gProp; -static bool isSubsidiaryLinesFlysEnabled() -{ - return !gProp.pSGlobalShell->GetViewOptions()->IsPagePreview() && - !gProp.pSGlobalShell->GetViewOptions()->IsReadonly() && - !gProp.pSGlobalShell->GetViewOptions()->IsFormView() && - gProp.pSGlobalShell->GetViewOptions()->IsObjectBoundaries(); -} -//other subsidiary lines enabled? static bool isSubsidiaryLinesEnabled() { return !gProp.pSGlobalShell->GetViewOptions()->IsPagePreview() && !gProp.pSGlobalShell->GetViewOptions()->IsReadonly() && !gProp.pSGlobalShell->GetViewOptions()->IsFormView() && - !gProp.pSGlobalShell->GetViewOptions()->IsWhitespaceHidden() && - gProp.pSGlobalShell->GetViewOptions()->IsDocBoundaries(); -} -//subsidiary lines for sections -static bool isSubsidiaryLinesForSectionsEnabled() -{ - return !gProp.pSGlobalShell->GetViewOptions()->IsPagePreview() && - !gProp.pSGlobalShell->GetViewOptions()->IsReadonly() && - !gProp.pSGlobalShell->GetViewOptions()->IsFormView() && - gProp.pSGlobalShell->GetViewOptions()->IsSectionBoundaries(); -} - - -namespace { - -bool isTableBoundariesEnabled() -{ - if (!gProp.pSGlobalShell->GetViewOptions()->IsTable()) - return false; - - if (gProp.pSGlobalShell->GetViewOptions()->IsPagePreview()) - return false; - - if (gProp.pSGlobalShell->GetViewOptions()->IsReadonly()) - return false; - - if (gProp.pSGlobalShell->GetViewOptions()->IsFormView()) - return false; - - return gProp.pSGlobalShell->GetViewOptions()->IsTableBoundaries(); -} - + gProp.pSGlobalShell->GetViewOptions()->IsShowBoundaries(); } /** @@ -1107,8 +1068,8 @@ void SwSubsRects::PaintSubsidiary( OutputDevice *pOut, switch ( rLRect.GetSubColor() ) { case SubColFlags::Page: pCol = &pOpt->GetDocBoundariesColor(); break; - case SubColFlags::Fly: pCol = &pOpt->GetObjectBoundariesColor(); break; case SubColFlags::Tab: pCol = &pOpt->GetTableBoundariesColor(); break; + case SubColFlags::Fly: case SubColFlags::Sect: pCol = &pOpt->GetSectionBoundColor(); break; } @@ -2576,7 +2537,9 @@ void SwTabFramePainter::PaintLines(OutputDevice& rDev, const SwRect& rRect) cons const Color* pTmpColor = nullptr; if (0 == aStyles[ 0 ].GetWidth()) { - if (isTableBoundariesEnabled() && gProp.pSGlobalShell->GetWin()) + if (isSubsidiaryLinesEnabled() && + gProp.pSGlobalShell->GetViewOptions()->IsTableBoundaries() && + gProp.pSGlobalShell->GetWin()) aStyles[ 0 ].Set( rCol, rCol, rCol, false, 1, 0, 0 ); else aStyles[0].SetType(SvxBorderLineStyle::NONE); @@ -6564,7 +6527,7 @@ static void lcl_paintBitmapExToRect(vcl::RenderContext *pOut, const Point& aPoin _pViewShell->GetOut()->SetLineColor(); if (!bRight) { - _pViewShell->GetOut()->SetFillColor(_pViewShell->GetViewOptions()->GetObjectBoundariesColor()); + _pViewShell->GetOut()->SetFillColor(_pViewShell->GetViewOptions()->GetDocBoundariesColor()); _pViewShell->GetOut()->DrawRect(tools::Rectangle(Point(aPageRect.Left()-pMgr->GetSidebarBorderWidth(),aPageRect.Top()),Size(pMgr->GetSidebarBorderWidth(),aPageRect.Height()))) ; if (Application::GetSettings().GetStyleSettings().GetHighContrastMode() ) _pViewShell->GetOut()->SetFillColor(COL_BLACK); @@ -6574,7 +6537,7 @@ static void lcl_paintBitmapExToRect(vcl::RenderContext *pOut, const Point& aPoin } else { - _pViewShell->GetOut()->SetFillColor(_pViewShell->GetViewOptions()->GetObjectBoundariesColor()); + _pViewShell->GetOut()->SetFillColor(_pViewShell->GetViewOptions()->GetDocBoundariesColor()); SwRect aSidebarBorder(aPageRect.TopRight(),Size(pMgr->GetSidebarBorderWidth(),aPageRect.Height())); _pViewShell->GetOut()->DrawRect(aSidebarBorder.SVRect()); if (Application::GetSettings().GetStyleSettings().GetHighContrastMode() ) @@ -7065,8 +7028,10 @@ void SwFrame::PaintSwFrameBackground( const SwRect &rRect, const SwPageFrame *pP /// Refreshes all subsidiary lines of a page. void SwPageFrame::RefreshSubsidiary( const SwRect &rRect ) const { - if ( !(isSubsidiaryLinesEnabled() || isTableBoundariesEnabled() - || isSubsidiaryLinesForSectionsEnabled() || isSubsidiaryLinesFlysEnabled()) ) + if ( !(isSubsidiaryLinesEnabled() || + gProp.pSGlobalShell->GetViewOptions()->IsTextBoundaries() || + gProp.pSGlobalShell->GetViewOptions()->IsSectionBoundaries() || + gProp.pSGlobalShell->GetViewOptions()->IsTableBoundaries()) ) return; if ( !rRect.HasArea() ) @@ -7099,10 +7064,7 @@ void SwPageFrame::RefreshSubsidiary( const SwRect &rRect ) const void SwLayoutFrame::RefreshLaySubsidiary( const SwPageFrame *pPage, const SwRect &rRect ) const { - const bool bSubsOpt = isSubsidiaryLinesEnabled() - || (IsSctFrame() && isSubsidiaryLinesForSectionsEnabled()) - || (IsFlyFrame() && isSubsidiaryLinesFlysEnabled()); - if (bSubsOpt) + if (isSubsidiaryLinesEnabled()) PaintSubsidiaryLines( pPage, rRect ); const SwFrame *pLow = Lower(); @@ -7350,7 +7312,7 @@ std::vector SwPageFrame::GetSubsidiaryLinesPolygons(const S { std::vector aPolygons; - if (!rViewShell.GetViewOptions()->IsDocBoundaries()) + if (!rViewShell.GetViewOptions()->IsTextBoundaries()) return aPolygons; const SwFrame* pLay = Lower(); @@ -7499,7 +7461,7 @@ std::vector SwHeadFootFrame::GetSubsidiaryLinesPolygons(con { std::vector aPolygons; - if (!rViewShell.GetViewOptions()->IsDocBoundaries()) + if (!rViewShell.GetViewOptions()->IsTextBoundaries()) return aPolygons; SwRect aArea( getFramePrintArea() ); @@ -7573,22 +7535,12 @@ void SwLayoutFrame::PaintSubsidiaryLines( const SwPageFrame *pPage, const bool bCell = IsCellFrame(); - if (!bCell && IsFlyFrame()) - { - if (!gProp.pSGlobalShell->GetViewOptions()->IsObjectBoundaries()) - return; - - // if the frame is wrap none or wrap through, then text boundary lines have no meaning - // (unless the frame itself contains text) - const text::WrapTextMode aSurround = GetFormat()->GetSurround().GetSurround(); - if (GetFormat()->GetAnchor().GetAnchorId() != RndStdIds::FLY_AS_CHAR - && (!Lower() || !Lower()->IsTextFrame()) - && (aSurround == text::WrapTextMode::WrapTextMode_THROUGH - || aSurround == text::WrapTextMode::WrapTextMode_NONE)) - { - return; - } - } + if ( (IsSctFrame() || IsFlyFrame()) && + !gProp.pSGlobalShell->GetViewOptions()->IsSectionBoundaries() ) + return; + if ( IsTextFrame() && + !gProp.pSGlobalShell->GetViewOptions()->IsTextBoundaries() ) + return; // #i3662# - use frame area for cells for section use also frame area const bool bUseFrameArea = bCell || IsSctFrame(); diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index 5cb915d69785..a591b9dbd5d9 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -1744,6 +1744,9 @@ SwShdwCursorOptionsTabPage::SwShdwCursorOptionsTabPage(weld::Container* pPage, w , m_xFmtAidsAutoComplFrame(m_xBuilder->weld_frame(u"fmtaidsautocompleteframe"_ustr)) , m_xEncloseWithCharactersCB(m_xBuilder->weld_check_button(u"enclosewithcharacters"_ustr)) , m_xEncloseWithCharactersImg(m_xBuilder->weld_widget(u"lockenclosewithcharacters"_ustr)) + , m_xTextBoundariesCB(m_xBuilder->weld_check_button(u"cbTextBoundaries"_ustr)) + , m_xSectionBoundariesCB(m_xBuilder->weld_check_button(u"cbSectionBoundaries"_ustr)) + , m_xTableBoundariesCB(m_xBuilder->weld_check_button(u"cbTableBoundaries"_ustr)) { SwFillMode eMode = SwFillMode::Tab; bool bIsOn = false; @@ -1762,6 +1765,8 @@ SwShdwCursorOptionsTabPage::SwShdwCursorOptionsTabPage(weld::Container* pPage, w } m_xEncloseWithCharactersCB->set_active(bIsEncloseWithCharactersOn); + m_xTextBoundariesCB->connect_toggled(LINK(this, SwShdwCursorOptionsTabPage, TextBoundariesHdl)); + m_xDirectCursorFillMode->set_active( static_cast(eMode) ); const SfxUInt16Item* pHtmlModeItem = rSet.GetItemIfSet(SID_HTML_MODE, false); if(!pHtmlModeItem || !(pHtmlModeItem->GetValue() & HTMLMODE_ON)) @@ -1790,6 +1795,13 @@ SwShdwCursorOptionsTabPage::~SwShdwCursorOptionsTabPage() { } +IMPL_LINK_NOARG( SwShdwCursorOptionsTabPage, TextBoundariesHdl, weld::Toggleable&, void ) +{ + const bool bIsTextBoundaries(m_xTextBoundariesCB->get_active()); + m_xTextBoundariesFull->set_sensitive(bIsTextBoundaries); + m_xTextBoundariesCrop->set_sensitive(bIsTextBoundaries); +} + std::unique_ptr SwShdwCursorOptionsTabPage::Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet ) { return std::make_unique(pPage, pController, *rSet); @@ -1880,6 +1892,9 @@ bool SwShdwCursorOptionsTabPage::FillItemSet( SfxItemSet* rSet ) aDisp.m_bManualBreak = m_xBreakCB->get_active(); aDisp.m_xDefaultAnchor = m_xDefaultAnchorType->get_active(); aDisp.m_bTextBoundariesFull = m_xTextBoundariesFull->get_active(); + aDisp.m_bTextBoundaries = m_xTextBoundariesCB->get_active(); + aDisp.m_bSectionBoundaries = m_xSectionBoundariesCB->get_active(); + aDisp.m_bTableBoundaries = m_xTableBoundariesCB->get_active(); bRet |= (!pOldAttr || aDisp != *pOldAttr); if(bRet) @@ -1991,10 +2006,25 @@ void SwShdwCursorOptionsTabPage::Reset( const SfxItemSet* rSet ) m_xDefaultAnchorType->set_sensitive(!bReadOnly); m_xDefaultAnchorTypeImg->set_visible(bReadOnly); + bReadOnly = officecfg::Office::Writer::Content::Display::TextBoundaries::isReadOnly(); + m_xTextBoundariesCB->set_active( pDocDisplayAttr->m_bTextBoundaries ); + m_xTextBoundariesCB->set_sensitive(!bReadOnly); + + const bool bIsTextBoundaries(m_xTextBoundariesCB->get_active()); + m_xTextBoundariesFull->set_sensitive(bIsTextBoundaries); + m_xTextBoundariesCrop->set_sensitive(bIsTextBoundaries); if (pDocDisplayAttr->m_bTextBoundariesFull) m_xTextBoundariesFull->set_active(true); else m_xTextBoundariesCrop->set_active(true); + + bReadOnly = officecfg::Office::Writer::Content::Display::SectionBoundaries::isReadOnly(); + m_xSectionBoundariesCB->set_active( pDocDisplayAttr->m_bSectionBoundaries ); + m_xSectionBoundariesCB->set_sensitive(!bReadOnly); + + bReadOnly = officecfg::Office::Writer::Content::Display::TableBoundaries::isReadOnly(); + m_xTableBoundariesCB->set_active( pDocDisplayAttr->m_bTableBoundaries ); + m_xTableBoundariesCB->set_sensitive(!bReadOnly); } } diff --git a/sw/source/uibase/config/cfgitems.cxx b/sw/source/uibase/config/cfgitems.cxx index 5018e1d0fbfa..33791054fe3a 100644 --- a/sw/source/uibase/config/cfgitems.cxx +++ b/sw/source/uibase/config/cfgitems.cxx @@ -34,7 +34,10 @@ SwDocDisplayItem::SwDocDisplayItem() : m_bCharHiddenText = m_bBookmarks = m_bManualBreak = true; + m_bTextBoundaries = true; m_bTextBoundariesFull = false; // default is crop + m_bSectionBoundaries = true; + m_bTableBoundaries = true; m_xDefaultAnchor = 1; //FLY_TO_CHAR }; @@ -50,7 +53,10 @@ SwDocDisplayItem::SwDocDisplayItem(const SwViewOption& rVOpt ) : m_bCharHiddenText = rVOpt.IsShowHiddenChar(true); m_bBookmarks = rVOpt.IsShowBookmarks(true); m_bManualBreak = rVOpt.IsLineBreak(true); + m_bTextBoundaries = rVOpt.IsTextBoundaries(); m_bTextBoundariesFull = rVOpt.IsTextBoundariesFull(); + m_bSectionBoundaries = rVOpt.IsSectionBoundaries(); + m_bTableBoundaries = rVOpt.IsTableBoundaries(); m_xDefaultAnchor = rVOpt.GetDefaultAnchor(); } @@ -73,7 +79,10 @@ bool SwDocDisplayItem::operator==( const SfxPoolItem& rAttr ) const m_bCharHiddenText == rItem.m_bCharHiddenText && m_bBookmarks == rItem.m_bBookmarks && m_bManualBreak == rItem.m_bManualBreak && + m_bTextBoundaries == rItem.m_bTextBoundaries && m_bTextBoundariesFull == rItem.m_bTextBoundariesFull && + m_bSectionBoundaries == rItem.m_bSectionBoundaries && + m_bTableBoundaries == rItem.m_bTableBoundaries && m_xDefaultAnchor == rItem.m_xDefaultAnchor); } @@ -87,7 +96,10 @@ void SwDocDisplayItem::FillViewOptions( SwViewOption& rVOpt) const rVOpt.SetShowHiddenChar(m_bCharHiddenText ); rVOpt.SetShowBookmarks(m_bBookmarks ); rVOpt.SetLineBreak (m_bManualBreak ); + rVOpt.SetTextBoundaries(m_bTextBoundaries); rVOpt.SetTextBoundariesFull(m_bTextBoundariesFull); + rVOpt.SetSectionBoundaries(m_bSectionBoundaries); + rVOpt.SetTableBoundaries(m_bTableBoundaries); rVOpt.SetDefaultAnchor( m_xDefaultAnchor ); } diff --git a/sw/source/uibase/config/usrpref.cxx b/sw/source/uibase/config/usrpref.cxx index 795a678412e1..d446baca6b42 100644 --- a/sw/source/uibase/config/usrpref.cxx +++ b/sw/source/uibase/config/usrpref.cxx @@ -125,8 +125,12 @@ Sequence SwContentViewConfig::GetPropertyNames() const "Display/DefaultAnchor", // 25 "Zoom/DefaultZoom", // 26 "Zoom/ZoomType", // 27 - "Zoom/ZoomValue", //28 - "Display/TextBoundaries" // 29 + "Zoom/ZoomValue", // 28 + "Display/TextBoundaries", // 29 + "Display/TextBoundariesFull", // 30 + "Display/SectionBoundaries", // 31 + "Display/TableBoundaries", // 32 + "Display/ShowBoundaries" // 33 }; #if defined(__GNUC__) && !defined(__clang__) // clang 8.0.0 says strcmp isn't constexpr @@ -205,7 +209,11 @@ void SwContentViewConfig::ImplCommit() case 26: bVal = m_rParent.IsDefaultZoom(); break;// "Zoom/DefaultZoom" case 27:pValues[nProp] <<= static_cast(m_rParent.GetDefaultZoomType()); break; // "Zoom/ZoomType" case 28: pValues[nProp] <<= static_cast(m_rParent.GetDefaultZoomValue()); break; // "Zoom/ZoomValue" - case 29: bVal = m_rParent.IsTextBoundariesFull(); break; // "Display/TextBoundaries" + case 29: bVal = m_rParent.IsTextBoundaries(); break; // "Display/TextBoundaries" + case 30: bVal = m_rParent.IsTextBoundariesFull(); break; // "Display/TextBoundariesFull" + case 31: bVal = m_rParent.IsSectionBoundaries(); break; // "Display/SectionBoundaries" + case 32: bVal = m_rParent.IsTableBoundaries(); break; // "Display/TableBoundaries" + case 33: bVal = m_rParent.IsShowBoundaries(); break; // "Display/ShowBoundaries" } if ((nProp != g_UpdateLinkIndex) && (nProp != g_DefaultAnchor) && (nProp != g_ZoomType) && (nProp != g_ZoomValue)) @@ -283,7 +291,11 @@ void SwContentViewConfig::Load() m_rParent.SetDefaultZoomValue(static_cast(nSet), true); } break; //"Zoom/ZoomValue" // 28 - case 29: m_rParent.SetTextBoundariesFull(bSet); break; //"Display/TextBoundaries" // 29 + case 29: m_rParent.SetTextBoundaries(bSet); break; //"Display/TextBoundaries" + case 30: m_rParent.SetTextBoundariesFull(bSet); break; //"Display/TextBoundariesFull" + case 31: m_rParent.SetSectionBoundaries(bSet); break; //"Display/SectionBoundaries" + case 32: m_rParent.SetTableBoundaries(bSet); break; //"Display/TableBoundaries" + case 33: m_rParent.SetShowBoundaries(bSet); break; //"Display/ShowBoundaries" } } } diff --git a/sw/source/uibase/config/viewopt.cxx b/sw/source/uibase/config/viewopt.cxx index 00a908d7b624..082f8f4331dd 100644 --- a/sw/source/uibase/config/viewopt.cxx +++ b/sw/source/uibase/config/viewopt.cxx @@ -47,7 +47,6 @@ SwViewColors SwViewOption::s_aInitialColorConfig {}; SwViewColors::SwViewColors() : m_aDocColor(COL_LIGHTGRAY), m_aDocBoundColor(COL_LIGHTGRAY), - m_aObjectBoundColor(COL_LIGHTGRAY), m_aAppBackgroundColor(COL_LIGHTGRAY), m_aTableBoundColor(COL_LIGHTGRAY), m_aFontColor(COL_BLACK), @@ -72,23 +71,12 @@ SwViewColors::SwViewColors(const svtools::ColorConfig& rConfig) { m_aDocColor = rConfig.GetColorValue(svtools::DOCCOLOR).nColor; - svtools::ColorConfigValue aValue = rConfig.GetColorValue(svtools::DOCBOUNDARIES); - m_aDocBoundColor = aValue.nColor; + m_aDocBoundColor = rConfig.GetColorValue(svtools::DOCBOUNDARIES).nColor; m_nAppearanceFlags = ViewOptFlags::NONE; - if(aValue.bIsVisible) - m_nAppearanceFlags |= ViewOptFlags::DocBoundaries; - m_aAppBackgroundColor = rConfig.GetColorValue(svtools::APPBACKGROUND).nColor; + m_aTableBoundColor = rConfig.GetColorValue(svtools::TABLEBOUNDARIES).nColor; - aValue = rConfig.GetColorValue(svtools::OBJECTBOUNDARIES); - m_aObjectBoundColor = aValue.nColor; - if(aValue.bIsVisible) - m_nAppearanceFlags |= ViewOptFlags::ObjectBoundaries; - - aValue = rConfig.GetColorValue(svtools::TABLEBOUNDARIES); - m_aTableBoundColor = aValue.nColor; - if(aValue.bIsVisible) - m_nAppearanceFlags |= ViewOptFlags::TableBoundaries; + svtools::ColorConfigValue aValue; aValue = rConfig.GetColorValue(svtools::WRITERIDXSHADINGS); m_aIndexShadingsColor = aValue.nColor; @@ -126,10 +114,7 @@ SwViewColors::SwViewColors(const svtools::ColorConfig& rConfig) if (aValue.bIsVisible && !comphelper::LibreOfficeKit::isActive()) m_nAppearanceFlags |= ViewOptFlags::FieldShadings; - aValue = rConfig.GetColorValue(svtools::WRITERSECTIONBOUNDARIES); - m_aSectionBoundColor = aValue.nColor; - if(aValue.bIsVisible) - m_nAppearanceFlags |= ViewOptFlags::SectionBoundaries; + m_aSectionBoundColor = rConfig.GetColorValue(svtools::WRITERSECTIONBOUNDARIES).nColor; aValue = rConfig.GetColorValue(svtools::WRITERPAGEBREAKS); m_aPageBreakColor = aValue.nColor; @@ -470,11 +455,6 @@ const Color& SwViewOption::GetDocBoundariesColor() const return m_aColorConfig.m_aDocBoundColor; } -const Color& SwViewOption::GetObjectBoundariesColor() const -{ - return m_aColorConfig.m_aObjectBoundColor; -} - const Color& SwViewOption::GetAppBackgroundColor() const { return m_aColorConfig.m_aAppBackgroundColor; @@ -573,14 +553,10 @@ void SwViewOption::SetAppearanceFlag(ViewOptFlags nFlag, bool bSet, bool bSaveIn }; static const FlagToConfig_Impl aFlags[] = { - { ViewOptFlags::DocBoundaries , svtools::DOCBOUNDARIES }, - { ViewOptFlags::ObjectBoundaries , svtools::OBJECTBOUNDARIES }, - { ViewOptFlags::TableBoundaries , svtools::TABLEBOUNDARIES }, { ViewOptFlags::IndexShadings , svtools::WRITERIDXSHADINGS }, { ViewOptFlags::Links , svtools::LINKS }, { ViewOptFlags::VisitedLinks , svtools::LINKSVISITED }, { ViewOptFlags::FieldShadings , svtools::WRITERFIELDSHADINGS }, - { ViewOptFlags::SectionBoundaries , svtools::WRITERSECTIONBOUNDARIES }, { ViewOptFlags::Shadow , svtools::SHADOWCOLOR }, }; for (auto& item : aFlags) diff --git a/sw/source/uibase/inc/cfgitems.hxx b/sw/source/uibase/inc/cfgitems.hxx index a02f2ec7864d..2619e6449e12 100644 --- a/sw/source/uibase/inc/cfgitems.hxx +++ b/sw/source/uibase/inc/cfgitems.hxx @@ -53,6 +53,10 @@ class SW_DLLPUBLIC SwDocDisplayItem final : public SfxPoolItem bool m_bBookmarks :1; bool m_bManualBreak :1; bool m_bTextBoundariesFull :1; + bool m_bTextBoundaries :1; + bool m_bSectionBoundaries :1; + bool m_bTableBoundaries :1; + sal_Int32 m_xDefaultAnchor; public: diff --git a/sw/source/uibase/inc/optpage.hxx b/sw/source/uibase/inc/optpage.hxx index cdeb071100a7..ca60e8f00219 100644 --- a/sw/source/uibase/inc/optpage.hxx +++ b/sw/source/uibase/inc/optpage.hxx @@ -336,6 +336,12 @@ class SwShdwCursorOptionsTabPage final : public SfxTabPage std::unique_ptr m_xEncloseWithCharactersCB; std::unique_ptr m_xEncloseWithCharactersImg; + std::unique_ptr m_xTextBoundariesCB; + std::unique_ptr m_xSectionBoundariesCB; + std::unique_ptr m_xTableBoundariesCB; + + DECL_LINK(TextBoundariesHdl, weld::Toggleable&, void); + public: SwShdwCursorOptionsTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); virtual ~SwShdwCursorOptionsTabPage() override; diff --git a/sw/source/uibase/uiview/view0.cxx b/sw/source/uibase/uiview/view0.cxx index 8d236be3ce87..fcf35ac29f4d 100644 --- a/sw/source/uibase/uiview/view0.cxx +++ b/sw/source/uibase/uiview/view0.cxx @@ -170,6 +170,7 @@ void SwView::RecheckBrowseMode() //SID_AUTOSPELL_MARKOFF, SID_TOGGLE_RESOLVED_NOTES, /* 11672*/ FN_RULER, /*20211*/ + FN_VIEW_BOUNDARIES, /*20212*/ FN_VIEW_GRAPHIC, /*20213*/ FN_VIEW_BOUNDS, /**/ FN_VIEW_FIELDS, /*20215*/ @@ -236,8 +237,10 @@ void SwView::StateViewOptions(SfxItemSet &rSet) aBool.SetValue( bState ); } break; + case FN_VIEW_BOUNDARIES: + aBool.SetValue( pOpt->IsShowBoundaries()); break; case FN_VIEW_BOUNDS: - aBool.SetValue( pOpt->IsDocBoundaries()); break; + aBool.SetValue( pOpt->IsTextBoundaries()); break; case FN_VIEW_SECTION_BOUNDARIES: aBool.SetValue(pOpt->IsSectionBoundaries()); break; case FN_VIEW_GRAPHIC: @@ -403,14 +406,26 @@ void SwView::ExecViewOptions(SfxRequest &rReq) case FN_VIEW_BOUNDS: if( STATE_TOGGLE == eState ) - bFlag = !pOpt->IsDocBoundaries(); - pOpt->SetAppearanceFlag(ViewOptFlags::DocBoundaries, bFlag, true ); + bFlag = !pOpt->IsTextBoundaries(); + pOpt->SetTextBoundaries( bFlag ); break; case FN_VIEW_SECTION_BOUNDARIES: if( STATE_TOGGLE == eState ) bFlag = !pOpt->IsSectionBoundaries(); - pOpt->SetAppearanceFlag(ViewOptFlags::SectionBoundaries, bFlag, true ); + pOpt->SetSectionBoundaries( bFlag ); + break; + + case FN_VIEW_TABLEGRID: + if( STATE_TOGGLE == eState ) + bFlag = !pOpt->IsTableBoundaries(); + pOpt->SetTableBoundaries( bFlag ); + break; + + case FN_VIEW_BOUNDARIES: + if( STATE_TOGGLE == eState ) + bFlag = !pOpt->IsShowBoundaries(); + pOpt->SetShowBoundaries( bFlag ); break; case SID_GRID_VISIBLE: @@ -521,13 +536,6 @@ void SwView::ExecViewOptions(SfxRequest &rReq) pOpt->SetViewAnyRuler( bFlag ); break; - - case FN_VIEW_TABLEGRID: - if( STATE_TOGGLE == eState ) - bFlag = !pOpt->IsTableBoundaries(); - pOpt->SetAppearanceFlag(ViewOptFlags::TableBoundaries, bFlag, true ); - break; - case FN_VIEW_FIELDNAME: if( STATE_TOGGLE == eState ) bFlag = !pOpt->IsFieldName() ; diff --git a/sw/source/uibase/uno/unomod.cxx b/sw/source/uibase/uno/unomod.cxx index 2414fbfe44e1..713dea75838f 100644 --- a/sw/source/uibase/uno/unomod.cxx +++ b/sw/source/uibase/uno/unomod.cxx @@ -581,8 +581,8 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c case HANDLE_VIEWSET_HIDDEN_TEXT : mpViewOption->SetShowHiddenField(*o3tl::doAccess(rValue)); break; case HANDLE_VIEWSET_HIDDEN_CHARACTERS : mpViewOption->SetShowHiddenChar(*o3tl::doAccess(rValue)); break; case HANDLE_VIEWSET_HIDDEN_PARAGRAPHS : mpViewOption->SetShowHiddenPara(*o3tl::doAccess(rValue)); break; - case HANDLE_VIEWSET_TABLE_BOUNDARIES : mpViewOption->SetAppearanceFlag(ViewOptFlags::TableBoundaries, *o3tl::doAccess(rValue), true); break; - case HANDLE_VIEWSET_TEXT_BOUNDARIES : mpViewOption->SetDocBoundaries(*o3tl::doAccess(rValue)); break; + case HANDLE_VIEWSET_TABLE_BOUNDARIES : mpViewOption->SetTableBoundaries(*o3tl::doAccess(rValue)); break; + case HANDLE_VIEWSET_TEXT_BOUNDARIES : mpViewOption->SetTextBoundaries(*o3tl::doAccess(rValue)); break; case HANDLE_VIEWSET_SMOOTH_SCROLLING : mpViewOption->SetSmoothScroll(*o3tl::doAccess(rValue)); break; case HANDLE_VIEWSET_SHOW_CONTENT_TIPS : mpViewOption->SetShowContentTips(*o3tl::doAccess(rValue)); break; case HANDLE_VIEWSET_IS_RASTER_VISIBLE : mpViewOption->SetGridVisible(*o3tl::doAccess(rValue)); break; @@ -751,7 +751,6 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c } } break; - case HANDLE_VIEWSET_TEXTBOUNDARIES: mpViewOption->SetTextBoundariesFull(*o3tl::doAccess(rValue)); break; default: throw UnknownPropertyException(OUString::number(rInfo.mnHandle)); } @@ -829,7 +828,7 @@ void SwXViewSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, u case HANDLE_VIEWSET_HIDE_WHITESPACE : bBoolVal = mpConstViewOption->IsHideWhitespaceMode(); break; case HANDLE_VIEWSET_HIDDEN_PARAGRAPHS : bBoolVal = mpConstViewOption->IsShowHiddenPara(); break; case HANDLE_VIEWSET_TABLE_BOUNDARIES : bBoolVal = mpConstViewOption->IsTableBoundaries(); break; - case HANDLE_VIEWSET_TEXT_BOUNDARIES : bBoolVal = mpConstViewOption->IsDocBoundaries(); break; + case HANDLE_VIEWSET_TEXT_BOUNDARIES : bBoolVal = mpConstViewOption->IsTextBoundaries(); break; case HANDLE_VIEWSET_SMOOTH_SCROLLING : bBoolVal = mpConstViewOption->IsSmoothScroll(); break; case HANDLE_VIEWSET_SHOW_CONTENT_TIPS : bBoolVal = mpConstViewOption->IsShowContentTips(); break; case HANDLE_VIEWSET_INLINECHANGES_TIPS : bBoolVal = mpConstViewOption->IsShowInlineTooltips(); break; @@ -932,7 +931,6 @@ void SwXViewSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, u bBool = false; } break; - case HANDLE_VIEWSET_TEXTBOUNDARIES : bBoolVal = mpConstViewOption->IsTextBoundariesFull(); break; default: OSL_FAIL("there is no such ID!"); } if( bBool ) diff --git a/sw/uiconfig/sglobal/menubar/menubar.xml b/sw/uiconfig/sglobal/menubar/menubar.xml index 1b1370e8b380..dd3eb8c6bd12 100644 --- a/sw/uiconfig/sglobal/menubar/menubar.xml +++ b/sw/uiconfig/sglobal/menubar/menubar.xml @@ -200,8 +200,7 @@ - - + diff --git a/sw/uiconfig/sweb/menubar/menubar.xml b/sw/uiconfig/sweb/menubar/menubar.xml index dc0715beeb81..00c5cefefe15 100644 --- a/sw/uiconfig/sweb/menubar/menubar.xml +++ b/sw/uiconfig/sweb/menubar/menubar.xml @@ -131,7 +131,7 @@ - + diff --git a/sw/uiconfig/swform/menubar/menubar.xml b/sw/uiconfig/swform/menubar/menubar.xml index 5eebcc9a96a1..6da6a923e662 100644 --- a/sw/uiconfig/swform/menubar/menubar.xml +++ b/sw/uiconfig/swform/menubar/menubar.xml @@ -168,8 +168,7 @@ - - + diff --git a/sw/uiconfig/swreport/menubar/menubar.xml b/sw/uiconfig/swreport/menubar/menubar.xml index 59f630afc70e..57b49e6b9d90 100644 --- a/sw/uiconfig/swreport/menubar/menubar.xml +++ b/sw/uiconfig/swreport/menubar/menubar.xml @@ -160,8 +160,7 @@ - - + diff --git a/sw/uiconfig/swriter/menubar/menubar.xml b/sw/uiconfig/swriter/menubar/menubar.xml index ea5ef0f6b9cb..04b9fb4e2c91 100644 --- a/sw/uiconfig/swriter/menubar/menubar.xml +++ b/sw/uiconfig/swriter/menubar/menubar.xml @@ -206,9 +206,7 @@ - - - + diff --git a/sw/uiconfig/swriter/ui/notebookbar.ui b/sw/uiconfig/swriter/ui/notebookbar.ui index 25983178d3da..524dffbc4939 100644 --- a/sw/uiconfig/swriter/ui/notebookbar.ui +++ b/sw/uiconfig/swriter/ui/notebookbar.ui @@ -2263,21 +2263,7 @@ True False - .uno:ViewBounds - - - - - True - False - .uno:TableBoundaries - - - - - True - False - .uno:SectionBoundaries + .uno:ShowBoundaries diff --git a/sw/uiconfig/swriter/ui/notebookbar_compact.ui b/sw/uiconfig/swriter/ui/notebookbar_compact.ui index 4e678b5a18ef..2a600fc1ccb5 100644 --- a/sw/uiconfig/swriter/ui/notebookbar_compact.ui +++ b/sw/uiconfig/swriter/ui/notebookbar_compact.ui @@ -2441,21 +2441,7 @@ True False - .uno:ViewBounds - - - - - True - False - .uno:TableBoundaries - - - - - True - False - .uno:SectionBoundaries + .uno:ShowBoundaries diff --git a/sw/uiconfig/swriter/ui/notebookbar_groupedbar_compact.ui b/sw/uiconfig/swriter/ui/notebookbar_groupedbar_compact.ui index e0129e255828..f1688927c5e1 100644 --- a/sw/uiconfig/swriter/ui/notebookbar_groupedbar_compact.ui +++ b/sw/uiconfig/swriter/ui/notebookbar_groupedbar_compact.ui @@ -1670,21 +1670,7 @@ True False - .uno:ViewBounds - - - - - True - False - .uno:TableBoundaries - - - - - True - False - .uno:SectionBoundaries + .uno:ShowBoundaries @@ -3406,21 +3392,7 @@ True False - .uno:ViewBounds - - - - - True - False - .uno:TableBoundaries - - - - - True - False - .uno:SectionBoundaries + .uno:ShowBoundaries diff --git a/sw/uiconfig/swriter/ui/notebookbar_groupedbar_full.ui b/sw/uiconfig/swriter/ui/notebookbar_groupedbar_full.ui index 59a3584f33a8..1eeacc41be3c 100644 --- a/sw/uiconfig/swriter/ui/notebookbar_groupedbar_full.ui +++ b/sw/uiconfig/swriter/ui/notebookbar_groupedbar_full.ui @@ -1649,21 +1649,7 @@ True False - .uno:ViewBounds - - - - - True - False - .uno:TableBoundaries - - - - - True - False - .uno:SectionBoundaries + .uno:ShowBoundaries @@ -3747,21 +3733,7 @@ True False - .uno:ViewBounds - - - - - True - False - .uno:TableBoundaries - - - - - True - False - .uno:SectionBoundaries + .uno:ShowBoundaries diff --git a/sw/uiconfig/swriter/ui/optformataidspage.ui b/sw/uiconfig/swriter/ui/optformataidspage.ui index de56bcb643a2..c461544ca92e 100644 --- a/sw/uiconfig/swriter/ui/optformataidspage.ui +++ b/sw/uiconfig/swriter/ui/optformataidspage.ui @@ -107,7 +107,7 @@ - Tabs + _Tabs True True False @@ -145,7 +145,7 @@ - Hidden characters + _Hidden characters True True False @@ -164,7 +164,7 @@ - Bookmarks + _Bookmarks True True False @@ -433,7 +433,7 @@ 6 - Math baseline alignment + _Math baseline alignment True True False @@ -844,38 +844,20 @@ 0 none - + True False + 12 6 3 - - Crop marks + + Te_xt True True False start - 12 - True - True - True - rbTextBoundariesFull - - - 0 - 1 - - - - - Full - True - True - False - start - 12 True True True @@ -885,13 +867,85 @@ 0 + + + Tab_les + True + True + False + start + True + True + True + + + 0 + 3 + 2 + + + + + _Sections and Frames + True + True + False + start + True + True + True + + + 0 + 2 + 2 + + + + + _Crop marks + True + True + False + start + 12 + True + True + True + + + 1 + 1 + + + + + Border _Outline + True + True + False + start + 12 + True + True + True + rbTextBoundariesCrop + + + 1 + 0 + + + + + True False - Text Boundaries + Object Boundaries diff --git a/sw/uiconfig/swxform/menubar/menubar.xml b/sw/uiconfig/swxform/menubar/menubar.xml index 70e0c4a10b84..393fbf4aec4a 100644 --- a/sw/uiconfig/swxform/menubar/menubar.xml +++ b/sw/uiconfig/swxform/menubar/menubar.xml @@ -196,8 +196,7 @@ - - +