summaryrefslogtreecommitdiff
path: root/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
diff options
context:
space:
mode:
authorShubham Goyal <22shubh22@gmail.com>2019-02-26 23:02:40 +0530
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-03-08 15:51:23 +0100
commit732d630c3d2a168c725c18e4dd8df7a0a4f85566 (patch)
treeaf02abe6e0b2346c46a464b8063faa81ee11ed7d /xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
parentcfdba2b94fd7c0a2ec0250ddc9212d367db50c8c (diff)
tdf#53524 Create UNO grid control- dialog editor
The commit is based on the patch in https://bz.apache.org/ooo/show_bug.cgi?id=120066. Change-Id: Ia4ad536331954679940104adf5d6178228c90854 Reviewed-on: https://gerrit.libreoffice.org/68814 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx')
-rw-r--r--xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx59
1 files changed, 59 insertions, 0 deletions
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
index d73182609010..0a2a2f45b992 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
@@ -1701,6 +1701,11 @@ Reference< xml::input::XElement > BulletinBoardElement::startChildElement(
{
return new ProgressBarElement( rLocalName, xAttributes, this, m_xImport.get() );
}
+ // table
+ else if (rLocalName == "table")
+ {
+ return new GridControlElement( rLocalName, xAttributes, this, m_xImport.get() );
+ }
else if ( rLocalName == "multipage" )
{
return new MultiPage( rLocalName, xAttributes, this, m_xImport.get() );
@@ -1841,6 +1846,60 @@ void WindowElement::endElement()
_events.clear();
}
+// table
+Reference< xml::input::XElement > GridControlElement::startChildElement(
+ sal_Int32 nUid, OUString const & rLocalName,
+ Reference< xml::input::XAttributes > const & xAttributes )
+{
+ // event
+ if (m_xImport->isEventElement( nUid, rLocalName ))
+ {
+ return new EventElement( nUid, rLocalName, xAttributes, this, m_xImport.get() );
+ }
+ else
+ {
+ throw xml::sax::SAXException( "expected event element!", Reference< XInterface >(), Any() );
+ }
+}
+
+void GridControlElement::endElement()
+{
+ ControlImportContext ctx( m_xImport.get(), getControlId( _xAttributes ), "com.sun.star.awt.grid.UnoControlGridModel");
+ Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
+ Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
+ if (xStyle.is())
+ {
+ StyleElement * pStyle = static_cast< StyleElement * >( xStyle.get () );
+ pStyle->importBackgroundColorStyle( xControlModel );
+ pStyle->importBorderStyle( xControlModel );
+ pStyle->importTextColorStyle( xControlModel );
+ pStyle->importTextLineColorStyle( xControlModel );
+ pStyle->importFontStyle( xControlModel );
+ }
+ ctx.importDefaults( _nBasePosX, _nBasePosY, _xAttributes );
+ ctx.importBooleanProperty( "Tabstop", "tabstop", _xAttributes );
+ ctx.importVerticalAlignProperty( "VerticalAlign", "valign", _xAttributes );
+ ctx.importSelectionTypeProperty( "SelectionModel", "selectiontype", _xAttributes );
+ ctx.importBooleanProperty( "ShowColumnHeader", "showcolumnheader", _xAttributes );
+ ctx.importBooleanProperty( "ShowRowHeader", "showrowheader", _xAttributes );
+ ctx.importHexLongProperty( "GridLineColor", "gridline-color", _xAttributes );
+ ctx.importBooleanProperty( "UseGridLines", "usegridlines", _xAttributes );
+ ctx.importHexLongProperty( "HeaderBackgroundColor", "headerbackground-color", _xAttributes );
+ ctx.importHexLongProperty( "HeaderTextColor", "headertext-color", _xAttributes );
+ ctx.importHexLongProperty( "ActiveSelectionBackgroundColor", "activeselectionbackground-color", _xAttributes );
+ ctx.importHexLongProperty( "ActiveSelectionTextColor", "activeselectiontext-color", _xAttributes );
+ ctx.importHexLongProperty( "InactiveSelectionBackgroundColor", "inactiveselectionbackground-color", _xAttributes );
+ ctx.importHexLongProperty( "InactiveSelectionTextColor", "inactiveselectiontext-color", _xAttributes );
+ ctx.importEvents( _events );
+ // avoid ring-reference:
+ // vector< event elements > holding event elements holding this (via _pParent)
+ _events.clear();
+
+ ctx.finish();
+}
+
+//##################################################################################################
+
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */