[Libreoffice-commits] core.git: dbaccess/inc dbaccess/source extensions/inc extensions/source offapi/com reportdesign/inc reportdesign/source xmloff/source

Ilhan Yesil (via logerrit) logerrit at kemper.freedesktop.org
Fri Sep 13 08:45:39 UTC 2019


 dbaccess/inc/strings.hxx                              |    1 
 dbaccess/source/core/api/TableDeco.cxx                |    3 
 dbaccess/source/core/api/datasettings.cxx             |    3 
 dbaccess/source/core/api/table.cxx                    |    3 
 dbaccess/source/core/inc/datasettings.hxx             |    1 
 dbaccess/source/inc/stringconstants.hxx               |    1 
 extensions/inc/helpids.h                              |    1 
 extensions/inc/strings.hrc                            |    1 
 extensions/source/propctrlr/formmetadata.cxx          |    4 -
 extensions/source/propctrlr/formmetadata.hxx          |    1 
 extensions/source/propctrlr/formstrings.hxx           |    1 
 offapi/com/sun/star/report/XReportComponent.idl       |   10 ++
 reportdesign/inc/ReportHelperDefines.hxx              |    2 
 reportdesign/inc/helpids.h                            |    1 
 reportdesign/inc/strings.hrc                          |    1 
 reportdesign/inc/strings.hxx                          |    2 
 reportdesign/source/core/inc/ReportComponent.hxx      |    2 
 reportdesign/source/core/inc/ReportHelperImpl.hxx     |    9 ++
 reportdesign/source/filter/xml/xmlColumn.cxx          |   25 +++++--
 reportdesign/source/filter/xml/xmlExport.cxx          |   39 +++++++++++
 reportdesign/source/filter/xml/xmlExport.hxx          |    1 
 reportdesign/source/filter/xml/xmlHelper.cxx          |    3 
 reportdesign/source/filter/xml/xmlTable.cxx           |    2 
 reportdesign/source/filter/xml/xmlTable.hxx           |    7 +-
 reportdesign/source/ui/inc/metadata.hxx               |   61 +++++++++---------
 reportdesign/source/ui/inspection/GeometryHandler.cxx |    1 
 reportdesign/source/ui/inspection/metadata.cxx        |    2 
 xmloff/source/table/XMLTableExport.cxx                |    4 -
 28 files changed, 149 insertions(+), 43 deletions(-)

New commits:
commit 260caebf8a2382bcde1fb9ff74ceb1b940654e6f
Author:     Ilhan Yesil <ilhanyesil at gmx.de>
AuthorDate: Tue May 8 14:17:56 2018 +0200
Commit:     Lionel Elie Mamane <lionel at mamane.lu>
CommitDate: Fri Sep 13 10:45:01 2019 +0200

    tdf#45789 [API CHANGE] Automatic row height in reports
    
    The controls have now an AutoGrow flag which is saved as
    style:min-row-height instead of style:row-height on
    style:table-row-properties in content.xml.
    In this case the table row height will be allowed to grow to accommodate
    the content.
    
    Note: in the conceptual model of reportdesigner this is a per-control
    property but in the current implementation, it is a per-row property in
    the ODF file. Thus, as soon as one control in the row has the AutoGrow
    property set, they all do.
    
    Change-Id: I95c25599e06af0f2f12e72a7cfc0881206f02039
    Reviewed-on: https://gerrit.libreoffice.org/53977
    Reviewed-by: Lionel Elie Mamane <lionel at mamane.lu>
    Tested-by: Jenkins

diff --git a/dbaccess/inc/strings.hxx b/dbaccess/inc/strings.hxx
index a0909f00c639..793807f0c58c 100644
--- a/dbaccess/inc/strings.hxx
+++ b/dbaccess/inc/strings.hxx
@@ -89,6 +89,7 @@
 #define PROPERTY_HELPFILENAME "HelpFileName"
 #define PROPERTY_WIDTH "Width"
 #define PROPERTY_ROW_HEIGHT "RowHeight"
+#define PROPERTY_AUTOGROW "AutoGrow"
 #define PROPERTY_FORMATKEY "FormatKey"
 #define PROPERTY_ALIGN "Align"
 #define PROPERTY_FONT "FontDescriptor"
