framework/source/uielement/toolbarmodemenucontroller.cxx   |    2 +-
 framework/source/uielement/toolbarsmenucontroller.cxx      |    2 +-
 include/svtools/popupmenucontrollerbase.hxx                |    4 ++--
 officecfg/registry/schema/org/openoffice/Office/Writer.xcs |    8 ++++++++
 svtools/source/uno/popupmenucontrollerbase.cxx             |    2 +-
 sw/inc/viewopt.hxx                                         |    2 +-
 sw/source/uibase/config/cfgitems.cxx                       |    2 +-
 sw/source/uibase/config/usrpref.cxx                        |    7 +++++--
 sw/source/uibase/uno/unomod.cxx                            |    6 +++++-
 9 files changed, 25 insertions(+), 10 deletions(-)

New commits:
commit 0b7d01a1a20b291e5c0ca3082c7714a565381f4d
Author:     Heiko Tietze <tietze.he...@gmail.com>
AuthorDate: Wed Nov 6 12:35:36 2024 +0100
Commit:     Heiko Tietze <heiko.tie...@documentfoundation.org>
CommitDate: Fri Nov 8 10:16:58 2024 +0100

    Related tdf#74386 - Improvements for text boundaries options
    
    * Default is Crop Marks now
    * Settings are persistent
    
    Change-Id: If5304c874706345fa943a106044155152c86bc0c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176131
    Tested-by: Jenkins
    Reviewed-by: Heiko Tietze <heiko.tie...@documentfoundation.org>

diff --git a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
index b21efe63c7f1..d1cd0b52d309 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
@@ -900,6 +900,14 @@
           </constraints>
           <value>1</value>
         </prop>
+        <prop oor:name="TextBoundaries" oor:type="xs:boolean" 
oor:nillable="false">
+          <!-- UIHints: Not accessible via user interface -->
+          <info>
+            <desc>Shows text boundaries as full frame (true) or crop marks 
(false), if enabled.</desc>
+            <label>Show text boundaries as full frame or crop marks</label>
+          </info>
+          <value>false</value>
+        </prop>
       </group>
       <group oor:name="Zoom">
           <info>
diff --git a/sw/inc/viewopt.hxx b/sw/inc/viewopt.hxx
index 56ef7ff19900..1aedb38d243b 100644
--- a/sw/inc/viewopt.hxx
+++ b/sw/inc/viewopt.hxx
@@ -103,7 +103,7 @@ struct ViewOptFlags1
         , bShowOutlineContentVisibilityButton(false)
         , bShowChangesInMargin(false)
         , bShowChangesInMargin2(false)
-        , bTextBoundariesFull(true)
+        , bTextBoundariesFull(false)
     {}
 
     bool operator==(const ViewOptFlags1& rOther) const
diff --git a/sw/source/uibase/config/cfgitems.cxx 
b/sw/source/uibase/config/cfgitems.cxx
index 27a3690f9b99..5018e1d0fbfa 100644
--- a/sw/source/uibase/config/cfgitems.cxx
+++ b/sw/source/uibase/config/cfgitems.cxx
@@ -34,7 +34,7 @@ SwDocDisplayItem::SwDocDisplayItem() :
     m_bCharHiddenText     =
     m_bBookmarks          =
     m_bManualBreak        = true;
-    m_bTextBoundariesFull = true;
+    m_bTextBoundariesFull = false; // default is crop
     m_xDefaultAnchor      = 1; //FLY_TO_CHAR
 };
 
diff --git a/sw/source/uibase/config/usrpref.cxx 
b/sw/source/uibase/config/usrpref.cxx
index ea59c279b37e..795a678412e1 100644
--- a/sw/source/uibase/config/usrpref.cxx
+++ b/sw/source/uibase/config/usrpref.cxx
@@ -125,7 +125,8 @@ Sequence<OUString> SwContentViewConfig::GetPropertyNames() 
const
         "Display/DefaultAnchor",                // 25
         "Zoom/DefaultZoom",                     // 26
         "Zoom/ZoomType",                        // 27
-        "Zoom/ZoomValue"                        //28
+        "Zoom/ZoomValue",                       //28
+        "Display/TextBoundaries"                // 29
     };
 #if defined(__GNUC__) && !defined(__clang__)
     // clang 8.0.0 says strcmp isn't constexpr
@@ -204,6 +205,7 @@ void SwContentViewConfig::ImplCommit()
             case 26: bVal = m_rParent.IsDefaultZoom(); break;// 
