diff options
author | Shubham Goyal <22shubh22@gmail.com> | 2019-02-26 23:02:40 +0530 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2019-03-08 15:51:23 +0100 |
commit | 732d630c3d2a168c725c18e4dd8df7a0a4f85566 (patch) | |
tree | af02abe6e0b2346c46a464b8063faa81ee11ed7d /xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx | |
parent | cfdba2b94fd7c0a2ec0250ddc9212d367db50c8c (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_expmodels.cxx')
-rw-r--r-- | xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx index 0fde594f8921..e86038147a7f 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx @@ -1009,6 +1009,42 @@ void ElementDescriptor::readScrollBarModel( StyleBag * all_styles ) readEvents(); } +void ElementDescriptor::readGridControlModel( StyleBag * all_styles ) +{ + // collect styles + Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 ); + if (readProp("BackgroundColor") >>= aStyle._backgroundColor) + aStyle._set |= 0x1; + if (readBorderProps( this, aStyle )) + aStyle._set |= 0x4; + if (readProp("TextColor") >>= aStyle._textColor) + aStyle._set |= 0x2; + if (readProp("TextLineColor") >>= aStyle._textLineColor) + aStyle._set |= 0x20; + if (readFontProps( this, aStyle )) + aStyle._set |= 0x8; + if (aStyle._set) + { + addAttribute( XMLNS_DIALOGS_PREFIX ":style-id",all_styles->getStyleId( aStyle ) ); + } + // collect elements + readDefaults(); + readBoolAttr("Tabstop", XMLNS_DIALOGS_PREFIX ":tabstop"); + readVerticalAlignAttr( "VerticalAlign", XMLNS_DIALOGS_PREFIX ":valign"); + readSelectionTypeAttr( "SelectionModel", XMLNS_DIALOGS_PREFIX ":selectiontype"); + readBoolAttr( "ShowColumnHeader", XMLNS_DIALOGS_PREFIX ":showcolumnheader"); + readBoolAttr( "ShowRowHeader", XMLNS_DIALOGS_PREFIX ":showrowheader"); + readHexLongAttr( "GridLineColor", XMLNS_DIALOGS_PREFIX ":gridline-color"); + readBoolAttr( "UseGridLines", XMLNS_DIALOGS_PREFIX ":usegridlines" ); + readHexLongAttr( "HeaderBackgroundColor", XMLNS_DIALOGS_PREFIX ":headerbackground-color"); + readHexLongAttr( "HeaderTextColor", XMLNS_DIALOGS_PREFIX ":headertext-color"); + readHexLongAttr( "ActiveSelectionBackgroundColor", XMLNS_DIALOGS_PREFIX ":activeselectionbackground-color"); + readHexLongAttr( "ActiveSelectionTextColor", XMLNS_DIALOGS_PREFIX ":activeselectiontext-color"); + readHexLongAttr( "InactiveSelectionBackgroundColor", XMLNS_DIALOGS_PREFIX ":inactiveselectionbackground-color"); + readHexLongAttr( "InactiveSelectionTextColor", XMLNS_DIALOGS_PREFIX ":inactiveselectiontext-color"); + readEvents(); +} + void ElementDescriptor::readDialogModel( StyleBag * all_styles ) { // collect elements @@ -1216,6 +1252,11 @@ void ElementDescriptor::readBullitinBoard( StyleBag * all_styles ) pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":progressmeter", _xDocument ); pElem->readProgressBarModel( all_styles ); } + else if (xServiceInfo->supportsService( "com.sun.star.awt.grid.UnoControlGridModel" ) ) + { + pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":table", _xDocument ); + pElem->readGridControlModel( all_styles ); + } if (pElem) { |