diff --git a/dbaccess/source/core/api/TableDeco.cxx b/dbaccess/source/core/api/TableDeco.cxx
index c2c99f269e91..ddc04e4750bd 100644
--- a/dbaccess/source/core/api/TableDeco.cxx
+++ b/dbaccess/source/core/api/TableDeco.cxx
@@ -110,6 +110,7 @@ sal_Bool SAL_CALL ODBTableDecorator::convertFastPropertyValue(
         case PROPERTY_ID_APPLYFILTER:
         case PROPERTY_ID_FONT:
         case PROPERTY_ID_ROW_HEIGHT:
+        case PROPERTY_ID_AUTOGROW:
         case PROPERTY_ID_TEXTCOLOR:
         case PROPERTY_ID_TEXTLINECOLOR:
         case PROPERTY_ID_TEXTEMPHASIS:
@@ -156,6 +157,7 @@ void ODBTableDecorator::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, con
         case PROPERTY_ID_APPLYFILTER:
         case PROPERTY_ID_FONT:
         case PROPERTY_ID_ROW_HEIGHT:
+        case PROPERTY_ID_AUTOGROW:
         case PROPERTY_ID_TEXTCOLOR:
         case PROPERTY_ID_TEXTLINECOLOR:
         case PROPERTY_ID_TEXTEMPHASIS:
@@ -236,6 +238,7 @@ void ODBTableDecorator::getFastPropertyValue(Any& _rValue, sal_Int32 _nHandle) c
         case PROPERTY_ID_APPLYFILTER:
         case PROPERTY_ID_FONT:
         case PROPERTY_ID_ROW_HEIGHT:
+        case PROPERTY_ID_AUTOGROW:
         case PROPERTY_ID_TEXTCOLOR:
         case PROPERTY_ID_TEXTLINECOLOR:
         case PROPERTY_ID_TEXTEMPHASIS:
diff --git a/dbaccess/source/core/api/datasettings.cxx b/dbaccess/source/core/api/datasettings.cxx
index 37ec588f4de3..0eabe9fa9b12 100644
--- a/dbaccess/source/core/api/datasettings.cxx
+++ b/dbaccess/source/core/api/datasettings.cxx
@@ -65,6 +65,9 @@ void ODataSettings::registerPropertiesFor(ODataSettings_Base* _pItem)
     registerMayBeVoidProperty(PROPERTY_ROW_HEIGHT, PROPERTY_ID_ROW_HEIGHT, PropertyAttribute::BOUND | PropertyAttribute::MAYBEVOID,
                     &_pItem->m_aRowHeight, ::cppu::UnoType<sal_Int32>::get());
 
+    registerProperty(PROPERTY_AUTOGROW, PROPERTY_ID_AUTOGROW, PropertyAttribute::BOUND,
+                    &_pItem->m_bAutoGrow, cppu::UnoType<bool>::get());
+
     registerMayBeVoidProperty(PROPERTY_TEXTCOLOR, PROPERTY_ID_TEXTCOLOR, PropertyAttribute::BOUND | PropertyAttribute::MAYBEVOID,
                     &_pItem->m_aTextColor, ::cppu::UnoType<sal_Int32>::get());
 
diff --git a/dbaccess/source/core/api/table.cxx b/dbaccess/source/core/api/table.cxx
index 3007b03c9fc1..34d7298d82a2 100644
--- a/dbaccess/source/core/api/table.cxx
+++ b/dbaccess/source/core/api/table.cxx
@@ -181,6 +181,9 @@ void ODBTable::construct()
     registerMayBeVoidProperty(PROPERTY_ROW_HEIGHT, PROPERTY_ID_ROW_HEIGHT, PropertyAttribute::BOUND | PropertyAttribute::MAYBEVOID,
                     &m_aRowHeight, cppu::UnoType<sal_Int32>::get());
 
+    registerProperty(PROPERTY_AUTOGROW, PROPERTY_ID_AUTOGROW, PropertyAttribute::BOUND,
+                    &m_bAutoGrow, cppu::UnoType<bool>::get());
+
     registerMayBeVoidProperty(PROPERTY_TEXTCOLOR, PROPERTY_ID_TEXTCOLOR, PropertyAttribute::BOUND | PropertyAttribute::MAYBEVOID,
                     &m_aTextColor, cppu::UnoType<sal_Int32>::get());
 
diff --git a/dbaccess/source/core/inc/datasettings.hxx b/dbaccess/source/core/inc/datasettings.hxx
index 1ca0c693cc50..c5185891cd33 100644
--- a/dbaccess/source/core/inc/datasettings.hxx
+++ b/dbaccess/source/core/inc/datasettings.hxx
@@ -44,6 +44,7 @@ public:
     bool                           m_bApplyFilter;     // no BitField ! the base class needs a pointer to this member !
     css::awt::FontDescriptor       m_aFont;
     css::uno::Any                  m_aRowHeight;
+    bool                           m_bAutoGrow;
     css::uno::Any                  m_aTextColor;
     css::uno::Any                  m_aTextLineColor;
     sal_Int16                      m_nFontEmphasis;
diff --git a/dbaccess/source/inc/stringconstants.hxx b/dbaccess/source/inc/stringconstants.hxx
index 197a9c95de9d..9b7e732fee8f 100644
--- a/dbaccess/source/inc/stringconstants.hxx
+++ b/dbaccess/source/inc/stringconstants.hxx
@@ -167,6 +167,7 @@
 #define PROPERTY_ID_CURRENT_QUERY_DESIGN    144
 #define PROPERTY_ID_SINGLESELECTQUERYCOMPOSER   145
 #define PROPERTY_ID_PROPCHANGE_NOTIFY       146
+#define PROPERTY_ID_AUTOGROW                147
 
 #endif
 
diff --git a/extensions/inc/helpids.h b/extensions/inc/helpids.h
index 2e5f303b51fb..4b3d430b022e 100644
--- a/extensions/inc/helpids.h
+++ b/extensions/inc/helpids.h
@@ -104,6 +104,7 @@
 #define HID_PROP_RIGHT                                  "EXTENSIONS_HID_PROP_RIGHT"
 #define HID_PROP_HEIGHT                                 "EXTENSIONS_HID_PROP_HEIGHT"
 #define HID_PROP_WIDTH                                  "EXTENSIONS_HID_PROP_WIDTH"
+#define HID_PROP_AUTOGROW                               "EXTENSIONS_HID_PROP_AUTOGROW"
 #define HID_PROP_BOUNDCOLUMN                            "EXTENSIONS_HID_PROP_BOUNDCOLUMN"
 #define HID_PROP_LISTSOURCETYPE                         "EXTENSIONS_HID_PROP_LISTSOURCETYPE"
 #define HID_PROP_LISTSOURCE                             "EXTENSIONS_HID_PROP_LISTSOURCE"
diff --git a/extensions/inc/strings.hrc b/extensions/inc/strings.hrc
index c14b676d8e8f..1bece38c2cba 100644
--- a/extensions/inc/strings.hrc
+++ b/extensions/inc/strings.hrc
@@ -106,6 +106,7 @@
 #define RID_STR_CLASSID                         NC_("RID_STR_CLASSID", "Class ID")
 #define RID_STR_HEIGHT                          NC_("RID_STR_HEIGHT", "Height")
 #define RID_STR_WIDTH                           NC_("RID_STR_WIDTH", "Width")
+#define RID_STR_AUTOGROW                        NC_("RID_STR_AUTOGROW", "Auto grow")
 #define RID_STR_LISTINDEX                       NC_("RID_STR_LISTINDEX", "List index")
 #define RID_STR_ROWHEIGHT                       NC_("RID_STR_ROWHEIGHT", "Row height")
 #define RID_STR_FILLCOLOR                       NC_("RID_STR_FILLCOLOR", "Fill color")
diff --git a/extensions/source/propctrlr/formmetadata.cxx b/extensions/source/propctrlr/formmetadata.cxx
index caa4e89662af..2592c47c57eb 100644
--- a/extensions/source/propctrlr/formmetadata.cxx
+++ b/extensions/source/propctrlr/formmetadata.cxx
@@ -350,7 +350,9 @@ namespace pcr
         DEF_INFO_2( ACTIVESELECTIONTEXTCOLOR, ACTIVESELECTIONTEXTCOLOR, 211, ACTIVESELECTIONTEXTCOLOR, DIALOG_VISIBLE, COMPOSEABLE ),
         DEF_INFO_2( INACTIVESELECTIONBACKGROUNDCOLOR, INACTIVESELECTIONBACKGROUNDCOLOR, 212, INACTIVESELECTIONBACKGROUNDCOLOR, DIALOG_VISIBLE, COMPOSEABLE ),
         DEF_INFO_2( INACTIVESELECTIONTEXTCOLOR, INACTIVESELECTIONTEXTCOLOR, 213, INACTIVESELECTIONTEXTCOLOR, DIALOG_VISIBLE, COMPOSEABLE ),
-        DEF_INFO_2( URL,               URL,                214, URL,                             DIALOG_VISIBLE, COMPOSEABLE )
+        DEF_INFO_2( URL,               URL,                214, URL,                             DIALOG_VISIBLE, COMPOSEABLE ),
+
+        DEF_INFO_3( AUTOGROW,          AUTOGROW,           215, AUTOGROW,          FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE)
         };
 
         s_pPropertyInfos = aPropertyInfos;
