schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng |    8 
 sw/qa/extras/globalfilter/globalfilter.cxx                  |    7 
 sw/source/core/unocore/unomap1.cxx                          |    1 
 sw/uiconfig/swriter/ui/frmaddpage.ui                        |  228 ++++++------
 xmloff/inc/xmlprop.hxx                                      |    1 
 xmloff/source/text/txtparae.cxx                             |    1 
 xmloff/source/text/txtprmap.cxx                             |    1 
 7 files changed, 149 insertions(+), 98 deletions(-)

New commits:
commit 198b138bc14bff7d334ecf5b1d1d5b5c8bba82fa
Author:     Michael Stahl <[email protected]>
AuthorDate: Thu Mar 2 20:29:36 2023 +0100
Commit:     Caolán McNamara <[email protected]>
CommitDate: Sat Mar 4 20:50:49 2023 +0000

    tdf#153925 xmloff,sw: decorative flag on frame styles
    
    * sw API SwXStyle property "Decorative"
    * UI checkbox "Decorative" - split up the GtkFrame to always show it
    * ODF import/export as loext:decorative on style:graphic-properties
    * test for ODF filters
    
    Change-Id: If124cb50ee7776b5807720e65f41a07e7b9f4cf9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148143
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <[email protected]>
    (cherry picked from commit 2721520ca37654056c3d509657c50ee42e3dcae4)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148110
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng 
b/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
index ee9b89ded8a9..f2e54ddc9c18 100644
--- a/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
+++ b/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
@@ -3314,4 +3314,12 @@ 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.
     </rng:optional>
   </rng:define>
 
+  <rng:define name="style-graphic-properties-attlist" combine="interleave">
+    <rng:optional>
+      <rng:attribute name="loext:decorative">
+        <rng:ref name="boolean"/>
+      </rng:attribute>
+    </rng:optional>
+  </rng:define>
+
 </rng:grammar>
diff --git a/sw/qa/extras/globalfilter/globalfilter.cxx 
b/sw/qa/extras/globalfilter/globalfilter.cxx
index 7beb928dd344..43b6afdad443 100644
--- a/sw/qa/extras/globalfilter/globalfilter.cxx
+++ b/sw/qa/extras/globalfilter/globalfilter.cxx
@@ -1237,9 +1237,16 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf143311)
     // check DOCX filters
     saveAndReload("Office Open XML Text");
     CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(getShape(1), "Decorative"));
+    {
+        // tdf#153925 not imported - check default and set it to test ODF 
filters
+        uno::Reference<beans::XPropertySet> const 
xStyle(getStyles("FrameStyles")->getByName("Formula"), uno::UNO_QUERY_THROW);
+        CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(xStyle, "Decorative"));
+        xStyle->setPropertyValue("Decorative", uno::Any(true));
+    }
     // check ODF filters
     saveAndReload("writer8");
     CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(getShape(1), "Decorative"));
+    CPPUNIT_ASSERT_EQUAL(true, 
getProperty<bool>(getStyles("FrameStyles")->getByName("Formula"), 
"Decorative"));
 
     // check PDF export
     utl::MediaDescriptor aMediaDescriptor;
diff --git a/sw/source/core/unocore/unomap1.cxx 
b/sw/source/core/unocore/unomap1.cxx
index a37843b1538a..bf247d5c7d7d 100644
--- a/sw/source/core/unocore/unomap1.cxx
+++ b/sw/source/core/unocore/unomap1.cxx
@@ -407,6 +407,7 @@ o3tl::span<const SfxItemPropertyMapEntry> 
SwUnoPropertyMapProvider::GetFrameStyl
         { UNO_NAME_ALLOW_OVERLAP, RES_WRAP_INFLUENCE_ON_OBJPOS, 
cppu::UnoType<bool>::get(), PROPERTY_NONE, MID_ALLOW_OVERLAP},
         { UNO_NAME_WRITING_MODE, RES_FRAMEDIR, 
cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, 0 },
         { UNO_NAME_HIDDEN, FN_UNO_HIDDEN,     cppu::UnoType<bool>::get(), 
PROPERTY_NONE, 0},
+        { u"Decorative", RES_DECORATIVE, cppu::UnoType<bool>::get(), 
PROPERTY_NONE, 0 },
         { UNO_NAME_TEXT_VERT_ADJUST, RES_TEXT_VERT_ADJUST, 
cppu::UnoType<css::drawing::TextVerticalAdjust>::get(), PROPERTY_NONE ,0},
 
         // added FillProperties for SW, same as FILL_PROPERTIES in svx