"Zoom/DefaultZoom"
             case 27:pValues[nProp] <<= 
static_cast<sal_Int32>(m_rParent.GetDefaultZoomType()); break; // 
"Zoom/ZoomType"
             case 28: pValues[nProp] <<= 
static_cast<sal_Int32>(m_rParent.GetDefaultZoomValue()); break; // 
"Zoom/ZoomValue"
+            case 29: bVal = m_rParent.IsTextBoundariesFull(); break; // 
"Display/TextBoundaries"
         }
         if ((nProp != g_UpdateLinkIndex) && (nProp != g_DefaultAnchor) &&
             (nProp != g_ZoomType) && (nProp != g_ZoomValue))
@@ -280,7 +282,8 @@ void SwContentViewConfig::Load()
                     pValues[nProp] >>= nSet;
                     
m_rParent.SetDefaultZoomValue(static_cast<sal_uInt16>(nSet), true);
                 }
-                break; //"Zoom/ZoomValue"
+                break; //"Zoom/ZoomValue" // 28
+                case 29: m_rParent.SetTextBoundariesFull(bSet); break; 
//"Display/TextBoundaries" // 29
             }
         }
     }
diff --git a/sw/source/uibase/uno/unomod.cxx b/sw/source/uibase/uno/unomod.cxx
index f8305d3c1682..2414fbfe44e1 100644
--- a/sw/source/uibase/uno/unomod.cxx
+++ b/sw/source/uibase/uno/unomod.cxx
@@ -96,7 +96,8 @@ enum SwViewSettingsPropertyHandles
     HANDLE_VIEWSET_BOOKMARKS,
     HANDLE_VIEWSET_SHOW_OUTLINECONTENTVISIBILITYBUTTON,
     HANDLE_VIEWSET_TREAT_SUB_OUTLINE_LEVELS_AS_CONTENT,
-    HANDLE_VIEWSET_CHANGES_IN_MARGIN
+    HANDLE_VIEWSET_CHANGES_IN_MARGIN,
+    HANDLE_VIEWSET_TEXTBOUNDARIES
 };
 
 enum SwPrintSettingsPropertyHandles
@@ -174,6 +175,7 @@ static rtl::Reference<ChainablePropertySetInfo> 
lcl_createViewSettingsInfo()
         { u"VerticalRulerMetric"_ustr,  HANDLE_VIEWSET_VERT_RULER_METRIC   , 
cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE},
         { u"ZoomType"_ustr,             HANDLE_VIEWSET_ZOOM_TYPE            , 
cppu::UnoType<sal_Int16>::get(),   PROPERTY_NONE},
         { u"ZoomValue"_ustr,            HANDLE_VIEWSET_ZOOM                 , 
cppu::UnoType<sal_Int16>::get(),   PROPERTY_NONE},
+        { u"TextBoundaries"_ustr,       HANDLE_VIEWSET_TEXTBOUNDARIES       , 
cppu::UnoType<sal_Int16>::get(),   PROPERTY_NONE},
         { OUString(), 0, css::uno::Type(), 0 }
     };
     return new ChainablePropertySetInfo ( aViewSettingsMap_Impl );
@@ -749,6 +751,7 @@ void SwXViewSettings::_setSingleValue( const 
comphelper::PropertyInfo & rInfo, c
                 }
         }
         break;
+        case HANDLE_VIEWSET_TEXTBOUNDARIES: 
mpViewOption->SetTextBoundariesFull(*o3tl::doAccess<bool>(rValue)); break;
         default:
             throw UnknownPropertyException(OUString::number(rInfo.mnHandle));
     }
