[Libreoffice-commits] core.git: 4 commits - dbaccess/source sax/source xmlscript/source
Lionel Elie Mamane
lionel at mamane.lu
Thu Feb 5 12:46:03 PST 2015
dbaccess/source/ui/dlg/tablespage.cxx | 1
sax/source/expatwrap/sax_expat.cxx | 1
xmlscript/source/xmldlg_imexp/imp_share.hxx | 37 +++++---
xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx | 90 ++++++++++++++++-----
4 files changed, 98 insertions(+), 31 deletions(-)
New commits:
commit f1ffba89214e3250a5781feb90e4c100d04038b9
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date: Thu Feb 5 21:35:04 2015 +0100
constify
Change-Id: Id319c001b399a3105d6c9f87a58168f956ad46c3
diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx b/xmlscript/source/xmldlg_imexp/imp_share.hxx
index 7fe3505..cec6fe5 100644
--- a/xmlscript/source/xmldlg_imexp/imp_share.hxx
+++ b/xmlscript/source/xmldlg_imexp/imp_share.hxx
@@ -203,12 +203,12 @@ class ElementBase
: public ::cppu::WeakImplHelper1< css::xml::input::XElement >
{
protected:
- DialogImport * _pImport;
- ElementBase * _pParent;
+ DialogImport * const _pImport;
+ ElementBase * const _pParent;
- sal_Int32 _nUid;
- OUString _aLocalName;
- css::uno::Reference< css::xml::input::XAttributes > _xAttributes;
+ const sal_Int32 _nUid;
+ const OUString _aLocalName;
+ const css::uno::Reference< css::xml::input::XAttributes > _xAttributes;
public:
ElementBase(
@@ -381,9 +381,9 @@ public:
class ImportContext
{
protected:
- DialogImport * _pImport;
- css::uno::Reference< css::beans::XPropertySet > _xControlModel;
- OUString _aId;
+ DialogImport * const _pImport;
+ const css::uno::Reference< css::beans::XPropertySet > _xControlModel;
+ const OUString _aId;
public:
inline ImportContext(
commit e57febdb7fbe34d6548f780336cf9ee4a729cb5c
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date: Thu Feb 5 21:34:52 2015 +0100
proper indentation
Change-Id: Ifc7577f46625562183ed3ee2273f28b9dcfc13df
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
index 8c3beed..7a317e8 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
@@ -1163,29 +1163,29 @@ void TitledBoxElement::endElement()
throw (xml::sax::SAXException, RuntimeException, std::exception)
{
{
- ControlImportContext ctx(_pImport, getControlId( _xAttributes ), "com.sun.star.awt.UnoControlGroupBoxModel" );
- Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
+ ControlImportContext ctx(_pImport, getControlId( _xAttributes ), "com.sun.star.awt.UnoControlGroupBoxModel" );
+ Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
- Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
- if (xStyle.is())
- {
- StyleElement * pStyle = static_cast< StyleElement * >( xStyle.get () );
- pStyle->importTextColorStyle( xControlModel );
- pStyle->importTextLineColorStyle( xControlModel );
- pStyle->importFontStyle( xControlModel );
- }
+ Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
+ if (xStyle.is())
+ {
+ StyleElement * pStyle = static_cast< StyleElement * >( xStyle.get () );
+ pStyle->importTextColorStyle( xControlModel );
+ pStyle->importTextLineColorStyle( xControlModel );
+ pStyle->importFontStyle( xControlModel );
+ }
- ctx.importDefaults( 0, 0, _xAttributes ); // inherited from BulletinBoardElement
+ ctx.importDefaults( 0, 0, _xAttributes ); // inherited from BulletinBoardElement
- if (!_label.isEmpty())
- {
- xControlModel->setPropertyValue( "Label", makeAny( _label ) );
- }
+ if (!_label.isEmpty())
+ {
+ xControlModel->setPropertyValue( "Label", makeAny( _label ) );
+ }
- ctx.importEvents( _events );
- // avoid ring-reference:
- // vector< event elements > holding event elements holding this (via _pParent)
- _events.clear();
+ ctx.importEvents( _events );
+ // avoid ring-reference:
+ // vector< event elements > holding event elements holding this (via _pParent)
+ _events.clear();
ctx.finish();
}
commit 87934ed763b62d6e4b1245d6fe93befb6640f8ca
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date: Thu Feb 5 21:32:12 2015 +0100
destructors are not allowed to throw
so move potentially throwing call to a manually called finish()
additionally don't make it leak something that is not a RuntimeException,
the caller does not expect it.
Change-Id: I8b19585ae197f5ac8625dc85d4c4860a1c11b262
diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx
index df1870e..2aa3041 100644
--- a/sax/source/expatwrap/sax_expat.cxx
+++ b/sax/source/expatwrap/sax_expat.cxx
@@ -31,6 +31,7 @@
#include <com/sun/star/xml/sax/XParser.hpp>
#include <com/sun/star/xml/sax/SAXParseException.hpp>
#include <com/sun/star/io/XSeekable.hpp>
+#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
#include <cppuhelper/weak.hxx>
#include <cppuhelper/implbase3.hxx>
diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx b/xmlscript/source/xmldlg_imexp/imp_share.hxx
index 16ef33d..7fe3505 100644
--- a/xmlscript/source/xmldlg_imexp/imp_share.hxx
+++ b/xmlscript/source/xmldlg_imexp/imp_share.hxx
@@ -38,6 +38,8 @@
#include <com/sun/star/awt/FontRelief.hpp>
#include <com/sun/star/xml/input/XRoot.hpp>
#include <com/sun/star/script/XLibraryContainer.hpp>
+#include <com/sun/star/container/ElementExistException.hpp>
+#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
#include <osl/diagnose.h>
#include <vector>
#include <boost/shared_ptr.hpp>
@@ -495,10 +497,21 @@ public:
{}
inline ~ControlImportContext()
{
- _pImport->_xDialogModel->insertByName(
- _aId, css::uno::makeAny(
- css::uno::Reference<css::awt::XControlModel>::query(
- _xControlModel ) ) );
+ }
+
+ inline void finish() throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception)
+ {
+ try
+ {
+ _pImport->_xDialogModel->insertByName(
+ _aId, css::uno::makeAny(
+ css::uno::Reference<css::awt::XControlModel>::query(
+ _xControlModel ) ) );
+ }
+ catch(const css::container::ElementExistException &e)
+ {
+ throw css::lang::WrappedTargetRuntimeException("", e.Context, makeAny(e));
+ }
}
};
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
index 6f2c6ea..8c3beed 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
@@ -101,6 +101,8 @@ void Frame::endElement()
// avoid ring-reference:
// vector< event elements > holding event elements holding this (via _pParent)
_events.clear();
+
+ ctx.finish();
}
@@ -156,6 +158,8 @@ void MultiPage::endElement()
// avoid ring-reference:
// vector< event elements > holding event elements holding this (via _pParent)
_events.clear();
+
+ ctx.finish();
}
Reference< xml::input::XElement > Page::startChildElement(
@@ -208,6 +212,8 @@ void Page::endElement()
// avoid ring-reference:
// vector< event elements > holding event elements holding this (via _pParent)
_events.clear();
+
+ ctx.finish();
}
// progessmeter
@@ -252,6 +258,8 @@ void ProgressBarElement::endElement()
// avoid ring-reference:
// vector< event elements > holding event elements holding this (via _pParent)
_events.clear();
+
+ ctx.finish();
}
// scrollbar
@@ -302,6 +310,8 @@ void ScrollBarElement::endElement()
// avoid ring-reference:
// vector< event elements > holding event elements holding this (via _pParent)
_events.clear();
+
+ ctx.finish();
}
// spinbutton
@@ -350,6 +360,8 @@ void SpinButtonElement::endElement()
// avoid ring-reference:
// vector< event elements > holding event elements holding this (via _pParent)
_events.clear();
+
+ ctx.finish();
}
// fixedline
@@ -390,6 +402,8 @@ void FixedLineElement::endElement()
// avoid ring-reference:
// vector< event elements > holding event elements holding this (via _pParent)
_events.clear();
+
+ ctx.finish();
}
// patternfield
@@ -438,6 +452,8 @@ void PatternFieldElement::endElement()
// avoid ring-reference:
// vector< event elements > holding event elements holding this (via _pParent)
_events.clear();
+
+ ctx.finish();
}
// formattedfield
@@ -566,6 +582,8 @@ void FormattedFieldElement::endElement()
// avoid ring-reference:
// vector< event elements > holding event elements holding this (via _pParent)
_events.clear();
+
+ ctx.finish();
}
// timefield
@@ -620,6 +638,8 @@ void TimeFieldElement::endElement()
// avoid ring-reference:
// vector< event elements > holding event elements holding this (via _pParent)
_events.clear();
+
+ ctx.finish();
}
// numericfield
@@ -674,6 +694,8 @@ void NumericFieldElement::endElement()
// avoid ring-reference:
// vector< event elements > holding event elements holding this (via _pParent)
_events.clear();
+
+ ctx.finish();
}
// datefield
@@ -729,6 +751,8 @@ void DateFieldElement::endElement()
// avoid ring-reference:
// vector< event elements > holding event elements holding this (via _pParent)
_events.clear();
+
+ ctx.finish();
}
// currencyfield
@@ -785,6 +809,8 @@ void CurrencyFieldElement::endElement()
// avoid ring-reference:
// vector< event elements > holding event elements holding this (via _pParent)
_events.clear();
+
+ ctx.finish();
}
// filecontrol
@@ -829,6 +855,8 @@ void FileControlElement::endElement()
// avoid ring-reference:
// vector< event elements > holding event elements holding this (via _pParent)
_events.clear();
+
+ ctx.finish();
}
// treecontrol
@@ -875,6 +903,8 @@ void TreeControlElement::endElement()
// avoid ring-reference:
// vector< event elements > holding event elements holding this (via _pParent)
_events.clear();
+
+ ctx.finish();
}
// imagecontrol
@@ -917,6 +947,8 @@ void ImageControlElement::endElement()
// avoid ring-reference:
// vector< event elements > holding event elements holding this (via _pParent)
_events.clear();
+
+ ctx.finish();
}
// textfield
@@ -964,6 +996,8 @@ void TextElement::endElement()
// avoid ring-reference:
// vector< event elements > holding event elements holding this (via _pParent)
_events.clear();
+
+ ctx.finish();
}
// FixedHyperLink
@@ -1013,6 +1047,8 @@ void FixedHyperLinkElement::endElement()
// avoid ring-reference:
// vector< event elements > holding event elements holding this (via _pParent)
_events.clear();
+
+ ctx.finish();
}
// edit
@@ -1076,6 +1112,8 @@ void TextFieldElement::endElement()
// avoid ring-reference:
// vector< event elements > holding event elements holding this (via _pParent)
_events.clear();
+
+ ctx.finish();
}
// titledbox
@@ -1148,6 +1186,8 @@ void TitledBoxElement::endElement()
// avoid ring-reference:
// vector< event elements > holding event elements holding this (via _pParent)
_events.clear();
+
+ ctx.finish();
}
// create radios AFTER group box!
@@ -1194,6 +1234,8 @@ void TitledBoxElement::endElement()
// avoid ring-reference:
// vector< event elements > holding event elements holding this (via _pParent)
radioEvents.clear();
+
+ ctx.finish();
}
// avoid ring-reference:
// vector< radio elements > holding radio elements holding this (via _pParent)
@@ -1290,6 +1332,8 @@ void RadioGroupElement::endElement()
// avoid ring-reference:
// vector< event elements > holding event elements holding this (via _pParent)
radioEvents.clear();
+
+ ctx.finish();
}
// avoid ring-reference:
// vector< radio elements > holding radio elements holding this (via _pParent)
@@ -1415,6 +1459,8 @@ void MenuListElement::endElement()
// avoid ring-reference:
// vector< event elements > holding event elements holding this (via _pParent)
_events.clear();
+
+ ctx.finish();
}
// combobox
@@ -1482,6 +1528,8 @@ void ComboBoxElement::endElement()
// avoid ring-reference:
// vector< event elements > holding event elements holding this (via _pParent)
_events.clear();
+
+ ctx.finish();
}
// checkbox
@@ -1548,6 +1596,8 @@ void CheckBoxElement::endElement()
// avoid ring-reference:
// vector< event elements > holding event elements holding this (via _pParent)
_events.clear();
+
+ ctx.finish();
}
// button
@@ -1612,6 +1662,8 @@ void ButtonElement::endElement()
// avoid ring-reference:
// vector< event elements > holding event elements holding this (via _pParent)
_events.clear();
+
+ ctx.finish();
}
// bulletinboard
commit f40b11f901d440b6d259c5c030d78f1ac2705647
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date: Thu Feb 5 21:29:29 2015 +0100
tdf#89070 Table filter dialog: properly initialise OTableTreeListBox
regression from .ui conversion:
commit 5c72a213c7c4b588d0c1e0884ff2c46c22425faf
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jan 21 14:41:16 2014 +0000
convert table filter page to .ui
Change-Id: I7bfb7698e2a5303b492766fba564c7b9033bcc52
Change-Id: Ic7d41d64d4c15eabf7b7f83a17482c473154434a
diff --git a/dbaccess/source/ui/dlg/tablespage.cxx b/dbaccess/source/ui/dlg/tablespage.cxx
index 0c85536..062983e 100644
--- a/dbaccess/source/ui/dlg/tablespage.cxx
+++ b/dbaccess/source/ui/dlg/tablespage.cxx
@@ -79,6 +79,7 @@ namespace dbaui
get(m_pTables, "TablesFilterPage");
get(m_pTablesList, "treeview");
+ m_pTablesList->init(true);
m_pTablesList->set_width_request(56 * m_pTablesList->approximate_char_width());
m_pTablesList->set_height_request(12 * m_pTablesList->GetTextHeight());
More information about the Libreoffice-commits
mailing list