diff --git a/extensions/source/propctrlr/formmetadata.hxx b/extensions/source/propctrlr/formmetadata.hxx
index 425ed052fec3..9c67e3a9c513 100644
--- a/extensions/source/propctrlr/formmetadata.hxx
+++ b/extensions/source/propctrlr/formmetadata.hxx
@@ -338,6 +338,7 @@ namespace pcr
     #define PROPERTY_ID_INACTIVESELECTIONBACKGROUNDCOLOR 217
     #define PROPERTY_ID_INACTIVESELECTIONTEXTCOLOR  218
     #define PROPERTY_ID_URL                         219
+    #define PROPERTY_ID_AUTOGROW                    220
 
 
 } // namespace pcr
diff --git a/extensions/source/propctrlr/formstrings.hxx b/extensions/source/propctrlr/formstrings.hxx
index 7a2b36d91426..33a554f05790 100644
--- a/extensions/source/propctrlr/formstrings.hxx
+++ b/extensions/source/propctrlr/formstrings.hxx
@@ -156,6 +156,7 @@ namespace pcr
     #define PROPERTY_HASNAVIGATION          "HasNavigationBar"
     #define PROPERTY_POSITIONX              "PositionX"
     #define PROPERTY_POSITIONY              "PositionY"
+    #define PROPERTY_AUTOGROW               "AutoGrow"
     #define PROPERTY_STEP                   "Step"
     #define PROPERTY_WORDLINEMODE           "FontWordLineMode"
     #define PROPERTY_PROGRESSVALUE          "ProgressValue"
diff --git a/offapi/com/sun/star/report/XReportComponent.idl b/offapi/com/sun/star/report/XReportComponent.idl
index d7089eae9c8c..fd48f3d5cb1b 100644
--- a/offapi/com/sun/star/report/XReportComponent.idl
+++ b/offapi/com/sun/star/report/XReportComponent.idl
@@ -84,6 +84,16 @@ interface XReportComponent
         set raises ( com::sun::star::beans::PropertyVetoException );
     };
 