diff --git a/sw/uiconfig/swriter/ui/frmaddpage.ui 
b/sw/uiconfig/swriter/ui/frmaddpage.ui
index 51431a1ff493..f73f404a9b7b 100644
--- a/sw/uiconfig/swriter/ui/frmaddpage.ui
+++ b/sw/uiconfig/swriter/ui/frmaddpage.ui
@@ -18,7 +18,7 @@
     <property name="row-spacing">12</property>
     <property name="column-spacing">24</property>
     <child>
-      <object class="GtkFrame" id="nameframe">
+      <object class="GtkFrame" id="a11yframe">
         <property name="visible">True</property>
         <property name="can-focus">False</property>
         <property name="hexpand">True</property>
@@ -26,8 +26,8 @@
         <property name="label-xalign">0</property>
         <property name="shadow-type">none</property>
         <child>
-          <!-- n-columns=2 n-rows=3 -->
-          <object class="GtkGrid" id="grid1">
+          <!-- n-columns=1 n-rows=2 -->
+          <object class="GtkGrid" id="grid0">
             <property name="visible">True</property>
             <property name="can-focus">False</property>
             <property name="margin-start">12</property>
@@ -37,113 +37,146 @@
             <property name="row-spacing">6</property>
             <property name="column-spacing">12</property>
             <child>
-              <object class="GtkEntry" id="name">
-                <property name="visible">True</property>
-                <property name="can-focus">True</property>
-                <property name="hexpand">True</property>
-                <property name="activates-default">True</property>
-                <property name="width-chars">50</property>
-                <property name="truncate-multiline">True</property>
-                <child internal-child="accessible">
-                  <object class="AtkObject" id="name-atkobject">
-                    <property name="AtkObject::accessible-description" 
translatable="yes" context="frmaddpage|extended_tip|name">Enter a name for the 
selected item.</property>
-                  </object>
-                </child>
-              </object>
-              <packing>
-                <property name="left-attach">1</property>
-                <property name="top-attach">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkEntry" id="altname">
-                <property name="visible">True</property>
-                <property name="can-focus">True</property>
-                <property name="hexpand">True</property>
-                <property name="activates-default">True</property>
-                <property name="width-chars">50</property>
-                <property name="truncate-multiline">True</property>
-                <child internal-child="accessible">
-                  <object class="AtkObject" id="altname-atkobject">
-                    <property name="AtkObject::accessible-description" 
translatable="yes" context="frmaddpage|extended_tip|altname">Enter a short 
description of the essential details of the selected object for a person who 
cannot see the object. This text is available for use by assistive 
technologies. For images, this text is exported with an appropriate tag to HTML 
and PDF format.</property>
-                  </object>
-                </child>
-              </object>
-              <packing>
-                <property name="left-attach">1</property>
-                <property name="top-attach">1</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkLabel" id="name_label">
-                <property name="visible">True</property>
-                <property name="can-focus">False</property>
-                <property name="label" translatable="yes" 
context="frmaddpage|name_label">_Name:</property>
-                <property name="use-underline">True</property>
-                <property name="mnemonic-widget">name</property>
-                <property name="xalign">0</property>
-              </object>
-              <packing>
-                <property name="left-attach">0</property>
-                <property name="top-attach">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkLabel" id="altname_label">
+              <object class="GtkFrame" id="nameframe">
                 <property name="visible">True</property>
                 <property name="can-focus">False</property>
-                <property name="label" translatable="yes" 
context="frmaddpage|altname_label">Text _Alternative:</property>
-                <property name="tooltip_text" translatable="yes" 
context="frmaddpage|altname_label|tooltip_text">Give a short description for 
users who do not see this object.</property>
-                <property name="use_underline">True</property>
-                <property name="mnemonic_widget">altname</property>
-                <property name="xalign">0</property>
-              </object>
-              <packing>
-                <property name="left-attach">0</property>
-                <property name="top-attach">1</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkLabel" id="description_label">
-                <property name="visible">True</property>
-                <property name="can-focus">False</property>
-                <property name="label" translatable="yes" 
context="frmaddpage|description_label">_Description:</property>
-                <property name="tooltip_text" translatable="yes" 
context="frmaddpage|description_label">Give a longer explanation of the content 
if it is too complex to be described briefly in “Text Alternative.”</property>
-                <property name="use_underline">True</property>
-                <property name="mnemonic_widget">description</property>
-                <property name="xalign">0</property>
-              </object>
-              <packing>
-                <property name="left-attach">0</property>
-                <property name="top-attach">2</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkScrolledWindow" id="scrolledwindow1">
-                <property name="visible">True</property>
-                <property name="can-focus">True</property>
                 <property name="hexpand">True</property>
                 <property name="vexpand">True</property>
