summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorIlhan Yesil <ilhanyesil@gmx.de>2018-05-08 14:17:56 +0200
committerLionel Elie Mamane <lionel@mamane.lu>2019-09-13 10:45:01 +0200
commit260caebf8a2382bcde1fb9ff74ceb1b940654e6f (patch)
treedcf1cea94f62144c9ae533cba3e6bf7040bb1e81 /dbaccess
parentd27e70fce2acfc9b14f2f07c9096daa50dc2acd8 (diff)
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@mamane.lu> Tested-by: Jenkins
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/inc/strings.hxx1
-rw-r--r--dbaccess/source/core/api/TableDeco.cxx3
-rw-r--r--dbaccess/source/core/api/datasettings.cxx3
-rw-r--r--dbaccess/source/core/api/table.cxx3
-rw-r--r--dbaccess/source/core/inc/datasettings.hxx1
-rw-r--r--dbaccess/source/inc/stringconstants.hxx1
6 files changed, 12 insertions, 0 deletions
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