[Libreoffice-commits] core.git: xmlscript/source

2023-05-06 Thread Mike Kaganski (via logerrit)
 xmlscript/source/xml_helper/xml_impctx.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6868a857fc8a5256b47da239b573b27d40002080
Author: Mike Kaganski 
AuthorDate: Sun Apr 23 20:15:55 2023 +0300
Commit: Mike Kaganski 
CommitDate: Sat May 6 12:28:01 2023 +0200

Use getXWeak in xmlscript

Change-Id: I00f644392860162cf7294ff8119bf00a5ec69b3f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150889
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/xmlscript/source/xml_helper/xml_impctx.cxx 
b/xmlscript/source/xml_helper/xml_impctx.cxx
index 000de7e94072..e38263243717 100644
--- a/xmlscript/source/xml_helper/xml_impctx.cxx
+++ b/xmlscript/source/xml_helper/xml_impctx.cxx
@@ -400,7 +400,7 @@ OUString DocumentHandlerImpl::getUriByUid( sal_Int32 Uid )
 if (rURIUid.second == Uid)
 return rURIUid.first;
 }
-throw container::NoSuchElementException( "no such xmlns uid!" , 
static_cast< OWeakObject * >(this) );
+throw container::NoSuchElementException( "no such xmlns uid!" , getXWeak() 
);
 }
 
 // XDocumentHandler


[Libreoffice-commits] core.git: xmlscript/source

2023-02-27 Thread Noel Grandin (via logerrit)
 xmlscript/source/xml_helper/xml_impctx.cxx |   30 +++--
 1 file changed, 16 insertions(+), 14 deletions(-)

New commits:
commit 604c464e35807c7e4fa700726a338a9682010a15
Author: Noel Grandin 
AuthorDate: Sat Feb 25 16:47:39 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Feb 28 07:01:32 2023 +

osl::Mutex->std::mutex in xmlscript::DocumentHandlerImpl

Change-Id: If956c1e09e0185e7966edc17e2941b3f5d86c98f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147681
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/xmlscript/source/xml_helper/xml_impctx.cxx 
b/xmlscript/source/xml_helper/xml_impctx.cxx
index 1b4247ba822a..000de7e94072 100644
--- a/xmlscript/source/xml_helper/xml_impctx.cxx
+++ b/xmlscript/source/xml_helper/xml_impctx.cxx
@@ -31,6 +31,8 @@
 #include 
 
 #include 
+#include 
+#include 
 #include 
 #include 
 
@@ -75,13 +77,13 @@ class ExtendedAttributes;
 
 class MGuard
 {
-Mutex * m_pMutex;
+std::mutex * m_pMutex;
 public:
-explicit MGuard( std::unique_ptr const & pMutex )
-: m_pMutex( pMutex.get() )
-{ if (m_pMutex) m_pMutex->acquire(); }
+explicit MGuard( std::optional & oMutex )
+: m_pMutex( oMutex ? &*oMutex : nullptr )
+{ if (m_pMutex) m_pMutex->lock(); }
 ~MGuard() noexcept
-{ if (m_pMutex) m_pMutex->release(); }
+{ if (m_pMutex) m_pMutex->unlock(); }
 };
 
 class DocumentHandlerImpl :
@@ -107,7 +109,7 @@ class DocumentHandlerImpl :
 std::vector< ElementEntry > m_elements;
 sal_Int32 m_nSkipElements;
 
-std::unique_ptr m_pMutex;
+mutable std::optional m_oMutex;
 
 inline Reference< xml::input::XElement > getCurrentElement() const;
 