-                <property name="shadow-type">in</property>
+                <property name="label-xalign">0</property>
+                <property name="shadow-type">none</property>
                 <child>
-                  <object class="GtkTextView" id="description">
+                  <!-- n-columns=2 n-rows=3 -->
+                  <object class="GtkGrid" id="grid1">
                     <property name="visible">True</property>
-                    <property name="can-focus">True</property>
+                    <property name="can-focus">False</property>
+                    <property name="margin-start">0</property>
+                    <property name="margin-top">0</property>
                     <property name="hexpand">True</property>
                     <property name="vexpand">True</property>
-                    <property name="wrap-mode">word</property>
-                    <property name="buffer">textbuffer1</property>
-                    <child internal-child="accessible">
-                      <object class="AtkObject" id="description-atkobject">
-                        <property name="AtkObject::accessible-description" 
translatable="yes" context="frmaddpage|extended_tip|description">Enter a longer 
description of the object, especially if the object is too complex or contains 
too much detail to be described adequately with the short “Text Alternative.” 
This text is available for use by assistive technologies. For images, this text 
is exported with an appropriate tag to HTML and PDF format.</property>
+                    <property name="row-spacing">6</property>
+                    <property name="column-spacing">12</property>
+                    <child>
+                      <object class="GtkEntry" id="name">
+                        <property name="visible">True</property>
+                        <property name="can-focus">True</property>
+                        <property name="hexpand">True</property>
+                        <property name="activates-default">True</property>
+                        <property name="width-chars">50</property>
+                        <property name="truncate-multiline">True</property>
+                        <child internal-child="accessible">
+                          <object class="AtkObject" id="name-atkobject">
+                            <property name="AtkObject::accessible-description" 
translatable="yes" context="frmaddpage|extended_tip|name">Enter a name for the 
selected item.</property>
+                          </object>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="left-attach">1</property>
+                        <property name="top-attach">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkEntry" id="altname">
+                        <property name="visible">True</property>
+                        <property name="can-focus">True</property>
+                        <property name="hexpand">True</property>
+                        <property name="activates-default">True</property>
+                        <property name="width-chars">50</property>
+                        <property name="truncate-multiline">True</property>
+                        <child internal-child="accessible">
+                          <object class="AtkObject" id="altname-atkobject">
+                            <property name="AtkObject::accessible-description" 
translatable="yes" context="frmaddpage|extended_tip|altname">Enter a short 
description of the essential details of the selected object for a person who 
cannot see the object. This text is available for use by assistive 
technologies. For images, this text is exported with an appropriate tag to HTML 
and PDF format.</property>
+                          </object>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="left-attach">1</property>
+                        <property name="top-attach">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="name_label">
+                        <property name="visible">True</property>
+                        <property name="can-focus">False</property>
+                        <property name="label" translatable="yes" 
context="frmaddpage|name_label">_Name:</property>
+                        <property name="use-underline">True</property>
+                        <property name="mnemonic-widget">name</property>
+                        <property name="xalign">0</property>
                       </object>
+                      <packing>
+                        <property name="left-attach">0</property>
+                        <property name="top-attach">0</property>
+                      </packing>
                     </child>
+                    <child>
+                      <object class="GtkLabel" id="altname_label">
+                        <property name="visible">True</property>
+                        <property name="can-focus">False</property>
+                        <property name="label" translatable="yes" 
context="frmaddpage|altname_label">Text _Alternative:</property>
+                        <property name="tooltip_text" translatable="yes" 
context="frmaddpage|altname_label|tooltip_text">Give a short description for 
users who do not see this object.</property>
+                        <property name="use_underline">True</property>
+                        <property name="mnemonic_widget">altname</property>
+                        <property name="xalign">0</property>
+                      </object>
+                      <packing>
+                        <property name="left-attach">0</property>
+                        <property name="top-attach">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="description_label">
+                        <property name="visible">True</property>
+                        <property name="can-focus">False</property>
+                        <property name="label" translatable="yes" 
context="frmaddpage|description_label">_Description:</property>
+                        <property name="tooltip_text" translatable="yes" 
context="frmaddpage|description_label">Give a longer explanation of the content 
if it is too complex to be described briefly in “Text Alternative.”</property>
+                        <property name="use_underline">True</property>
+                        <property name="mnemonic_widget">description</property>
+                        <property name="xalign">0</property>
+                      </object>
+                      <packing>
+                        <property name="left-attach">0</property>
+                        <property name="top-attach">2</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkScrolledWindow" id="scrolledwindow1">
+                        <property name="visible">True</property>
+                        <property name="can-focus">True</property>
+                        <property name="hexpand">True</property>
+                        <property name="vexpand">True</property>
+                        <property name="shadow-type">in</property>
+                        <child>
+                          <object class="GtkTextView" id="description">
+                            <property name="visible">True</property>
+                            <property name="can-focus">True</property>
+                            <property name="hexpand">True</property>
+                            <property name="vexpand">True</property>
+                            <property name="wrap-mode">word</property>
+                            <property name="buffer">textbuffer1</property>
+                            <child internal-child="accessible">
+                              <object class="AtkObject" 
id="description-atkobject">
+                                <property 
name="AtkObject::accessible-description" translatable="yes" 
context="frmaddpage|extended_tip|description">Enter a longer description of the 
object, especially if the object is too complex or contains too much detail to 
be described adequately with the short “Text Alternative.” This text is 
available for use by assistive technologies. For images, this text is exported 
with an appropriate tag to HTML and PDF format.</property>
+                              </object>
+                            </child>
+                          </object>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="left-attach">1</property>
+                        <property name="top-attach">2</property>
+                      </packing>
+                    </child>
+                  </object>
+                </child>
+                <child type="label">
+                  <object class="GtkLabel" id="dummylabelforVCL">
+                    <property name="visible">False</property>
+                    <property name="can-focus">False</property>
                   </object>
                 </child>
               </object>
               <packing>