+    /** Specifies that the control containing data shall automatically grow to the optimal height
+     to show the data without wasting space.
+    */
+
+    [attribute, bound] boolean AutoGrow
+    {
+        set raises(com::sun::star::beans::UnknownPropertyException);
+        get raises(com::sun::star::beans::UnknownPropertyException);
+    };
+
     /** specifies the border style of the control.
 
         <pre>
diff --git a/reportdesign/inc/ReportHelperDefines.hxx b/reportdesign/inc/ReportHelperDefines.hxx
index 86f5c7a18e2c..5eeb0b40c1cf 100644
--- a/reportdesign/inc/ReportHelperDefines.hxx
+++ b/reportdesign/inc/ReportHelperDefines.hxx
@@ -45,6 +45,8 @@
     virtual void SAL_CALL setPositionY(::sal_Int32 the_value) override; \
     virtual ::sal_Int32 SAL_CALL getWidth() override; \
     virtual void SAL_CALL setWidth(::sal_Int32 the_value) override; \
+    virtual sal_Bool SAL_CALL getAutoGrow() override; \
+    virtual void SAL_CALL setAutoGrow(sal_Bool the_value) override; \
     virtual ::sal_Int16 SAL_CALL getControlBorder() override; \
     virtual void SAL_CALL setControlBorder(::sal_Int16 the_value) override; \
     virtual ::sal_Int32 SAL_CALL getControlBorderColor() override; \
diff --git a/reportdesign/inc/helpids.h b/reportdesign/inc/helpids.h
index 9f481d4eb389..ba35fde1abbf 100644
--- a/reportdesign/inc/helpids.h
+++ b/reportdesign/inc/helpids.h
@@ -75,6 +75,7 @@
 #define HID_RPT_PROP_RPT_POSITIONY                    "REPORTDESIGN_HID_RPT_PROP_RPT_POSITIONY"
 #define HID_RPT_PROP_RPT_WIDTH                        "REPORTDESIGN_HID_RPT_PROP_RPT_WIDTH"
 #define HID_RPT_PROP_RPT_HEIGHT                       "REPORTDESIGN_HID_RPT_PROP_RPT_HEIGHT"
+#define HID_RPT_PROP_RPT_AUTOGROW                     "REPORTDESIGN_HID_RPT_PROP_RPT_AUTOGROW"
 #define HID_RPT_START_TITLE                           "REPORTDESIGN_HID_RPT_START_TITLE"
 #define HID_RPT_START_IMAGE                           "REPORTDESIGN_HID_RPT_START_IMAGE"
 #define HID_RPT_PROP_DEEPTRAVERSING                   "REPORTDESIGN_HID_RPT_PROP_DEEPTRAVERSING"
diff --git a/reportdesign/inc/strings.hrc b/reportdesign/inc/strings.hrc
index bcabc42faa08..0856156447d0 100644
--- a/reportdesign/inc/strings.hrc
+++ b/reportdesign/inc/strings.hrc
@@ -47,6 +47,7 @@
 #define RID_STR_POSITIONY                       NC_("RID_STR_POSITIONY", "Position Y")
 #define RID_STR_WIDTH                           NC_("RID_STR_WIDTH", "Width")
 #define RID_STR_HEIGHT                          NC_("RID_STR_HEIGHT", "Height")
+#define RID_STR_AUTOGROW                        NC_("RID_STR_AUTOGROW", "Auto Grow")
 #define RID_STR_INITIALFORMULA                  NC_("RID_STR_INITIALFORMULA", "Initial value")
 #define RID_STR_PRESERVEIRI                     NC_("RID_STR_PRESERVEIRI", "Preserve as Link")
 #define RID_STR_FORMULA                         NC_("RID_STR_FORMULA", "Formula")
diff --git a/reportdesign/inc/strings.hxx b/reportdesign/inc/strings.hxx
index 06d88c360909..917e6898775e 100644
--- a/reportdesign/inc/strings.hxx
+++ b/reportdesign/inc/strings.hxx
@@ -73,6 +73,8 @@
 #define PROPERTY_WIDTH "Width"
 #define PROPERTY_POSITIONX "PositionX"
 #define PROPERTY_POSITIONY "PositionY"
+#define PROPERTY_AUTOGROW "AutoGrow"
+#define PROPERTY_MINHEIGHT "MinHeight"
 #define PROPERTY_DATAFIELD "DataField"
 #define PROPERTY_PARAADJUST "ParaAdjust"
 #define PROPERTY_FONTDESCRIPTOR "FontDescriptor"
diff --git a/reportdesign/source/core/inc/ReportComponent.hxx b/reportdesign/source/core/inc/ReportComponent.hxx
index 6025d72608ef..b6f9660402a4 100644
--- a/reportdesign/source/core/inc/ReportComponent.hxx
+++ b/reportdesign/source/core/inc/ReportComponent.hxx
@@ -55,6 +55,7 @@ namespace reportdesign
         ::sal_Int32 m_nBorderColor;
         ::sal_Int16 m_nBorder;
         bool m_bPrintRepeatedValues;
+        bool m_bAutoGrow;
 
         OReportComponentProperties(
                 css::uno::Reference<css::uno::XComponentContext> const& xContext)
@@ -66,6 +67,7 @@ namespace reportdesign
             , m_nBorderColor(0)
             , m_nBorder(2)
             , m_bPrintRepeatedValues(true)
+            , m_bAutoGrow(false)
         {}
         ~OReportComponentProperties();
 
diff --git a/reportdesign/source/core/inc/ReportHelperImpl.hxx b/reportdesign/source/core/inc/ReportHelperImpl.hxx
index 47acf133a5f2..b6352de35715 100644
--- a/reportdesign/source/core/inc/ReportHelperImpl.hxx
+++ b/reportdesign/source/core/inc/ReportHelperImpl.hxx
@@ -74,6 +74,15 @@ uno::Reference< report::XSection > SAL_CALL clazz::getSection() \
     ::osl::MutexGuard aGuard(m_aMutex); \
     uno::Reference< container::XChild > xParent(getParent(  ),uno::UNO_QUERY); \
     return lcl_getSection(xParent); \
+} \
+sal_Bool SAL_CALL clazz::getAutoGrow() \
+{ \
+    ::osl::MutexGuard aGuard(m_aMutex); \
+    return (arg).m_bAutoGrow; \
+} \
+void SAL_CALL clazz::setAutoGrow(sal_Bool _autogrow) \
+{ \
+    set(PROPERTY_AUTOGROW,static_cast<bool>(_autogrow),(arg).m_bAutoGrow); \
 }
 
 #define REPORTCOMPONENT_IMPL(clazz,arg) \
diff --git a/reportdesign/source/filter/xml/xmlColumn.cxx b/reportdesign/source/filter/xml/xmlColumn.cxx
index a5216aa7bc8e..f2e949356053 100644
--- a/reportdesign/source/filter/xml/xmlColumn.cxx
+++ b/reportdesign/source/filter/xml/xmlColumn.cxx
@@ -33,8 +33,9 @@
 #include <com/sun/star/beans/PropertyAttribute.hpp>
 #include <strings.hxx>
 
-#define PROPERTY_ID_WIDTH    1
-#define PROPERTY_ID_HEIGHT   2
+#define PROPERTY_ID_WIDTH      1
+#define PROPERTY_ID_HEIGHT     2
+#define PROPERTY_ID_MINHEIGHT  3
 
 namespace rptxml
 {
@@ -130,9 +131,10 @@ void OXMLRowColumn::fillStyle(const OUString& _sStyleName)
             PropertySetInfo* pInfo = new PropertySetInfo();
             static PropertyMapEntry const pMap[] =
             {
-                {OUString(PROPERTY_WIDTH),  PROPERTY_ID_WIDTH,          ::cppu::UnoType<sal_Int32>::get()       ,PropertyAttribute::BOUND,0},
-                {OUString(PROPERTY_HEIGHT), PROPERTY_ID_HEIGHT,         ::cppu::UnoType<sal_Int32>::get()       ,PropertyAttribute::BOUND,0},
-                { OUString(), 0, css::uno::Type(), 0, 0 }
+                {OUString(PROPERTY_WIDTH),    PROPERTY_ID_WIDTH,        ::cppu::UnoType<sal_Int32>::get()       ,PropertyAttribute::BOUND,0},
+                {OUString(PROPERTY_HEIGHT),   PROPERTY_ID_HEIGHT,       ::cppu::UnoType<sal_Int32>::get()       ,PropertyAttribute::BOUND,0 },
+                {OUString(PROPERTY_MINHEIGHT), PROPERTY_ID_MINHEIGHT,    ::cppu::UnoType<sal_Int32>::get()       ,PropertyAttribute::BOUND,0 },
+                {OUString(), 0, css::uno::Type(), 0, 0 }
             };
             pInfo->add(pMap);
             Reference<XPropertySet> xProp = GenericPropertySet_CreateInstance(pInfo);
@@ -151,8 +153,19 @@ void OXMLRowColumn::fillStyle(const OUString& _sStyleName)
                 {
                     pAutoStyle->FillPropertySet(xProp);
                     sal_Int32 nHeight = 0;
+                    sal_Int32 nMinHeight = 0;
                     xProp->getPropertyValue(PROPERTY_HEIGHT) >>= nHeight;
-                    m_pContainer->addHeight(nHeight);
+                    xProp->getPropertyValue(PROPERTY_MINHEIGHT) >>= nMinHeight;
+                    if (nHeight == 0 && nMinHeight > 0)
+                    {
+                        m_pContainer->addHeight(nMinHeight);
+                        m_pContainer->addAutoHeight(true);
+                    }
+                    else
+                    {
+                        m_pContainer->addHeight(nHeight);
+                        m_pContainer->addAutoHeight(false);
+                    }
                 }
             }
         }
diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx
index ce77628ea17c..43abca700f9f 100644
--- a/reportdesign/source/filter/xml/xmlExport.cxx
+++ b/reportdesign/source/filter/xml/xmlExport.cxx
@@ -504,6 +504,29 @@ void ORptExport::collectStyleNames(sal_Int32 _nFamily,const ::std::vector< sal_I
     }
 }
 
+void ORptExport::collectStyleNames(sal_Int32 _nFamily, const ::std::vector< sal_Int32>& _aSize, const ::std::vector< sal_Int32>& _aSizeAutoGrow, std::vector<OUString>& _rStyleNames)
+{
+    ::std::vector< XMLPropertyState > aPropertyStates;
+    aPropertyStates.emplace_back(0);
+    ::std::vector<sal_Int32>::const_iterator aIter = _aSize.begin();
+    ::std::vector<sal_Int32>::const_iterator aIter2 = aIter + 1;
+    ::std::vector<sal_Int32>::const_iterator aEnd = _aSize.end();
+    for (;aIter2 != aEnd; ++aIter, ++aIter2)
+    {
+        sal_Int32 nValue = static_cast<sal_Int32>(*aIter2 - *aIter);
+        aPropertyStates[0].maValue <<= nValue;
+        // note: there cannot be 0-height rows, because a call to std::unique has removed them
+        // it cannot be predicted that the size of _aSizeAutoGrow has any relation to the size of
+        // _aSize, because of the same std::unique operation (and _aSizeAutoGrow wasn't even the same
+        // size before that), so the matching elemenent in _aSizeAutoGrow has to be found by lookup.
+        ::std::vector<sal_Int32>::const_iterator aAutoGrow = ::std::find(_aSizeAutoGrow.begin(), _aSizeAutoGrow.end(), *aIter2);
+        bool bAutoGrow = aAutoGrow != _aSizeAutoGrow.end();
+        // the mnIndex is into the array returned by OXMLHelper::GetRowStyleProps()
+        aPropertyStates[0].mnIndex = bAutoGrow ? 1 : 0;
+        _rStyleNames.push_back(GetAutoStylePool()->Add(_nFamily, aPropertyStates));
+    }
+}
+
 void ORptExport::exportSectionAutoStyle(const Reference<XSection>& _xProp)
 {
     OSL_ENSURE(_xProp != nullptr,"Section is NULL -> GPF");
@@ -524,6 +547,11 @@ void ORptExport::exportSectionAutoStyle(const Reference<XSection>& _xProp)
     aRowPos.push_back(0);
     aRowPos.push_back(_xProp->getHeight());
 
+
+    ::std::vector<sal_Int32> aRowPosAutoGrow;
+    aRowPosAutoGrow.reserve(2 * (nCount + 1));
+
+
     sal_Int32 i;
     for (i = 0 ; i< nCount ; ++i)
     {
@@ -552,11 +580,20 @@ void ORptExport::exportSectionAutoStyle(const Reference<XSection>& _xProp)
         aRowPos.push_back(nY);
         nY += xReportElement->getHeight();
         aRowPos.push_back(nY); // --nY why?
+        bool bAutoGrow = xReportElement->getAutoGrow();
+        if (bAutoGrow)
+        {
+            // the resulting table row ending at nY should auto-grow
+            aRowPosAutoGrow.push_back(nY);
+        }
     }
 
     ::std::sort(aColumnPos.begin(),aColumnPos.end(),::std::less<sal_Int32>());
     aColumnPos.erase(::std::unique(aColumnPos.begin(),aColumnPos.end()),aColumnPos.end());
 
+    // note: the aRowPos contains top and bottom position of every report control; we now compute the
+    // top of every row in the resulting table, by sorting and eliminating unnecessary duplicate
+    // positions. (the same for the colums in the preceding lines.)
     ::std::sort(aRowPos.begin(),aRowPos.end(),::std::less<sal_Int32>());
     aRowPos.erase(::std::unique(aRowPos.begin(),aRowPos.end()),aRowPos.end());
 
@@ -569,7 +606,7 @@ void ORptExport::exportSectionAutoStyle(const Reference<XSection>& _xProp)
     TGridStyleMap::iterator aPos = m_aColumnStyleNames.emplace(_xProp.get(),std::vector<OUString>()).first;
     collectStyleNames(XML_STYLE_FAMILY_TABLE_COLUMN,aColumnPos,aPos->second);
     aPos = m_aRowStyleNames.emplace(_xProp.get(),std::vector<OUString>()).first;
-    collectStyleNames(XML_STYLE_FAMILY_TABLE_ROW,aRowPos,aPos->second);
+    collectStyleNames(XML_STYLE_FAMILY_TABLE_ROW, aRowPos, aRowPosAutoGrow, aPos->second);
 
     sal_Int32 x1 = 0;
     sal_Int32 y1 = 0;
diff --git a/reportdesign/source/filter/xml/xmlExport.hxx b/reportdesign/source/filter/xml/xmlExport.hxx
index 5f71c3d25e37..97355c888158 100644
--- a/reportdesign/source/filter/xml/xmlExport.hxx
+++ b/reportdesign/source/filter/xml/xmlExport.hxx
@@ -131,6 +131,7 @@ private:
     void                    exportReportComponentAutoStyles(const Reference<XSection>& _xProp);
     void                    collectComponentStyles();
     void                    collectStyleNames(sal_Int32 _nFamily,const ::std::vector< sal_Int32>& _aSize, std::vector<OUString>& _rStyleNames);
+    void                    collectStyleNames(sal_Int32 _nFamily,const ::std::vector< sal_Int32>& _aSize, const ::std::vector< sal_Int32>& _aSizeAutoGrow, std::vector<OUString>& _rStyleNames);
     void                    exportParagraph(const Reference< XReportControlModel >& _xReportElement);
     bool                    exportFormula(enum ::xmloff::token::XMLTokenEnum eName,const OUString& _sFormula);
     void                    exportGroupsExpressionAsFunction(const Reference< XGroups>& _xGroups);
diff --git a/reportdesign/source/filter/xml/xmlHelper.cxx b/reportdesign/source/filter/xml/xmlHelper.cxx
index 313ee4dd445e..714b1db2460f 100644
--- a/reportdesign/source/filter/xml/xmlHelper.cxx
+++ b/reportdesign/source/filter/xml/xmlHelper.cxx
@@ -172,7 +172,8 @@ const XMLPropertyMapEntry* OXMLHelper::GetRowStyleProps()
 {
     static const XMLPropertyMapEntry aXMLStylesProperties[] =
     {
-        MAP_CONST_S( "Height", STYLE, ROW_HEIGHT, XML_TYPE_PROP_TABLE_ROW|XML_TYPE_MEASURE, 0),
+        MAP_CONST_S("Height", STYLE, ROW_HEIGHT, XML_TYPE_PROP_TABLE_ROW | XML_TYPE_MEASURE, 0),
+        MAP_CONST_S("MinHeight", STYLE, MIN_ROW_HEIGHT, XML_TYPE_PROP_TABLE_ROW | XML_TYPE_MEASURE, 0),
         MAP_END()
     };
     return aXMLStylesProperties;
diff --git a/reportdesign/source/filter/xml/xmlTable.cxx b/reportdesign/source/filter/xml/xmlTable.cxx
index 60030675a095..af7272437ba4 100644
--- a/reportdesign/source/filter/xml/xmlTable.cxx
+++ b/reportdesign/source/filter/xml/xmlTable.cxx
@@ -245,6 +245,7 @@ void OXMLTable::EndElement()
                             {
                                 rxElement->setSize(awt::Size(nWidth,nHeight));
                                 rxElement->setPosition(awt::Point(nPosX,nPosY));
+                                rxElement->setAutoGrow(rCell.bAutoHeight);
                             }
                             catch(const beans::PropertyVetoException &)
                             {
@@ -278,6 +279,7 @@ void OXMLTable::addCell(const Reference<XReportComponent>& _xElement)
         {
             rCell.nWidth   = m_aWidth[m_nColumnIndex-1];
             rCell.nHeight  = m_aHeight[m_nRowIndex-1];
+            rCell.bAutoHeight = m_aAutoHeight[m_nRowIndex-1];
             rCell.nColSpan = m_nColSpan;
             rCell.nRowSpan = m_nRowSpan;
         }
diff --git a/reportdesign/source/filter/xml/xmlTable.hxx b/reportdesign/source/filter/xml/xmlTable.hxx
index d8d76f2814e6..cf377ffd0323 100644
--- a/reportdesign/source/filter/xml/xmlTable.hxx
+++ b/reportdesign/source/filter/xml/xmlTable.hxx
@@ -35,12 +35,14 @@ namespace rptxml
             sal_Int32 nHeight;
             sal_Int32 nColSpan;
             sal_Int32 nRowSpan;
+            bool  bAutoHeight;
             ::std::vector< css::uno::Reference< css::report::XReportComponent> > xElements;
-            TCell() : nWidth(0),nHeight(0),nColSpan(1),nRowSpan(1){}
+            TCell() : nWidth(0),nHeight(0),nColSpan(1),nRowSpan(1),bAutoHeight(false){}
         };
     private:
         ::std::vector< ::std::vector<TCell> >                                               m_aGrid;
         ::std::vector<sal_Int32>                                                            m_aHeight;
+        ::std::vector<bool>                                                                 m_aAutoHeight;
         ::std::vector<sal_Int32>                                                            m_aWidth;
         css::uno::Reference< css::report::XSection >                                        m_xSection;
         OUString                                                                            m_sStyleName;
@@ -68,7 +70,8 @@ namespace rptxml
 
         virtual void EndElement() override;
 
-        void addHeight(sal_Int32 _nHeight)   { m_aHeight.push_back( _nHeight ); }
+        void addHeight(sal_Int32 _nHeight) { m_aHeight.push_back(_nHeight); }
+        void addAutoHeight(bool _bAutoHeight) { m_aAutoHeight.push_back(_bAutoHeight); }
         void addWidth(sal_Int32 _nWidth)     { m_aWidth.push_back( _nWidth ); }
 
         void setColumnSpanned(sal_Int32 _nColSpan)     { m_nColSpan = _nColSpan; }
diff --git a/reportdesign/source/ui/inc/metadata.hxx b/reportdesign/source/ui/inc/metadata.hxx
index fd2594c11c14..30bc0c34f07e 100644
--- a/reportdesign/source/ui/inc/metadata.hxx
+++ b/reportdesign/source/ui/inc/metadata.hxx
@@ -105,36 +105,37 @@ namespace rptui
     #define PROPERTY_ID_POSITIONY                       13
     #define PROPERTY_ID_WIDTH                           14
     #define PROPERTY_ID_HEIGHT                          15
-    #define PROPERTY_ID_FORMULA                         16
-    #define PROPERTY_ID_CONDITIONALPRINTEXPRESSION      17
-    #define PROPERTY_ID_PRINTREPEATEDVALUES             18
-    #define PROPERTY_ID_PRINTWHENGROUPCHANGE            19
-    #define PROPERTY_ID_INITIALFORMULA                  20
-    #define PROPERTY_ID_STARTNEWCOLUMN                  21
-    #define PROPERTY_ID_TYPE                            22
-    #define PROPERTY_ID_DATAFIELD                       23
-    #define PROPERTY_ID_CHARFONTNAME                    24
-    #define PROPERTY_ID_DEEPTRAVERSING                  25
-    #define PROPERTY_ID_PREEVALUATED                    26
-
-    #define PROPERTY_ID_BACKTRANSPARENT                 27
-    #define PROPERTY_ID_CONTROLBACKGROUNDTRANSPARENT    28
-    #define PROPERTY_ID_BACKCOLOR                       29
-    #define PROPERTY_ID_CONTROLBACKGROUND               30
-
-    #define PROPERTY_ID_FORMULALIST                     31
-    #define PROPERTY_ID_SCOPE                           32
-    #define PROPERTY_ID_RESETPAGENUMBER                 33
-    #define PROPERTY_ID_CHARTTYPE                       34
-    #define PROPERTY_ID_MASTERFIELDS                    35
-    #define PROPERTY_ID_DETAILFIELDS                    36
-    #define PROPERTY_ID_PREVIEW_COUNT                   37
-    #define PROPERTY_ID_AREA                            38
-    #define PROPERTY_ID_MIMETYPE                        39
-
-    #define PROPERTY_ID_FONT                            40
-    #define PROPERTY_ID_PARAADJUST                      41
-    #define PROPERTY_ID_VERTICALALIGN                   42
+    #define PROPERTY_ID_AUTOGROW                        16
+    #define PROPERTY_ID_FORMULA                         17
+    #define PROPERTY_ID_CONDITIONALPRINTEXPRESSION      18
+    #define PROPERTY_ID_PRINTREPEATEDVALUES             19
+    #define PROPERTY_ID_PRINTWHENGROUPCHANGE            20
+    #define PROPERTY_ID_INITIALFORMULA                  21
+    #define PROPERTY_ID_STARTNEWCOLUMN                  22
+    #define PROPERTY_ID_TYPE                            23
+    #define PROPERTY_ID_DATAFIELD                       24
+    #define PROPERTY_ID_CHARFONTNAME                    25
+    #define PROPERTY_ID_DEEPTRAVERSING                  26
+    #define PROPERTY_ID_PREEVALUATED                    27
+
+    #define PROPERTY_ID_BACKTRANSPARENT                 28
+    #define PROPERTY_ID_CONTROLBACKGROUNDTRANSPARENT    29
+    #define PROPERTY_ID_BACKCOLOR                       30
+    #define PROPERTY_ID_CONTROLBACKGROUND               31
+
+    #define PROPERTY_ID_FORMULALIST                     32
+    #define PROPERTY_ID_SCOPE                           33
+    #define PROPERTY_ID_RESETPAGENUMBER                 34
+    #define PROPERTY_ID_CHARTTYPE                       35
+    #define PROPERTY_ID_MASTERFIELDS                    36
+    #define PROPERTY_ID_DETAILFIELDS                    37
+    #define PROPERTY_ID_PREVIEW_COUNT                   38
+    #define PROPERTY_ID_AREA                            39
+    #define PROPERTY_ID_MIMETYPE                        40
+
+    #define PROPERTY_ID_FONT                            41
+    #define PROPERTY_ID_PARAADJUST                      42
+    #define PROPERTY_ID_VERTICALALIGN                   43
 
 
 } // namespace rptui
diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx
index 86bdade20e35..20e37bf6413c 100644
--- a/reportdesign/source/ui/inspection/GeometryHandler.cxx
+++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx
@@ -1315,6 +1315,7 @@ uno::Sequence< beans::Property > SAL_CALL GeometryHandler::getSupportedPropertie
         ,OUString(PROPERTY_POSITIONY)
         ,OUString(PROPERTY_WIDTH)
         ,OUString(PROPERTY_HEIGHT)
+        ,OUString(PROPERTY_AUTOGROW)
         ,OUString(PROPERTY_PREEVALUATED)
         ,OUString(PROPERTY_DEEPTRAVERSING)
         ,OUString(PROPERTY_FORMULA)
diff --git a/reportdesign/source/ui/inspection/metadata.cxx b/reportdesign/source/ui/inspection/metadata.cxx
index 14e4a3088871..2fd4bc6bf20d 100644
--- a/reportdesign/source/ui/inspection/metadata.cxx
+++ b/reportdesign/source/ui/inspection/metadata.cxx
@@ -118,6 +118,7 @@ namespace rptui
             ,DEF_INFO_1( POSITIONY,                     POSITIONY,                  RPT_POSITIONY,              Composeable )
             ,DEF_INFO_1( WIDTH,                         WIDTH,                      RPT_WIDTH,                  Composeable )
             ,DEF_INFO_1( HEIGHT,                        HEIGHT,                     RPT_HEIGHT,                 Composeable )
+            ,DEF_INFO_1( AUTOGROW,                      AUTOGROW,                   RPT_AUTOGROW,               Composeable )
             ,DEF_INFO_1( FONT,                          FONT,                       RPT_FONT,                   Composeable )
             ,DEF_INFO_1( PREEVALUATED,                  PREEVALUATED,               PREEVALUATED,               Composeable )
             ,DEF_INFO_1( DEEPTRAVERSING,                DEEPTRAVERSING,             DEEPTRAVERSING,             Composeable )
@@ -268,6 +269,7 @@ namespace rptui
                 ,PROPERTY_POSITIONY
                 ,PROPERTY_WIDTH
                 ,PROPERTY_HEIGHT
+                ,PROPERTY_AUTOGROW
                 ,PROPERTY_FONT
                 ,PROPERTY_LABEL
                 ,PROPERTY_LINECOLOR
diff --git a/xmloff/source/table/XMLTableExport.cxx b/xmloff/source/table/XMLTableExport.cxx
index 2e1c7d2ccfb3..9c397d7a232f 100644
--- a/xmloff/source/table/XMLTableExport.cxx
+++ b/xmloff/source/table/XMLTableExport.cxx
@@ -85,8 +85,8 @@ const XMLPropertyMapEntry* getRowPropertiesMap()
     static const XMLPropertyMapEntry aXMLRowProperties[] =
     {
         RMAP( "Height",         XML_NAMESPACE_STYLE, XML_ROW_HEIGHT,                    XML_TYPE_MEASURE,   0 ),
-        RMAP( "OptimalHeight",  XML_NAMESPACE_STYLE, XML_MIN_ROW_HEIGHT,                XML_TYPE_MEASURE,   0 ),
-        RMAP( "OptimalWidth",   XML_NAMESPACE_STYLE, XML_USE_OPTIMAL_ROW_HEIGHT,        XML_TYPE_BOOL, 0 ),
+        RMAP( "MinHeight",      XML_NAMESPACE_STYLE, XML_MIN_ROW_HEIGHT,                XML_TYPE_MEASURE,   0 ),
+        RMAP( "OptimalHeight",  XML_NAMESPACE_STYLE, XML_USE_OPTIMAL_ROW_HEIGHT,        XML_TYPE_BOOL, 0 ),
         MAP_END
     };
 


More information about the Libreoffice-commits mailing list