@@ -929,6 +932,7 @@ 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 )
commit 1e99b33b9ab77874a3483ce6e192a58842794f2a
Author:     Patrick Luby <guibmac...@gmail.com>
AuthorDate: Thu Nov 7 08:52:37 2024 -0500
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Nov 8 10:16:43 2024 +0100

    Revert commit 2fe53b2e436cb236b2dc121ceec4f22de49a13a8
    
    Commit 709b1f3ddb87303a2dec6155dbe0106369c151ed fixes the
    root cause of the crash during a dynamic_cast so revert
    commit 709b1f3ddb87303a2dec6155dbe0106369c151ed as it was
    merely a workaround and is no longer needed.
    
    Change-Id: Ia052913eba7fd4d979054ea6a644f4ff9791277c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176217
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/framework/source/uielement/toolbarmodemenucontroller.cxx 
b/framework/source/uielement/toolbarmodemenucontroller.cxx
index 11bf5d787866..1b6c9964b698 100644
--- a/framework/source/uielement/toolbarmodemenucontroller.cxx
+++ b/framework/source/uielement/toolbarmodemenucontroller.cxx
@@ -274,7 +274,7 @@ void SAL_CALL ToolbarModeMenuController::setPopupMenu( 
const Reference< css::awt
         // Create popup menu on demand
         SolarMutexGuard aSolarMutexGuard;
 
-        m_xPopupMenu = dynamic_cast<VCLXMenu*>(xPopupMenu.get());
+        m_xPopupMenu = dynamic_cast<VCLXPopupMenu*>(xPopupMenu.get());
         assert(bool(xPopupMenu) == bool(m_xPopupMenu) && "we only support 
VCLXPopupMenu");
         m_xPopupMenu->addMenuListener( Reference< css::awt::XMenuListener 
>(this) );
         fillPopupMenu( m_xPopupMenu );
diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx 
b/framework/source/uielement/toolbarsmenucontroller.cxx
index 764702adadc1..387eef47590b 100644
--- a/framework/source/uielement/toolbarsmenucontroller.cxx
+++ b/framework/source/uielement/toolbarsmenucontroller.cxx
@@ -706,7 +706,7 @@ void SAL_CALL ToolbarsMenuController::setPopupMenu( const 
Reference< css::awt::X
         // Create popup menu on demand
         SolarMutexGuard aSolarMutexGuard;
 
-        m_xPopupMenu = dynamic_cast<VCLXMenu*>(xPopupMenu.get());
+        m_xPopupMenu = dynamic_cast<VCLXPopupMenu*>(xPopupMenu.get());
         assert(bool(xPopupMenu) == bool(m_xPopupMenu) && "we only support 
VCLXPopupMenu");
         m_xPopupMenu->addMenuListener( Reference< css::awt::XMenuListener 
>(this) );
         fillPopupMenu( m_xPopupMenu );
diff --git a/include/svtools/popupmenucontrollerbase.hxx 
b/include/svtools/popupmenucontrollerbase.hxx
index b3b7bee4a1f3..228fd5bd4c8f 100644
--- a/include/svtools/popupmenucontrollerbase.hxx
+++ b/include/svtools/popupmenucontrollerbase.hxx
@@ -37,7 +37,7 @@
 namespace com :: sun :: star :: frame { class XFrame; }
 namespace com :: sun :: star :: uno { class XComponentContext; }
 namespace com :: sun :: star :: util { class XURLTransformer; }
-class VCLXMenu;
+class VCLXPopupMenu;
 
 namespace svt
 {
@@ -118,7 +118,7 @@ namespace svt
             css::uno::Reference< css::frame::XDispatch >           m_xDispatch;
             css::uno::Reference< css::frame::XFrame >              m_xFrame;
             css::uno::Reference< css::util::XURLTransformer >      
m_xURLTransformer;
-            rtl::Reference< VCLXMenu >                             
m_xPopupMenu;
+            rtl::Reference< VCLXPopupMenu >                        
m_xPopupMenu;
             comphelper::OInterfaceContainerHelper4<XStatusListener> 
maStatusListeners;
     };
 }
diff --git a/svtools/source/uno/popupmenucontrollerbase.cxx 
b/svtools/source/uno/popupmenucontrollerbase.cxx
index 02d09d7d82a7..ab6bee1a0555 100644
--- a/svtools/source/uno/popupmenucontrollerbase.cxx
+++ b/svtools/source/uno/popupmenucontrollerbase.cxx
@@ -343,7 +343,7 @@ void SAL_CALL PopupMenuControllerBase::setPopupMenu( const 
Reference< awt::XPopu
         // Create popup menu on demand
         SolarMutexGuard aSolarMutexGuard;
 
-        m_xPopupMenu = dynamic_cast<VCLXMenu*>(xPopupMenu.get());
+        m_xPopupMenu = dynamic_cast<VCLXPopupMenu*>(xPopupMenu.get());
         assert(bool(xPopupMenu) == bool(m_xPopupMenu) && "we only support 
VCLXPopupMenu");
         m_xPopupMenu->addMenuListener( Reference< awt::XMenuListener >(this) );
 

Reply via email to