-                <property name="left-attach">1</property>
-                <property name="top-attach">2</property>
+                <property name="left-attach">0</property>
+                <property name="top-attach">1</property>
               </packing>
             </child>
             <child>
@@ -162,8 +195,7 @@
               </object>
               <packing>
                 <property name="left-attach">0</property>
-                <property name="top-attach">3</property>
-                <property name="width">2</property>
+                <property name="top-attach">2</property>
               </packing>
             </child>
           </object>
diff --git a/xmloff/inc/xmlprop.hxx b/xmloff/inc/xmlprop.hxx
index f3629c228623..4325a00d82b5 100644
--- a/xmloff/inc/xmlprop.hxx
+++ b/xmloff/inc/xmlprop.hxx
@@ -167,6 +167,7 @@ inline constexpr OUStringLiteral PROP_DataRowSource = 
u"DataRowSource";
 inline constexpr OUStringLiteral PROP_DataTableHBorder = u"DataTableHBorder";
 inline constexpr OUStringLiteral PROP_DataTableOutline = u"DataTableOutline";
 inline constexpr OUStringLiteral PROP_DataTableVBorder = u"DataTableVBorder";
+inline constexpr OUStringLiteral PROP_Decorative = u"Decorative";
 inline constexpr OUStringLiteral PROP_Deep = u"Deep";
 inline constexpr OUStringLiteral PROP_DefaultOutlineLevel = 
u"DefaultOutlineLevel";
 inline constexpr OUStringLiteral PROP_Dim3D = u"Dim3D";
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index c534d4fc4dcf..482a1fa71897 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -3010,6 +3010,7 @@ XMLShapeExportFlags 
XMLTextParagraphExport::addTextFrameAttributes(
         }
     }
 
+    // TODO remove
     if (xPropSetInfo->hasPropertyByName("Decorative")
         && rPropSet->getPropertyValue("Decorative").get<bool>())
     {
diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx
index 8385e678bfbe..820506c8ea8a 100644
--- a/xmloff/source/text/txtprmap.cxx
+++ b/xmloff/source/text/txtprmap.cxx
@@ -891,6 +891,7 @@ XMLPropertyMapEntry const aXMLFramePropMap[] =
     MAP_EXT( PROP_RelativeWidthRelation, XML_NAMESPACE_LO_EXT, 
XML_REL_WIDTH_REL, XML_TYPE_TEXT_HORIZONTAL_REL|XML_TYPE_PROP_GRAPHIC, 
CTF_RELWIDTHREL),
     MAP_EXT( PROP_RelativeHeightRelation, XML_NAMESPACE_LO_EXT, 
XML_REL_HEIGHT_REL, XML_TYPE_TEXT_VERTICAL_REL|XML_TYPE_PROP_GRAPHIC, 
CTF_RELHEIGHTREL),
     MG_E(PROP_TextVerticalAdjust, DRAW, TEXTAREA_VERTICAL_ALIGN, 
XML_TYPE_VERTICAL_ALIGN, 0),
+    MAP_EXT(PROP_Decorative, XML_NAMESPACE_LO_EXT, XML_DECORATIVE, 
XML_TYPE_BOOL|XML_TYPE_PROP_GRAPHIC, 0),
 
     M_END()
 };

Reply via email to