@@ -178,13 +180,13 @@ DocumentHandlerImpl::DocumentHandlerImpl(
 m_elements.reserve( 10 );
 
 if (! bSingleThreadedUse)
-m_pMutex.reset(new Mutex);
+m_oMutex.emplace();
 }
 
 inline Reference< xml::input::XElement >
 DocumentHandlerImpl::getCurrentElement() const
 {
-MGuard aGuard( m_pMutex );
+MGuard aGuard( m_oMutex );
 if (m_elements.empty())
 return Reference< xml::input::XElement >();
 else
@@ -193,7 +195,7 @@ DocumentHandlerImpl::getCurrentElement() const
 
 inline sal_Int32 DocumentHandlerImpl::getUidByURI( OUString const & rURI )
 {
-MGuard guard( m_pMutex );
+MGuard guard( m_oMutex );
 if (m_nLastURI_lookup == UID_UNKNOWN || m_aLastURI_lookup != rURI)
 {
 t_OUString2LongMap::const_iterator iFind( m_URI2Uid.find( rURI ) );
@@ -370,7 +372,7 @@ Sequence< OUString > 
DocumentHandlerImpl::getSupportedServiceNames()
 void DocumentHandlerImpl::initialize(
 Sequence< Any > const & arguments )
 {
-MGuard guard( m_pMutex );
+MGuard guard( m_oMutex );
 Reference< xml::input::XRoot > xRoot;
 if (arguments.getLength() != 1 ||
 !(arguments[ 0 ] >>= xRoot) ||
@@ -392,7 +394,7 @@ sal_Int32 DocumentHandlerImpl::getUidByUri( OUString const 
& Uri )
 
 OUString DocumentHandlerImpl::getUriByUid( sal_Int32 Uid )
 {
-MGuard guard( m_pMutex );
+MGuard guard( m_oMutex );
 for (const auto& rURIUid : m_URI2Uid)
 {
 if (rURIUid.second == Uid)
@@ -424,7 +426,7 @@ void DocumentHandlerImpl::startElement(
 ElementEntry elementEntry;
 
 { // guard start:
-MGuard aGuard( m_pMutex );
+MGuard aGuard( m_oMutex );
 // currently skipping elements and waiting for end tags?
 if (m_nSkipElements > 0)
 {
@@ -526,7 +528,7 @@ void DocumentHandlerImpl::startElement(
 }
 
 {
-MGuard aGuard( m_pMutex );
+MGuard aGuard( m_oMutex );
 if (elementEntry.m_xElement.is())
 {
 m_elements.push_back( std::move(elementEntry) );
@@ -549,7 +551,7 @@ void DocumentHandlerImpl::endElement(
 {
 Reference< xml::input::XElement > xCurrentElement;
 {
-MGuard aGuard( m_pMutex );
+MGuard aGuard( m_oMutex );
 if (m_nSkipElements)
 {
 --m_nSkipElements;


[Libreoffice-commits] core.git: xmlscript/source

2022-08-07 Thread Julien Nabet (via logerrit)
 xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx |2 ++
 xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx |2 ++
 2 files changed, 4 insertions(+)

New commits:
commit 7b204ecb49563544ee9c811dbcbee998062bf511
Author: Julien Nabet 
AuthorDate: Sun Aug 7 22:04:26 2022 +0200
Commit: Julien Nabet 
CommitDate: Mon Aug 8 07:23:59 2022 +0200

Related tdf#114790: add align and vertalign to datefield im/export

Change-Id: I2661e0c372fbb3c364ac338f23ebbd5b1a448ff0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137936
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
index 01328f68050b..823df0e9ac1b 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
@@ -709,6 +709,8 @@ void ElementDescriptor::readDateFieldModel( StyleBag * 
all_styles )
 
 // collect elements
 readDefaults();
+readAlignAttr( "Align", XMLNS_DIALOGS_PREFIX ":align" );
+readVerticalAlignAttr( "VerticalAlign", XMLNS_DIALOGS_PREFIX ":valign" );
 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX ":tabstop" );
 readBoolAttr( "ReadOnly", XMLNS_DIALOGS_PREFIX ":readonly" );
 readBoolAttr( "HideInactiveSelection", XMLNS_DIALOGS_PREFIX 
":hide-inactive-selection" );
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
index 4c7f9642f06e..bea460715789 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
@@ -691,6 +691,8 @@ void DateFieldElement::endElement()
 }
 
 ctx.importDefaults( _nBasePosX, _nBasePosY, _xAttributes );
+ctx.importAlignProperty( "Align", "align", _xAttributes );
+ctx.importVerticalAlignProperty( "VerticalAlign", "valign", _xAttributes );
 ctx.importBooleanProperty( "Tabstop", "tabstop", _xAttributes );
 ctx.importBooleanProperty( "ReadOnly", "readonly", _xAttributes );
 ctx.importBooleanProperty( "StrictFormat", "strict-format", _xAttributes );


[Libreoffice-commits] core.git: xmlscript/source

2022-08-07 Thread Caolán McNamara (via logerrit)
 xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx |2 ++
 xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx |2 ++
 2 files changed, 4 insertions(+)

New commits:
commit cf2a7501fa1848fdccd9717f52f18d0f44db458b
Author: Caolán McNamara 
AuthorDate: Sun Aug 7 15:17:22 2022 +0100
Commit: Caolán McNamara 
CommitDate: Sun Aug 7 17:05:34 2022 +0200

Resolves: tdf#114790 add align and vertalign to currencyfield im/export

Change-Id: Idef9a94aeefb295cd349ed0216d08bc8e2faf079
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137925
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
index 1ab4d3d21cce..01328f68050b 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
@@ -667,6 +667,8 @@ void ElementDescriptor::readCurrencyFieldModel( StyleBag * 
all_styles )
 
 // collect elements
 readDefaults();
+readAlignAttr( "Align", XMLNS_DIALOGS_PREFIX ":align" );
+readVerticalAlignAttr( "VerticalAlign", XMLNS_DIALOGS_PREFIX ":valign" );
 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX ":tabstop" );
 readBoolAttr( "ReadOnly", XMLNS_DIALOGS_PREFIX ":readonly" );
 readBoolAttr( "HideInactiveSelection", XMLNS_DIALOGS_PREFIX 
":hide-inactive-selection" );
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
index e74e35ece9e2..4c7f9642f06e 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
@@ -745,6 +745,8 @@ void CurrencyFieldElement::endElement()
 }
 
 ctx.importDefaults( _nBasePosX, _nBasePosY, _xAttributes );
+ctx.importAlignProperty( "Align", "align", _xAttributes );
+ctx.importVerticalAlignProperty( "VerticalAlign", "valign", _xAttributes );
 ctx.importBooleanProperty("Tabstop", "tabstop", _xAttributes );
 ctx.importBooleanProperty( "ReadOnly", "readonly" , _xAttributes );
 ctx.importBooleanProperty( "StrictFormat", "strict-format", _xAttributes );


[Libreoffice-commits] core.git: xmlscript/source

2022-05-02 Thread Stephan Bergmann (via logerrit)
 xmlscript/source/xmldlg_imexp/imp_share.hxx|4 
 xmlscript/source/xmldlg_imexp/xmldlg_export.cxx|4 
 xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx |   46 +-
 xmlscript/source/xmldlg_imexp/xmldlg_import.cxx|   88 ++---
 4 files changed, 71 insertions(+), 71 deletions(-)

New commits:
commit 0c34f61772a3d4b3169af869149bed5e4850eb14
Author: Stephan Bergmann 
AuthorDate: Mon May 2 14:22:13 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Mon May 2 17:24:32 2022 +0200

Just use Any ctor instead of makeAny in xmlscript

Change-Id: I6dbf6acdf051fefe73c82b7739105a73d3aabede
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133699
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx 
b/xmlscript/source/xmldlg_imexp/imp_share.hxx
index 3b52f683b1e0..12da217242de 100644
--- a/xmlscript/source/xmldlg_imexp/imp_share.hxx
+++ b/xmlscript/source/xmldlg_imexp/imp_share.hxx
@@ -486,13 +486,13 @@ public:
 try
 {
 _pImport->_xDialogModel->insertByName(
-_aId, css::uno::makeAny(
+_aId, css::uno::Any(
 css::uno::Reference::query(
 _xControlModel ) ) );
 }
 catch(const css::container::ElementExistException )
 {
-throw css::lang::WrappedTargetRuntimeException("", e.Context, 
makeAny(e));
+throw css::lang::WrappedTargetRuntimeException("", e.Context, 
css::uno::Any(e));
 }
 }
 };
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
index 6a7af3fc3d85..cc561a08d3ca 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
@@ -937,7 +937,7 @@ void ElementDescriptor::readDataAwareAttr( OUString const & 
rAttrName )
 {
 table::CellAddress aAddress;
 xBindable->getPropertyValue( "BoundCell" ) >>= aAddress;
-xConvertor->setPropertyValue( "Address", makeAny( aAddress ) );
+xConvertor->setPropertyValue( "Address", Any( aAddress ) );
 OUString sAddress;
 xConvertor->getPropertyValue( "PersistentRepresentation" ) >>= 
sAddress;
 if ( !sAddress.isEmpty() )
@@ -967,7 +967,7 @@ void ElementDescriptor::readDataAwareAttr( OUString const & 
rAttrName )
 xListSource->getPropertyValue( "CellRange" ) >>= aAddress;
 
 OUString sAddress;
-xConvertor->setPropertyValue( "Address", makeAny( aAddress ) );
+xConvertor->setPropertyValue( "Address", Any( aAddress ) );
 xConvertor->getPropertyValue( "PersistentRepresentation" ) >>= 
sAddress;
 SAL_INFO("xmlscript.xmldlg"," cell range source list " << sAddress 
);
 if ( !sAddress.isEmpty() )
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
index 66a69a2b5518..e74e35ece9e2 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
@@ -86,7 +86,7 @@ void Frame::endElement()
 ctx.importDefaults( 0, 0, _xAttributes ); // inherited from 
BulletinBoardElement
 if (!_label.isEmpty())
 {
-xControlModel->setPropertyValue( "Label" , makeAny( _label ) );
+xControlModel->setPropertyValue( "Label" , Any( _label ) );
 }
 ctx.importEvents( _events );
 // avoid ring-reference:
@@ -468,7 +468,7 @@ void FormattedFieldElement::endElement()
 ctx.importShortProperty( "MaxTextLen", "maxlength", _xAttributes );
 ctx.importBooleanProperty( "Spin",  "spin", _xAttributes );
 if (ctx.importLongProperty( "RepeatDelay", "repeat", _xAttributes ))
-ctx.getControlModel()->setPropertyValue( "Repeat" , makeAny(true) );
+ctx.getControlModel()->setPropertyValue( "Repeat" , Any(true) );
 
 OUString 
sDefault(_xAttributes->getValueByUidName(m_pImport->XMLNS_DIALOGS_UID, 
"value-default") );
 if (!sDefault.isEmpty())
@@ -476,16 +476,16 @@ void FormattedFieldElement::endElement()
 double d = sDefault.toDouble();
 if (d != 0.0 || sDefault == "0" || sDefault == "0.0" )
 {
-ctx.getControlModel()->setPropertyValue( "EffectiveDefault", 
makeAny( d ) );
+ctx.getControlModel()->setPropertyValue( "EffectiveDefault", Any( 
d ) );
 }
 else // treat as string
 {
-ctx.getControlModel()->setPropertyValue( "EffectiveDefault", 
makeAny( sDefault ) );
+ctx.getControlModel()->setPropertyValue( "EffectiveDefault", Any( 
sDefault ) );
 }
 }
 
 // format spec
-ctx.getControlModel()->setPropertyValue("FormatsSupplier", makeAny( 
m_pImport->getNumberFormatsSupplier() ) );
+ctx.getControlModel()->setPropertyValue("FormatsSupplier", Any( 

[Libreoffice-commits] core.git: xmlscript/source

2021-11-01 Thread Mike Kaganski (via logerrit)
 xmlscript/source/xmldlg_imexp/xmldlg_import.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 38979c6abd4bcac13e9674187e73ccf675fbaf55
Author: Mike Kaganski 
AuthorDate: Fri Oct 29 10:29:03 2021 +0300
Commit: Mike Kaganski 
CommitDate: Mon Nov 1 07:31:06 2021 +0100

Prepare for removal of non-const operator[] from Sequence in xmlscript

Change-Id: I166e51e13974154dba4749568b1232eecd2fb8cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124417
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
index ab9b47d0e619..2bad2426c9ab 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
@@ -855,8 +855,7 @@ bool ImportContext::importGraphicOrImageProperty(
 uno::Reference 
xGraphicStorageHandler;
 if ( xDocStorage.is() )
 {
-uno::Sequence< Any > aArgs( 1 );
-aArgs[ 0 ] <<= xDocStorage->getDocumentStorage();
+uno::Sequence< Any > aArgs{ Any(xDocStorage->getDocumentStorage()) 
};
 xGraphicStorageHandler.set(
 
_pImport->getComponentContext()->getServiceManager()->createInstanceWithArgumentsAndContext(
 "com.sun.star.comp.Svx.GraphicImportHelper" , aArgs, 
_pImport->getComponentContext() ),
 UNO_QUERY );


[Libreoffice-commits] core.git: xmlscript/source

2021-08-01 Thread Noel Grandin (via logerrit)
 xmlscript/source/xmlflat_imexp/xmlbas_export.cxx |8 
 xmlscript/source/xmlflat_imexp/xmlbas_export.hxx |4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 499adc4cc3597486a49b3781ba21e3c216668ea4
Author: Noel Grandin 
AuthorDate: Sat Jul 31 18:57:57 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun Aug 1 10:41:25 2021 +0200

osl::Mutex->std::mutex in XMLBasicExporterBase

Change-Id: I5178e6bc6566186081e7a21e91cd8ca221b74cac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119751
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx 
b/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx
index 3f0351a1f97e..c714bea9743f 100644
--- a/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx
+++ b/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx
@@ -60,7 +60,7 @@ namespace xmlscript
 
 void XMLBasicExporterBase::initialize( const Sequence< Any >& aArguments )
 {
-::osl::MutexGuard aGuard( m_aMutex );
+std::lock_guard aGuard( m_aMutex );
 
 if ( aArguments.getLength() != 1 )
 {
@@ -79,7 +79,7 @@ namespace xmlscript
 
 void XMLBasicExporterBase::setSourceDocument( const Reference< XComponent 
>& rxDoc )
 {
-::osl::MutexGuard aGuard( m_aMutex );
+std::lock_guard aGuard( m_aMutex );
 
 m_xModel.set( rxDoc, UNO_QUERY );
 
@@ -93,7 +93,7 @@ namespace xmlscript
 
 sal_Bool XMLBasicExporterBase::filter( const Sequence< beans::PropertyValue >& 
/*aDescriptor*/ )
 {
-::osl::MutexGuard aGuard( m_aMutex );
+std::lock_guard aGuard( m_aMutex );
 
 bool bReturn = true;
 
@@ -306,7 +306,7 @@ sal_Bool XMLBasicExporterBase::filter( const Sequence< 
beans::PropertyValue >& /
 
 void XMLBasicExporterBase::cancel()
 {
-::osl::MutexGuard aGuard( m_aMutex );
+std::lock_guard aGuard( m_aMutex );
 
 // cancel export
 }
diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_export.hxx 
b/xmlscript/source/xmlflat_imexp/xmlbas_export.hxx
index e58eebe6005f..1ed5e9e5d356 100644
--- a/xmlscript/source/xmlflat_imexp/xmlbas_export.hxx
+++ b/xmlscript/source/xmlflat_imexp/xmlbas_export.hxx
@@ -25,7 +25,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 namespace xmlscript
 {
@@ -39,7 +39,7 @@ namespace xmlscript
 class XMLBasicExporterBase : public XMLBasicExporterBase_BASE
 {
 private:
-::osl::Mutex  m_aMutex;
+std::mutexm_aMutex;
 css::uno::Reference< css::xml::sax::XDocumentHandler >m_xHandler;
 css::uno::Reference< css::frame::XModel > m_xModel;
 bool constm_bOasis;


[Libreoffice-commits] core.git: xmlscript/source

2021-05-31 Thread Noel Grandin (via logerrit)
 xmlscript/source/xmldlg_imexp/imp_share.hxx|2 ++
 xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx |3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 057b25c04ea1032c20d99fc3eda88680cd0b9e54
Author: Noel Grandin 
AuthorDate: Mon May 31 10:57:33 2021 +0200
Commit: Caolán McNamara 
CommitDate: Mon May 31 16:19:53 2021 +0200

crashtesting fix

when doing
soffice --convert-to ods tdf96952-1.xls

after
commit 5c79032077d387053c62829d62518695f68555c1
Date:   Tue May 25 09:32:58 2021 +0200
fix leaks in loading xmlscript

Change-Id: I55c1e95a09db937604f62a5b33e56349512ff8ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116435
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx 
b/xmlscript/source/xmldlg_imexp/imp_share.hxx
index 99a52b58dcb1..2cc574c01b93 100644
--- a/xmlscript/source/xmldlg_imexp/imp_share.hxx
+++ b/xmlscript/source/xmldlg_imexp/imp_share.hxx
@@ -531,6 +531,8 @@ public:
 class BulletinBoardElement
 : public ControlElement
 {
+// we are the owner of this, so have to keep a reference to it
+rtl::Reference mxDialogImport;
 public:
 virtual css::uno::Reference< css::xml::input::XElement >
 SAL_CALL startChildElement(
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
index da2fd2d2c412..66a69a2b5518 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
@@ -1725,7 +1725,8 @@ BulletinBoardElement::BulletinBoardElement(
 OUString const & rLocalName,
 Reference< xml::input::XAttributes > const & xAttributes,
 ElementBase * pParent, DialogImport * pImport )
-: ControlElement( rLocalName, xAttributes, pParent, pImport )
+: ControlElement( rLocalName, xAttributes, pParent, pImport ),
+  mxDialogImport(pImport)
 {
 OUString aValue( _xAttributes->getValueByUidName( 
m_pImport->XMLNS_DIALOGS_UID, "left" ) );
 if (!aValue.isEmpty())
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: xmlscript/source

2021-02-18 Thread Noel (via logerrit)
 xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx |   27 ++---
 xmlscript/source/xmldlg_imexp/xmldlg_export.cxx|   22 ++---
 xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx |   12 -
 xmlscript/source/xmlflat_imexp/xmlbas_export.cxx   |   26 
 xmlscript/source/xmllib_imexp/xmllib_export.cxx|5 +--
 xmlscript/source/xmlmod_imexp/xmlmod_export.cxx|6 ++--
 6 files changed, 44 insertions(+), 54 deletions(-)

New commits:
commit 85e51d1fb5ed3019ef2409c8c8a7721148bb4178
Author: Noel 
AuthorDate: Fri Feb 19 08:38:41 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Feb 19 08:46:06 2021 +0100

loplugin:refcounting in xmlscript

Change-Id: I82e3fe7ec8f45d9e99ec51688df97a0e5a33f58c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/69
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
index 0646be0cc824..be5899fb72d9 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -87,7 +88,7 @@ void ElementDescriptor::readMultiPageModel( StyleBag * 
all_styles )
 uno::Reference< container::XNameContainer > xPagesContainer( _xProps, 
uno::UNO_QUERY );
 if ( xPagesContainer.is() && 
xPagesContainer->getElementNames().hasElements() )
 {
-ElementDescriptor * pElem = new ElementDescriptor( _xProps, 
_xPropState, XMLNS_DIALOGS_PREFIX ":bulletinboard", _xDocument );
+rtl::Reference pElem = new ElementDescriptor( 
_xProps, _xPropState, XMLNS_DIALOGS_PREFIX ":bulletinboard", _xDocument );
 pElem->readBullitinBoard( all_styles );
 addSubElement( pElem );
 }
@@ -115,14 +116,14 @@ void ElementDescriptor::readFrameModel( StyleBag * 
all_styles )
 
 if ( readProp( "Label" ) >>= aTitle)
 {
-ElementDescriptor * title = new ElementDescriptor( _xProps, 
_xPropState, XMLNS_DIALOGS_PREFIX ":title", _xDocument );
+rtl::Reference title = new ElementDescriptor( 
_xProps, _xPropState, XMLNS_DIALOGS_PREFIX ":title", _xDocument );
 title->addAttribute( XMLNS_DIALOGS_PREFIX ":value", aTitle );
 addSubElement( title );
 }
 uno::Reference< container::XNameContainer > xControlContainer( _xProps, 
uno::UNO_QUERY );
 if ( xControlContainer.is() && 
xControlContainer->getElementNames().hasElements() )
 {
-ElementDescriptor * pElem = new ElementDescriptor( _xProps, 
_xPropState, XMLNS_DIALOGS_PREFIX ":bulletinboard", _xDocument );
+rtl::Reference pElem = new ElementDescriptor( 
_xProps, _xPropState, XMLNS_DIALOGS_PREFIX ":bulletinboard", _xDocument );
 pElem->readBullitinBoard( all_styles );
 addSubElement( pElem );
 }
@@ -152,7 +153,7 @@ void ElementDescriptor::readPageModel( StyleBag * 
all_styles )
 uno::Reference< container::XNameContainer > xControlContainer( _xProps, 
uno::UNO_QUERY );
 if ( xControlContainer.is() && 
xControlContainer->getElementNames().hasElements() )
 {
-ElementDescriptor * pElem = new ElementDescriptor( _xProps, 
_xPropState, XMLNS_DIALOGS_PREFIX ":bulletinboard", _xDocument );
+rtl::Reference pElem = new ElementDescriptor( 
_xProps, _xPropState, XMLNS_DIALOGS_PREFIX ":bulletinboard", _xDocument );
 pElem->readBullitinBoard( all_styles );
 addSubElement( pElem );
 }
@@ -312,11 +313,11 @@ void ElementDescriptor::readComboBoxModel( StyleBag * 
all_styles )
 Sequence< OUString > itemValues;
 if ((readProp( "StringItemList" ) >>= itemValues) &&  
itemValues.hasElements())
 {
-ElementDescriptor * popup = new ElementDescriptor( _xProps, 
_xPropState, XMLNS_DIALOGS_PREFIX ":menupopup", _xDocument );
+rtl::Reference popup = new ElementDescriptor( 
_xProps, _xPropState, XMLNS_DIALOGS_PREFIX ":menupopup", _xDocument );
 
 for ( const auto& rItemValue : std::as_const(itemValues) )
 {
-ElementDescriptor * item = new ElementDescriptor( _xProps, 
_xPropState, XMLNS_DIALOGS_PREFIX ":menuitem", _xDocument );
+rtl::Reference item = new ElementDescriptor( 
_xProps, _xPropState, XMLNS_DIALOGS_PREFIX ":menuitem", _xDocument );
 item->addAttribute( XMLNS_DIALOGS_PREFIX ":value", rItemValue );
 popup->addSubElement( item );
 }
@@ -359,11 +360,11 @@ void ElementDescriptor::readListBoxModel( StyleBag * 
all_styles )
 Sequence< OUString > itemValues;
 if ((readProp( "StringItemList" ) >>= itemValues) && 
itemValues.hasElements())
 {
-ElementDescriptor * popup = new ElementDescriptor( _xProps, 
_xPropState, XMLNS_DIALOGS_PREFIX ":menupopup", _xDocument );
+rtl::Reference popup = new ElementDescriptor( 
_xProps, 

[Libreoffice-commits] core.git: xmlscript/source

2020-10-22 Thread Serge Krot (via logerrit)
 xmlscript/source/xmldlg_imexp/imp_share.hxx|5 -
 xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx |8 
 2 files changed, 8 insertions(+), 5 deletions(-)

New commits:
commit f4a5893eceabc1f6d541164a0e858456f0ce0905
Author: Serge Krot 
AuthorDate: Wed Oct 21 13:39:01 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Thu Oct 22 16:30:48 2020 +0200

tdf#137652 fix XDL import: no more missing empty items for combobox

Change-Id: I6837968ee7cc5e4b3bc9abd7e320f562c6ff0833
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104619
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx 
b/xmlscript/source/xmldlg_imexp/imp_share.hxx
index 977625bebae0..6d8e9128a336 100644
--- a/xmlscript/source/xmldlg_imexp/imp_share.hxx
+++ b/xmlscript/source/xmldlg_imexp/imp_share.hxx
@@ -311,6 +311,7 @@ class MenuPopupElement
 {
 std::vector< OUString > _itemValues;
 std::vector< sal_Int16 > _itemSelected;
+bool _allowEmptyItems;
 public:
 css::uno::Sequence< OUString > getItemValues();
 css::uno::Sequence< sal_Int16 > getSelectedItems();
@@ -323,9 +324,11 @@ public:
 MenuPopupElement(
 OUString const & rLocalName,
 css::uno::Reference< css::xml::input::XAttributes > const & 
xAttributes,
-ElementBase * pParent, DialogImport * pImport )
+ElementBase * pParent, DialogImport * pImport,
+bool aAllowEmptyItems)
 : ElementBase( pImport->XMLNS_DIALOGS_UID,
rLocalName, xAttributes, pParent, pImport )
+, _allowEmptyItems(aAllowEmptyItems)
 {}
 };
 
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
index 96177d502165..9f324465cf48 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
@@ -1275,8 +1275,8 @@ Reference< xml::input::XElement > 
MenuPopupElement::startChildElement(
 else if ( rLocalName == "menuitem" )
 {
 OUString aValue( xAttributes->getValueByUidName( 
m_xImport->XMLNS_DIALOGS_UID,"value" ) );
-SAL_WARN_IF( aValue.isEmpty(), "xmlscript.xmldlg", "### menuitem has 
no value?" );
-if (!aValue.isEmpty())
+SAL_WARN_IF( aValue.isEmpty() && !_allowEmptyItems, 
"xmlscript.xmldlg", "### menuitem has no value?" );
+if ((!aValue.isEmpty()) || _allowEmptyItems)
 {
 _itemValues.push_back( aValue );
 
@@ -1331,7 +1331,7 @@ Reference< xml::input::XElement > 
MenuListElement::startChildElement(
 // menupopup
 else if ( rLocalName == "menupopup" )
 {
-_popup = new MenuPopupElement( rLocalName, xAttributes, this, 
m_xImport.get() );
+_popup = new MenuPopupElement( rLocalName, xAttributes, this, 
m_xImport.get(), false );
 return _popup;
 }
 else
@@ -1399,7 +1399,7 @@ Reference< xml::input::XElement > 
ComboBoxElement::startChildElement(
 // menupopup
 else if ( rLocalName == "menupopup" )
 {
-_popup = new MenuPopupElement( rLocalName, xAttributes, this, 
m_xImport.get() );
+_popup = new MenuPopupElement( rLocalName, xAttributes, this, 
m_xImport.get(), true );
 return _popup;
 }
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: xmlscript/source

2020-08-02 Thread Noel Grandin (via logerrit)
 xmlscript/source/xmldlg_imexp/xmldlg_export.cxx|  860 ++---
 xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx |9 
 xmlscript/source/xmldlg_imexp/xmldlg_import.cxx|  244 ++---
 3 files changed, 558 insertions(+), 555 deletions(-)

New commits:
commit 5ef5c1b294063d1d2d6554d5fcf1d4cfb4d3f06d
Author: Noel Grandin 
AuthorDate: Sun Aug 2 20:07:28 2020 +0200
Commit: Noel Grandin 
CommitDate: Sun Aug 2 22:44:21 2020 +0200

loplugin:flatten in xmlscript

Change-Id: I326aa7ebea7925f580fd12c6c58f62e4add20d84
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99965
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
index 392793ce4d67..32c61ad72497 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
@@ -527,194 +527,194 @@ void ElementDescriptor::readHexLongAttr( OUString const 
& rPropName, OUString co
 
 void ElementDescriptor::readDateFormatAttr( OUString const & rPropName, 
OUString const & rAttrName )
 {
-if (beans::PropertyState_DEFAULT_VALUE != _xPropState->getPropertyState( 
rPropName ))
+if (beans::PropertyState_DEFAULT_VALUE == _xPropState->getPropertyState( 
rPropName ))
+return;
+
+Any a( _xProps->getPropertyValue( rPropName ) );
+if (auto n = o3tl::tryAccess(a))
 {
-Any a( _xProps->getPropertyValue( rPropName ) );
-if (auto n = o3tl::tryAccess(a))
+switch (*n)
 {
-switch (*n)
-{
-case 0:
-addAttribute( rAttrName, "system_short" );
-break;
-case 1:
-addAttribute( rAttrName, "system_short_YY" );
-break;
-case 2:
-addAttribute( rAttrName, "system_short_" );
-break;
-case 3:
-addAttribute( rAttrName, "system_long" );
-break;
-case 4:
-addAttribute( rAttrName, "short_DDMMYY" );
-break;
-case 5:
-addAttribute( rAttrName, "short_MMDDYY" );
-break;
-case 6:
-addAttribute( rAttrName, "short_YYMMDD" );
-break;
-case 7:
-addAttribute( rAttrName, "short_DDMM" );
-break;
-case 8:
-addAttribute( rAttrName, "short_MMDD" );
-break;
-case 9:
-addAttribute( rAttrName, "short_MMDD" );
-break;
-case 10:
-addAttribute( rAttrName, "short_YYMMDD_DIN5008" );
-break;
-case 11:
-addAttribute( rAttrName, "short_MMDD_DIN5008" );
-break;
-default:
-SAL_WARN( "xmlscript.xmldlg", "### unexpected date format!" );
-break;
-}
+case 0:
+addAttribute( rAttrName, "system_short" );
+break;
+case 1:
+addAttribute( rAttrName, "system_short_YY" );
+break;
+case 2:
+addAttribute( rAttrName, "system_short_" );
+break;
+case 3:
+addAttribute( rAttrName, "system_long" );
+break;
+case 4:
+addAttribute( rAttrName, "short_DDMMYY" );
+break;
+case 5:
+addAttribute( rAttrName, "short_MMDDYY" );
+break;
+case 6:
+addAttribute( rAttrName, "short_YYMMDD" );
+break;
+case 7:
+addAttribute( rAttrName, "short_DDMM" );
+break;
+case 8:
+addAttribute( rAttrName, "short_MMDD" );
+break;
+case 9:
+addAttribute( rAttrName, "short_MMDD" );
+break;
+case 10:
+addAttribute( rAttrName, "short_YYMMDD_DIN5008" );
+break;
+case 11:
+addAttribute( rAttrName, "short_MMDD_DIN5008" );
+break;
+default:
+SAL_WARN( "xmlscript.xmldlg", "### unexpected date format!" );
+break;
 }
-else
-OSL_FAIL( "### unexpected property type!" );
 }
+else
+OSL_FAIL( "### unexpected property type!" );
 }
 
 void ElementDescriptor::readDateAttr( OUString const & rPropName, OUString 
const & rAttrName )
 {
-if (beans::PropertyState_DEFAULT_VALUE != _xPropState->getPropertyState( 
rPropName ))
+if (beans::PropertyState_DEFAULT_VALUE == _xPropState->getPropertyState( 
rPropName ))
+return;
+
+Any a( _xProps->getPropertyValue( rPropName ) );
+if (a.getValueTypeClass() == TypeClass_STRUCT && a.getValueType() == 
cppu::UnoType::get())
 {
-Any a( _xProps->getPropertyValue( rPropName ) );
-  

[Libreoffice-commits] core.git: xmlscript/source

2020-07-02 Thread Stephan Bergmann (via logerrit)
 xmlscript/source/misc/unoservices.cxx   |2 +-
 xmlscript/source/xml_helper/xml_impctx.cxx  |4 ++--
 xmlscript/source/xmldlg_imexp/xmldlg_import.cxx |2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 54c866828a9b85c23830e4a8be2c27b59ffd3cd5
Author: Stephan Bergmann 
AuthorDate: Thu Jul 2 16:33:16 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Jul 2 19:42:13 2020 +0200

Upcoming improved loplugin:staticanonymous -> redundantstatic: xmlscript

Change-Id: I59dc2d6949eb51394874403e62079ad75063882d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97773
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/xmlscript/source/misc/unoservices.cxx 
b/xmlscript/source/misc/unoservices.cxx
index 4c5ff6e24381..31c5e7593a26 100644
--- a/xmlscript/source/misc/unoservices.cxx
+++ b/xmlscript/source/misc/unoservices.cxx
@@ -25,7 +25,7 @@ using namespace ::com::sun::star::uno;
 
 namespace xmlscript
 {
-static const struct ::cppu::ImplementationEntry s_entries [] =
+const struct ::cppu::ImplementationEntry s_entries [] =
 {
 {
 create_DocumentHandlerImpl, 
getImplementationName_DocumentHandlerImpl,
diff --git a/xmlscript/source/xml_helper/xml_impctx.cxx 
b/xmlscript/source/xml_helper/xml_impctx.cxx
index b696577b90da..5bb2f59f50d6 100644
--- a/xmlscript/source/xml_helper/xml_impctx.cxx
+++ b/xmlscript/source/xml_helper/xml_impctx.cxx
@@ -171,8 +171,8 @@ public:
 
 }
 
-static OUString const g_sXMLNS_PREFIX_UNKNOWN( "<<< unknown prefix >>>" );
-static OUString const g_sXMLNS( "xmlns" );
+OUString const g_sXMLNS_PREFIX_UNKNOWN( "<<< unknown prefix >>>" );
+OUString const g_sXMLNS( "xmlns" );
 
 
 DocumentHandlerImpl::DocumentHandlerImpl(
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
index cb3550a3abff..4a355b72852a 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
@@ -1388,7 +1388,7 @@ bool ImportContext::importImageScaleModeProperty(
 return false;
 }
 
-static StringTriple const s_aEventTranslations[] =
+StringTriple const s_aEventTranslations[] =
 {
 // from xmloff/source/forms/formevents.cxx
 // 28.09.2001 tbe added on-adjustmentvaluechange
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: xmlscript/source

2020-02-25 Thread Samuel Mehrbrodt (via logerrit)
 xmlscript/source/xmldlg_imexp/xmldlg_export.cxx |4 +++-
 xmlscript/source/xmldlg_imexp/xmldlg_import.cxx |   11 +++
 2 files changed, 14 insertions(+), 1 deletion(-)

New commits:
commit 6d9cf22b2239611a6612a7855f8a701ed723cbd4
Author: Samuel Mehrbrodt 
AuthorDate: Mon Feb 24 23:38:40 2020 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Wed Feb 26 06:40:23 2020 +0100

tdf#130793 Fix import/export of image URLs

Change-Id: I329af3b0d5a81d9f31def9c2ad861d0e83e3714c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89388
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
index 1e192e3c387d..413facd87652 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
@@ -738,7 +738,9 @@ void ElementDescriptor::readImageOrGraphicAttr(OUString 
const & rAttrName)
 }
 }
 }
-else if (beans::PropertyState_DEFAULT_VALUE != 
_xPropState->getPropertyState("ImageURL"))
+// tdf#130793 Above fails if the dialog is not part of a document. Export 
the ImageURL then.
+if (sURL.isEmpty()
+&& beans::PropertyState_DEFAULT_VALUE != 
_xPropState->getPropertyState("ImageURL"))
 {
 _xProps->getPropertyValue("ImageURL") >>= sURL;
 }
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
index 791976b55c5e..5aa953cd6562 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
@@ -880,6 +880,17 @@ bool ImportContext::importGraphicOrImageProperty(
 return true;
 }
 }
+else if (!sURL.isEmpty())
+{
+// tdf#130793 Above fails if the dialog is not part of a document.
+// In this case we need to set the ImageURL.
+Reference xProps = getControlModel();
+if (xProps.is())
+{
+xProps->setPropertyValue("ImageURL", makeAny(sURL));
+return true;
+}
+}
 }
 return false;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: xmlscript/source

2020-02-16 Thread Andrea Gelmini (via logerrit)
 xmlscript/source/xmllib_imexp/xmllib_import.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 4c0c886f2b646c99deb7c503948308fd8698
Author: Andrea Gelmini 
AuthorDate: Thu Jan 9 21:25:29 2020 +0100
Commit: Olivier Hallot 
CommitDate: Sun Feb 16 10:23:08 2020 +0100

Fix typo

Thanks to Valter:
https://listarchives.libreoffice.org/global/l10n/msg12412.html

Change-Id: I2b79bc19de31b014cbf2519ae01e5214252f24a5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86505
Tested-by: Jenkins
Reviewed-by: Olivier Hallot 

diff --git a/xmlscript/source/xmllib_imexp/xmllib_import.cxx 
b/xmlscript/source/xmllib_imexp/xmllib_import.cxx
index c5fbb84bf599..5e063430e3bb 100644
--- a/xmlscript/source/xmllib_imexp/xmllib_import.cxx
+++ b/xmlscript/source/xmllib_imexp/xmllib_import.cxx
@@ -212,7 +212,7 @@ Reference< xml::input::XElement > 
LibraryElement::startChildElement(
 }
 else
 {
-throw xml::sax::SAXException( "expected styles ot bulletinboard 
element!", Reference< XInterface >(), Any() );
+throw xml::sax::SAXException( "expected styles or bulletinboard 
element!", Reference< XInterface >(), Any() );
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: xmlscript/source

2019-12-28 Thread Andrea Gelmini (via logerrit)
 xmlscript/source/inc/misc.hxx|4 +---
 xmlscript/source/inc/unoservices.hxx |4 +---
 xmlscript/source/inc/xml_import.hxx  |4 +---
 xmlscript/source/xmldlg_imexp/common.hxx |4 +---
 xmlscript/source/xmldlg_imexp/exp_share.hxx  |4 +---
 xmlscript/source/xmldlg_imexp/imp_share.hxx  |4 +---
 xmlscript/source/xmlflat_imexp/xmlbas_export.hxx |4 +---
 xmlscript/source/xmlflat_imexp/xmlbas_import.hxx |4 +---
 xmlscript/source/xmllib_imexp/imp_share.hxx  |4 +---
 xmlscript/source/xmlmod_imexp/imp_share.hxx  |4 +---
 10 files changed, 10 insertions(+), 30 deletions(-)

New commits:
commit 77f4eb0bfefff6cb972abd8e1cc2b9d2c6df368d
Author: Andrea Gelmini 
AuthorDate: Sat Dec 28 00:06:54 2019 +0100
Commit: Julien Nabet 
CommitDate: Sat Dec 28 12:04:11 2019 +0100

tdf#124176: Use "pragma once" on xmlscript/*

It passed "make check" on Linux

Change-Id: Id8727da150ad1b5252fbc997ff5df28b23303fb6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85882
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/xmlscript/source/inc/misc.hxx b/xmlscript/source/inc/misc.hxx
index 7671deacf989..d70f6b0639a2 100644
--- a/xmlscript/source/inc/misc.hxx
+++ b/xmlscript/source/inc/misc.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_XMLSCRIPT_SOURCE_INC_MISC_HXX
-#define INCLUDED_XMLSCRIPT_SOURCE_INC_MISC_HXX
+#pragma once
 
 #include 
 
@@ -47,6 +46,5 @@ inline T extract_throw( css::uno::Any const & a )
 
 }
 
-#endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlscript/source/inc/unoservices.hxx 
b/xmlscript/source/inc/unoservices.hxx
index 03079c009c60..4ad18b40ee23 100644
--- a/xmlscript/source/inc/unoservices.hxx
+++ b/xmlscript/source/inc/unoservices.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_XMLSCRIPT_SOURCE_INC_UNOSERVICES_HXX
-#define INCLUDED_XMLSCRIPT_SOURCE_INC_UNOSERVICES_HXX
+#pragma once
 
 #include 
 
@@ -42,6 +41,5 @@ css::uno::Reference 
create_DocumentHandlerImpl(
 
 }
 
-#endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlscript/source/inc/xml_import.hxx 
b/xmlscript/source/inc/xml_import.hxx
index 8548ae3b5b95..d4a2a4839890 100644
--- a/xmlscript/source/inc/xml_import.hxx
+++ b/xmlscript/source/inc/xml_import.hxx
@@ -16,8 +16,7 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-#ifndef INCLUDED_XMLSCRIPT_SOURCE_INC_XML_IMPORT_HXX
-#define INCLUDED_XMLSCRIPT_SOURCE_INC_XML_IMPORT_HXX
+#pragma once
 
 #include 
 #include 
@@ -47,6 +46,5 @@ createDocumentHandler(
 
 }
 
-#endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlscript/source/xmldlg_imexp/common.hxx 
b/xmlscript/source/xmldlg_imexp/common.hxx
index 1737c3cf1330..ef2358f3c402 100644
--- a/xmlscript/source/xmldlg_imexp/common.hxx
+++ b/xmlscript/source/xmldlg_imexp/common.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_XMLSCRIPT_SOURCE_XMLDLG_IMEXP_COMMON_HXX
-#define INCLUDED_XMLSCRIPT_SOURCE_XMLDLG_IMEXP_COMMON_HXX
+#pragma once
 
 #include 
 
@@ -40,6 +39,5 @@ extern StringTriple const * const g_pEventTranslations;
 
 }
 
-#endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlscript/source/xmldlg_imexp/exp_share.hxx 
b/xmlscript/source/xmldlg_imexp/exp_share.hxx
index 5b7c8aeb663c..dc7da2477194 100644
--- a/xmlscript/source/xmldlg_imexp/exp_share.hxx
+++ b/xmlscript/source/xmldlg_imexp/exp_share.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_XMLSCRIPT_SOURCE_XMLDLG_IMEXP_EXP_SHARE_HXX
-#define INCLUDED_XMLSCRIPT_SOURCE_XMLDLG_IMEXP_EXP_SHARE_HXX
+#pragma once
 
 #include 
 #include 
@@ -255,6 +254,5 @@ inline bool ElementDescriptor::readProp(
 
 }
 
-#endif // INCLUDED_XMLSCRIPT_SOURCE_XMLDLG_IMEXP_EXP_SHARE_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx 
b/xmlscript/source/xmldlg_imexp/imp_share.hxx
index 709bdf88c8ee..977625bebae0 100644
--- a/xmlscript/source/xmldlg_imexp/imp_share.hxx
+++ b/xmlscript/source/xmldlg_imexp/imp_share.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_XMLSCRIPT_SOURCE_XMLDLG_IMEXP_IMP_SHARE_HXX
-#define INCLUDED_XMLSCRIPT_SOURCE_XMLDLG_IMEXP_IMP_SHARE_HXX
+#pragma once
 
 #include 
 #include 
@@ -1042,6 +1041,5 @@ public:
 
 }
 
-#endif // INCLUDED_XMLSCRIPT_SOURCE_XMLDLG_IMEXP_IMP_SHARE_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_export.hxx 
b/xmlscript/source/xmlflat_imexp/xmlbas_export.hxx
index 

[Libreoffice-commits] core.git: xmlscript/source

2019-08-23 Thread Stephan Bergmann (via logerrit)
 xmlscript/source/xml_helper/xml_byteseq.cxx |8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 7b4b70afba2d6bde66dd59da5950d45efb4a645b
Author: Stephan Bergmann 
AuthorDate: Fri Aug 23 21:15:01 2019 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Aug 23 23:33:18 2019 +0200

Avoid -fsanitizeinvalid-null-argument

...as witnessed once with some `instdir/program/unopkg remove 
ooo2gd_3.0.0.oxt`:

> xmlscript/source/xml_helper/xml_byteseq.cxx:116:13: runtime error: null 
pointer passed as argument 1, which is declared to never be null
> /usr/include/string.h:43:28: note: nonnull attribute specified here
>  #0 in 
xmlscript::BSeqOutputStream::writeBytes(com::sun::star::uno::Sequence const&) at xmlscript/source/xml_helper/xml_byteseq.cxx:116:5
>  #1 in fileaccess::TaskManager::page(int, rtl::OUString const&, 
com::sun::star::uno::Reference const&) at 
ucb/source/ucp/file/filtask.cxx:655:32
>  #2 in fileaccess::BaseContent::open(int, 
com::sun::star::ucb::OpenCommandArgument2 const&) at 
ucb/source/ucp/file/bc.cxx:911:29
>  #3 in fileaccess::BaseContent::execute(com::sun::star::ucb::Command 
const&, int, 
com::sun::star::uno::Reference 
const&) at ucb/source/ucp/file/bc.cxx:323:53
>  #4 in non-virtual thunk to 
fileaccess::BaseContent::execute(com::sun::star::ucb::Command const&, int, 
com::sun::star::uno::Reference 
const&) at ucb/source/ucp/file/bc.cxx
>  #5 in 
ucbhelper::Content_Impl::executeCommand(com::sun::star::ucb::Command const&) at 
ucbhelper/source/client/content.cxx:1254:19
>  #6 in 
ucbhelper::Content::openStream(com::sun::star::uno::Reference
 const&) at ucbhelper/source/client/content.cxx:816:14
>  #7 in dp_misc::readFile(ucbhelper::Content&) at 
desktop/source/deployment/misc/dp_ucb.cxx:195:23
>  #8 in dp_misc::readLine(rtl::OUString*, rtl::OUString const&, 
ucbhelper::Content&, unsigned short) at 
desktop/source/deployment/misc/dp_ucb.cxx:207:34
>  #9 in dp_registry::backend::configuration::(anonymous 
namespace)::BackendImpl::configmgrini_verify_init(com::sun::star::uno::Reference
 const&) at 
desktop/source/deployment/registry/configuration/dp_configuration.cxx:371:17
[...]

Change-Id: I66bef2d1bc037efa893f3ae3ad8058aa16f7cc5b
Reviewed-on: https://gerrit.libreoffice.org/78042
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/xmlscript/source/xml_helper/xml_byteseq.cxx 
b/xmlscript/source/xml_helper/xml_byteseq.cxx
index 24b7e2b6ee47..dc443a968e2d 100644
--- a/xmlscript/source/xml_helper/xml_byteseq.cxx
+++ b/xmlscript/source/xml_helper/xml_byteseq.cxx
@@ -113,9 +113,11 @@ void BSeqOutputStream::writeBytes( Sequence< sal_Int8 > 
const & rData )
 {
 sal_Int32 nPos = _seq->size();
 _seq->resize( nPos + rData.getLength() );
-memcpy( _seq->data() + nPos,
-  rData.getConstArray(),
-  rData.getLength() );
+if (rData.getLength() != 0) {
+memcpy( _seq->data() + nPos,
+rData.getConstArray(),
+rData.getLength() );
+}
 }
 void BSeqOutputStream::flush()
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: xmlscript/source xmlsecurity/source

2019-05-09 Thread Arkadiy Illarionov (via logerrit)
 xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx|   19 +---
 xmlscript/source/xmldlg_imexp/xmldlg_export.cxx   |5 -
 xmlscript/source/xmlflat_imexp/xmlbas_export.cxx  |   39 --
 xmlscript/source/xmllib_imexp/xmllib_export.cxx   |   19 +---
 xmlsecurity/source/component/documentdigitalsignatures.cxx|   19 +---
 xmlsecurity/source/dialogs/certificatechooser.cxx |   16 ++--
 xmlsecurity/source/dialogs/macrosecurity.cxx  |5 -
 xmlsecurity/source/framework/xmlsignaturetemplateimpl.cxx |8 --
 xmlsecurity/source/helper/documentsignaturehelper.cxx |   30 +++
 xmlsecurity/source/helper/documentsignaturemanager.cxx|7 -
 xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx |   13 +--
 xmlsecurity/source/xmlsec/saxhelper.cxx   |7 +
 12 files changed, 72 insertions(+), 115 deletions(-)

New commits:
commit fac093e5e63bd53bae3de552fedba927bd5c4561
Author: Arkadiy Illarionov 
AuthorDate: Thu May 9 15:17:26 2019 +0300
Commit: Noel Grandin 
CommitDate: Thu May 9 18:21:59 2019 +0200

Simplify Sequence iterations in xmlscript, xmlsecurity

Use range-based loops or replace with comphelper or STL functions

Change-Id: I3d63811caf80c87a9d560087e1f0d933ebcc0d55
Reviewed-on: https://gerrit.libreoffice.org/72040
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
index 186dc6923f61..cf0a13e39235 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
@@ -318,11 +318,10 @@ void ElementDescriptor::readComboBoxModel( StyleBag * 
all_styles )
 {
 ElementDescriptor * popup = new ElementDescriptor( _xProps, 
_xPropState, XMLNS_DIALOGS_PREFIX ":menupopup", _xDocument );
 
-OUString const * pItemValues = itemValues.getConstArray();
-for ( sal_Int32 nPos = 0; nPos < itemValues.getLength(); ++nPos )
+for ( const auto& rItemValue : itemValues )
 {
 ElementDescriptor * item = new ElementDescriptor( _xProps, 
_xPropState, XMLNS_DIALOGS_PREFIX ":menuitem", _xDocument );
-item->addAttribute( XMLNS_DIALOGS_PREFIX ":value", pItemValues[ 
nPos ] );
+item->addAttribute( XMLNS_DIALOGS_PREFIX ":value", rItemValue );
 popup->addSubElement( item );
 }
 
@@ -366,12 +365,10 @@ void ElementDescriptor::readListBoxModel( StyleBag * 
all_styles )
 {
 ElementDescriptor * popup = new ElementDescriptor( _xProps, 
_xPropState, XMLNS_DIALOGS_PREFIX ":menupopup", _xDocument );
 
-OUString const * pItemValues = itemValues.getConstArray();
-sal_Int32 nPos;
-for ( nPos = 0; nPos < itemValues.getLength(); ++nPos )
+for ( const auto& rItemValue : itemValues )
 {
 ElementDescriptor * item = new ElementDescriptor(_xProps, 
_xPropState, XMLNS_DIALOGS_PREFIX ":menuitem", _xDocument );
-item->addAttribute( XMLNS_DIALOGS_PREFIX ":value", pItemValues[ 
nPos ] );
+item->addAttribute( XMLNS_DIALOGS_PREFIX ":value", rItemValue );
 popup->addSubElement( item );
 }
 
@@ -379,7 +376,7 @@ void ElementDescriptor::readListBoxModel( StyleBag * 
all_styles )
 if (readProp( "SelectedItems" ) >>= selected)
 {
 sal_Int16 const * pSelected = selected.getConstArray();
-for ( nPos = selected.getLength(); nPos--; )
+for ( sal_Int32 nPos = selected.getLength(); nPos--; )
 {
 ElementDescriptor * item = static_cast< ElementDescriptor * >(
 popup->getSubElement( pSelected[ nPos ] ).get() );
@@ -1090,14 +1087,12 @@ void ElementDescriptor::readBullitinBoard( StyleBag * 
all_styles )
 if ( !xDialogModel.is() )
 return; // #TODO throw???
 Sequence< OUString > aElements( xDialogModel->getElementNames() );
-OUString const * pElements = aElements.getConstArray();
 
 ElementDescriptor * pRadioGroup = nullptr;
 
-sal_Int32 nPos;
-for ( nPos = 0; nPos < aElements.getLength(); ++nPos )
+for ( const auto& rElement : aElements )
 {
-Any aControlModel( xDialogModel->getByName( pElements[ nPos ] ) );
+Any aControlModel( xDialogModel->getByName( rElement ) );
 Reference< beans::XPropertySet > xProps;
 OSL_VERIFY( aControlModel >>= xProps );
 if (! xProps.is())
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
index 9341952eef35..eca2feb26fa0 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
@@ -1152,11 +1152,10 @@ void ElementDescriptor::readEvents()
 if (xEvents.is())
 {
 Sequence< OUString > aNames( 

[Libreoffice-commits] core.git: xmlscript/source

2018-10-25 Thread Libreoffice Gerrit user
 xmlscript/source/xmllib_imexp/xmllib_import.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 655e3bd9a880a8bf3a1f9d3514e64d0da3d36b8a
Author: Andrea Gelmini 
AuthorDate: Thu Oct 25 10:11:54 2018 +0200
Commit: Julien Nabet 
CommitDate: Thu Oct 25 13:51:38 2018 +0200

Fix typo

Change-Id: I7c5603468f5ee7f7e33940d7b3787318c307acfa
Reviewed-on: https://gerrit.libreoffice.org/62343
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/xmlscript/source/xmllib_imexp/xmllib_import.cxx 
b/xmlscript/source/xmllib_imexp/xmllib_import.cxx
index 2adea0c01cea..59bc6ad64d0c 100644
--- a/xmlscript/source/xmllib_imexp/xmllib_import.cxx
+++ b/xmlscript/source/xmllib_imexp/xmllib_import.cxx
@@ -176,7 +176,7 @@ Reference< xml::input::XElement > 
LibrariesElement::startChildElement(
 }
 else
 {
-throw xml::sax::SAXException( "expected styles ot bulletinboard 
element!", Reference< XInterface >(), Any() );
+throw xml::sax::SAXException( "expected styles of bulletinboard 
element!", Reference< XInterface >(), Any() );
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: xmlscript/source

2018-10-19 Thread Libreoffice Gerrit user
 xmlscript/source/xmldlg_imexp/xmldlg_export.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 45e208f4621fba7525c3f1e44b6529b70d771ed4
Author: Caolán McNamara 
AuthorDate: Fri Oct 19 10:21:30 2018 +0100
Commit: Caolán McNamara 
CommitDate: Fri Oct 19 16:36:33 2018 +0200

copy and paste error

Change-Id: I73a617137bf0b3b567181ff817069944076eab0e
Reviewed-on: https://gerrit.libreoffice.org/61980
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
index 32ca0eb15ce0..60343d87c507 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
@@ -1248,7 +1248,7 @@ static bool equalFont( Style const & style1, Style const 
& style2 )
 f1.StyleName == f2.StyleName &&
 f1.Family == f2.Family &&
 f1.CharSet == f2.CharSet &&
-f1.Pitch == f2.CharSet &&
+f1.Pitch == f2.Pitch &&
 f1.CharacterWidth == f2.CharacterWidth &&
 f1.Weight == f2.Weight &&
 f1.Slant == f2.Slant &&
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: xmlscript/source

2018-03-14 Thread Tomaž Vajngerl
 xmlscript/source/xmldlg_imexp/common.hxx   |1 
 xmlscript/source/xmldlg_imexp/exp_share.hxx|8 ++---
 xmlscript/source/xmldlg_imexp/imp_share.hxx|2 -
 xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx |   11 +++
 xmlscript/source/xmldlg_imexp/xmldlg_export.cxx|   33 ++---
 xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx |   12 +++
 xmlscript/source/xmldlg_imexp/xmldlg_import.cxx|   25 ---
 7 files changed, 52 insertions(+), 40 deletions(-)

New commits:
commit 043273e721ade64e4fb42f969cf22b4202c6b80d
Author: Tomaž Vajngerl 
Date:   Thu Mar 15 09:49:02 2018 +0900

xmlscript: change import/export to not use GraphicObject URL

Change-Id: Ic81bf1a5ce45394e098366d0f4af53845ba0da87
Reviewed-on: https://gerrit.libreoffice.org/51307
Tested-by: Jenkins 
Reviewed-by: Tomaž Vajngerl 

diff --git a/xmlscript/source/xmldlg_imexp/common.hxx 
b/xmlscript/source/xmldlg_imexp/common.hxx
index ecfa439d4c00..1737c3cf1330 100644
--- a/xmlscript/source/xmldlg_imexp/common.hxx
+++ b/xmlscript/source/xmldlg_imexp/common.hxx
@@ -40,7 +40,6 @@ extern StringTriple const * const g_pEventTranslations;
 
 }
 
-#define XMLSCRIPT_GRAPHOBJ_URLPREFIX "vnd.sun.star.GraphicObject:"
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlscript/source/xmldlg_imexp/exp_share.hxx 
b/xmlscript/source/xmldlg_imexp/exp_share.hxx
index e58a2c215640..39dc1fc3b9ef 100644
--- a/xmlscript/source/xmldlg_imexp/exp_share.hxx
+++ b/xmlscript/source/xmldlg_imexp/exp_share.hxx
@@ -140,8 +140,6 @@ public:
 OUString const & rPropName, OUString const & rAttrName );
 void readVerticalAlignAttr(
 OUString const & rPropName, OUString const & rAttrName );
-void readImageURLAttr(
-OUString const & rPropName, OUString const & rAttrName );
 void readImageAlignAttr(
 OUString const & rPropName, OUString const & rAttrName );
 void readImagePositionAttr(
@@ -164,8 +162,10 @@ public:
 OUString const & rPropName, OUString const & rAttrName );
 void readImageScaleModeAttr(
 OUString const & rPropName, OUString const & rAttrName );
-void readDataAwareAttr(
-OUString const & rAttrName );
+
+void readDataAwareAttr(OUString const & rAttrName );
+void readImageOrGraphicAttr(OUString const & rAttrName );
+
 void addBoolAttr(
 OUString const & rAttrName, bool bValue )
 { addAttribute( rAttrName, OUString::boolean(bValue) ); }
diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx 
b/xmlscript/source/xmldlg_imexp/imp_share.hxx
index 8f41b29172c9..c93bd905d363 100644
--- a/xmlscript/source/xmldlg_imexp/imp_share.hxx
+++ b/xmlscript/source/xmldlg_imexp/imp_share.hxx
@@ -421,7 +421,7 @@ public:
 bool importVerticalAlignProperty(
 OUString const & rPropName, OUString const & rAttrName,
 css::uno::Reference const & xAttributes 
);
-bool importImageURLProperty( OUString const & rPropName, OUString const & 
rAttrName,
+bool importGraphicOrImageProperty(OUString const & rAttrName,
 css::uno::Reference< css::xml::input::XAttributes > const & 
xAttributes );
 bool importImageAlignProperty(
 OUString const & rPropName, OUString const & rAttrName,
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
index 764cdb892d77..9c0e71610112 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
@@ -187,8 +187,7 @@ void ElementDescriptor::readButtonModel( StyleBag * 
all_styles )
 readAlignAttr( "Align", XMLNS_DIALOGS_PREFIX ":align" );
 readVerticalAlignAttr( "VerticalAlign", XMLNS_DIALOGS_PREFIX ":valign" );
 readButtonTypeAttr( "PushButtonType", XMLNS_DIALOGS_PREFIX ":button-type" 
);
-readImageURLAttr( "ImageURL", XMLNS_DIALOGS_PREFIX ":image-src" );
-
+readImageOrGraphicAttr(XMLNS_DIALOGS_PREFIX ":image-src");
 readImagePositionAttr( "ImagePosition", XMLNS_DIALOGS_PREFIX 
":image-position" );
 readImageAlignAttr( "ImageAlign", XMLNS_DIALOGS_PREFIX ":image-align" );
 
@@ -247,7 +246,7 @@ void ElementDescriptor::readCheckBoxModel( StyleBag * 
all_styles )
 readStringAttr( "Label", XMLNS_DIALOGS_PREFIX ":value" );
 readAlignAttr( "Align",  XMLNS_DIALOGS_PREFIX ":align" );
 readVerticalAlignAttr( "VerticalAlign", XMLNS_DIALOGS_PREFIX ":valign" );
-readImageURLAttr( "ImageURL", XMLNS_DIALOGS_PREFIX ":image-src" );
+readImageOrGraphicAttr(XMLNS_DIALOGS_PREFIX ":image-src");
 readImagePositionAttr( "ImagePosition", XMLNS_DIALOGS_PREFIX 
":image-position" );
 readBoolAttr( "MultiLine", XMLNS_DIALOGS_PREFIX ":multiline" );
 
@@ -417,7 +416,7 @@ void ElementDescriptor::readRadioButtonModel( StyleBag * 
all_styles  )
 readStringAttr( "Label", XMLNS_DIALOGS_PREFIX 

[Libreoffice-commits] core.git: xmlscript/source

2017-10-17 Thread Noel Grandin
 xmlscript/source/xmldlg_imexp/exp_share.hxx |3 ++-
 xmlscript/source/xmldlg_imexp/xmldlg_export.cxx |   14 +-
 2 files changed, 7 insertions(+), 10 deletions(-)

New commits:
commit d6831a8a34257789a920491747e12ebe62f927fe
Author: Noel Grandin 
Date:   Tue Oct 17 12:39:08 2017 +0200

loplugin:useuniqueptr in StyleBag

Change-Id: I965b086338935aa91691b96a63c9bc95f8b7f7ca
Reviewed-on: https://gerrit.libreoffice.org/43452
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/xmlscript/source/xmldlg_imexp/exp_share.hxx 
b/xmlscript/source/xmldlg_imexp/exp_share.hxx
index 661f356c5869..825db80f598c 100644
--- a/xmlscript/source/xmldlg_imexp/exp_share.hxx
+++ b/xmlscript/source/xmldlg_imexp/exp_share.hxx
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 
@@ -75,7 +76,7 @@ struct Style
 };
 class StyleBag
 {
-::std::vector< Style * > _styles;
+::std::vector< 

[Libreoffice-commits] core.git: xmlscript/source

2017-09-17 Thread Caolán McNamara
 xmlscript/source/xml_helper/xml_impctx.cxx |   19 +--
 1 file changed, 9 insertions(+), 10 deletions(-)

New commits:
commit 1b3fc6e2b8f3f36868657d623de21ce3e249efa0
Author: Caolán McNamara 
Date:   Sun Sep 17 12:31:08 2017 +0100

ofz: fix leak on exception

 #0 0x600ca0 in operator new(unsigned long) 
/src/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:82
 #1 0x4802b4b in xmlscript::DocumentHandlerImpl::pushPrefix(rtl::OUString 
const&, rtl::OUString const&) 
/src/libreoffice/xmlscript/source/xml_helper/xml_impctx.cxx:259:32
 #2 0x47ff026 in xmlscript::DocumentHandlerImpl::startElement(rtl::OUString 
const&, 
com::sun::star::uno::Reference 
const&) /src/libreoffice/xmlscript/source/xml_helper/xml_impctx.cxx:480:17
 #3 0x7665a34 in 
xmlscript::XMLBasicImporterBase::startElement(rtl::OUString const&, 
com::sun::star::uno::Reference 
const&) /src/libreoffice/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx:537:25
 #4 0x4c2831f in 
XMLBasicImportContext::StartElement(com::sun::star::uno::Reference
 const&) /src/libreoffice/xmloff/source/script/xmlbasici.cxx:84:21
 #5 0x489c29b in SvXMLImport::startElement(rtl::OUString const&, 
com::sun::star::uno::Reference 
const&) /src/libreoffice/xmloff/source/core/xmlimp.cxx:728:15
 #6 0x4892ab7 in SvXMLImportContext::startUnknownElement(rtl::OUString 
const&, rtl::OUString const&, 
com::sun::star::uno::Reference 
const&) /src/libreoffice/xmloff/source/core/xmlictxt.cxx:124:14
 #7 0x489ec2d in SvXMLImport::startUnknownElement(rtl::OUString const&, 
rtl::OUString const&, 
com::sun::star::uno::Reference 
const&) /src/libreoffice/xmloff/source/core/xmlimp.cxx:889:15
 #8 0x86871f3 in (anonymous namespace)::Entity::startElement((anonymous 
namespace)::Event*) /src/libreoffice/sax/source/fastparser/fastparser.cxx:445:27
 #9 0x86823f1 in sax_fastparser::FastSaxParserImpl::consume((anonymous 
namespace)::EventList&) 
/src/libreoffice/sax/source/fastparser/fastparser.cxx:960:25
 #10 0x86812f8 in 
sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource
 const&) /src/libreoffice/sax/source/fastparser/fastparser.cxx:784:26
 #11 0x489842e in 
SvXMLImport::parseStream(com::sun::star::xml::sax::InputSource const&) 
/src/libreoffice/xmloff/source/core/xmlimp.cxx:464:15
 #12 0x837fb5d in 
filter::odfflatxml::OdfFlatXml::importer(com::sun::star::uno::Sequence
 const&, 
com::sun::star::uno::Reference 
const&, com::sun::star::uno::Sequence const&) 
/src/libreoffice/filter/source/odfflatxml/OdfFlatXml.cxx:149:26

Change-Id: Ic4ba40dca088a333a1271e005a05bd3c6e7d70ac
Reviewed-on: https://gerrit.libreoffice.org/42375
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/xmlscript/source/xml_helper/xml_impctx.cxx 
b/xmlscript/source/xml_helper/xml_impctx.cxx
index 0d70c782bfaa..79d7889698b7 100644
--- a/xmlscript/source/xml_helper/xml_impctx.cxx
+++ b/xmlscript/source/xml_helper/xml_impctx.cxx
@@ -68,7 +68,7 @@ struct PrefixEntry
 };
 
 typedef std::unordered_map<
-OUString, PrefixEntry *, OUStringHash > t_OUString2PrefixMap;
+OUString, std::unique_ptr, OUStringHash > 
t_OUString2PrefixMap;
 
 struct ElementEntry
 {
@@ -258,13 +258,13 @@ inline void DocumentHandlerImpl::pushPrefix(
 {
 PrefixEntry * pEntry = new PrefixEntry();
 pEntry->m_Uids.push_back( nUid ); // latest id for prefix
-m_prefixes[ rPrefix ] = pEntry;
+m_prefixes[rPrefix].reset(pEntry);
 }
 else
 {
-PrefixEntry * pEntry = iFind->second;
-SAL_WARN_IF( pEntry->m_Uids.empty(), "xmlscript.xmlhelper", 
"pEntry->m_Uids is empty" );
-pEntry->m_Uids.push_back( nUid );
+PrefixEntry& rEntry = *iFind->second;
+SAL_WARN_IF(rEntry.m_Uids.empty(), "xmlscript.xmlhelper", 
"pEntry->m_Uids is empty");
+rEntry.m_Uids.push_back(nUid);
 }
 
 m_aLastPrefix_lookup = rPrefix;
@@ -277,12 +277,11 @@ inline void DocumentHandlerImpl::popPrefix(
 t_OUString2PrefixMap::iterator iFind( m_prefixes.find( rPrefix ) );
 if (iFind != m_prefixes.end()) // unused prefix
 {
-PrefixEntry * pEntry = iFind->second;
-pEntry->m_Uids.pop_back(); // pop last id for prefix
-if (pEntry->m_Uids.empty()) // erase prefix key
+PrefixEntry& rEntry = *iFind->second;
+rEntry.m_Uids.pop_back(); // pop last id for prefix
+if (rEntry.m_Uids.empty()) // erase prefix key
 {
-m_prefixes.erase( iFind );
-delete pEntry;
+m_prefixes.erase(iFind);
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: xmlscript/source

2017-09-15 Thread Caolán McNamara
 xmlscript/source/xml_helper/xml_impctx.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 61037c622b13122de578f5ef60a3b343af3f9633
Author: Caolán McNamara 
Date:   Fri Sep 15 11:13:23 2017 +0100

ofz: leak of prefixes in skipped elements

Change-Id: I8e83eb605bdf5991988e147cf8478e44c858a2b0
Reviewed-on: https://gerrit.libreoffice.org/42320
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/xmlscript/source/xml_helper/xml_impctx.cxx 
b/xmlscript/source/xml_helper/xml_impctx.cxx
index 5c461c29a64f..0d70c782bfaa 100644
--- a/xmlscript/source/xml_helper/xml_impctx.cxx
+++ b/xmlscript/source/xml_helper/xml_impctx.cxx
@@ -545,6 +545,11 @@ void DocumentHandlerImpl::startElement(
 else
 {
 ++m_nSkipElements;
+
+// pop prefixes
+for (sal_Int32 nPos = elementEntry->m_prefixes.size(); nPos--;)
+popPrefix(elementEntry->m_prefixes[nPos]);
+
 SAL_INFO("xmlscript.xmlhelper", " no context given on 
createChildElement() => ignoring element \"" << rQElementName << "\" ...");
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: xmlscript/source

2017-08-10 Thread Stephan Bergmann
 xmlscript/source/xmldlg_imexp/xmldlg_export.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1fc6b2f745300eae03373a1beb5d5ff79cf7de10
Author: Stephan Bergmann 
Date:   Thu Aug 10 11:25:14 2017 +0200

tdf#109177: Fix expected type of Orientation attr

Regression introduced with 7e781aa15ab8c6bb727ccf290db7768bc9ba6245 "Clean 
up
uses of Any::getValue() in xmlscript"

Change-Id: I66df1c5aacab1d697438c57418c9100f9dba627a

diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
index 5a5afd351b71..6238f6945e76 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
@@ -860,7 +860,7 @@ void ElementDescriptor::readOrientationAttr( OUString const 
& rPropName, OUStrin
 if (beans::PropertyState_DEFAULT_VALUE != _xPropState->getPropertyState( 
rPropName ))
 {
 Any a( _xProps->getPropertyValue( rPropName ) );
-if (auto n = o3tl::tryAccess(a))
+if (auto n = o3tl::tryAccess(a))
 {
 switch (*n)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: xmlscript/source

2017-04-10 Thread Miklos Vajna
 xmlscript/source/xmldlg_imexp/xmldlg_import.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c113aded3e7f333e44c0cde1c3e4f4194fc407fa
Author: Miklos Vajna 
Date:   Mon Apr 10 12:07:11 2017 +0200

tdf#107029 xmlscript: fix enum conversion

Regression from commit 0fe6f1a196b70f0ba4c948389b2ef9b1e77187b8 (use
actual UNO enums in vcl..xmlsecurity, 2017-04-03), it's important when
changing a sal_Int16 to an enum, then arguments of makeAny() calls of
that variable are explicitly casted the previous type to keep
compatibility.

Change-Id: Ib55eeded34033ce536078919c6fad4d571951cd3
Reviewed-on: https://gerrit.libreoffice.org/36358
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
index 32edd32ea4cf..f5606ffe2d90 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
@@ -1092,7 +1092,7 @@ bool ImportContext::importButtonTypeProperty(
 throw xml::sax::SAXException( "invalid button-type value!", 
Reference< XInterface >(), Any() );
 }
 
-_xControlModel->setPropertyValue( rPropName, makeAny( nButtonType ) );
+_xControlModel->setPropertyValue( rPropName, makeAny( 
(sal_Int16)nButtonType ) );
 return true;
 }
 return false;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: xmlscript/source

2017-04-04 Thread Miklos Vajna
 xmlscript/source/xmldlg_imexp/xmldlg_export.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 843cb68d00146d8ef18a4fa6f8316808056fd823
Author: Miklos Vajna 
Date:   Tue Apr 4 16:01:06 2017 +0200

xmlscript: fix -Werror=maybe-uninitialized

Change-Id: Ifcde2202fcb2cfa1dd226697910c1fbd219a3f83

diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
index 0e3bc40c3b0b..742509a14957 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
@@ -1021,7 +1021,7 @@ void ElementDescriptor::readImageScaleModeAttr( OUString 
const & rPropName, OUSt
 
 if (aImageScaleMode.getValueTypeClass() == TypeClass_SHORT)
 {
-sal_Int16 nImageScaleMode;
+sal_Int16 nImageScaleMode = 0;
 aImageScaleMode >>= nImageScaleMode;
 
 switch(nImageScaleMode)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: xmlscript/source

2017-01-22 Thread Jochen Nitschke
 xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx |5 -
 1 file changed, 5 deletions(-)

New commits:
commit db2991d15950d30fd4202ad86ae78dc12fcee9ed
Author: Jochen Nitschke 
Date:   Sun Jan 22 09:34:35 2017 +

cppcheck: multiCondition

> Expression is always false becase 'else if' condition matches
> previous condition at line 1130.

Change-Id: Ic56379716ada435ad7e2a00252310bfa50868f04
Reviewed-on: https://gerrit.libreoffice.org/33388
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
index 2a94774..79d327e 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
@@ -1152,11 +1152,6 @@ Reference< xml::input::XElement > 
TitledBoxElement::startChildElement(
 _radios.push_back( xRet );
 return xRet;
 }
-// event
-else if (m_xImport->isEventElement( nUid, rLocalName ))
-{
-return new EventElement( nUid, rLocalName, xAttributes, this, 
m_xImport.get() );
-}
 else
 {
 return BulletinBoardElement::startChildElement( nUid, rLocalName, 
xAttributes );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: xmlscript/source

2016-06-27 Thread Stephan Bergmann
 xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx |5 +
 xmlscript/source/xmldlg_imexp/xmldlg_export.cxx|   55 ++---
 2 files changed, 31 insertions(+), 29 deletions(-)

New commits:
commit 7e781aa15ab8c6bb727ccf290db7768bc9ba6245
Author: Stephan Bergmann 
Date:   Mon Jun 27 15:41:42 2016 +0200

Clean up uses of Any::getValue() in xmlscript

Change-Id: I863ce5cdf53aee40c12cfe1b8ae4399b7cf006ce

diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
index 6610f76..fe4723c 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -876,10 +877,10 @@ void ElementDescriptor::readFormattedFieldModel( StyleBag 
* all_styles )
 switch (a.getValueTypeClass())
 {
 case TypeClass_DOUBLE:
-addAttribute( XMLNS_DIALOGS_PREFIX ":value-default", OUString::number( 
*static_cast(a.getValue()) ) );
+addAttribute( XMLNS_DIALOGS_PREFIX ":value-default", OUString::number( 
*o3tl::forceAccess(a) ) );
 break;
 case TypeClass_STRING:
-addAttribute( XMLNS_DIALOGS_PREFIX ":value-default", 
*static_cast(a.getValue()) );
+addAttribute( XMLNS_DIALOGS_PREFIX ":value-default", 
*o3tl::forceAccess(a) );
 break;
 default:
 break;
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
index d8a7446..1732d64 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
@@ -19,6 +19,7 @@
 
 #include "exp_share.hxx"
 
+#include 
 #include 
 #include 
 #include 
@@ -517,9 +518,9 @@ void ElementDescriptor::readHexLongAttr( OUString const & 
rPropName, OUString co
 if (beans::PropertyState_DEFAULT_VALUE != _xPropState->getPropertyState( 
rPropName ))
 {
 Any a( _xProps->getPropertyValue( rPropName ) );
-if (a.getValueTypeClass() == TypeClass_LONG)
+if (auto n = o3tl::tryAccess(a))
 {
-addAttribute( rAttrName, "0x" + 
OUString::number((sal_Int64)(sal_uInt64)*static_cast(a.getValue()),16)  );
+addAttribute( rAttrName, "0x" + OUString::number(*n, 16)  );
 }
 }
 }
@@ -529,9 +530,9 @@ void ElementDescriptor::readDateFormatAttr( OUString const 
& rPropName, OUString
 if (beans::PropertyState_DEFAULT_VALUE != _xPropState->getPropertyState( 
rPropName ))
 {
 Any a( _xProps->getPropertyValue( rPropName ) );
-if (a.getValueTypeClass() == TypeClass_SHORT)
+if (auto n = o3tl::tryAccess(a))
 {
-switch (*static_cast(a.getValue()))
+switch (*n)
 {
 case 0:
 addAttribute( rAttrName, "system_short" );
@@ -626,9 +627,9 @@ void ElementDescriptor::readTimeFormatAttr( OUString const 
& rPropName, OUString
 if (beans::PropertyState_DEFAULT_VALUE != _xPropState->getPropertyState( 
rPropName ))
 {
 Any a( _xProps->getPropertyValue( rPropName ) );
-if (a.getValueTypeClass() == TypeClass_SHORT)
+if (auto n = o3tl::tryAccess(a))
 {
-switch (*static_cast(a.getValue()))
+switch (*n)
 {
 case 0:
 addAttribute( rAttrName, "24h_short" );
@@ -663,9 +664,9 @@ void ElementDescriptor::readAlignAttr( OUString const & 
rPropName, OUString cons
 if (beans::PropertyState_DEFAULT_VALUE != _xPropState->getPropertyState( 
rPropName ))
 {
 Any a( _xProps->getPropertyValue( rPropName ) );
-if (a.getValueTypeClass() == TypeClass_SHORT)
+if (auto n = o3tl::tryAccess(a))
 {
-switch (*static_cast(a.getValue()))
+switch (*n)
 {
 case 0:
 addAttribute( rAttrName, "left" );
@@ -744,9 +745,9 @@ void ElementDescriptor::readImageAlignAttr( OUString const 
& rPropName, OUString
 if (beans::PropertyState_DEFAULT_VALUE != _xPropState->getPropertyState( 
rPropName ))
 {
 Any a( _xProps->getPropertyValue( rPropName ) );
-if (a.getValueTypeClass() == TypeClass_SHORT)
+if (auto n = o3tl::tryAccess(a))
 {
-switch (*static_cast(a.getValue()))
+switch (*n)
 {
 case 0:
 addAttribute( rAttrName, "left" );
@@ -775,9 +776,9 @@ void ElementDescriptor::readImagePositionAttr( OUString 
const & rPropName, OUStr
 if (beans::PropertyState_DEFAULT_VALUE != _xPropState->getPropertyState( 
rPropName ))
 {
 Any a( _xProps->getPropertyValue( rPropName ) );
-if (a.getValueTypeClass() == TypeClass_SHORT)
+if (auto n = o3tl::tryAccess(a))
 {
-switch (*static_cast(a.getValue()))
+

[Libreoffice-commits] core.git: xmlscript/source

2016-05-12 Thread Stephan Bergmann
 xmlscript/source/xml_helper/xml_impctx.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 11b3262dd116118d46b0fbfea5f4dcea1de755c9
Author: Stephan Bergmann 
Date:   Thu May 12 14:37:32 2016 +0200

loplugin:nullptr

Change-Id: I2eb28f3408967d9de4143f6b9212056ac8614d1c

diff --git a/xmlscript/source/xml_helper/xml_impctx.cxx 
b/xmlscript/source/xml_helper/xml_impctx.cxx
index 493c333..95f60fa 100644
--- a/xmlscript/source/xml_helper/xml_impctx.cxx
+++ b/xmlscript/source/xml_helper/xml_impctx.cxx
@@ -207,7 +207,7 @@ DocumentHandlerImpl::~DocumentHandlerImpl() throw ()
 {
 delete m_pMutex;
 #if OSL_DEBUG_LEVEL == 0
-m_pMutex = 0;
+m_pMutex = nullptr;
 #endif
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: xmlscript/source

2016-05-04 Thread Stephan Bergmann
 xmlscript/source/xmlflat_imexp/xmlbas_import.cxx |6 +++---
 xmlscript/source/xmlflat_imexp/xmlbas_import.hxx |2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 2894df68fee2eff2ce960dfeebc6b263ccae645f
Author: Stephan Bergmann 
Date:   Wed May 4 12:53:44 2016 +0200

sal_Bool -> bool

Change-Id: I770a8507cdc1ee56456642b1f878381d6cf9d0b3

diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx 
b/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx
index 095267b..736afd5 100644
--- a/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx
+++ b/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx
@@ -62,7 +62,7 @@ namespace xmlscript
 m_pParent->release();
 }
 
-bool BasicElementBase::getBoolAttr( sal_Bool* pRet, const OUString& 
rAttrName,
+bool BasicElementBase::getBoolAttr( bool* pRet, const OUString& rAttrName,
 const css::uno::Reference< css::xml::input::XAttributes >& xAttributes,
 sal_Int32 nUid )
 {
@@ -180,7 +180,7 @@ void BasicElementBase::processingInstruction( const 
OUString& /*rTarget*/, const
 
 OUString aStorageURL = 
xAttributes->getValueByUidName(m_pImport->XMLNS_XLINK_UID, "href" );
 
-sal_Bool bReadOnly = false;
+bool bReadOnly = false;
 getBoolAttr( ,"readonly", xAttributes, 
m_pImport->XMLNS_UID );
 
 if ( m_xLibContainer.is() )
@@ -211,7 +211,7 @@ void BasicElementBase::processingInstruction( const 
OUString& /*rTarget*/, const
 {
 OUString aName = xAttributes->getValueByUidName( 
m_pImport->XMLNS_UID, "name" );
 
-sal_Bool bReadOnly = false;
+bool bReadOnly = false;
 getBoolAttr( , "readonly", xAttributes, 
m_pImport->XMLNS_UID );
 
 if ( m_xLibContainer.is() )
diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_import.hxx 
b/xmlscript/source/xmlflat_imexp/xmlbas_import.hxx
index 4929254..0eecb0d 100644
--- a/xmlscript/source/xmlflat_imexp/xmlbas_import.hxx
+++ b/xmlscript/source/xmlflat_imexp/xmlbas_import.hxx
@@ -48,7 +48,7 @@ namespace xmlscript
 OUString m_aLocalName;
 css::uno::Reference< css::xml::input::XAttributes > m_xAttributes;
 
-static bool getBoolAttr( sal_Bool* pRet, const OUString& rAttrName,
+static bool getBoolAttr( bool* pRet, const OUString& rAttrName,
 const css::uno::Reference< css::xml::input::XAttributes >& 
xAttributes,
 sal_Int32 nUid );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: xmlscript/source xmlscript/util

2016-05-02 Thread Yeliz Taneroğlu
 xmlscript/source/inc/unoservices.hxx |9 --
 xmlscript/source/misc/unoservices.cxx|5 ---
 xmlscript/source/xmlflat_imexp/xmlbas_import.cxx |   30 ---
 xmlscript/util/xmlscript.component   |3 +-
 4 files changed, 13 insertions(+), 34 deletions(-)

New commits:
commit 2dc8f1b25c157a597905fb33f1527244baf977f3
Author: Yeliz Taneroğlu 
Date:   Sun May 1 13:33:41 2016 +0300

tdf#74608 Constructor function for XMLOasisBasicImporter

Change-Id: Iec1c875f6aa34c37ac26a5dac008db547e8965ca
Reviewed-on: https://gerrit.libreoffice.org/24551
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/xmlscript/source/inc/unoservices.hxx 
b/xmlscript/source/inc/unoservices.hxx
index 61e10d9..bdeea6a 100644
--- a/xmlscript/source/inc/unoservices.hxx
+++ b/xmlscript/source/inc/unoservices.hxx
@@ -57,15 +57,6 @@ OUString SAL_CALL getImplementationName_XMLBasicImporter();
 
 css::uno::Reference SAL_CALL create_XMLBasicImporter(
 css::uno::Reference const & xContext);
-
-css::uno::Sequence SAL_CALL
-getSupportedServiceNames_XMLOasisBasicImporter();
-
-OUString SAL_CALL getImplementationName_XMLOasisBasicImporter();
-
-css::uno::Reference SAL_CALL 
create_XMLOasisBasicImporter(
-css::uno::Reference const & xContext);
-
 }
 
 #endif
diff --git a/xmlscript/source/misc/unoservices.cxx 
b/xmlscript/source/misc/unoservices.cxx
index 87eb33e..204d4de 100644
--- a/xmlscript/source/misc/unoservices.cxx
+++ b/xmlscript/source/misc/unoservices.cxx
@@ -42,11 +42,6 @@ namespace xmlscript
 getSupportedServiceNames_XMLBasicImporter, 
::cppu::createSingleComponentFactory,
 nullptr, 0
 },
-{
-create_XMLOasisBasicImporter, 
getImplementationName_XMLOasisBasicImporter,
-getSupportedServiceNames_XMLOasisBasicImporter, 
::cppu::createSingleComponentFactory,
-nullptr, 0
-},
 { nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
 };
 }
diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx 
b/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx
index 81d7cbd..35cdec0 100644
--- a/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx
+++ b/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx
@@ -510,17 +510,6 @@ void BasicImport::setDocumentLocator( const Reference< 
xml::sax::XLocator >& /*x
 return aNames;
 }
 
-OUString getImplementationName_XMLOasisBasicImporter()
-{
-return OUString( "com.sun.star.comp.xmlscript.XMLOasisBasicImporter" );
-}
-
-Sequence< OUString > getSupportedServiceNames_XMLOasisBasicImporter()
-{
-Sequence< OUString > aNames { 
"com.sun.star.document.XMLOasisBasicImporter" };
-return aNames;
-}
-
 // XMLBasicImporterBase
 
 XMLBasicImporterBase::XMLBasicImporterBase( const Reference< 
XComponentContext >& rxContext, bool bOasis )
@@ -679,12 +668,13 @@ void BasicImport::setDocumentLocator( const Reference< 
xml::sax::XLocator >& /*x
 
 OUString XMLOasisBasicImporter::getImplementationName(  ) throw 
(RuntimeException, std::exception)
 {
-return getImplementationName_XMLOasisBasicImporter();
+return OUString( "com.sun.star.comp.xmlscript.XMLOasisBasicImporter" );
 }
 
 Sequence< OUString > XMLOasisBasicImporter::getSupportedServiceNames(  ) 
throw (RuntimeException, std::exception)
 {
-return getSupportedServiceNames_XMLOasisBasicImporter();
+Sequence< OUString > aNames { 
"com.sun.star.document.XMLOasisBasicImporter" };
+return aNames;
 }
 
 // component operations
@@ -695,12 +685,14 @@ void BasicImport::setDocumentLocator( const Reference< 
xml::sax::XLocator >& /*x
 return static_cast< lang::XTypeProvider * >( new XMLBasicImporter( 
xContext ) );
 }
 
-Reference< XInterface > SAL_CALL create_XMLOasisBasicImporter(
-Reference< XComponentContext > const & xContext )
-{
-return static_cast< lang::XTypeProvider * >( new 
XMLOasisBasicImporter( xContext ) );
-}
-
 }   // namespace xmlscript
 
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_comp_xmlscript_XMLOasisBasicImporter(
+css::uno::XComponentContext *context,
+css::uno::Sequence const &)
+{
+return cppu::acquire(new xmlscript::XMLOasisBasicImporter(context));
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlscript/util/xmlscript.component 
b/xmlscript/util/xmlscript.component
index 298d874..e212b9b 100644
--- a/xmlscript/util/xmlscript.component
+++ b/xmlscript/util/xmlscript.component
@@ -32,7 +32,8 @@
  constructor="com_sun_star_comp_xmlscript_XMLOasisBasicExporter">
 
   
-  
+  
 
   
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org

[Libreoffice-commits] core.git: xmlscript/source xmlscript/util

2016-05-02 Thread Yeliz Taneroğlu
 xmlscript/source/inc/unoservices.hxx |8 -
 xmlscript/source/misc/unoservices.cxx|5 ---
 xmlscript/source/xmlflat_imexp/xmlbas_export.cxx |   31 ---
 xmlscript/util/xmlscript.component   |3 +-
 4 files changed, 14 insertions(+), 33 deletions(-)

New commits:
commit b8c04ea449750b39ab5dc64f91f74688fd9a4d3a
Author: Yeliz Taneroğlu 
Date:   Sat Apr 30 15:56:22 2016 +0300

tdf#74608 Constructor function for XMLOasisBasicExporter

Change-Id: If5409621f515918e715e3c0b71ec1b3d6fd1ef92
Reviewed-on: https://gerrit.libreoffice.org/24518
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/xmlscript/source/inc/unoservices.hxx 
b/xmlscript/source/inc/unoservices.hxx
index 6ac388a..61e10d9 100644
--- a/xmlscript/source/inc/unoservices.hxx
+++ b/xmlscript/source/inc/unoservices.hxx
@@ -51,14 +51,6 @@ css::uno::Reference SAL_CALL 
create_XMLBasicExporter(
 css::uno::Reference const & xContext);
 
 css::uno::Sequence SAL_CALL
-getSupportedServiceNames_XMLOasisBasicExporter();
-
-OUString SAL_CALL getImplementationName_XMLOasisBasicExporter();
-
-css::uno::Reference SAL_CALL 
create_XMLOasisBasicExporter(
-css::uno::Reference const & xContext);
-
-css::uno::Sequence SAL_CALL
 getSupportedServiceNames_XMLBasicImporter();
 
 OUString SAL_CALL getImplementationName_XMLBasicImporter();
diff --git a/xmlscript/source/misc/unoservices.cxx 
b/xmlscript/source/misc/unoservices.cxx
index 8d89cef..87eb33e 100644
--- a/xmlscript/source/misc/unoservices.cxx
+++ b/xmlscript/source/misc/unoservices.cxx
@@ -38,11 +38,6 @@ namespace xmlscript
 nullptr, 0
 },
 {
-create_XMLOasisBasicExporter, 
getImplementationName_XMLOasisBasicExporter,
-getSupportedServiceNames_XMLOasisBasicExporter, 
::cppu::createSingleComponentFactory,
-nullptr, 0
-},
-{
 create_XMLBasicImporter, getImplementationName_XMLBasicImporter,
 getSupportedServiceNames_XMLBasicImporter, 
::cppu::createSingleComponentFactory,
 nullptr, 0
diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx 
b/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx
index 4f6c49e..4250644 100644
--- a/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx
+++ b/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx
@@ -52,17 +52,6 @@ namespace xmlscript
 return aNames;
 }
 
-OUString getImplementationName_XMLOasisBasicExporter()
-{
-return OUString( "com.sun.star.comp.xmlscript.XMLOasisBasicExporter" );
-}
-
-Sequence< OUString > getSupportedServiceNames_XMLOasisBasicExporter()
-{
-Sequence< OUString > aNames { 
"com.sun.star.document.XMLOasisBasicExporter" };
-return aNames;
-}
-
 // XMLBasicExporterBase
 
 XMLBasicExporterBase::XMLBasicExporterBase( bool bOasis )
@@ -399,12 +388,13 @@ sal_Bool XMLBasicExporterBase::filter( const Sequence< 
beans::PropertyValue >& /
 
 OUString XMLOasisBasicExporter::getImplementationName(  ) throw 
(RuntimeException, std::exception)
 {
-return getImplementationName_XMLOasisBasicExporter();
+return OUString( "com.sun.star.comp.xmlscript.XMLOasisBasicExporter" );
 }
 
 Sequence< OUString > XMLOasisBasicExporter::getSupportedServiceNames(  ) 
throw (RuntimeException, std::exception)
 {
-return getSupportedServiceNames_XMLOasisBasicExporter();
+Sequence< OUString > aNames { 
"com.sun.star.document.XMLOasisBasicExporter" };
+return aNames;
 }
 
 // component operations
@@ -415,12 +405,15 @@ sal_Bool XMLBasicExporterBase::filter( const Sequence< 
beans::PropertyValue >& /
 return static_cast< lang::XTypeProvider * >( new XMLBasicExporter );
 }
 
-Reference< XInterface > SAL_CALL create_XMLOasisBasicExporter(
-Reference< XComponentContext > const &  )
-{
-return static_cast< lang::XTypeProvider * >( new XMLOasisBasicExporter 
);
-}
-
 }   // namespace xmlscript
 
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_comp_xmlscript_XMLOasisBasicExporter(
+css::uno::XComponentContext *,
+css::uno::Sequence const &)
+{
+
+return cppu::acquire(new xmlscript::XMLOasisBasicExporter());
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlscript/util/xmlscript.component 
b/xmlscript/util/xmlscript.component
index 79b518a..298d874 100644
--- a/xmlscript/util/xmlscript.component
+++ b/xmlscript/util/xmlscript.component
@@ -28,7 +28,8 @@
   
 
   
-  
+  
 
   
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: xmlscript/source

2016-04-09 Thread Vasily Melenchuk
 xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx |1 +
 xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx |1 +
 2 files changed, 2 insertions(+)

New commits:
commit bef802a7bf7acb8331a1d776db9bbcc3bf16220b
Author: Vasily Melenchuk 
Date:   Fri Apr 8 18:54:35 2016 +0100

tdf#99172 support for vertical align import/export property for text boxes

Change-Id: I1cf8d8d57a7245800e2b28b674301ebcb5470348
Reviewed-on: https://gerrit.libreoffice.org/23927
Tested-by: Jenkins 
Reviewed-by: Samuel Mehrbrodt 

diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
index 9bc4adf..7f17cf8 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
@@ -556,6 +556,7 @@ void ElementDescriptor::readEditModel( StyleBag * 
all_styles )
 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX ":tabstop" );
 readBoolAttr( "HideInactiveSelection", XMLNS_DIALOGS_PREFIX 
":hide-inactive-selection" );
 readAlignAttr( "Align", XMLNS_DIALOGS_PREFIX ":align" );
+readVerticalAlignAttr( "VerticalAlign", XMLNS_DIALOGS_PREFIX ":valign" );
 readBoolAttr( "HardLineBreaks", XMLNS_DIALOGS_PREFIX ":hard-linebreaks" );
 readBoolAttr( "HScroll", XMLNS_DIALOGS_PREFIX ":hscroll" );
 readBoolAttr( "VScroll", XMLNS_DIALOGS_PREFIX ":vscroll" );
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
index af17a17..cee3520 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
@@ -1090,6 +1090,7 @@ void TextFieldElement::endElement()
 ctx.importDefaults( _nBasePosX, _nBasePosY, _xAttributes );
 ctx.importBooleanProperty("Tabstop", "tabstop", _xAttributes );
 ctx.importAlignProperty( "Align", "align", _xAttributes );
+ctx.importVerticalAlignProperty( "VerticalAlign", "valign", _xAttributes );
 ctx.importBooleanProperty( "HardLineBreaks", "hard-linebreaks", 
_xAttributes );
 ctx.importBooleanProperty( "HScroll", "hscroll" ,_xAttributes );
 ctx.importBooleanProperty( "VScroll", "vscroll", _xAttributes );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: xmlscript/source

2016-04-05 Thread Stephan Bergmann
 xmlscript/source/xml_helper/xml_byteseq.cxx |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 5b32ba4217e88f3f6fab0baaa79988623e55ba0e
Author: Stephan Bergmann 
Date:   Tue Apr 5 16:19:50 2016 +0200

-fsanitize=nonnull-attribute

Change-Id: Ice9fef5bdfd3e993b1b2ba035cbc971b8dacbe3a

diff --git a/xmlscript/source/xml_helper/xml_byteseq.cxx 
b/xmlscript/source/xml_helper/xml_byteseq.cxx
index 56cc5d2..19bdb0b 100644
--- a/xmlscript/source/xml_helper/xml_byteseq.cxx
+++ b/xmlscript/source/xml_helper/xml_byteseq.cxx
@@ -69,7 +69,9 @@ sal_Int32 BSeqInputStream::readBytes(
 
 if (rData.getLength() != nBytesToRead)
 rData.realloc( nBytesToRead );
-memcpy(rData.getArray(), &_seq.data()[_nPos], nBytesToRead);
+if (nBytesToRead != 0) {
+memcpy(rData.getArray(), &_seq.data()[_nPos], nBytesToRead);
+}
 _nPos += nBytesToRead;
 return nBytesToRead;
 }
@@ -145,7 +147,9 @@ Reference< io::XInputStream > SAL_CALL createInputStream( 
std::vector
 Reference< io::XInputStream > SAL_CALL createInputStream( const sal_Int8* 
pData, int len )
 {
 std::vector rInData(len);
-memcpy( rInData.data(), pData, len);
+if (len != 0) {
+memcpy( rInData.data(), pData, len);
+}
 return new BSeqInputStream( rInData );
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: xmlscript/source

2016-03-08 Thread Rohan Kumar
 xmlscript/source/xml_helper/xml_impctx.cxx  |   18 +++---
 xmlscript/source/xmldlg_imexp/xmldlg_import.cxx |8 +---
 xmlscript/source/xmllib_imexp/xmllib_import.cxx |7 +--
 xmlscript/source/xmlmod_imexp/xmlmod_import.cxx |7 +--
 4 files changed, 6 insertions(+), 34 deletions(-)

New commits:
commit 0a8c9fde3ba59a278c9ee4d18f099cfeec71fbef
Author: Rohan Kumar 
Date:   Wed Mar 9 11:32:40 2016 +0530

tdf#91794 remove OSL_DEBUG_LEVEL > 1 conditionals

I removed OSL_DEBUG_LEVEL > 1 conditionals and left SAL_INFO()s
statements alone. I also removed OUStringToOString(..) calls that were
used by SAL_INFO(..)

Change-Id: I01cce00265531d7f0ad0a6f564fef6262d3d1205
Reviewed-on: https://gerrit.libreoffice.org/23036
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/xmlscript/source/xml_helper/xml_impctx.cxx 
b/xmlscript/source/xml_helper/xml_impctx.cxx
index 02ae45c..493c333 100644
--- a/xmlscript/source/xml_helper/xml_impctx.cxx
+++ b/xmlscript/source/xml_helper/xml_impctx.cxx
@@ -497,11 +497,7 @@ void DocumentHandlerImpl::startElement(
 if (m_nSkipElements > 0)
 {
 ++m_nSkipElements; // wait for another end tag
-#if OSL_DEBUG_LEVEL > 1
-OString aQName(
-OUStringToOString( rQElementName, RTL_TEXTENCODING_ASCII_US ) );
-SAL_INFO("xmlscript.xmlhelper", "### no context given on 
createChildElement() => ignoring element \"" << aQName.getStr() << "\" ...");
-#endif
+SAL_INFO("xmlscript.xmlhelper", " no context given on 
createChildElement() => ignoring element \"" << rQElementName << "\" ...");
 return;
 }
 
@@ -608,11 +604,7 @@ void DocumentHandlerImpl::startElement(
 else
 {
 ++m_nSkipElements;
-#if OSL_DEBUG_LEVEL > 1
-OString aQName(
-OUStringToOString( rQElementName, RTL_TEXTENCODING_ASCII_US ) );
-SAL_INFO("xmlscript.xmlhelper", "### no context given on 
createChildElement() => ignoring element \"" << aQName.getStr() << "\" ...");
-#endif
+SAL_INFO("xmlscript.xmlhelper", " no context given on 
createChildElement() => ignoring element \"" << rQElementName << "\" ...");
 }
 }
 }
@@ -627,11 +619,7 @@ void DocumentHandlerImpl::endElement(
 if (m_nSkipElements)
 {
 --m_nSkipElements;
-#if OSL_DEBUG_LEVEL > 1
-OString aQName(
-OUStringToOString( rQElementName, RTL_TEXTENCODING_ASCII_US ) );
-SAL_INFO("xmlscript.xmlhelper", "### received endElement() for \"" << 
aQName.getStr() << "\".");
-#endif
+SAL_INFO("xmlscript.xmlhelper", "### received endElement() for \"" << 
rQElementName << "\".");
 static_cast(rQElementName);
 return;
 }
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
index 89069cb..c82d306 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
@@ -1702,11 +1702,7 @@ ElementBase::~ElementBase()
 _pParent->release();
 }
 
-#if OSL_DEBUG_LEVEL > 1
-OString aStr( OUStringToOString(
- _aLocalName, RTL_TEXTENCODING_ASCII_US ) );
-SAL_INFO("xmlscript.xmldlg", "ElementBase::~ElementBase(): " << 
aStr.getStr() );
-#endif
+SAL_INFO("xmlscript.xmldlg", "ElementBase::~ElementBase(): " << 
_aLocalName );
 }
 
 // XRoot
@@ -1761,9 +1757,7 @@ Reference< xml::input::XElement > 
DialogImport::startRootElement(
 
 DialogImport::~DialogImport()
 {
-#if OSL_DEBUG_LEVEL > 1
 SAL_INFO("xmlscript.xmldlg", "DialogImport::~DialogImport()." );
-#endif
 }
 
 Reference< util::XNumberFormatsSupplier > const & 
DialogImport::getNumberFormatsSupplier()
diff --git a/xmlscript/source/xmllib_imexp/xmllib_import.cxx 
b/xmlscript/source/xmllib_imexp/xmllib_import.cxx
index 0b0e6b1..8919192 100644
--- a/xmlscript/source/xmllib_imexp/xmllib_import.cxx
+++ b/xmlscript/source/xmllib_imexp/xmllib_import.cxx
@@ -110,10 +110,7 @@ LibElementBase::~LibElementBase()
 _pParent->release();
 }
 
-#if OSL_DEBUG_LEVEL > 1
-OString aStr( OUStringToOString( _aLocalName, RTL_TEXTENCODING_ASCII_US ) 
);
-SAL_INFO("xmlscript.xmllib", "LibElementBase::~LibElementBase(): " << 
aStr.getStr() );
-#endif
+SAL_INFO("xmlscript.xmllib", "LibElementBase::~LibElementBase(): " << 
_aLocalName );
 }
 
 // XRoot
@@ -176,9 +173,7 @@ Reference< xml::input::XElement > 
LibraryImport::startRootElement(
 
 LibraryImport::~LibraryImport()
 {
-#if OSL_DEBUG_LEVEL > 1
 SAL_INFO("xmlscript.xmllib", "LibraryImport::~LibraryImport()." );
-#endif
 }
 
 // libraries
diff --git a/xmlscript/source/xmlmod_imexp/xmlmod_import.cxx 
b/xmlscript/source/xmlmod_imexp/xmlmod_import.cxx
index 23bd93b..965f1bb 100644
--- a/xmlscript/source/xmlmod_imexp/xmlmod_import.cxx
+++ b/xmlscript/source/xmlmod_imexp/xmlmod_import.cxx
@@ -110,10 +110,7 @@ 

[Libreoffice-commits] core.git: xmlscript/source

2015-12-18 Thread Oliver Specht
 xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx |2 ++
 xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx |2 ++
 2 files changed, 4 insertions(+)

New commits:
commit ffdd3c68205ddaa2d7fd895234461c02f1560e7c
Author: Oliver Specht 
Date:   Fri Dec 18 10:32:51 2015 +0100

tdf#80047: load align and valign attributes of NumericField

Change-Id: Iff92f050210c112f355803d4d4bcec6b9d289a84
Reviewed-on: https://gerrit.libreoffice.org/20788
Reviewed-by: Oliver Specht 
Tested-by: Oliver Specht 

diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
index cfa7509..9bc4adf 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
@@ -751,6 +751,8 @@ void ElementDescriptor::readNumericFieldModel( StyleBag * 
all_styles )
 
 // collect elements
 readDefaults();
+readAlignAttr( "Align", XMLNS_DIALOGS_PREFIX ":align" );
+readVerticalAlignAttr( "VerticalAlign", XMLNS_DIALOGS_PREFIX ":valign" );
 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX ":tabstop" );
 readBoolAttr( "ReadOnly", XMLNS_DIALOGS_PREFIX ":readonly" );
 readBoolAttr( "HideInactiveSelection", XMLNS_DIALOGS_PREFIX 
":hide-inactive-selection" );
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
index 7ca5ed4..af17a17 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
@@ -677,6 +677,8 @@ void NumericFieldElement::endElement()
 }
 
 ctx.importDefaults( _nBasePosX, _nBasePosY, _xAttributes );
+ctx.importAlignProperty( "Align", "align", _xAttributes );
+ctx.importVerticalAlignProperty( "VerticalAlign", "valign", _xAttributes );
 ctx.importBooleanProperty( "Tabstop","tabstop",_xAttributes );
 ctx.importBooleanProperty( "ReadOnly", "readonly",_xAttributes );
 ctx.importBooleanProperty( "StrictFormat", "strict-format", _xAttributes );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: xmlscript/source

2015-11-26 Thread Noel Grandin
 xmlscript/source/inc/misc.hxx|   10 -
 xmlscript/source/inc/xml_import.hxx  |6 
 xmlscript/source/xml_helper/xml_impctx.cxx   |2 
 xmlscript/source/xmlflat_imexp/xmlbas_export.hxx |   50 +++---
 xmlscript/source/xmlflat_imexp/xmlbas_import.cxx |2 
 xmlscript/source/xmlflat_imexp/xmlbas_import.hxx |  170 +++
 xmlscript/source/xmllib_imexp/xmllib_export.cxx  |2 
 xmlscript/source/xmllib_imexp/xmllib_import.cxx  |4 
 8 files changed, 123 insertions(+), 123 deletions(-)

New commits:
commit 93ca2247212118695d27ec13d6eedc4d3e512960
Author: Noel Grandin 
Date:   Thu Nov 26 09:02:49 2015 +0200

com::sun::star->css in xmlscript/

Change-Id: I8ead2862ef429a0ac3fc16fe6ca5dfc9e5f549bc
Reviewed-on: https://gerrit.libreoffice.org/20193
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/xmlscript/source/inc/misc.hxx b/xmlscript/source/inc/misc.hxx
index e8ece5e..7671dea 100644
--- a/xmlscript/source/inc/misc.hxx
+++ b/xmlscript/source/inc/misc.hxx
@@ -26,19 +26,19 @@ namespace xmlscript
 {
 
 template< typename T >
-inline void extract_throw( T * p, ::com::sun::star::uno::Any const & a )
+inline void extract_throw( T * p, css::uno::Any const & a )
 {
 if (! (a >>= *p))
 {
-throw ::com::sun::star::uno::RuntimeException(
+throw css::uno::RuntimeException(
 "expected " + cppu::UnoType::get().getTypeName(),
-::com::sun::star::uno::Reference<
-::com::sun::star::uno::XInterface>() );
+css::uno::Reference<
+css::uno::XInterface>() );
 }
 }
 
 template< typename T >
-inline T extract_throw( ::com::sun::star::uno::Any const & a )
+inline T extract_throw( css::uno::Any const & a )
 {
 T v = T();
 extract_throw( , a );
diff --git a/xmlscript/source/inc/xml_import.hxx 
b/xmlscript/source/inc/xml_import.hxx
index 6f3cacd..f14e3e5 100644
--- a/xmlscript/source/inc/xml_import.hxx
+++ b/xmlscript/source/inc/xml_import.hxx
@@ -48,10 +48,10 @@ namespace xmlscript
 @return
 document handler for parser
 */
-::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler 
>
+css::uno::Reference< css::xml::sax::XDocumentHandler >
 SAL_CALL createDocumentHandler(
-::com::sun::star::uno::Reference<
-::com::sun::star::xml::input::XRoot > const & xRoot,
+css::uno::Reference<
+css::xml::input::XRoot > const & xRoot,
 bool bSingleThreadedUse = true );
 
 }
diff --git a/xmlscript/source/xml_helper/xml_impctx.cxx 
b/xmlscript/source/xml_helper/xml_impctx.cxx
index a553186..694b8ed 100644
--- a/xmlscript/source/xml_helper/xml_impctx.cxx
+++ b/xmlscript/source/xml_helper/xml_impctx.cxx
@@ -93,7 +93,7 @@ class DocumentHandlerImpl :
 public ::cppu::WeakImplHelper< xml::sax::XDocumentHandler,
 xml::input::XNamespaceMapping,
 lang::XInitialization,
-com::sun::star::lang::XServiceInfo >
+css::lang::XServiceInfo >
 {
 friend class ExtendedAttributes;
 
diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_export.hxx 
b/xmlscript/source/xmlflat_imexp/xmlbas_export.hxx
index 7e75ba5..10746ea 100644
--- a/xmlscript/source/xmlflat_imexp/xmlbas_export.hxx
+++ b/xmlscript/source/xmlflat_imexp/xmlbas_export.hxx
@@ -35,41 +35,41 @@ namespace xmlscript
 // class XMLBasicExporterBase
 
 typedef ::cppu::WeakImplHelper<
-::com::sun::star::lang::XServiceInfo,
-::com::sun::star::lang::XInitialization,
-::com::sun::star::document::XXMLBasicExporter > 
XMLBasicExporterBase_BASE;
+css::lang::XServiceInfo,
+css::lang::XInitialization,
+css::document::XXMLBasicExporter > XMLBasicExporterBase_BASE;
 
 class XMLBasicExporterBase : public XMLBasicExporterBase_BASE
 {
 private:
-::osl::Mutex   
 m_aMutex;
-::com::sun::star::uno::Reference< 
::com::sun::star::uno::XComponentContext >m_xContext;
-::com::sun::star::uno::Reference< 
::com::sun::star::xml::sax::XDocumentHandler >m_xHandler;
-::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >
 m_xModel;
-bool   
 m_bOasis;
+::osl::Mutex  m_aMutex;
+css::uno::Reference< css::uno::XComponentContext >m_xContext;
+css::uno::Reference< css::xml::sax::XDocumentHandler >m_xHandler;
+css::uno::Reference< css::frame::XModel > m_xModel;
+bool  m_bOasis;
 
 public:
 XMLBasicExporterBase(
-const 

[Libreoffice-commits] core.git: xmlscript/source

2015-02-05 Thread Michael Stahl
 xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx |1 +
 xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx |8 ++--
 2 files changed, 3 insertions(+), 6 deletions(-)

New commits:
commit ff26f022b36002c4f3ad426d8f37313e2651ae75
Author: Michael Stahl mst...@redhat.com
Date:   Thu Feb 5 17:32:36 2015 +0100

xmlscript: fix import/export of dialog radio-buttons

The BASIC dialog format is not specified by ODF anyway, so the change
was particularly stupid.

(regression from 2d4b87f0c1bfd97185a89c18d5b7680d11a958d6)

Change-Id: I5b20d690093b0d2b898f3e45cc0292fb72fbb353

diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
index 066cfd3..dc5d0b7 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
@@ -419,6 +419,7 @@ void ElementDescriptor::readRadioButtonModel( StyleBag * 
all_styles  )
 readImageURLAttr( ImageURL, XMLNS_DIALOGS_PREFIX :image-src );
 readImagePositionAttr( ImagePosition, XMLNS_DIALOGS_PREFIX 
:image-position );
 readBoolAttr( MultiLine, XMLNS_DIALOGS_PREFIX :multiline );
+readStringAttr( GroupName, XMLNS_DIALOGS_PREFIX :group-name );
 
 sal_Int16 nState = 0;
 if (readProp( State ) = nState)
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
index c1e8a39..6f2c6ea 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
@@ -1178,9 +1178,7 @@ void TitledBoxElement::endElement()
 ctx.importImageURLProperty( ImageURL ,  image-src , _xAttributes );
 ctx.importImagePositionProperty( ImagePosition, image-position, 
xAttributes );
 ctx.importBooleanProperty( MultiLine, multiline, xAttributes );
-// map invalid group-name attribute to name
-// (since radio buttons are grouped by name)
-ctx.importStringProperty( Name, group-name, xAttributes );
+ctx.importStringProperty( GroupName, group-name, xAttributes );
 
 sal_Int16 nVal = 0;
 sal_Bool bChecked = sal_False;
@@ -1275,9 +1273,7 @@ void RadioGroupElement::endElement()
 ctx.importImageURLProperty( ImageURL , image-src , xAttributes );
 ctx.importImagePositionProperty( ImagePosition, image-position, 
xAttributes );
 ctx.importBooleanProperty( MultiLine, multiline, xAttributes );
-// map invalid group-name attribute to name
-// (since radio buttons are grouped by name)
-ctx.importStringProperty( Name, group-name, xAttributes );
+ctx.importStringProperty( GroupName, group-name, xAttributes );
 sal_Int16 nVal = 0;
 sal_Bool bChecked = sal_False;
 if (getBoolAttr( bChecked, checked, xAttributes, 
_pImport-XMLNS_DIALOGS_UID )  bChecked)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: xmlscript/source

2015-01-27 Thread Tor Lillqvist
 xmlscript/source/xmldlg_imexp/xmldlg_export.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ad3e0989d137ef765d634cb07a7a7a46ecc774ff
Author: Tor Lillqvist t...@collabora.com
Date:   Tue Jan 27 15:01:14 2015 +0200

WaE: implicit conversion of literal of type 'int' to 'bool'

Change-Id: Ie12339760904329d690bbe4863286e005ebde380

diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
index e45ce96..ab9049f 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
@@ -1034,7 +1034,7 @@ void ElementDescriptor::readImageScaleModeAttr( OUString 
const  rPropName, OUSt
 addAttribute( rAttrName, OUString( anisotropic ) );
 break;
 default:
-OSL_ENSURE( 0, ### illegal image scale mode value.);
+OSL_ENSURE( false, ### illegal image scale mode value.);
 break;
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: xmlscript/source

2014-04-11 Thread Stephan Bergmann
 xmlscript/source/inc/unoservices.hxx |   86 +++
 xmlscript/source/misc/unoservices.cxx|   32 
 xmlscript/source/xml_helper/xml_impctx.cxx   |3 
 xmlscript/source/xmlflat_imexp/xmlbas_export.cxx |3 
 xmlscript/source/xmlflat_imexp/xmlbas_import.cxx |3 
 5 files changed, 97 insertions(+), 30 deletions(-)

New commits:
commit 115b2958125cf71d1d9283bbf411827348105fdb
Author: Stephan Bergmann sberg...@redhat.com
Date:   Fri Apr 11 23:29:01 2014 +0200

Clean up function declarations

Change-Id: If482545f87a9b0c066f91639c55b73bee4d01b5c

diff --git a/xmlscript/source/inc/unoservices.hxx 
b/xmlscript/source/inc/unoservices.hxx
new file mode 100644
index 000..a146a0c
--- /dev/null
+++ b/xmlscript/source/inc/unoservices.hxx
@@ -0,0 +1,86 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the License); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_XMLSCRIPT_SOURCE_INC_UNOSERVICES_HXX
+#define INCLUDED_XMLSCRIPT_SOURCE_INC_UNOSERVICES_HXX
+
+#include sal/config.h
+
+#include com/sun/star/uno/Exception.hpp
+#include com/sun/star/uno/Sequence.hxx
+#include rtl/ustring.hxx
+#include sal/types.h
+
+namespace com { namespace sun { namespace star { namespace uno {
+class XComponentContext;
+class XInterface;
+} } } }
+
+namespace xmlscript {
+
+css::uno::SequenceOUString SAL_CALL
+getSupportedServiceNames_DocumentHandlerImpl();
+
+OUString SAL_CALL getImplementationName_DocumentHandlerImpl();
+
+css::uno::Referencecss::uno::XInterface SAL_CALL create_DocumentHandlerImpl(
+css::uno::Referencecss::uno::XComponentContext const  xContext)
+SAL_THROW((css::uno::Exception));
+
+css::uno::SequenceOUString SAL_CALL
+getSupportedServiceNames_XMLBasicExporter();
+
+OUString SAL_CALL getImplementationName_XMLBasicExporter();
+
+css::uno::Referencecss::uno::XInterface SAL_CALL create_XMLBasicExporter(
+css::uno::Referencecss::uno::XComponentContext const  xContext)
+SAL_THROW((css::uno::Exception));
+
+css::uno::SequenceOUString SAL_CALL
+getSupportedServiceNames_XMLOasisBasicExporter();
+
+OUString SAL_CALL getImplementationName_XMLOasisBasicExporter();
+
+css::uno::Referencecss::uno::XInterface SAL_CALL 
create_XMLOasisBasicExporter(
+css::uno::Referencecss::uno::XComponentContext const  xContext)
+SAL_THROW((css::uno::Exception));
+
+css::uno::SequenceOUString SAL_CALL
+getSupportedServiceNames_XMLBasicImporter();
+
+OUString SAL_CALL getImplementationName_XMLBasicImporter();
+
+css::uno::Referencecss::uno::XInterface SAL_CALL create_XMLBasicImporter(
+css::uno::Referencecss::uno::XComponentContext const  xContext)
+SAL_THROW((css::uno::Exception));
+
+css::uno::SequenceOUString SAL_CALL
+getSupportedServiceNames_XMLOasisBasicImporter();
+
+OUString SAL_CALL getImplementationName_XMLOasisBasicImporter();
+
+css::uno::Referencecss::uno::XInterface SAL_CALL 
create_XMLOasisBasicImporter(
+css::uno::Referencecss::uno::XComponentContext const  xContext)
+SAL_THROW((css::uno::Exception));
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlscript/source/misc/unoservices.cxx 
b/xmlscript/source/misc/unoservices.cxx
index 78f1654..2b9e43c 100644
--- a/xmlscript/source/misc/unoservices.cxx
+++ b/xmlscript/source/misc/unoservices.cxx
@@ -19,41 +19,13 @@
 
 #include cppuhelper/implementationentry.hxx
 
+#include unoservices.hxx
+
 using namespace ::rtl;
 using namespace ::com::sun::star::uno;
 
 namespace xmlscript
 {
-Sequence OUString  SAL_CALL 
getSupportedServiceNames_DocumentHandlerImpl();
-OUString SAL_CALL getImplementationName_DocumentHandlerImpl();
-Reference XInterface  SAL_CALL create_DocumentHandlerImpl(
-Reference XComponentContext  const  xContext )
-SAL_THROW( (Exception) );
-
-Sequence OUString  SAL_CALL getSupportedServiceNames_XMLBasicExporter();
-OUString SAL_CALL getImplementationName_XMLBasicExporter();
-Reference XInterface  SAL_CALL create_XMLBasicExporter(
-Reference XComponentContext  const  xContext )
-SAL_THROW( (Exception) );
-
-Sequence OUString  SAL_CALL 

[Libreoffice-commits] core.git: xmlscript/source

2014-02-26 Thread Alexander Wilms
 xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a22ae26668b260edb7f724ffcff0abc935b6d64a
Author: Alexander Wilms f.alexander.wi...@gmail.com
Date:   Tue Feb 25 23:17:18 2014 +0100

Remove visual noise from xmlscript

Change-Id: Id984fe846f28eba50f0fd480dca235482d150dd9
Reviewed-on: https://gerrit.libreoffice.org/8347
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
index 47ee825a..5691a50 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
@@ -105,7 +105,7 @@ void Frame::endElement()
 _events.clear();
 }
 
-//===
+
 Reference xml::input::XElement  MultiPage::startChildElement(
 sal_Int32 nUid, OUString const  rLocalName,
 Reference xml::input::XAttributes  const  xAttributes )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: xmlscript/source

2013-08-16 Thread Jelle van der Waa
 xmlscript/source/xmldlg_imexp/xmldlg_export.cxx |   35 
 xmlscript/source/xmldlg_imexp/xmldlg_import.cxx |   17 ++-
 2 files changed, 9 insertions(+), 43 deletions(-)

New commits:
commit d812281f96b03866c5d367380409c266b9bb8d05
Author: Jelle van der Waa je...@vdwaa.nl
Date:   Mon Aug 12 22:11:38 2013 +0200

fdo#57950: Remove some chained appends in xmlscript

Change-Id: I7061f59077a75b879ad42179b839894747f5ba5b
Reviewed-on: https://gerrit.libreoffice.org/5377
Reviewed-by: Tor Lillqvist t...@iki.fi
Tested-by: Tor Lillqvist t...@iki.fi

diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
index 450d18e..0f7c5b0 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
@@ -80,41 +80,25 @@ Reference xml::sax::XAttributeList  Style::createElement()
 // background-color
 if (_set  0x1)
 {
-OUStringBuffer buf( 16 );
-buf.append( (sal_Unicode)'0' );
-buf.append( (sal_Unicode)'x' );
-buf.append( OUString::valueOf( 
(sal_Int64)(sal_uInt64)_backgroundColor, 16 ) );
-pStyle-addAttribute( XMLNS_DIALOGS_PREFIX :background-color, 
buf.makeStringAndClear() );
+pStyle-addAttribute( XMLNS_DIALOGS_PREFIX :background-color, 0x + 
OUString::number(_backgroundColor,16));
 }
 
 // text-color
 if (_set  0x2)
 {
-OUStringBuffer buf( 16 );
-buf.append( (sal_Unicode)'0' );
-buf.append( (sal_Unicode)'x' );
-buf.append( OUString::valueOf( (sal_Int64)(sal_uInt64)_textColor, 16 ) 
);
-pStyle-addAttribute( XMLNS_DIALOGS_PREFIX :text-color, 
buf.makeStringAndClear() );
+pStyle-addAttribute( XMLNS_DIALOGS_PREFIX :text-color, 0x + 
OUString::number(_textColor,16));
 }
 
 // textline-color
 if (_set  0x20)
 {
-OUStringBuffer buf( 16 );
-buf.append( (sal_Unicode)'0' );
-buf.append( (sal_Unicode)'x' );
-buf.append( OUString::valueOf( (sal_Int64)(sal_uInt64)_textLineColor, 
16 ) );
-pStyle-addAttribute( XMLNS_DIALOGS_PREFIX :textline-color, 
buf.makeStringAndClear() );
+pStyle-addAttribute( XMLNS_DIALOGS_PREFIX :textline-color, 0x + 
OUString::number(_textLineColor,16));
 }
 
 // fill-color
 if (_set  0x10)
 {
-OUStringBuffer buf( 16 );
-buf.append( (sal_Unicode)'0' );
-buf.append( (sal_Unicode)'x' );
-buf.append( OUString::valueOf( (sal_Int64)(sal_uInt64)_fillColor, 16 ) 
);
-pStyle-addAttribute( XMLNS_DIALOGS_PREFIX :fill-color, 
buf.makeStringAndClear() );
+pStyle-addAttribute( XMLNS_DIALOGS_PREFIX :fill-color, 0x + 
OUString::number(_fillColor,16));
 }
 
 // border
@@ -132,10 +116,7 @@ Reference xml::sax::XAttributeList  
Style::createElement()
 pStyle-addAttribute( XMLNS_DIALOGS_PREFIX :border, simple );
 break;
 case BORDER_SIMPLE_COLOR: {
-OUStringBuffer buf;
-buf.appendAscii( 0x );
-buf.append( OUString::valueOf((sal_Int64)(sal_uInt64)_borderColor, 
16 ) );
-pStyle-addAttribute( XMLNS_DIALOGS_PREFIX :border, 
buf.makeStringAndClear() );
+pStyle-addAttribute( XMLNS_DIALOGS_PREFIX :border, 0x + 
OUString::number(_borderColor,16));
 break;
 }
 default:
@@ -535,11 +516,7 @@ void ElementDescriptor::readHexLongAttr( OUString const  
rPropName, OUString co
 Any a( _xProps-getPropertyValue( rPropName ) );
 if (a.getValueTypeClass() == TypeClass_LONG)
 {
-OUStringBuffer buf( 16 );
-buf.append( (sal_Unicode)'0' );
-buf.append( (sal_Unicode)'x' );
-buf.append( OUString::valueOf( (sal_Int64)(sal_uInt64)*(sal_uInt32 
*)a.getValue(), 16 ) );
-addAttribute( rAttrName, buf.makeStringAndClear() );
+addAttribute( rAttrName, 0x + 
OUString::number((sal_Int64)(sal_uInt64)*(sal_uInt32 *)a.getValue(),16)  );
 }
 }
 }
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
index b05ea5b..ef41489 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
@@ -1444,11 +1444,7 @@ void ImportContext::importEvents(
 if (getStringAttr( aLocation, location, 
xAttributes, _pImport-XMLNS_SCRIPT_UID ))
 {
 // prepend location
-OUStringBuffer buf;
-buf.append( aLocation );
-buf.append( (sal_Unicode)':' );
-buf.append( descr.ScriptCode );
-descr.ScriptCode = buf.makeStringAndClear();
+descr.ScriptCode = aLocation + : + 
descr.ScriptCode;
 }
 

[Libreoffice-commits] core.git: xmlscript/source

2013-08-05 Thread Lionel Elie Mamane
 xmlscript/source/xmldlg_imexp/exp_share.hxx|4 +
 xmlscript/source/xmldlg_imexp/imp_share.hxx|6 ++
 xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx |   12 ++--
 xmlscript/source/xmldlg_imexp/xmldlg_export.cxx|   56 +
 xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx |   12 ++--
 xmlscript/source/xmldlg_imexp/xmldlg_import.cxx|   38 ++
 6 files changed, 116 insertions(+), 12 deletions(-)

New commits:
commit 3b388abc1e9d75a045cc0f6ca9306ff3336251bc
Author: Lionel Elie Mamane lio...@mamane.lu
Date:   Mon Aug 5 19:18:20 2013 +0200

Adapt Dialog XML import/export code

to:
 commit 8ee69b0ba13f74d1515fac71df92947eb6328ab1

 fdo#67235 adapt form control code to time nanosecond API change, step 3.

Change-Id: I57b549c9c1379154173bb50463171a60ce35ca0c

diff --git a/xmlscript/source/xmldlg_imexp/exp_share.hxx 
b/xmlscript/source/xmldlg_imexp/exp_share.hxx
index 3b836de6..eb94eff 100644
--- a/xmlscript/source/xmldlg_imexp/exp_share.hxx
+++ b/xmlscript/source/xmldlg_imexp/exp_share.hxx
@@ -137,8 +137,12 @@ public:
 OUString const  rPropName, OUString const  rAttrName );
 void readImagePositionAttr(
 OUString const  rPropName, OUString const  rAttrName );
+void readDateAttr(
+OUString const  rPropName, OUString const  rAttrName );
 void readDateFormatAttr(
 OUString const  rPropName, OUString const  rAttrName );
+void readTimeAttr(
+OUString const  rPropName, OUString const  rAttrName );
 void readTimeFormatAttr(
 OUString const  rPropName, OUString const  rAttrName );
 void readOrientationAttr(
diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx 
b/xmlscript/source/xmldlg_imexp/imp_share.hxx
index 2df45c0..dfea149 100644
--- a/xmlscript/source/xmldlg_imexp/imp_share.hxx
+++ b/xmlscript/source/xmldlg_imexp/imp_share.hxx
@@ -444,9 +444,15 @@ public:
 bool importImagePositionProperty(
 OUString const  rPropName, OUString const  rAttrName,
 css::uno::Referencecss::xml::input::XAttributes const  xAttributes 
);
+bool importDateProperty(
+OUString const  rPropName, OUString const  rAttrName,
+css::uno::Referencecss::xml::input::XAttributes const  xAttributes 
);
 bool importDateFormatProperty(
 OUString const  rPropName, OUString const  rAttrName,
 css::uno::Referencecss::xml::input::XAttributes const  xAttributes 
);
+bool importTimeProperty(
+OUString const  rPropName, OUString const  rAttrName,
+css::uno::Referencecss::xml::input::XAttributes const  xAttributes 
);
 bool importTimeFormatProperty(
 OUString const  rPropName, OUString const  rAttrName,
 css::uno::Referencecss::xml::input::XAttributes const  xAttributes 
);
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
index eb2ed75..84f2f16 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
@@ -737,9 +737,9 @@ void ElementDescriptor::readDateFieldModel( StyleBag * 
all_styles )
 readBoolAttr( StrictFormat, XMLNS_DIALOGS_PREFIX :strict-format );
 readDateFormatAttr( DateFormat, XMLNS_DIALOGS_PREFIX :date-format );
 readBoolAttr( DateShowCentury, XMLNS_DIALOGS_PREFIX :show-century );
-readLongAttr( Date, XMLNS_DIALOGS_PREFIX :value );
-readLongAttr( DateMin, XMLNS_DIALOGS_PREFIX :value-min );
-readLongAttr( DateMax, XMLNS_DIALOGS_PREFIX :value-max );
+readDateAttr( Date, XMLNS_DIALOGS_PREFIX :value );
+readDateAttr( DateMin, XMLNS_DIALOGS_PREFIX :value-min );
+readDateAttr( DateMax, XMLNS_DIALOGS_PREFIX :value-max );
 readBoolAttr( Spin, XMLNS_DIALOGS_PREFIX :spin );
 if (extract_throwbool( _xProps-getPropertyValue( Repeat ) ))
 readLongAttr( RepeatDelay, XMLNS_DIALOGS_PREFIX :repeat, true /* 
force */ );
@@ -815,9 +815,9 @@ void ElementDescriptor::readTimeFieldModel( StyleBag * 
all_styles )
 readBoolAttr( HideInactiveSelection, XMLNS_DIALOGS_PREFIX 
:hide-inactive-selection );
 readBoolAttr( StrictFormat, XMLNS_DIALOGS_PREFIX :strict-format );
 readTimeFormatAttr( TimeFormat, XMLNS_DIALOGS_PREFIX :time-format );
-readLongAttr( Time, XMLNS_DIALOGS_PREFIX :value );
-readLongAttr( TimeMin, XMLNS_DIALOGS_PREFIX :value-min );
-readLongAttr( TimeMax, XMLNS_DIALOGS_PREFIX :value-max );
+readTimeAttr( Time, XMLNS_DIALOGS_PREFIX :value );
+readTimeAttr( TimeMin, XMLNS_DIALOGS_PREFIX :value-min );
+readTimeAttr( TimeMax, XMLNS_DIALOGS_PREFIX :value-max );
 readBoolAttr( Spin, XMLNS_DIALOGS_PREFIX :spin );
 if (extract_throwbool( _xProps-getPropertyValue( Repeat ) ))
 readLongAttr( RepeatDelay, XMLNS_DIALOGS_PREFIX :repeat, true /* 
force */ );
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
index