diff options
author | Rüdiger Timm <rt@openoffice.org> | 2007-07-03 11:58:01 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2007-07-03 11:58:01 +0000 |
commit | be8ed9e2c6f0ed2dc7451a0e4fcf529e80018745 (patch) | |
tree | f36b39e0752fc5edf36a9f48a678a7c386fa6414 /xmlscript | |
parent | a9fae234137c210e99703764c96c80c89c7bac13 (diff) |
INTEGRATION: CWS tkr01 (1.34.12); FILE MERGED
2007/06/26 10:03:11 tkr 1.34.12.1: #i78846# Enable TreeControl support
Diffstat (limited to 'xmlscript')
-rw-r--r-- | xmlscript/source/xmldlg_imexp/xmldlg_import.cxx | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx index d6eb2d3a1551..e6238eb8ccae 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx @@ -4,9 +4,9 @@ * * $RCSfile: xmldlg_import.cxx,v $ * - * $Revision: 1.34 $ + * $Revision: 1.35 $ * - * last change: $Author: vg $ $Date: 2006-11-21 17:42:15 $ + * last change: $Author: rt $ $Date: 2007-07-03 12:58:01 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -63,6 +63,7 @@ #include <com/sun/star/script/XScriptEventsSupplier.hpp> #include <com/sun/star/script/ScriptEventDescriptor.hpp> +#include <com/sun/star/view/SelectionType.hpp> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -1308,6 +1309,46 @@ bool ImportContext::importLineEndFormatProperty( } return false; } +//__________________________________________________________________________________________________ +bool ImportContext::importSelectionTypeProperty( + OUString const & rPropName, OUString const & rAttrName, + Reference< xml::input::XAttributes > const & xAttributes ) +{ + OUString aSelectionType( + xAttributes->getValueByUidName( + _pImport->XMLNS_DIALOGS_UID, rAttrName ) ); + if (aSelectionType.getLength()) + { + view::SelectionType eSelectionType; + + if (aSelectionType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("none") )) + { + eSelectionType = view::SelectionType_NONE; + } + else if (aSelectionType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("single") )) + { + eSelectionType = view::SelectionType_SINGLE; + } + else if (aSelectionType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("multi") )) + { + eSelectionType = view::SelectionType_MULTI; + } + else if (aSelectionType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("range") )) + { + eSelectionType = view::SelectionType_RANGE; + } + else + { + throw xml::sax::SAXException( + OUString( RTL_CONSTASCII_USTRINGPARAM("invalid selection type value!") ), + Reference< XInterface >(), Any() ); + } + + _xControlModel->setPropertyValue( rPropName, makeAny( eSelectionType ) ); + return true; + } + return false; +} //================================================================================================== struct StringTriple |