[Libreoffice-commits] core.git: dbaccess/source editeng/source slideshow/source svx/source sw/source vcl/unx

2023-12-04 Thread Julien Nabet (via logerrit)
 dbaccess/source/core/api/OptimisticSet.cxx   |4 +++-
 editeng/source/misc/svxacorr.cxx |4 +++-
 slideshow/source/engine/box2dtools.cxx   |8 ++--
 svx/source/form/fmshimp.cxx  |3 +--
 sw/source/filter/ww8/docxattributeoutput.cxx |4 +++-
 vcl/unx/generic/fontmanager/fontmanager.cxx  |1 +
 6 files changed, 17 insertions(+), 7 deletions(-)

New commits:
commit b50da6f3a9109fc1d4468c15aa7d5c68773ec199
Author: Julien Nabet 
AuthorDate: Mon Dec 4 11:31:36 2023 +0100
Commit: Julien Nabet 
CommitDate: Mon Dec 4 18:00:43 2023 +0100

cid#1546275 Using invalid iterator

and :

cid#1546219 Using invalid iterator
cid#1546088 Using invalid iterator
cid#1546070 Using invalid iterator
cid#1546061 Using invalid iterator
cid#1546055 Using invalid iterator
cid#1546049 Using invalid iterator

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

diff --git a/dbaccess/source/core/api/OptimisticSet.cxx 
b/dbaccess/source/core/api/OptimisticSet.cxx
index d1d70955f674..2a89974794ad 100644
--- a/dbaccess/source/core/api/OptimisticSet.cxx
+++ b/dbaccess/source/core/api/OptimisticSet.cxx
@@ -353,7 +353,9 @@ void OptimisticSet::executeDelete(const ORowSetRow& 
_rDeleteRow,const OUString&
 if(m_bDeleted)
 {
 sal_Int32 nBookmark = 
::comphelper::getINT32((*_rDeleteRow)[0].getAny());
-if(m_aKeyIter == m_aKeyMap.find(nBookmark) && m_aKeyIter != 
m_aKeyMap.end())
+const auto iter = m_aKeyMap.find(nBookmark);
+assert(iter != m_aKeyMap.end());
+if(m_aKeyIter == iter && m_aKeyIter != m_aKeyMap.end())
 ++m_aKeyIter;
 m_aKeyMap.erase(nBookmark);
 m_bDeleted = true;
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 61bc805993ce..8a28ccf42ada 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -2077,7 +2077,9 @@ bool SvxAutoCorrect::FindInWordStartExceptList( 
LanguageType eLang,
 CreateLanguageFile(aLanguageTag, false))
 {
 //the language is available - so bring it on
-auto& rList = m_aLangTable.find(aLanguageTag)->second;
+const auto iter = m_aLangTable.find(aLanguageTag);
+assert(iter != m_aLangTable.end());
+auto& rList = iter->second;
 if(rList.GetWordStartExceptList()->find(sWord) != 
rList.GetWordStartExceptList()->end() )
 return true;
 }
diff --git a/slideshow/source/engine/box2dtools.cxx 
b/slideshow/source/engine/box2dtools.cxx
index 97e172a4eb4e..161bbe8c37f4 100644
--- a/slideshow/source/engine/box2dtools.cxx
+++ b/slideshow/source/engine/box2dtools.cxx
@@ -323,7 +323,9 @@ void box2DWorld::setShapeAngleByAngularVelocity(
 assert(mpBox2DWorld);
 if (fPassedTime > 0) // this only makes sense if there was an advance in 
time
 {
-Box2DBodySharedPtr pBox2DBody = mpXShapeToBodyMap.find(xShape)->second;
+const auto iter = mpXShapeToBodyMap.find(xShape);
+assert(iter != mpXShapeToBodyMap.end());
+Box2DBodySharedPtr pBox2DBody = iter->second;
 pBox2DBody->setAngleByAngularVelocity(fAngle, fPassedTime);
 }
 }
@@ -561,7 +563,9 @@ void box2DWorld::queueShapeAnimationEndUpdate(
 
 void box2DWorld::alertPhysicsAnimationEnd(const 
slideshow::internal::ShapeSharedPtr& pShape)
 {
-Box2DBodySharedPtr pBox2DBody = 
mpXShapeToBodyMap.find(pShape->getXShape())->second;
+const auto iter = mpXShapeToBodyMap.find(pShape->getXShape());
+assert(iter != mpXShapeToBodyMap.end());
+Box2DBodySharedPtr pBox2DBody = iter->second;
 // since the animation ended make the body static
 makeBodyStatic(pBox2DBody);
 pBox2DBody->setRestitution(fDefaultStaticBodyBounciness);
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index dd71f6999ade..a71f78f2296b 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -3380,8 +3380,7 @@ void FmXFormShell::CreateExternalView_Lock()
 
 // value list
 MapUString2UstringSeq::const_iterator aCurrentValueList = 
aRadioValueLists.find(rCtrlSource.first);
-DBG_ASSERT(aCurrentValueList != aRadioValueLists.end(),
-"FmXFormShell::CreateExternalView : inconsistent radio 
descriptions !");
+assert(aCurrentValueList != aRadioValueLists.end());
 pListBoxDescription->Name = FM_PROP_STRINGITEMLIST;
 pListBoxDescription->Value <<= (*aCurrentValueList).second;
 ++pListBoxDescription;
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 8949ffe58a77..d84549d43066 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -315,7 

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

2023-11-10 Thread Noel Grandin (via logerrit)
 dbaccess/source/filter/xml/xmlStyleImport.cxx |4 ++--
 dbaccess/source/filter/xml/xmlStyleImport.hxx |5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit c4216ba557577e8fef4dfc1dc5aa35ea1e1ef082
Author: Noel Grandin 
AuthorDate: Wed Nov 8 18:30:00 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri Nov 10 17:02:24 2023 +0100

loplugin:fieldcast in OTableStyleContext

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

diff --git a/dbaccess/source/filter/xml/xmlStyleImport.cxx 
b/dbaccess/source/filter/xml/xmlStyleImport.cxx
index ddadc5e3b91f..4196860031a0 100644
--- a/dbaccess/source/filter/xml/xmlStyleImport.cxx
+++ b/dbaccess/source/filter/xml/xmlStyleImport.cxx
@@ -41,7 +41,7 @@ using namespace xmloff::token;
 
 
 OTableStyleContext::OTableStyleContext( ODBFilter& rImport,
-SvXMLStylesContext& rStyles, XmlStyleFamily nFamily )
+OTableStylesContext& rStyles, XmlStyleFamily nFamily )
 :XMLPropStyleContext( rImport, rStyles, nFamily, false )
 ,pStyles()
 ,m_nNumberFormat(-1)
@@ -101,7 +101,7 @@ void OTableStyleContext::SetDefaults()
 
 void OTableStyleContext::AddProperty(const sal_Int16 nContextID, const 
uno::Any& rValue)
 {
-sal_Int32 nIndex(static_cast(pStyles)->GetIndex(nContextID));
+sal_Int32 nIndex(pStyles->GetIndex(nContextID));
 OSL_ENSURE(nIndex != -1, "Property not found in Map");
 XMLPropertyState aPropState(nIndex, rValue);
 GetProperties().push_back(aPropState); // has to be inserted in a sort 
order later
diff --git a/dbaccess/source/filter/xml/xmlStyleImport.hxx 
b/dbaccess/source/filter/xml/xmlStyleImport.hxx
index d3fc001b03d5..7f6c9932dac7 100644
--- a/dbaccess/source/filter/xml/xmlStyleImport.hxx
+++ b/dbaccess/source/filter/xml/xmlStyleImport.hxx
@@ -27,12 +27,13 @@
 namespace dbaxml
 {
 class ODBFilter;
+class OTableStylesContext;
 
 class OTableStyleContext : public XMLPropStyleContext
 {
 OUString m_sDataStyleName;
 OUString sPageStyle;
-SvXMLStylesContext* pStyles;
+OTableStylesContext*pStyles;
 sal_Int32   m_nNumberFormat;
 
 ODBFilter& GetOwnImport();
@@ -46,7 +47,7 @@ namespace dbaxml
 
 
 OTableStyleContext( ODBFilter& rImport,
-SvXMLStylesContext& rStyles, XmlStyleFamily nFamily );
+OTableStylesContext& rStyles, XmlStyleFamily nFamily );
 
 virtual ~OTableStyleContext() override;
 


[Libreoffice-commits] core.git: dbaccess/source include/svtools svtools/source

2023-11-09 Thread Yli875 (via logerrit)
 dbaccess/source/ui/misc/UITools.cxx |2 +-
 include/svtools/brwbox.hxx  |8 
 svtools/source/brwbox/brwbox1.cxx   |   14 +++---
 svtools/source/brwbox/brwbox2.cxx   |8 
 svtools/source/brwbox/datwin.cxx|4 ++--
 svtools/source/brwbox/datwin.hxx|   10 +-
 svtools/source/brwbox/editbrowsebox.cxx |2 +-
 7 files changed, 24 insertions(+), 24 deletions(-)

New commits:
commit 38f9bc92401899489c94276f8647a747f17598e1
Author: Yli875 
AuthorDate: Sun Oct 1 22:08:43 2023 -0700
Commit: Hossein 
CommitDate: Thu Nov 9 13:45:47 2023 +0100

tdf#114441 Convert sal_uLong to better integer types

The maximum value of the width in BrowserColumn is LONG_MAX. tools::Long
value range is the closest among other integer types. It is widely used
in these files. Also, other parameter types and return types have been
changed to match the width type.

Change-Id: Ia8b941a8ea02075a0d9b4d44675d5809005738bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157477
Tested-by: Hossein 
Reviewed-by: Hossein 

diff --git a/dbaccess/source/ui/misc/UITools.cxx 
b/dbaccess/source/ui/misc/UITools.cxx
index a07d588be2a9..483afced1082 100644
--- a/dbaccess/source/ui/misc/UITools.cxx
+++ b/dbaccess/source/ui/misc/UITools.cxx
@@ -929,7 +929,7 @@ void notifySystemWindow(vcl::Window const * _pWindow, 
vcl::Window* _pToRegister,
 void adjustBrowseBoxColumnWidth( ::svt::EditBrowseBox* _pBox, sal_uInt16 
_nColId )
 {
 sal_Int32 nColSize = -1;
-sal_uInt32 nDefaultWidth = _pBox->GetDefaultColumnWidth( 
_pBox->GetColumnTitle( _nColId ) );
+::tools::Long nDefaultWidth = _pBox->GetDefaultColumnWidth( 
_pBox->GetColumnTitle( _nColId ) );
 if ( nDefaultWidth != _pBox->GetColumnWidth( _nColId ) )
 {
 Size aSizeMM = _pBox->PixelToLogic( Size( _pBox->GetColumnWidth( 
_nColId ), 0 ), MapMode( MapUnit::MapMM ) );
diff --git a/include/svtools/brwbox.hxx b/include/svtools/brwbox.hxx
index 2bdd2b910465..42155eb1f45e 100644
--- a/include/svtools/brwbox.hxx
+++ b/include/svtools/brwbox.hxx
@@ -510,12 +510,12 @@ public:
 { Control::SetFont( rNewFont ); }
 
 // inserting, changing, removing and freezing of columns
-voidInsertHandleColumn( sal_uLong nWidth );
+voidInsertHandleColumn( tools::Long nWidth );
 voidInsertDataColumn( sal_uInt16 nItemId, const OUString& 
rText,
 tools::Long nSize, HeaderBarItemBits nBits 
= HeaderBarItemBits::STDSTYLE,
 sal_uInt16 nPos = HEADERBAR_APPEND );
 voidSetColumnTitle( sal_uInt16 nColumnId, const OUString 
 );
-voidSetColumnWidth( sal_uInt16 nColumnId, sal_uLong nWidth );
+voidSetColumnWidth( sal_uInt16 nColumnId, tools::Long nWidth );
 voidSetColumnPos( sal_uInt16 nColumnId, sal_uInt16 nPos );
 voidFreezeColumn( sal_uInt16 nColumnId );
 voidRemoveColumn( sal_uInt16 nColumnId );
@@ -530,7 +530,7 @@ public:
 // access to dynamic values of cursor row
 OUStringGetColumnTitle( sal_uInt16 nColumnId ) const;
 tools::Rectangle   GetFieldRect( sal_uInt16 nColumnId ) const;
-sal_uLong   GetColumnWidth( sal_uInt16 nColumnId ) const;
+tools::Long GetColumnWidth( sal_uInt16 nColumnId ) const;
 sal_uInt16  GetColumnId( sal_uInt16 nPos ) const;
 sal_uInt16  GetColumnPos( sal_uInt16 nColumnId ) const;
 boolIsFrozen( sal_uInt16 nColumnId ) const;
@@ -619,7 +619,7 @@ public:
 
 The width is calculated so that the text fits completely, plus some 
margin.
 */
-sal_uLong GetDefaultColumnWidth( const OUString& _rText ) const;
+tools::Long   GetDefaultColumnWidth( const OUString& _rText ) const;
 
 /** GetCellText returns the text at the given position
 @param  _nRow
diff --git a/svtools/source/brwbox/brwbox1.cxx 
b/svtools/source/brwbox/brwbox1.cxx
index 509d1265649f..cc78b514f7a6 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -272,13 +272,13 @@ const vcl::Font& BrowseBox::GetFont() const
 return pDataWin->GetFont();
 }
 
-sal_uLong BrowseBox::GetDefaultColumnWidth( const OUString& _rText ) const
+tools::Long BrowseBox::GetDefaultColumnWidth( const OUString& _rText ) const
 {
 return pDataWin->GetTextWidth( _rText ) + 
pDataWin->GetTextWidth(OUString('0')) * 4;
 }
 
 
-void BrowseBox::InsertHandleColumn( sal_uLong nWidth )
+void BrowseBox::InsertHandleColumn( tools::Long nWidth )
 {
 
 #if OSL_DEBUG_LEVEL > 0
@@ -570,7 +570,7 @@ void BrowseBox::SetColumnTitle( sal_uInt16 nItemId, const 
OUString& rTitle )
 }
 
 
-void BrowseBox::SetColumnWidth( sal_uInt16 nItemId, sal_uLong nWidth )
+void BrowseBox::SetColumnWidth( sal_uInt16 nItemId, tools::Long nWidth )
 {
 
 // get the position 

[Libreoffice-commits] core.git: dbaccess/source include/sfx2 sc/source sfx2/source

2023-11-09 Thread Caolán McNamara (via logerrit)
 dbaccess/source/core/dataaccess/ModelImpl.cxx |3 +-
 include/sfx2/docmacromode.hxx |4 ++-
 include/sfx2/objsh.hxx|3 ++
 sc/source/core/data/global.cxx|   33 +-
 sfx2/source/doc/docmacromode.cxx  |8 --
 sfx2/source/doc/objmisc.cxx   |8 +-
 sfx2/source/doc/objxtor.cxx   |1 
 sfx2/source/inc/objshimp.hxx  |3 +-
 8 files changed, 56 insertions(+), 7 deletions(-)

New commits:
commit 8ccd386b0793b14859ba2031b34853715606828c
Author: Caolán McNamara 
AuthorDate: Fri Nov 3 17:26:25 2023 +
Commit: Caolán McNamara 
CommitDate: Thu Nov 9 13:29:50 2023 +0100

default to ignoring libreoffice special-purpose protocols in calc hyperlink

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

diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx 
b/dbaccess/source/core/dataaccess/ModelImpl.cxx
index 98023c53c38b..2144a1793e11 100644
--- a/dbaccess/source/core/dataaccess/ModelImpl.cxx
+++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx
@@ -1122,7 +1122,8 @@ bool ODatabaseModelImpl::checkMacrosOnLoading()
 {
 Reference< XInteractionHandler > xInteraction;
 xInteraction = m_aMediaDescriptor.getOrDefault( "InteractionHandler", 
xInteraction );
-return m_aMacroMode.checkMacrosOnLoading( xInteraction );
+const bool bHasMacros = m_aMacroMode.hasMacros();
+return m_aMacroMode.checkMacrosOnLoading(xInteraction, false 
/*HasValidContentSignature*/, bHasMacros);
 }
 
 void ODatabaseModelImpl::resetMacroExecutionMode()
diff --git a/include/sfx2/docmacromode.hxx b/include/sfx2/docmacromode.hxx
index f7213b709b87..688297f26598 100644
--- a/include/sfx2/docmacromode.hxx
+++ b/include/sfx2/docmacromode.hxx
@@ -274,6 +274,8 @@ namespace sfx2
 */
 static bool storageHasMacros( const css::uno::Reference< 
css::embed::XStorage >& _rxStorage );
 
+bool hasMacros() const;
+
 static bool containerHasBasicMacros( const css::uno::Reference< 
css::script::XLibraryContainer >& xContainer );
 /** checks the macro execution mode while loading the document.
 
@@ -301,7 +303,7 @@ namespace sfx2
 bool
 checkMacrosOnLoading(
 const css::uno::Reference< css::task::XInteractionHandler 
>& _rxInteraction,
-bool bHasValidContentSignature = false
+bool bHasValidContentSignature, bool bHasMacros
 );
 
 private:
diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index ea2596658a5d..83fbeba7a230 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -433,6 +433,9 @@ public:
 voidSetMacroCallsSeenWhileLoading();
 boolGetMacroCallsSeenWhileLoading() const;
 
+// true if the document had macros (or similar) on load to trigger warning 
user
+boolGetHadCheckedMacrosOnLoad() const;
+
 const css::uno::Sequence< css::beans::PropertyValue >& 
GetModifyPasswordInfo() const;
 boolSetModifyPasswordInfo( const 
css::uno::Sequence< css::beans::PropertyValue >& aInfo );
 
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index 57c9759f17a4..72323f7630e8 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -29,7 +29,9 @@
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -822,7 +824,7 @@ void ScGlobal::OpenURL(const OUString& rURL, const 
OUString& rTarget, bool bIgno
 
 OUString aUrlName( rURL );
 SfxViewFrame* pFrame = nullptr;
-const SfxObjectShell* pObjShell = nullptr;
+SfxObjectShell* pObjShell = nullptr;
 OUString aReferName;
 if ( pScActiveViewShell )
 {
@@ -856,6 +858,35 @@ void ScGlobal::OpenURL(const OUString& rURL, const 
OUString& rTarget, bool bIgno
 aUrlName = aNewUrlName;
 }
 
+if (INetURLObject(aUrlName).IsExoticProtocol())
+{
+// Default to ignoring exotic protocols
+bool bAllow = false;
+if (pObjShell)
+{
+// If the document had macros when loaded then follow the allowed 
macro-mode
+if (pObjShell->GetHadCheckedMacrosOnLoad())
+bAllow = pObjShell->AdjustMacroMode();
+else // otherwise ask the user, defaulting to cancel
+{
+assert(pFrame && "if we have pObjShell we have pFrame");
+//Reuse URITools::onOpenURI warning string
+std::unique_ptr 
xQueryBox(Application::CreateMessageDialog(pFrame->GetFrameWeld(),
+   
VclMessageType::Warning, 

[Libreoffice-commits] core.git: dbaccess/source include/sfx2 sfx2/source

2023-11-07 Thread Mike Kaganski (via logerrit)
 dbaccess/source/core/dataaccess/ModelImpl.cxx |   24 ++--
 dbaccess/source/core/inc/ModelImpl.hxx|3 ++-
 include/sfx2/docmacromode.hxx |   10 +-
 sfx2/source/doc/docmacromode.cxx  |2 +-
 sfx2/source/doc/objmisc.cxx   |   26 ++
 sfx2/source/inc/objshimp.hxx  |3 ++-
 6 files changed, 34 insertions(+), 34 deletions(-)

New commits:
commit 89780c208837973e21ddbf098d77f4369018ee9e
Author: Mike Kaganski 
AuthorDate: Tue Nov 7 16:05:07 2023 +0300
Commit: Mike Kaganski 
CommitDate: Tue Nov 7 17:41:49 2023 +0100

Pass XInteractionHandler to hasTrustedScriptingSignature instead of a bool

This allows to use the same interaction handler there, as used in
DocumentMacroMode::adjustMacroMode. hasTrustedScriptingSignature
used to find its own interaction handler; and that would conflict
with e.g. ODatabaseModelImpl::adjustMacroMode_AutoReject, which
passes nullptr to adjustMacroMode, with intention to not show any
UI; but with signed macros (see tdf#97694), the UI would still
appear.

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

diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx 
b/dbaccess/source/core/dataaccess/ModelImpl.cxx
index 66f8309ac657..98023c53c38b 100644
--- a/dbaccess/source/core/dataaccess/ModelImpl.cxx
+++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx
@@ -1357,7 +1357,8 @@ SignatureState 
ODatabaseModelImpl::getScriptingSignatureState()
 return m_nScriptingSignatureState;
 }
 
-bool ODatabaseModelImpl::hasTrustedScriptingSignature(bool bAllowUIToAddAuthor)
+bool ODatabaseModelImpl::hasTrustedScriptingSignature(
+const css::uno::Reference& _rxInteraction)
 {
 bool bResult = false;
 
@@ -1389,20 +1390,15 @@ bool 
ODatabaseModelImpl::hasTrustedScriptingSignature(bool bAllowUIToAddAuthor)
   });
 }
 
-if (!bResult && bAllowUIToAddAuthor)
+if (!bResult && _rxInteraction)
 {
-Reference xInteraction;
-xInteraction = 
m_aMediaDescriptor.getOrDefault("InteractionHandler", xInteraction);
-if (xInteraction.is())
-{
-task::DocumentMacroConfirmationRequest aRequest;
-aRequest.DocumentURL = m_sDocFileLocation;
-aRequest.DocumentStorage = xStorage;
-aRequest.DocumentSignatureInformation = aInfo;
-aRequest.DocumentVersion = aODFVersion;
-aRequest.Classification = 
task::InteractionClassification_QUERY;
-bResult = SfxMedium::CallApproveHandler(xInteraction, 
uno::Any(aRequest), true);
-}
+task::DocumentMacroConfirmationRequest aRequest;
+aRequest.DocumentURL = m_sDocFileLocation;
+aRequest.DocumentStorage = xStorage;
+aRequest.DocumentSignatureInformation = aInfo;
+aRequest.DocumentVersion = aODFVersion;
+aRequest.Classification = task::InteractionClassification_QUERY;
+bResult = SfxMedium::CallApproveHandler(_rxInteraction, 
uno::Any(aRequest), true);
 }
 }
 catch (uno::Exception&)
diff --git a/dbaccess/source/core/inc/ModelImpl.hxx 
b/dbaccess/source/core/inc/ModelImpl.hxx
index a582ece2575f..2fc19830ca42 100644
--- a/dbaccess/source/core/inc/ModelImpl.hxx
+++ b/dbaccess/source/core/inc/ModelImpl.hxx
@@ -479,7 +479,8 @@ public:
 virtual bool macroCallsSeenWhileLoading() const override;
 virtual css::uno::Reference< css::document::XEmbeddedScripts > 
getEmbeddedDocumentScripts() const override;
 virtual SignatureState getScriptingSignatureState() override;
-virtual bool hasTrustedScriptingSignature( bool bAllowUIToAddAuthor ) 
override;
+virtual bool hasTrustedScriptingSignature(
+const css::uno::Reference& 
_rxInteraction) override;
 
 // IModifiableDocument
 virtual void storageIsModified() override;
diff --git a/include/sfx2/docmacromode.hxx b/include/sfx2/docmacromode.hxx
index 2a0421aa0c90..f7213b709b87 100644
--- a/include/sfx2/docmacromode.hxx
+++ b/include/sfx2/docmacromode.hxx
@@ -152,10 +152,18 @@ namespace sfx2
 When this happens, this method here should be replaced by a method 
at this
 new class.
 
+@param _rxInteraction
+A handler for interactions which might become necessary to 
trust a correct
+but not yet trusted signature, possibly also adding the author 
certificate to
+trusted list.
+
+If the user needs to be asked, and if this parameter is 
, the most
+defensive assumptions will be made, i.e. false will be 
returned.
+
 @seealso 
 */
 virtual bool
-  

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

2023-10-20 Thread Julien Nabet (via logerrit)
 dbaccess/source/core/inc/object.hxx |   30 --
 1 file changed, 30 deletions(-)

New commits:
commit 46ed432cf4bf31f61d7a2c7974288710fb1f
Author: Julien Nabet 
AuthorDate: Thu Oct 19 22:11:48 2023 +0200
Commit: Julien Nabet 
CommitDate: Fri Oct 20 09:54:35 2023 +0200

dbaccess/source/core/inc/object.hxx unused since initial import

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

diff --git a/dbaccess/source/core/inc/object.hxx 
b/dbaccess/source/core/inc/object.hxx
deleted file mode 100644
index a947f9c57c3e..
--- a/dbaccess/source/core/inc/object.hxx
+++ /dev/null
@@ -1,30 +0,0 @@
-/* -*- 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 .
- */
-
-#pragma once
-
-enum ObjectType
-{
-dbaTable,
-dbaQuery,
-dbaForm,
-dbaReport
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2023-10-19 Thread Julien Nabet (via logerrit)
 dbaccess/source/core/dataaccess/datasource.cxx |1 +
 dbaccess/source/ui/app/AppController.cxx   |8 +++-
 2 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 7f3ab74eb62ec83d6fc4432979654944f27de7b4
Author: Julien Nabet 
AuthorDate: Thu Oct 19 11:13:59 2023 +0200
Commit: Julien Nabet 
CommitDate: Thu Oct 19 18:20:12 2023 +0200

Related tdf#144256: missing removePropertyChangeListener calls in 
AppController

Compare and use same order as in 
dbaccess/source/core/dataaccess/datasource.cxx

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

diff --git a/dbaccess/source/core/dataaccess/datasource.cxx 
b/dbaccess/source/core/dataaccess/datasource.cxx
index 55c161b854d1..eaa580a3a66d 100644
--- a/dbaccess/source/core/dataaccess/datasource.cxx
+++ b/dbaccess/source/core/dataaccess/datasource.cxx
@@ -735,6 +735,7 @@ Reference< XPropertySetInfo >  
ODatabaseSource::getPropertySetInfo()
 return new ::cppu::OPropertyArrayHelper
 {
 {
+// a change here means a change should also been done in 
OApplicationController::disposing()
 { PROPERTY_INFO, PROPERTY_ID_INFO, cppu::UnoType>::get(), css::beans::PropertyAttribute::BOUND },
 { PROPERTY_ISPASSWORDREQUIRED, PROPERTY_ID_ISPASSWORDREQUIRED, 
cppu::UnoType::get(), css::beans::PropertyAttribute::BOUND },
 { PROPERTY_ISREADONLY, PROPERTY_ID_ISREADONLY, 
cppu::UnoType::get(), css::beans::PropertyAttribute::READONLY },
diff --git a/dbaccess/source/ui/app/AppController.cxx 
b/dbaccess/source/ui/app/AppController.cxx
index f9b818db663f..61c0940e98a1 100644
--- a/dbaccess/source/ui/app/AppController.cxx
+++ b/dbaccess/source/ui/app/AppController.cxx
@@ -327,14 +327,20 @@ void SAL_CALL OApplicationController::disposing()
 
 if ( m_xDataSource.is() )
 {
+// Should correspond to ODatabaseSource::createArrayHelper in 
dbaccess/source/core/dataaccess/datasource.cxx
 m_xDataSource->removePropertyChangeListener(OUString(), this);
 m_xDataSource->removePropertyChangeListener(PROPERTY_INFO, this);
-m_xDataSource->removePropertyChangeListener(PROPERTY_URL, this);
 
m_xDataSource->removePropertyChangeListener(PROPERTY_ISPASSWORDREQUIRED, this);
+m_xDataSource->removePropertyChangeListener(PROPERTY_ISREADONLY, 
this);
 
m_xDataSource->removePropertyChangeListener(PROPERTY_LAYOUTINFORMATION, this);
+m_xDataSource->removePropertyChangeListener(PROPERTY_NAME, this);
+
m_xDataSource->removePropertyChangeListener(PROPERTY_NUMBERFORMATSSUPPLIER, 
this);
+m_xDataSource->removePropertyChangeListener(PROPERTY_PASSWORD, 
this);
+m_xDataSource->removePropertyChangeListener(PROPERTY_SETTINGS, 
this);
 
m_xDataSource->removePropertyChangeListener(PROPERTY_SUPPRESSVERSIONCL, this);
 m_xDataSource->removePropertyChangeListener(PROPERTY_TABLEFILTER, 
this);
 
m_xDataSource->removePropertyChangeListener(PROPERTY_TABLETYPEFILTER, this);
+m_xDataSource->removePropertyChangeListener(PROPERTY_URL, this);
 m_xDataSource->removePropertyChangeListener(PROPERTY_USER, this);
 m_xDataSource = nullptr;
 }


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

2023-10-18 Thread Julien Nabet (via logerrit)
 dbaccess/source/core/dataaccess/ModelImpl.cxx  |3 -
 dbaccess/source/core/dataaccess/datasource.cxx |   73 -
 dbaccess/source/core/inc/ModelImpl.hxx |   70 ++-
 3 files changed, 68 insertions(+), 78 deletions(-)

New commits:
commit 1c15934170341bbcfb4671fdbb01c2259265b3e1
Author: Julien Nabet 
AuthorDate: Wed Oct 18 10:45:36 2023 +0200
Commit: Mike Kaganski 
CommitDate: Thu Oct 19 07:45:34 2023 +0200

Related tdf#144256: remove m_pSharedConnectionManager

to only use "m_xSharedConnectionManager".
For this, it required some refactoring but except the removing, logic 
hasn't been changed.

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

diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx 
b/dbaccess/source/core/dataaccess/ModelImpl.cxx
index 3e21289dbe9a..66f8309ac657 100644
--- a/dbaccess/source/core/dataaccess/ModelImpl.cxx
+++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx
@@ -370,7 +370,6 @@ ODatabaseModelImpl::ODatabaseModelImpl( const Reference< 
XComponentContext >& _r
 ,m_bModified(false)
 ,m_bDocumentReadOnly(false)
 ,m_bMacroCallsSeenWhileLoading(false)
-,m_pSharedConnectionManager(nullptr)
 ,m_nControllerLockCount(0)
 {
 // some kind of default
@@ -401,7 +400,6 @@ ODatabaseModelImpl::ODatabaseModelImpl(
 ,m_bModified(false)
 ,m_bDocumentReadOnly(false)
 ,m_bMacroCallsSeenWhileLoading(false)
-,m_pSharedConnectionManager(nullptr)
 ,m_nControllerLockCount(0)
 {
 impl_construct_nothrow();
@@ -624,7 +622,6 @@ void ODatabaseModelImpl::clearConnections()
 }
 }
 
-m_pSharedConnectionManager = nullptr;
 m_xSharedConnectionManager = nullptr;
 }
 
diff --git a/dbaccess/source/core/dataaccess/datasource.cxx 
b/dbaccess/source/core/dataaccess/datasource.cxx
index e2c02d49c818..55c161b854d1 100644
--- a/dbaccess/source/core/dataaccess/datasource.cxx
+++ b/dbaccess/source/core/dataaccess/datasource.cxx
@@ -62,7 +62,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 
@@ -250,69 +249,6 @@ void SAL_CALL 
OAuthenticationContinuation::setRememberAccount( RememberAuthentic
 SAL_WARN("dbaccess","OAuthenticationContinuation::setRememberAccount: not 
supported!");
 }
 
-namespace {
-
-/** The class OSharedConnectionManager implements a structure to share 
connections.
-It owns the master connections which will be disposed when the last 
connection proxy is gone.
-*/
-// need to hold the digest
-struct TDigestHolder
-{
-sal_uInt8 m_pBuffer[RTL_DIGEST_LENGTH_SHA1];
-TDigestHolder()
-{
-m_pBuffer[0] = 0;
-}
-
-};
-
-}
-
-class OSharedConnectionManager : public ::cppu::WeakImplHelper< XEventListener 
>
-{
-
- // contains the currently used master connections
-struct TConnectionHolder
-{
-Reference< XConnection >xMasterConnection;
-oslInterlockedCount nALiveCount;
-};
-
-// the less-compare functor, used for the stl::map
-struct TDigestLess
-{
-bool operator() (const TDigestHolder& x, const TDigestHolder& y) const
-{
-sal_uInt32 i;
-for(i=0;i < RTL_DIGEST_LENGTH_SHA1 && (x.m_pBuffer[i] >= 
y.m_pBuffer[i]); ++i)
-;
-return i < RTL_DIGEST_LENGTH_SHA1;
-}
-};
-
-typedef std::map< TDigestHolder,TConnectionHolder,TDigestLess>
TConnectionMap;  // holds the master connections
-typedef std::map< Reference< XConnection >,TConnectionMap::iterator>  
TSharedConnectionMap;// holds the shared connections
-
-::osl::Mutexm_aMutex;
-TConnectionMap  m_aConnections; // remember the master 
connection in conjunction with the digest
-TSharedConnectionMapm_aSharedConnection;// the shared 
connections with conjunction with an iterator into the connections map
-Reference< XProxyFactory >  m_xProxyFactory;
-
-protected:
-virtual ~OSharedConnectionManager() override;
-
-public:
-explicit OSharedConnectionManager(const Reference< XComponentContext >& 
_rxContext);
-
-void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
-Reference getConnection(   const OUString& url,
-const OUString& user,
-const OUString& password,
-const Sequence< PropertyValue >& 
_aInfo,
-ODatabaseSource* _pDataSource);
-void addEventListener(const Reference& _rxConnection, 
TConnectionMap::iterator const & _rIter);
-};
-
 OSharedConnectionManager::OSharedConnectionManager(const Reference< 
XComponentContext >& _rxContext)
 {
 

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

2023-10-18 Thread Mike Kaganski (via logerrit)
 dbaccess/source/core/inc/ModelImpl.hxx |3 ---
 1 file changed, 3 deletions(-)

New commits:
commit ae17d08c116e5865ba5448edfb415ea2d3f87c19
Author: Mike Kaganski 
AuthorDate: Wed Oct 18 11:52:13 2023 +0200
Commit: Mike Kaganski 
CommitDate: Wed Oct 18 14:12:56 2023 +0200

Drop duplicated forward declarations

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

diff --git a/dbaccess/source/core/inc/ModelImpl.hxx 
b/dbaccess/source/core/inc/ModelImpl.hxx
index fdaf89f1511d..3140c3c2bdc7 100644
--- a/dbaccess/source/core/inc/ModelImpl.hxx
+++ b/dbaccess/source/core/inc/ModelImpl.hxx
@@ -85,9 +85,6 @@ struct AsciiPropertyValue
 }
 };
 
-class ODatabaseContext;
-class OSharedConnectionManager;
-
 // ODatabaseModelImpl
 typedef ::utl::SharedUNOComponent< css::embed::XStorage >  SharedStorage;
 


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

2023-10-18 Thread Julien Nabet (via logerrit)
 dbaccess/source/core/dataaccess/SharedConnection.hxx |7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 4f48baedb56589d46ec978ce897d8104b8c216d8
Author: Julien Nabet 
AuthorDate: Wed Oct 18 09:54:00 2023 +0200
Commit: Julien Nabet 
CommitDate: Wed Oct 18 11:54:22 2023 +0200

Replace useless typedef OSharedConnection_BASE2 and replace it by its value

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

diff --git a/dbaccess/source/core/dataaccess/SharedConnection.hxx 
b/dbaccess/source/core/dataaccess/SharedConnection.hxx
index ea6e961cf19d..2c88e58fd55d 100644
--- a/dbaccess/source/core/dataaccess/SharedConnection.hxx
+++ b/dbaccess/source/core/dataaccess/SharedConnection.hxx
@@ -34,11 +34,10 @@ namespace dbaccess
 // datasource is asked for not isolated connection.
 typedef ::cppu::WeakComponentImplHelper< css::sdbc::XConnection
> OSharedConnection_BASE;
-typedef ::connectivity::OConnectionWrapper  OSharedConnection_BASE2;
 
 class OSharedConnection :   public ::cppu::BaseMutex
   , public OSharedConnection_BASE
-  , public OSharedConnection_BASE2
+  , public ::connectivity::OConnectionWrapper
 {
 protected:
 virtual void SAL_CALL disposing() override;
@@ -54,7 +53,7 @@ namespace dbaccess
 {
 return ::comphelper::concatSequences(
 OSharedConnection_BASE::getTypes(),
-OSharedConnection_BASE2::getTypes()
+::connectivity::OConnectionWrapper::getTypes()
 );
 }
 
@@ -62,7 +61,7 @@ namespace dbaccess
 {
 css::uno::Any aReturn = 
OSharedConnection_BASE::queryInterface(_rType);
 if ( !aReturn.hasValue() )
-aReturn = OSharedConnection_BASE2::queryInterface(_rType);
+aReturn = 
::connectivity::OConnectionWrapper::queryInterface(_rType);
 return aReturn;
 }
 


[Libreoffice-commits] core.git: dbaccess/source extensions/source filter/source framework/source i18npool/source include/rtl include/xmloff linguistic/source reportdesign/source sc/source sd/source sf

2023-10-18 Thread Stephan Bergmann (via logerrit)
 dbaccess/source/ui/app/AppIconControl.cxx |2 
 dbaccess/source/ui/browser/dbloader.cxx   |2 
 extensions/source/propctrlr/defaultforminspection.cxx |6 -
 filter/source/config/cache/filtercache.cxx|2 
 framework/source/fwe/xml/toolboxdocumenthandler.cxx   |4 
 framework/source/uiconfiguration/windowstateconfiguration.cxx |4 
 framework/source/uielement/controlmenucontroller.cxx  |4 
 i18npool/source/localedata/LocaleNode.cxx |   44 +-
 include/rtl/ustring.hxx   |   38 
 include/xmloff/maptype.hxx|2 
 linguistic/source/lngsvcmgr.cxx   |4 
 reportdesign/source/ui/inspection/DataProviderHandler.cxx |2 
 sc/source/core/data/colorscale.cxx|   44 +-
 sc/source/ui/navipi/content.cxx   |6 -
 sc/source/ui/unoobj/targuno.cxx   |4 
 sc/source/ui/view/olinewin.cxx|4 
 sd/source/ui/controller/slidelayoutcontroller.cxx |   10 +-
 sd/source/ui/presenter/PresenterHelper.cxx|4 
 sd/source/ui/view/viewoverlaymanager.cxx  |8 -
 sfx2/source/appl/shutdowniconaqua.mm  |4 
 sfx2/source/appl/shutdowniconw32.cxx  |6 -
 sfx2/source/doc/SfxDocumentMetaData.cxx   |6 -
 sfx2/source/doc/doctempl.cxx  |2 
 starmath/source/dialog.cxx|4 
 svx/source/dialog/frmsel.cxx  |4 
 svx/source/fmcomp/fmgridif.cxx|6 -
 svx/source/form/fmdmod.cxx|2 
 svx/source/form/fmshimp.cxx   |2 
 svx/source/form/fmundo.cxx|5 -
 svx/source/gallery2/gallery1.cxx  |2 
 svx/source/tbxctrls/extrusioncontrols.cxx |   16 +--
 svx/source/tbxctrls/grafctrl.cxx  |4 
 svx/source/unodraw/unoprov.cxx|   40 -
 sw/source/uibase/ribbar/workctrl.cxx  |4 
 tools/source/fsys/urlobj.cxx  |   12 +-
 vcl/unx/generic/window/salframe.cxx   |6 -
 xmloff/source/forms/elementexport.cxx |   18 ++--
 37 files changed, 150 insertions(+), 187 deletions(-)

New commits:
commit b946842a744c2b869e5c01adf90335edf07f09ad
Author: Stephan Bergmann 
AuthorDate: Wed Oct 18 07:37:17 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Oct 18 11:26:44 2023 +0200

Clean up the remaining uses of OUStringConstExpr, and drop it

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

diff --git a/dbaccess/source/ui/app/AppIconControl.cxx 
b/dbaccess/source/ui/app/AppIconControl.cxx
index 58d4db27da8c..bd94d52c564b 100644
--- a/dbaccess/source/ui/app/AppIconControl.cxx
+++ b/dbaccess/source/ui/app/AppIconControl.cxx
@@ -73,7 +73,7 @@ void OApplicationIconControl::Fill()
 {
 TranslateId pLabelResId;
 ElementType eType;
-rtl::OUStringConstExpr aImageResId;
+OUString aImageResId;
 } aCategories[] = { { RID_STR_TABLES_CONTAINER, E_TABLE, 
BMP_TABLEFOLDER_TREE_L },
 { RID_STR_QUERIES_CONTAINER, E_QUERY, 
BMP_QUERYFOLDER_TREE_L },
 { RID_STR_FORMS_CONTAINER, E_FORM, 
BMP_FORMFOLDER_TREE_L },
diff --git a/dbaccess/source/ui/browser/dbloader.cxx 
b/dbaccess/source/ui/browser/dbloader.cxx
index f2dfd2a497f9..0eeba92634a5 100644
--- a/dbaccess/source/ui/browser/dbloader.cxx
+++ b/dbaccess/source/ui/browser/dbloader.cxx
@@ -116,7 +116,7 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame 
> & rFrame, const OU
 
 static constexpr struct ServiceNameToImplName
 {
-rtl::OUStringConstExpr sServiceName;
+OUString sServiceName;
 const char* pAsciiImplementationName;
 } aImplementations[] = {
 { URL_COMPONENT_FORMGRIDVIEW,  
"org.openoffice.comp.dbu.OFormGridView"},
diff --git a/extensions/source/propctrlr/defaultforminspection.cxx 
b/extensions/source/propctrlr/defaultforminspection.cxx
index 16371b302868..3fa7fa5658a5 100644
--- a/extensions/source/propctrlr/defaultforminspection.cxx
+++ b/extensions/source/propctrlr/defaultforminspection.cxx
@@ -130,8 +130,8 @@ namespace pcr
 {
 const char* programmaticName;
 TranslateId uiNameResId;
-rtl::OUStringConstExpr 

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

2023-10-18 Thread Julien Nabet (via logerrit)
 dbaccess/source/core/dataaccess/SharedConnection.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 502fbd79f9d71d01a177c3cd77256ed6a5a544d8
Author: Julien Nabet 
AuthorDate: Tue Oct 17 22:17:00 2023 +0200
Commit: Julien Nabet 
CommitDate: Wed Oct 18 09:49:54 2023 +0200

Related tdf#144256: fix order of disposing in OSharedConnection

In dbaccess/source/core/dataaccess/SharedConnection.hxx, we got:
35  typedef ::cppu::WeakComponentImplHelper< css::sdbc::XConnection
36 > OSharedConnection_BASE;
37  typedef ::connectivity::OConnectionWrapper  OSharedConnection_BASE2;
38
39  class OSharedConnection :   public ::cppu::BaseMutex
40, public OSharedConnection_BASE
41, public OSharedConnection_BASE2

so first OSharedConnection_BASE ctr is called before OConnectionWrapper ctr
therefore OConnectionWrapper dtr should be called before 
OSharedConnection_BASE dtr

It doesn't fix the bug but investigating in all this mess, I'd like to fix 
these things since it may help.

Change-Id: I47255357b4ca02261f31ebf500f3f1ff55642e69
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158096
Reviewed-by: Mike Kaganski 
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/dbaccess/source/core/dataaccess/SharedConnection.cxx 
b/dbaccess/source/core/dataaccess/SharedConnection.cxx
index 31a8e68ba7b1..d893a8e298b3 100644
--- a/dbaccess/source/core/dataaccess/SharedConnection.cxx
+++ b/dbaccess/source/core/dataaccess/SharedConnection.cxx
@@ -38,8 +38,8 @@ OSharedConnection::~OSharedConnection() {}
 
 void SAL_CALL OSharedConnection::disposing()
 {
-OSharedConnection_BASE::disposing();
 OConnectionWrapper::disposing();
+OSharedConnection_BASE::disposing();
 }
 
 Reference SAL_CALL OSharedConnection::createStatement()


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

2023-10-13 Thread Julien Nabet (via logerrit)
 dbaccess/source/ui/dlg/directsql.cxx |   45 ++-
 1 file changed, 29 insertions(+), 16 deletions(-)

New commits:
commit ad5659d10f20ff39f455e5f19f32b4f9f3078245
Author: Julien Nabet 
AuthorDate: Wed Oct 11 22:21:39 2023 +0200
Commit: Julien Nabet 
CommitDate: Fri Oct 13 08:35:52 2023 +0200

tdf#157465: getBytes may trigger an exception with hsql

So test the SQL type of the column and:
- if it's css::sdbc::DataType::BIT treat it specifically
- otherwise, use plain getString method

Thank you Noel for the idea!

Change-Id: Ib5003d96c1b5ce541fb17e6e31592858f8cd61d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157849
Reviewed-by: Noel Grandin 
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/dbaccess/source/ui/dlg/directsql.cxx 
b/dbaccess/source/ui/dlg/directsql.cxx
index 856a20319b03..eab893e4e4b1 100644
--- a/dbaccess/source/ui/dlg/directsql.cxx
+++ b/dbaccess/source/ui/dlg/directsql.cxx
@@ -31,7 +31,10 @@
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
+#include 
 
 namespace dbaui
 {
@@ -305,6 +308,10 @@ namespace dbaui
 
 void DirectSQLDialog::display(const css::uno::Reference< 
css::sdbc::XResultSet >& xRS)
 {
+
+const Reference xResultSetMetaData = 
Reference(xRS,UNO_QUERY_THROW)->getMetaData();
+const sal_Int32 nColumnsCount = xResultSetMetaData->getColumnCount();
+
 // get a handle for the rows
 css::uno::Reference< css::sdbc::XRow > xRow( xRS, css::uno::UNO_QUERY 
);
 // work through each of the rows
@@ -315,25 +322,31 @@ namespace dbaui
 // work along the columns until that are none left
 try
 {
-int i = 1;
-for (;;)
+for (sal_Int32 i = 1; i <= nColumnsCount; ++i)
 {
-// be dumb, treat everything as a string unless below
-// tdf#153317, at least "Bit" type in Mysql/MariaDB gives: 
"\000" or "\001"
-// so retrieve Sequence from getBytes, test if it has a 
length of 1 (so we avoid BLOB/CLOB or other complex types)
-// and test if the value of first byte is one of those.
-// In this case, there's a good chance it's a "Bit" field
-// remark: for unknown reason, getByte(i) gives "\000" 
even if the bit is at 1.
-auto seq = xRow->getBytes(i);
-if ((seq.getLength() == 1) && (seq[0] >= 0) && (seq[0] <= 
1))
-{
-out.append(OUString::number(static_cast(seq[0])) 
+ ",");
-}
-else
+switch (xResultSetMetaData->getColumnType(i))
 {
-out.append(xRow->getString(i) + ",");
+// tdf#153317, at least "Bit" type in Mysql/MariaDB 
gives: "\000" or "\001"
+// so retrieve Sequence from getBytes, test if it has 
a length of 1 (so we avoid BLOB/CLOB or other complex types)
+// and test if the value of first byte is one of those.
+// In this case, there's a good chance it's a "Bit" 
field
+case css::sdbc::DataType::BIT:
+{
+auto seq = xRow->getBytes(i);
+if ((seq.getLength() == 1) && (seq[0] >= 0) && 
(seq[0] <= 1))
+{
+
out.append(OUString::number(static_cast(seq[0])) + ",");
+}
+else
+{
+out.append(xRow->getString(i) + ",");
+}
+break;
+}
+// for the rest, be dumb, treat everything as a string
+default:
+out.append(xRow->getString(i) + ",");
 }
-i++;
 }
 }
 // trap for when we fall off the end of the row


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

2023-09-23 Thread Julien Nabet (via logerrit)
 dbaccess/source/ui/dlg/DbAdminImpl.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 3399854b66bb1fb175b8504c964008e53167ca7b
Author: Julien Nabet 
AuthorDate: Sat Sep 23 17:23:36 2023 +0200
Commit: Julien Nabet 
CommitDate: Sun Sep 24 00:28:57 2023 +0200

tdf#157260: don't add a "port" param if already present in the connection 
DB url

Regression of 
https://cgit.freedesktop.org/libreoffice/core/commit/?id=afe99617707c92460e66486c0057ef327e8aa017
"tdf#43369: Specific UI for collecting PostgreSQL connection settings"
in 2023-04

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

diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx 
b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
index 88f95d9832db..94cdee5a9f05 100644
--- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx
+++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
@@ -539,7 +539,8 @@ OUString 
ODbDataSourceAdministrationHelper::getConnectionURL() const
 hostname = "'" + hostname + "'";
 rURL += " host=" + hostname;
 }
-if (pPortNumber && pPortNumber->GetValue())
+// tdf#157260: if port is already in the URL, don't add 
another one
+if (pPortNumber && pPortNumber->GetValue() && 
(rURL.indexOf("port=") == -1))
 {
 OUString port = "'" + 
OUString::number(pPortNumber->GetValue()) + "'";
 rURL += " port=" + port;


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

2023-09-15 Thread Julien Nabet (via logerrit)
 dbaccess/source/ui/tabledesign/TEditControl.cxx |   11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 4bab6b0b870ae56b8d40eac22dbb0a433006789e
Author: Julien Nabet 
AuthorDate: Fri Sep 15 16:53:17 2023 +0200
Commit: Julien Nabet 
CommitDate: Fri Sep 15 18:48:42 2023 +0200

tdf#71224: Remove "Insert fields" option for an existing table (workaround)

For the moment, we don't implement insert field at specific position
It's not SQL standard and each database has made its choice (some use 
"BEFORE", other "FIRST" and "AFTER")
and some, like Postgresql, don't allow this.
So for the moment, test if the table already exists (and so it's an 
edition), in this case only
we remove "Insert fields" entry. Indeed, in case of new table, there's no 
pb.

The real fix is to implement the insert for each database + error message 
for those which don't support this

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

diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx 
b/dbaccess/source/ui/tabledesign/TEditControl.cxx
index b3f5dbbe33c8..55696fe36463 100644
--- a/dbaccess/source/ui/tabledesign/TEditControl.cxx
+++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx
@@ -1412,8 +1412,17 @@ void OTableEditorCtrl::Command(const CommandEvent& rEvt)
 xContextMenu->remove("paste");
 if (!IsDeleteAllowed())
 xContextMenu->remove("delete");
-if (!IsInsertNewAllowed(nRow))
+// tdf#71224: WORKAROUND for the moment, we don't 
implement insert field at specific position
+// It's not SQL standard and each database has made its 
choice (some use "BEFORE", other "FIRST" and "AFTER")
+// and some, like Postgresql, don't allow this.
+// So for the moment, test if the table already exists 
(and so it's an edition), in this case only
+// we remove "Insert Fields" entry. Indeed, in case of new 
table, there's no pb.
+//
+// The real fix is to implement the insert for each 
database + error message for those which don't support this
+//if (!IsInsertNewAllowed(nRow))
+if ( GetView()->getController().getTable().is() )
 xContextMenu->remove("insert");
+
 if (IsPrimaryKeyAllowed())
 {
 xContextMenu->set_active("primarykey", 
IsRowSelected(GetCurRow()) && IsPrimaryKey());


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

2023-09-15 Thread Julien Nabet (via logerrit)
 dbaccess/source/ui/tabledesign/TEditControl.cxx |   11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

New commits:
commit 5b49cf64482ca8246dbcf5b5f12a11d7f9ed081b
Author: Julien Nabet 
AuthorDate: Fri Sep 15 14:48:52 2023 +0200
Commit: Julien Nabet 
CommitDate: Fri Sep 15 16:40:47 2023 +0200

Fix assertion 'GTK_IS_CHECK_MENU_ITEM (check_menu_item)' in dbaccess

Retrieve odb file 
https://bugs.documentfoundation.org/attachment.cgi?id=102977
Open the file and edit the only table
Right click at left on a field (except first one)

(soffice:271527): Gtk-CRITICAL **: 14:35:42.787: 
gtk_check_menu_item_set_active: assertion 'GTK_IS_CHECK_MENU_ITEM 
(check_menu_item)' failed

(soffice:271527): GLib-GObject-CRITICAL **: 14:35:42.787: invalid (NULL) 
pointer instance

(soffice:271527): GLib-GObject-CRITICAL **: 14:35:42.787: 
g_signal_handlers_unblock_matched: assertion 'G_TYPE_CHECK_INSTANCE (instance)' 
failed

If primary key entry is removed, don't try to call xContextMenu->set_active 
on it

Change-Id: Ice57d840d12e986eb60514326806782e40f249fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156946
Reviewed-by: Julien Nabet 
Reviewed-by: Caolán McNamara 
Tested-by: Jenkins

diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx 
b/dbaccess/source/ui/tabledesign/TEditControl.cxx
index 241efe597ef4..b3f5dbbe33c8 100644
--- a/dbaccess/source/ui/tabledesign/TEditControl.cxx
+++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx
@@ -1412,11 +1412,16 @@ void OTableEditorCtrl::Command(const CommandEvent& rEvt)
 xContextMenu->remove("paste");
 if (!IsDeleteAllowed())
 xContextMenu->remove("delete");
-if (!IsPrimaryKeyAllowed())
-xContextMenu->remove("primarykey");
 if (!IsInsertNewAllowed(nRow))
 xContextMenu->remove("insert");
-xContextMenu->set_active("primarykey", 
IsRowSelected(GetCurRow()) && IsPrimaryKey());
+if (IsPrimaryKeyAllowed())
+{
+xContextMenu->set_active("primarykey", 
IsRowSelected(GetCurRow()) && IsPrimaryKey());
+}
+else
+{
+xContextMenu->remove("primarykey");
+}
 
 if( SetDataPtr(m_nDataPos) )
 pDescrWin->SaveData( pActRow->GetActFieldDescr() );


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

2023-09-08 Thread Noel Grandin (via logerrit)
 dbaccess/source/core/dataaccess/databasecontext.cxx   |9 +
 dbaccess/source/core/dataaccess/databaseregistrations.cxx |8 
 dbaccess/source/core/dataaccess/databaseregistrations.hxx |4 ++--
 dbaccess/source/core/inc/databasecontext.hxx  |2 --
 4 files changed, 7 insertions(+), 16 deletions(-)

New commits:
commit debd9a749cbaaa6ec97992b6908293ec5d41bffc
Author: Noel Grandin 
AuthorDate: Fri Sep 8 11:25:50 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri Sep 8 22:15:45 2023 +0200

no need to use XAggregation for DatabaseRegistrations

the delegating class already implements the interface and forwards the
method calls

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

diff --git a/dbaccess/source/core/dataaccess/databasecontext.cxx 
b/dbaccess/source/core/dataaccess/databasecontext.cxx
index dce39f3badd4..5677b5fe316f 100644
--- a/dbaccess/source/core/dataaccess/databasecontext.cxx
+++ b/dbaccess/source/core/dataaccess/databasecontext.cxx
@@ -177,12 +177,7 @@ ODatabaseContext::ODatabaseContext( const Reference< 
XComponentContext >& _rxCon
 #endif
 
 osl_atomic_increment( _refCount );
-{
-m_xDBRegistrationAggregate.set( createDataSourceRegistrations( 
m_aContext ), UNO_SET_THROW );
-m_xDatabaseRegistrations.set( m_xDBRegistrationAggregate, 
UNO_QUERY_THROW );
-
-m_xDBRegistrationAggregate->setDelegator( *this );
-}
+m_xDatabaseRegistrations =  createDataSourceRegistrations( m_aContext );
 osl_atomic_decrement( _refCount );
 }
 
@@ -193,8 +188,6 @@ ODatabaseContext::~ODatabaseContext()
 #endif
 
 m_xDatabaseDocumentLoader.clear();
-m_xDBRegistrationAggregate->setDelegator( nullptr );
-m_xDBRegistrationAggregate.clear();
 m_xDatabaseRegistrations.clear();
 }
 
diff --git a/dbaccess/source/core/dataaccess/databaseregistrations.cxx 
b/dbaccess/source/core/dataaccess/databaseregistrations.cxx
index 40fa526d1ba7..9e53a8429ef3 100644
--- a/dbaccess/source/core/dataaccess/databaseregistrations.cxx
+++ b/dbaccess/source/core/dataaccess/databaseregistrations.cxx
@@ -27,7 +27,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -67,8 +67,8 @@ namespace dbaccess
 }
 
 // DatabaseRegistrations - declaration
-typedef ::cppu::WeakAggImplHelper1  <   XDatabaseRegistrations
->   DatabaseRegistrations_Base;
+typedef ::cppu::WeakImplHelper<   XDatabaseRegistrations
+   >   DatabaseRegistrations_Base;
 
 namespace {
 
@@ -359,7 +359,7 @@ namespace dbaccess
 }
 
 // DatabaseRegistrations - factory
-Reference< XAggregation > createDataSourceRegistrations( const 
Reference & _rxContext )
+Reference< XDatabaseRegistrations > createDataSourceRegistrations( const 
Reference & _rxContext )
 {
 return new DatabaseRegistrations( _rxContext );
 }
diff --git a/dbaccess/source/core/dataaccess/databaseregistrations.hxx 
b/dbaccess/source/core/dataaccess/databaseregistrations.hxx
index 709bc9f98490..52def1de5aa2 100644
--- a/dbaccess/source/core/dataaccess/databaseregistrations.hxx
+++ b/dbaccess/source/core/dataaccess/databaseregistrations.hxx
@@ -20,11 +20,11 @@
 #pragma once
 
 #include 
-#include 
+#include 
 
 namespace dbaccess
 {
-css::uno::Reference
+css::uno::Reference
 createDataSourceRegistrations(const 
css::uno::Reference& _rxContext);
 
 } // namespace dbaccess
diff --git a/dbaccess/source/core/inc/databasecontext.hxx 
b/dbaccess/source/core/inc/databasecontext.hxx
index 2f9bf326c9e0..d94df018d1c0 100644
--- a/dbaccess/source/core/inc/databasecontext.hxx
+++ b/dbaccess/source/core/inc/databasecontext.hxx
@@ -86,8 +86,6 @@ private:
 css::uno::Reference< css::uno::XComponentContext >
 m_aContext;
 
-css::uno::Reference< css::uno::XAggregation >
-m_xDBRegistrationAggregate;
 css::uno::Reference< css::sdb::XDatabaseRegistrations >
 m_xDatabaseRegistrations;
 


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

2023-08-08 Thread Noel Grandin (via logerrit)
 dbaccess/source/core/dataaccess/databasedocument.cxx |   20 +--
 dbaccess/source/core/dataaccess/databasedocument.hxx |   11 ++
 2 files changed, 5 insertions(+), 26 deletions(-)

New commits:
commit 009a24d64f775aabf7fc6307117ada45226df9a5
Author: Noel Grandin 
AuthorDate: Tue Aug 8 15:25:26 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Aug 8 18:32:32 2023 +0200

simplify ODatabaseDocument inheritance

no need to use two different ImplHelpers here

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

diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx 
b/dbaccess/source/core/dataaccess/databasedocument.cxx
index e40c295d9b51..043f3144d3a2 100644
--- a/dbaccess/source/core/dataaccess/databasedocument.cxx
+++ b/dbaccess/source/core/dataaccess/databasedocument.cxx
@@ -197,28 +197,12 @@ Any SAL_CALL ODatabaseDocument::queryInterface( const 
Type& _rType )
 )
 return Any();
 
-Any aReturn = ODatabaseDocument_OfficeDocument::queryInterface(_rType);
-if (!aReturn.hasValue())
-aReturn = ODatabaseDocument_Title::queryInterface(_rType);
-return aReturn;
-}
-
-void SAL_CALL ODatabaseDocument::acquire(  ) noexcept
-{
-ODatabaseDocument_OfficeDocument::acquire();
-}
-
-void SAL_CALL ODatabaseDocument::release(  ) noexcept
-{
-ODatabaseDocument_OfficeDocument::release();
+return ODatabaseDocument_OfficeDocument::queryInterface(_rType);
 }
 
 Sequence< Type > SAL_CALL ODatabaseDocument::getTypes(  )
 {
-Sequence< Type > aTypes = ::comphelper::concatSequences(
-ODatabaseDocument_OfficeDocument::getTypes(),
-ODatabaseDocument_Title::getTypes()
-);
+Sequence< Type > aTypes = ODatabaseDocument_OfficeDocument::getTypes();
 
 // strip XEmbeddedScripts and XScriptInvocationContext if we have any 
form/report
 // which already contains macros. In this case, the database document 
itself is not
diff --git a/dbaccess/source/core/dataaccess/databasedocument.hxx 
b/dbaccess/source/core/dataaccess/databasedocument.hxx
index bd458d1b9259..6278aa039a63 100644
--- a/dbaccess/source/core/dataaccess/databasedocument.hxx
+++ b/dbaccess/source/core/dataaccess/databasedocument.hxx
@@ -148,16 +148,13 @@ typedef cppu::PartialWeakComponentImplHelper<   
css::frame::XModel3
 ,   
css::document::XEventsSupplier
 ,   css::frame::XLoadable
 ,   
css::document::XDocumentRecovery
+, css::frame::XTitle
+,   
css::frame::XTitleChangeBroadcaster
+,   
css::frame::XUntitledNumbers
 >   
ODatabaseDocument_OfficeDocument;
 
-typedef ::cppu::ImplHelper3   ODatabaseDocument_Title;
-
 class ODatabaseDocument :public ModelDependentComponent // 
ModelDependentComponent must be first!
 ,public ODatabaseDocument_OfficeDocument
-,public ODatabaseDocument_Title
 {
 enum InitState
 {
@@ -299,8 +296,6 @@ public:
 
 // XInterface
 virtual css::uno::Any  SAL_CALL queryInterface(const css::uno::Type& 
_rType) override;
-virtual void SAL_CALL acquire(  ) noexcept override;
-virtual void SAL_CALL release(  ) noexcept override;
 
 // XTypeProvider
 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes(  ) 
override;


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

2023-07-28 Thread Pierre (via logerrit)
 dbaccess/source/core/misc/dsntypes.cxx |4 
 dbaccess/source/inc/dsntypes.hxx   |2 ++
 2 files changed, 6 insertions(+)

New commits:
commit 9c071c148afce0b95a16b36c27b709380d1130b5
Author: Pierre 
AuthorDate: Thu Jul 27 15:27:14 2023 +0200
Commit: Julien Nabet 
CommitDate: Fri Jul 28 09:14:57 2023 +0200

tdf#156471: New database wizard - add generic support for embedded 
databases of unknown type

e.g. provided by extension or future code.

The core assumption is that an embedded database doesn't need a 
user-configured "connection URL"
configured so don't ask for one.

Change-Id: I7d11cc0b492782634dd49f74d9d709dca434e990
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154989
Reviewed-by: Lionel Mamane 
Tested-by: Julien Nabet 

diff --git a/dbaccess/source/core/misc/dsntypes.cxx 
b/dbaccess/source/core/misc/dsntypes.cxx
index cfeaad56a671..c67ac1646a75 100644
--- a/dbaccess/source/core/misc/dsntypes.cxx
+++ b/dbaccess/source/core/misc/dsntypes.cxx
@@ -324,6 +324,9 @@ DATASOURCE_TYPE 
ODsnTypeCollection::determineType(std::u16string_view _rDsn) con
 if (sDsn.equalsIgnoreAsciiCase("sdbc:embedded:firebird"))
 return DST_EMBEDDED_FIREBIRD;
 
+if (sDsn.startsWithIgnoreAsciiCase("sdbc:embedded:"))
+return DST_EMBEDDED_UNKNOWN;
+
 // find second :
 nSeparator = sDsn.indexOf(u':', nSeparator + 1);
 if (-1 == nSeparator)
@@ -467,6 +470,7 @@ void ODsnTypeCollection::fillPageIds(std::u16string_view 
_sURL,std::vector

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

2023-07-23 Thread Julien Nabet (via logerrit)
 dbaccess/source/core/dataaccess/databasedocument.cxx |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 22914d1eb8afa35827b33f2d8bdce9da7283e735
Author: Julien Nabet 
AuthorDate: Sat Jul 22 15:50:51 2023 +0200
Commit: Julien Nabet 
CommitDate: Sun Jul 23 10:04:48 2023 +0200

No need to create an identical obj if we return the same property values

Change-Id: Ib932de42ffec6d71b31a25d53f46f18a26b0b2b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154762
Reviewed-by: Lionel Mamane 
Tested-by: Jenkins

diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx 
b/dbaccess/source/core/dataaccess/databasedocument.cxx
index 2aa2710006c0..e40c295d9b51 100644
--- a/dbaccess/source/core/dataaccess/databasedocument.cxx
+++ b/dbaccess/source/core/dataaccess/databasedocument.cxx
@@ -306,12 +306,12 @@ namespace
 
 Sequence< PropertyValue > lcl_appendFileNameToDescriptor( const 
::comphelper::NamedValueCollection& _rDescriptor, const OUString& _rURL )
 {
+if ( _rURL.isEmpty() )
+return _rDescriptor.getPropertyValues();
+
 ::comphelper::NamedValueCollection aMutableDescriptor( _rDescriptor );
-if ( !_rURL.isEmpty() )
-{
-aMutableDescriptor.put( "FileName", _rURL );
-aMutableDescriptor.put( "URL", _rURL );
-}
+aMutableDescriptor.put( "FileName", _rURL );
+aMutableDescriptor.put( "URL", _rURL );
 return aMutableDescriptor.getPropertyValues();
 }
 }


[Libreoffice-commits] core.git: dbaccess/source include/unotools sfx2/source unotools/source

2023-06-18 Thread Andreas Heinisch (via logerrit)
 dbaccess/source/ui/app/AppController.cxx  |2 
 include/unotools/historyoptions.hxx   |4 -
 sfx2/source/appl/newhelp.cxx  |3 -
 sfx2/source/appl/sfxpicklist.cxx  |3 -
 unotools/source/config/historyoptions.cxx |   68 --
 5 files changed, 51 insertions(+), 29 deletions(-)

New commits:
commit 760c7a806ced3861086d5fdfbb7b4b1461948c27
Author: Andreas Heinisch 
AuthorDate: Thu Jun 15 19:48:18 2023 +0200
Commit: Andreas Heinisch 
CommitDate: Mon Jun 19 07:47:59 2023 +0200

tdf#38742 - Start Center: move last opened documents to the top

Change-Id: If395b0784d9bdcdc1200c15fca60647da825ea1e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153150
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/dbaccess/source/ui/app/AppController.cxx 
b/dbaccess/source/ui/app/AppController.cxx
index 175f56b39724..ad18bff5892c 100644
--- a/dbaccess/source/ui/app/AppController.cxx
+++ b/dbaccess/source/ui/app/AppController.cxx
@@ -361,7 +361,7 @@ void SAL_CALL OApplicationController::disposing()
 aURL.GetURLNoPass( 
INetURLObject::DecodeMechanism::NONE ),
 aFilter,
 getStrippedDatabaseName(),
-std::nullopt, std::nullopt, std::nullopt);
+std::nullopt, std::nullopt);
 
 // add to recent document list
 if ( aURL.GetProtocol() == INetProtocol::File )
diff --git a/include/unotools/historyoptions.hxx 
b/include/unotools/historyoptions.hxx
index 53b9fcdfa805..b2388de2ad4b 100644
--- a/include/unotools/historyoptions.hxx
+++ b/include/unotools/historyoptions.hxx
@@ -73,13 +73,11 @@ namespace SvtHistoryOptions
 @param sTitle  document title to save in history
 @param sThumbnail  base64 encoded thumbnail of the item
 @param oIsReadOnly item was opened editable or read-only
-@param oIsPinned   item is pinned in the user-interface
 */
 UNOTOOLS_DLLPUBLIC void AppendItem(EHistoryType eHistory, const OUString& 
sURL,
const OUString& sFilter, const 
OUString& sTitle,
const std::optional& 
sThumbnail,
-   std::optional oIsReadOnly,
-   std::optional oIsPinned);
+   std::optional oIsReadOnly);
 
 /** Delete item from the specified list.
 */
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index 5c2d7cf6c0e1..e676bec19d4e 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -1175,8 +1175,7 @@ BookmarksTabPage_Impl::~BookmarksTabPage_Impl()
 for (sal_Int32 i = 0; i < nCount; ++i)
 {
 SvtHistoryOptions::AppendItem(EHistoryType::HelpBookmarks, 
m_xBookmarksBox->get_id(i), "",
-  m_xBookmarksBox->get_text(i), 
std::nullopt, std::nullopt,
-  std::nullopt);
+  m_xBookmarksBox->get_text(i), 
std::nullopt, std::nullopt);
 }
 
 m_xBookmarksBox.reset();
diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx
index 2451a8d0cad8..fb676d981d35 100644
--- a/sfx2/source/appl/sfxpicklist.cxx
+++ b/sfx2/source/appl/sfxpicklist.cxx
@@ -131,8 +131,7 @@ void SfxPickListImpl::AddDocumentToPickList( const 
SfxObjectShell* pDocSh )
 aFilter,
 aTitle,
 aThumbnail,
-oIsReadOnly,
-std::nullopt);
+oIsReadOnly);
 
 if ( aURL.GetProtocol() == INetProtocol::File )
 Application::AddToRecentDocumentList( aURL.GetURLNoPass( 
INetURLObject::DecodeMechanism::NONE ),
diff --git a/unotools/source/config/historyoptions.cxx 
b/unotools/source/config/historyoptions.cxx
index 0b9e4d717b83..2cda950858d2 100644
--- a/unotools/source/config/historyoptions.cxx
+++ b/unotools/source/config/historyoptions.cxx
@@ -134,7 +134,8 @@ std::vector< HistoryItem > GetList( EHistoryType eHistory )
 xSet->getPropertyValue(s_sPassword) >>= aItem.sPassword;
 xSet->getPropertyValue(s_sThumbnail) >>= aItem.sThumbnail;
 xSet->getPropertyValue(s_sReadOnly) >>= aItem.isReadOnly;
-xSet->getPropertyValue(s_sPinned) >>= aItem.isPinned;
+if (xSet->getPropertySetInfo()->hasPropertyByName(s_sPinned))
+xSet->getPropertyValue(s_sPinned) >>= aItem.isPinned;
 
 aRet.push_back(aItem);
 }
@@ -160,7 +161,7 @@ std::vector< HistoryItem > GetList( EHistoryType eHistory )
 
 void AppendItem(EHistoryType eHistory, const OUString& sURL, const OUString& 
sFilter,
 const OUString& sTitle, const std::optional& 
sThumbnail,
-::std::optional const oIsReadOnly, 

[Libreoffice-commits] core.git: dbaccess/source icon-themes/breeze icon-themes/breeze_dark icon-themes/breeze_dark_svg icon-themes/breeze_svg icon-themes/colibre icon-themes/colibre_dark icon-themes/c

2023-06-05 Thread Andreas Heinisch (via logerrit)
 dbaccess/source/ui/app/AppController.cxx|2 
 icon-themes/breeze/res/recentdoc_pin.png|binary
 icon-themes/breeze/res/recentdoc_pin_highlighted.png|binary
 icon-themes/breeze_dark/res/recentdoc_pin.png   |binary
 icon-themes/breeze_dark/res/recentdoc_pin_highlighted.png   |binary
 icon-themes/breeze_dark_svg/res/recentdoc_pin.svg   |1 
 icon-themes/breeze_dark_svg/res/recentdoc_pin_highlighted.svg   |   14 
 icon-themes/breeze_svg/res/recentdoc_pin.svg|1 
 icon-themes/breeze_svg/res/recentdoc_pin_highlighted.svg|   14 
 icon-themes/colibre/res/recentdoc_pin.png   |binary
 icon-themes/colibre/res/recentdoc_pin_highlighted.png   |binary
 icon-themes/colibre_dark/res/recentdoc_pin.png  |binary
 icon-themes/colibre_dark/res/recentdoc_pin_highlighted.png  |binary
 icon-themes/colibre_dark_svg/res/recentdoc_pin.svg  |1 
 icon-themes/colibre_dark_svg/res/recentdoc_pin_highlighted.svg  |   14 
 icon-themes/colibre_svg/res/recentdoc_pin.svg   |1 
 icon-themes/colibre_svg/res/recentdoc_pin_highlighted.svg   |   14 
 icon-themes/elementary/res/recentdoc_pin.png|binary
 icon-themes/elementary/res/recentdoc_pin_highlighted.png|binary
 icon-themes/elementary_svg/res/recentdoc_pin.svg|1 
 icon-themes/elementary_svg/res/recentdoc_pin_highlighted.svg|   14 
 icon-themes/sifr/res/recentdoc_pin.png  |binary
 icon-themes/sifr/res/recentdoc_pin_highlighted.png  |binary
 icon-themes/sifr_dark/res/recentdoc_pin.png |binary
 icon-themes/sifr_dark/res/recentdoc_pin_highlighted.png |binary
 icon-themes/sifr_dark_svg/res/recentdoc_pin.svg |1 
 icon-themes/sifr_dark_svg/res/recentdoc_pin_highlighted.svg |   14 
 icon-themes/sifr_svg/res/recentdoc_pin.svg  |1 
 icon-themes/sifr_svg/res/recentdoc_pin_highlighted.svg  |   14 
 icon-themes/sukapura/res/pin_document.png   |binary
 icon-themes/sukapura/res/recentdoc_pin.png  |binary
 icon-themes/sukapura/res/recentdoc_pin_highlighted.png  |binary
 icon-themes/sukapura/res/unpin_document.png |binary
 icon-themes/sukapura_dark/res/pin_document.png  |binary
 icon-themes/sukapura_dark/res/recentdoc_pin.png |binary
 icon-themes/sukapura_dark/res/recentdoc_pin_highlighted.png |binary
 icon-themes/sukapura_dark/res/unpin_document.png|binary
 icon-themes/sukapura_dark_svg/res/pin_document.svg  |7 
 icon-themes/sukapura_dark_svg/res/recentdoc_pin.svg |1 
 icon-themes/sukapura_dark_svg/res/recentdoc_pin_highlighted.svg |   14 
 icon-themes/sukapura_dark_svg/res/unpin_document.svg|   17 +
 icon-themes/sukapura_svg/res/recentdoc_pin.svg  |1 
 icon-themes/sukapura_svg/res/recentdoc_pin_highlighted.svg  |   14 
 include/sfx2/thumbnailviewitem.hxx  |   10 
 include/unotools/historyoptions.hxx |   25 +
 officecfg/registry/schema/org/openoffice/Office/Histories.xcs   |5 
 sfx2/inc/bitmaps.hlst   |2 
 sfx2/inc/recentdocsview.hxx |3 
 sfx2/source/appl/newhelp.cxx|4 
 sfx2/source/appl/sfxpicklist.cxx|3 
 sfx2/source/control/recentdocsview.cxx  |   10 
 sfx2/source/control/recentdocsviewitem.cxx  |   14 
 sfx2/source/control/recentdocsviewitem.hxx  |6 
 sfx2/source/control/thumbnailview.cxx   |   14 
 sfx2/source/control/thumbnailviewitem.cxx   |   47 ++
 unotools/source/config/historyoptions.cxx   |  165 
--
 56 files changed, 421 insertions(+), 48 deletions(-)

New commits:
commit 436f3f8eb5b45620842351a1f29ba49571043515
Author: Andreas Heinisch 
AuthorDate: Mon May 22 22:46:55 2023 +0200
Commit: Andreas Heinisch 
CommitDate: Tue Jun 6 07:08:09 2023 +0200

tdf#38742 - Start Center: introduce push pins to favorite documents

Change-Id: I879e4d93e1da222d9acabb776552ca1cf819574b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152136
Tested-by: Andreas Heinisch 
Reviewed-by: Andreas Heinisch 

diff --git a/dbaccess/source/ui/app/AppController.cxx 
b/dbaccess/source/ui/app/AppController.cxx
index ad18bff5892c..175f56b39724 100644
--- a/dbaccess/source/ui/app/AppController.cxx
+++ b/dbaccess/source/ui/app/AppController.cxx
@@ -361,7 +361,7 @@ void SAL_CALL OApplicationController::disposing()
 aURL.GetURLNoPass( 

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

2023-06-03 Thread Julien Nabet (via logerrit)
 dbaccess/source/ui/misc/databaseobjectview.cxx |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit c50e4b25b2eb278685698182e2a4b541739f2d42
Author: Julien Nabet 
AuthorDate: Sat Jun 3 10:01:47 2023 +0200
Commit: Lionel Mamane 
CommitDate: Sat Jun 3 11:46:15 2023 +0200

Simplify a bit DatabaseObjectView::fillDispatchArgs

Change-Id: Ic6d4c80813286d6b5dbe33dc0289d0f0d9cedfc9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152569
Reviewed-by: Julien Nabet 
Reviewed-by: Lionel Mamane 
Tested-by: Lionel Mamane 

diff --git a/dbaccess/source/ui/misc/databaseobjectview.cxx 
b/dbaccess/source/ui/misc/databaseobjectview.cxx
index f10921d6fdb6..e84f36e7f58f 100644
--- a/dbaccess/source/ui/misc/databaseobjectview.cxx
+++ b/dbaccess/source/ui/misc/databaseobjectview.cxx
@@ -253,22 +253,22 @@ namespace dbaui
 {
 DatabaseObjectView::fillDispatchArgs( i_rDispatchArgs, _aDataSource, 
_rQualifiedName );
 OSL_ENSURE( !_rQualifiedName.isEmpty(),"A Table name must be set");
-OUString sCatalog;
-OUString sSchema;
-OUString sTable;
-if ( m_bTable )
-::dbtools::qualifiedNameComponents( 
getConnection()->getMetaData(), _rQualifiedName, sCatalog, sSchema, sTable, 
::dbtools::EComposeRule::InDataManipulation );
-
-i_rDispatchArgs.put( PROPERTY_COMMAND_TYPE, (m_bTable ? 
CommandType::TABLE : CommandType::QUERY) );
 i_rDispatchArgs.put( PROPERTY_COMMAND, _rQualifiedName );
 i_rDispatchArgs.put( PROPERTY_ENABLE_BROWSER, false );
 
 if ( m_bTable )
 {
+OUString sCatalog;
+OUString sSchema;
+OUString sTable;
+::dbtools::qualifiedNameComponents( 
getConnection()->getMetaData(), _rQualifiedName, sCatalog, sSchema, sTable, 
::dbtools::EComposeRule::InDataManipulation );
 i_rDispatchArgs.put( PROPERTY_UPDATE_CATALOGNAME, sCatalog );
 i_rDispatchArgs.put( PROPERTY_UPDATE_SCHEMANAME, sSchema );
 i_rDispatchArgs.put( PROPERTY_UPDATE_TABLENAME, sTable );
+i_rDispatchArgs.put( PROPERTY_COMMAND_TYPE, CommandType::TABLE );
 }
+else
+i_rDispatchArgs.put( PROPERTY_COMMAND_TYPE, CommandType::QUERY );
 }
 
 // RelationDesigner


[Libreoffice-commits] core.git: dbaccess/source include/sfx2 include/svx sc/inc svx/source sw/inc

2023-05-29 Thread Noel Grandin (via logerrit)
 dbaccess/source/ui/inc/sbagrid.hrc |4 ++--
 include/sfx2/sfxsids.hrc   |   12 +++-
 include/svx/svxids.hrc |   14 +++---
 sc/inc/sc.hrc  |2 +-
 svx/source/dialog/srchdlg.cxx  |2 +-
 sw/inc/cmdid.h |2 +-
 6 files changed, 19 insertions(+), 17 deletions(-)

New commits:
commit 583c3fcea50b69ca9d3cd866050c9e722a8f780b
Author: Noel Grandin 
AuthorDate: Sun May 28 15:49:53 2023 +0200
Commit: Noel Grandin 
CommitDate: Mon May 29 13:13:44 2023 +0200

use more TypedWhichId

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

diff --git a/dbaccess/source/ui/inc/sbagrid.hrc 
b/dbaccess/source/ui/inc/sbagrid.hrc
index c84dbccead66..921faa6a9bd2 100644
--- a/dbaccess/source/ui/inc/sbagrid.hrc
+++ b/dbaccess/source/ui/inc/sbagrid.hrc
@@ -26,8 +26,8 @@
 
 // Columns
 // Formatting
-#define SBA_DEF_RANGEFORMAT (SBA_WHICHID_START+143) // RangeItem
-#define SBA_DEF_FMTVALUE(SBA_WHICHID_START+144) // SfxULONG, Format
+#define SBA_DEF_RANGEFORMAT 
TypedWhichId(SBA_WHICHID_START+143) // RangeItem
+#define SBA_DEF_FMTVALUE
TypedWhichId(SBA_WHICHID_START+144) // SfxULONG, Format
 
 // Justification
 #define SBA_ATTR_ALIGN_HOR_JUSTIFY  (SBA_WHICHID_START + 145) //  
SvxHorJustifyItem
diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc
index ea60a8507716..f21e1141bce7 100644
--- a/include/sfx2/sfxsids.hrc
+++ b/include/sfx2/sfxsids.hrc
@@ -28,6 +28,7 @@ class SfxBoolItem;
 class SfxDocumentInfoItem;
 class SfxEventNamesItem;
 class SfxFlagItem;
+class SfxGlobalNameItem;
 class SfxHyphenRegionItem;
 class SfxImageItem;
 class SfxInt16Item;
@@ -40,6 +41,7 @@ class SfxUInt16Item;
 class SfxUnoAnyItem;
 class SfxUnoFrameItem;
 class SfxWatermarkItem;
+class SfxVisibilityItem;
 class SvxClipboardFormatItem;
 class SvxHyperlinkItem;
 class SvxLanguageItem;
@@ -164,9 +166,9 @@ class SvxZoomItem;
 #define SID_REDACTDOC   (SID_SFX_START + 1732)
 #define SID_AUTOREDACTDOC   (SID_SFX_START + 1736)
 #define SID_UPDATEDOCMODE   
TypedWhichId(SID_SFX_START + 1668)
-#define SID_CHECKOUT(SID_SFX_START + 512)
-#define SID_CANCELCHECKOUT  (SID_SFX_START + 513)
-#define SID_CHECKIN (SID_SFX_START + 514)
+#define SID_CHECKOUT
TypedWhichId(SID_SFX_START + 512)
+#define SID_CANCELCHECKOUT  
TypedWhichId(SID_SFX_START + 513)
+#define SID_CHECKIN 
TypedWhichId(SID_SFX_START + 514)
 #define SID_FILTER_PROVIDER 
TypedWhichId(SID_SFX_START + 515)
 
 #define SID_FORCERELOAD 
TypedWhichId(SID_SFX_START + 1502)
@@ -276,7 +278,7 @@ class SvxZoomItem;
 #define SID_GOTOLINE(SID_SFX_START + 1724)
 #define SID_SHOWLINES   
TypedWhichId(SID_SFX_START + 1725)
 #define SID_BLUETOOTH_SENDDOC   (SID_SFX_START + 1726)
-#define SID_TEMPLATE_MANAGER(SID_SFX_START + 1727)
+#define SID_TEMPLATE_MANAGER
TypedWhichId(SID_SFX_START + 1727)
 #define SID_TOOLBAR_MODE(SID_SFX_START + 1728)
 #define SID_NO_FILE_SYNC(SID_SFX_START + 1729)
 #define SID_NO_THUMBNAIL(SID_SFX_START + 1730)
@@ -389,7 +391,7 @@ class SvxZoomItem;
 #define SID_TEMPLATE_REGIONNAME 
TypedWhichId(SID_SFX_START + 662)
 #define SID_TEMPLATE_LOAD   
TypedWhichId(SID_SFX_START + 663)
 
-#define SID_INSERT_OBJECT   (SID_SFX_START + 561)
+#define SID_INSERT_OBJECT   
TypedWhichId(SID_SFX_START + 561)
 #define SID_INSERT_FLOATINGFRAME(SID_SFX_START + 563)
 #define SID_CLASSIFICATION_APPLY(SID_SFX_START + 672)
 #define SID_WATERMARK   
TypedWhichId(SID_SFX_START + 676)
diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index 8625cd425672..b8269b0dcf13 100644
--- a/include/svx/svxids.hrc
+++ b/include/svx/svxids.hrc
@@ -348,8 +348,8 @@ class XFillGradientItem;
 #define SID_FRAME_LINECOLOR 
TypedWhichId( SID_SVX_START + 202 )
 #define SID_ATTR_LINE_WIDTH_ARG 
TypedWhichId( SID_SVX_START + 203 )
 #define SID_FILL_GRADIENT_JSON  
TypedWhichId( SID_SVX_START + 204 )
-#define SID_SEARCHDLG_SEARCHSTRINGS ( SID_SVX_START + 215 )
-#define SID_SEARCHDLG_REPLACESTRINGS( SID_SVX_START + 216 )
+#define SID_SEARCHDLG_SEARCHSTRINGS 
TypedWhichId( SID_SVX_START + 215 )
+#define SID_SEARCHDLG_REPLACESTRINGS
TypedWhichId( SID_SVX_START + 216 )
 #define SID_ATTR_TABLE  ( SID_SVX_START + 217 )
 #define 

[Libreoffice-commits] core.git: dbaccess/source include/sfx2 include/svl include/svx sc/inc sc/source sd/inc sd/source svx/source sw/source

2023-05-26 Thread Noel Grandin (via logerrit)
 dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx |4 +--
 dbaccess/source/ui/dlg/DbAdminImpl.cxx|6 ++---
 dbaccess/source/ui/dlg/adminpages.cxx |2 -
 dbaccess/source/ui/dlg/adminpages.hxx |3 +-
 dbaccess/source/ui/dlg/dbadmin.cxx|2 -
 dbaccess/source/ui/dlg/detailpages.hxx|2 -
 dbaccess/source/ui/inc/dsitems.hxx|   21 ++-
 include/sfx2/sfxsids.hrc  |4 +--
 include/svl/typedwhich.hxx|4 +--
 include/svx/svxids.hrc|   24 +++---
 sc/inc/sc.hrc |4 +--
 sc/source/ui/docshell/docsh4.cxx  |2 -
 sc/source/ui/view/cellsh.cxx  |6 ++---
 sc/source/ui/view/cellsh2.cxx |6 ++---
 sc/source/ui/view/tabvwsha.cxx|2 -
 sc/source/ui/view/tabvwshh.cxx|2 -
 sd/inc/sdattr.hrc |7 +++---
 sd/source/ui/dlg/dlgsnap.cxx  |4 +--
 sd/source/ui/dlg/present.cxx  |2 -
 sd/source/ui/func/fusldlg.cxx |2 -
 sd/source/ui/func/fusnapln.cxx|4 +--
 svx/source/form/fmshell.cxx   |4 +--
 svx/source/form/tbxform.cxx   |2 -
 svx/source/svdraw/svdedtv1.cxx|4 +--
 sw/source/ui/fldui/fldpage.cxx|2 -
 25 files changed, 64 insertions(+), 61 deletions(-)

New commits:
commit a4d4445e698b78ec0c2eb61a685869bd1d8bfd85
Author: Noel Grandin 
AuthorDate: Fri May 26 12:20:08 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri May 26 21:15:43 2023 +0200

use more TypedWhichId

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

diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx 
b/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx
index cd5d74156d4b..9f47fff7d9c9 100644
--- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx
+++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx
@@ -143,7 +143,7 @@ namespace dbaui
 DECL_LINK(OnTestJavaClickHdl, weld::Button&, void);
 
 OUString  m_sDefaultJdbcDriverName;
-sal_uInt16  m_nPortId;
+TypedWhichId m_nPortId;
 
 std::unique_ptr m_xHeaderText;
 std::unique_ptr m_xFTHelpText;
@@ -238,7 +238,7 @@ namespace dbaui
 virtual void fillWindows(std::vector< 
std::unique_ptr >& _rControlList) override;
 virtual bool commitPage( ::vcl::WizardTypes::CommitPageReason _eReason 
) override;
 
-sal_uInt16  m_nPortId;
+TypedWhichId m_nPortId;
 
 std::unique_ptr m_xHeaderText;
 std::unique_ptr m_xFTHelpText;
diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx 
b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
index 176eb0a9be49..0ce7a06afdb4 100644
--- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx
+++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
@@ -946,7 +946,7 @@ void 
ODbDataSourceAdministrationHelper::implTranslateProperty( SfxItemSet& _rSet
 {
 sal_Int32 nValue = 0;
 _rValue >>= nValue;
-_rSet.Put( SfxInt32Item( _nId, nValue ) );
+_rSet.Put( SfxInt32Item( TypedWhichId(_nId), 
nValue ) );
 }
 else {
 SAL_WARN( "dbaccess", 
"ODbDataSourceAdministrationHelper::implTranslateProperty: invalid property 
value ("
@@ -1013,7 +1013,7 @@ void 
ODbDataSourceAdministrationHelper::convertUrl(SfxItemSet& _rDest)
 ::dbaccess::ODsnTypeCollection* pCollection = 
pTypeCollection->getCollection();
 OSL_ENSURE(pCollection, "ODbAdminDialog::getDatasourceType: invalid type 
collection!");
 
-sal_uInt16 nPortNumberId= 0;
+TypedWhichId nPortNumberId(0);
 sal_Int32 nPortNumber   = -1;
 OUString sNewHostName;
 OUString sUrlPart;
@@ -1056,7 +1056,7 @@ void 
ODbDataSourceAdministrationHelper::convertUrl(SfxItemSet& _rDest)
 if ( !sNewHostName.isEmpty() )
 _rDest.Put(SfxStringItem(DSID_CONN_HOSTNAME, sNewHostName));
 
-if ( nPortNumber != -1 && nPortNumberId != 0 )
+if ( nPortNumber != -1 && nPortNumberId != TypedWhichId(0) )
 _rDest.Put(SfxInt32Item(nPortNumberId, nPortNumber));
 
 }
diff --git a/dbaccess/source/ui/dlg/adminpages.cxx 
b/dbaccess/source/ui/dlg/adminpages.cxx
index e3346d6b9d8a..ec837e803657 100644
--- a/dbaccess/source/ui/dlg/adminpages.cxx
+++ b/dbaccess/source/ui/dlg/adminpages.cxx
@@ -208,7 +208,7 @@ namespace dbaui
 
 _bChangedSomething = true;
 }
-void OGenericAdministrationPage::fillInt32(SfxItemSet& _rSet, const 
weld::SpinButton* pEdit, sal_uInt16 _nID, bool& _bChangedSomething)
+void 

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

2023-05-26 Thread Julien Nabet (via logerrit)
 dbaccess/source/ui/dlg/directsql.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 42547b6472cad484bced8aa47ecadd6d21d587ac
Author: Julien Nabet 
AuthorDate: Fri May 26 14:00:32 2023 +0200
Commit: Julien Nabet 
CommitDate: Fri May 26 17:19:08 2023 +0200

Related tdf#153317: extra check since we deal with signed integers

Thank you Michael Stahl for having spotted this! :-)

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

diff --git a/dbaccess/source/ui/dlg/directsql.cxx 
b/dbaccess/source/ui/dlg/directsql.cxx
index a82f8d4c10f8..856a20319b03 100644
--- a/dbaccess/source/ui/dlg/directsql.cxx
+++ b/dbaccess/source/ui/dlg/directsql.cxx
@@ -325,7 +325,7 @@ namespace dbaui
 // In this case, there's a good chance it's a "Bit" field
 // remark: for unknown reason, getByte(i) gives "\000" 
even if the bit is at 1.
 auto seq = xRow->getBytes(i);
-if ((seq.getLength() == 1) && (seq[0] <= 1))
+if ((seq.getLength() == 1) && (seq[0] >= 0) && (seq[0] <= 
1))
 {
 out.append(OUString::number(static_cast(seq[0])) 
+ ",");
 }


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

2023-05-26 Thread Julien Nabet (via logerrit)
 dbaccess/source/ui/dlg/directsql.cxx |   17 +++--
 1 file changed, 15 insertions(+), 2 deletions(-)

New commits:
commit 16a8943f7dbf338377fe486cc75116b89742c7b0
Author: Julien Nabet 
AuthorDate: Thu May 25 23:51:04 2023 +0200
Commit: Julien Nabet 
CommitDate: Fri May 26 09:09:53 2023 +0200

tdf#153317: direct SQL: try to detect Bit field in Mysql/MariaDB

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

diff --git a/dbaccess/source/ui/dlg/directsql.cxx 
b/dbaccess/source/ui/dlg/directsql.cxx
index 9080e63dca3f..a82f8d4c10f8 100644
--- a/dbaccess/source/ui/dlg/directsql.cxx
+++ b/dbaccess/source/ui/dlg/directsql.cxx
@@ -318,8 +318,21 @@ namespace dbaui
 int i = 1;
 for (;;)
 {
-// be dumb, treat everything as a string
-out.append(xRow->getString(i) + ",");
+// be dumb, treat everything as a string unless below
+// tdf#153317, at least "Bit" type in Mysql/MariaDB gives: 
"\000" or "\001"
+// so retrieve Sequence from getBytes, test if it has a 
length of 1 (so we avoid BLOB/CLOB or other complex types)
+// and test if the value of first byte is one of those.
+// In this case, there's a good chance it's a "Bit" field
+// remark: for unknown reason, getByte(i) gives "\000" 
even if the bit is at 1.
+auto seq = xRow->getBytes(i);
+if ((seq.getLength() == 1) && (seq[0] <= 1))
+{
+out.append(OUString::number(static_cast(seq[0])) 
+ ",");
+}
+else
+{
+out.append(xRow->getString(i) + ",");
+}
 i++;
 }
 }


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

2023-05-25 Thread Julien Nabet (via logerrit)
 dbaccess/source/core/inc/PropertyForward.hxx  |6 +++---
 dbaccess/source/core/misc/PropertyForward.cxx |6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit fd113e2f44d4e821e829fb71ac51da33a3284b2f
Author: Julien Nabet 
AuthorDate: Thu May 25 08:55:13 2023 +0200
Commit: Julien Nabet 
CommitDate: Thu May 25 12:31:34 2023 +0200

Revert "BaseMutex->std::mutex in OPropertyForward"

This reverts commit b0244ef9e44c5c1dc9faf9705f2ae1dba499d62c.

Lock when trying to save a change in a table:

#0  futex_wait (private=0, expected=2, futex_word=0x55f20be59550) at 
../sysdeps/nptl/futex-internal.h:146
#1  __GI___lll_lock_wait (futex=futex@entry=0x55f20be59550, private=0) at 
./nptl/lowlevellock.c:49
#2  0x7f462caab262 in lll_mutex_lock_optimized (mutex=0x55f20be59550) 
at ./nptl/pthread_mutex_lock.c:48
#3  ___pthread_mutex_lock (mutex=0x55f20be59550) at 
./nptl/pthread_mutex_lock.c:93
#4  0x7f45fad12a63 in __gthread_mutex_lock(pthread_mutex_t*) 
(__mutex=0x55f20be59550) at 
/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/x86_64-linux-gnu/c++/12/bits/gthr-default.h:749
#5  0x7f45fad138c5 in std::mutex::lock() (this=0x55f20be59550) at 
/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/std_mutex.h:100
#6  0x7f45fad1389c in std::unique_lock::lock() 
(this=0x7ffd5b691a78) at 
/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/unique_lock.h:139
#7  0x7f45fad136b1 in 
std::unique_lock::unique_lock(std::mutex&) (this=0x7ffd5b691a78, 
__m=...) at 
/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/unique_lock.h:69
#8  0x7f45fb060b55 in 
dbaccess::OPropertyForward::setDefinition(com::sun::star::uno::Reference
 const&)
(this=0x55f20be59520, _xDest=uno::Reference to 
(dbaccess::OTableColumnDescriptor *) 0x55f20bd765b8) at 
/home/julien/lo/libreoffice/dbaccess/source/core/misc/PropertyForward.cxx:128
#9  0x7f45fb039edc in 
dbaccess::OContainerMediator::elementInserted(com::sun::star::container::ContainerEvent
 const&) (this=0x55f20bd9ac30, _rEvent=...)
at 
/home/julien/lo/libreoffice/dbaccess/source/core/misc/ContainerMediator.cxx:105
#10 0x7f461ebaa03e in 
comphelper::OInterfaceContainerHelper3::NotifySingleListener::operator()(com::sun::star::uno::Reference
 const&) const (this=0x7ffd5b691c90, listener=uno::Reference to 
(dbaccess::OContainerMediator *) 0x55f20bd9ac58)
at include/comphelper/interfacecontainer3.hxx:252
#11 0x7f461eba9e4c in 
comphelper::OInterfaceContainerHelper3::forEach::NotifySingleListener
 
>(comphelper::OInterfaceContainerHelper3::NotifySingleListener
 const&) (this=0x55f20ba55ee0, func=...) at 
include/comphelper/interfacecontainer3.hxx:274
#12 0x7f461eb8aab3 in 
comphelper::OInterfaceContainerHelper3::notifyEach(void
 
(com::sun::star::container::XContainerListener::*)(com::sun::star::container::ContainerEvent
 const&), com::sun::star::container::ContainerEvent const&) 
(this=0x55f20ba55ee0, NotificationMethod= table offset 32, Event=...)
at include/comphelper/interfacecontainer3.hxx:289
#13 0x7f461eb8527d in 
connectivity::sdbcx::OCollection::appendByDescriptor(com::sun::star::uno::Reference
 const&)
(this=0x55f20ba55e80, descriptor=uno::Reference to 
(dbaccess::OTableColumnDescriptor *) 0x55f20b909188) at 
/home/julien/lo/libreoffice/connectivity/source/sdbcx/VCollection.cxx:388
#14 0x7f45fb060571 in 
dbaccess::OPropertyForward::propertyChange(com::sun::star::beans::PropertyChangeEvent
 const&) (this=0x55f20be59520, evt=...)
at 
/home/julien/lo/libreoffice/dbaccess/source/core/misc/PropertyForward.cxx:94
#15 0x7f462b59ac96 in cppu::OPropertySetHelper::fire(int*, 
com::sun::star::uno::Any const*, com::sun::star::uno::Any const*, int, unsigned 
char)
(this=0x55f20b7e8098, pnHandles=0x7ffd5b69320c, 
pNewValues=0x7ffd5b6934a8, pOldValues=0x7ffd5b693198, nHandles=1, bVetoable=0 
'\000') at /home/julien/lo/libreoffice/cppuhelper/source/propshlp.cxx:680
#16 0x7f462b59bb77 in cppu::OPropertySetHelper::impl_fireAll(int*, 
com::sun::star::uno::Any const*, com::sun::star::uno::Any const*, int)
(this=0x55f20b7e8098, i_handles=0x7ffd5b69320c, 
i_newValues=0x7ffd5b6934a8, i_oldValues=0x7ffd5b693198, i_count=1) at 
/home/julien/lo/libreoffice/cppuhelper/source/propshlp.cxx:568
#17 0x7f462b59a64e in 
cppu::OPropertySetHelper::setFastPropertyValue(int, com::sun::star::uno::Any 
const&) (this=0x55f20b7e8098, nHandle=22, rValue=uno::Any("long": 1))
at /home/julien/lo/libreoffice/cppuhelper/source/propshlp.cxx:543
#18 0x7f462b59884b in 
cppu::OPropertySetHelper::setPropertyValue(rtl::OUString const&, 
com::sun::star::uno::Any const&) (this=0x55f20b7e8098, 
rPropertyName="FormatKey", rValue=uno::Any("long": 1))
at 

[Libreoffice-commits] core.git: dbaccess/source extensions/source forms/source fpicker/source framework/source oox/source

2023-04-20 Thread Gabor Kelemen (via logerrit)
 dbaccess/source/core/misc/objectnameapproval.cxx|2 --
 dbaccess/source/core/recovery/storagestream.cxx |1 -
 dbaccess/source/core/recovery/storagetextstream.cxx |1 -
 dbaccess/source/ui/inc/dbwiz.hxx|1 -
 dbaccess/source/ui/inc/dbwizsetup.hxx   |1 -
 dbaccess/source/ui/misc/defaultobjectnamecheck.cxx  |1 -
 extensions/source/logging/loghandler.cxx|1 -
 extensions/source/propctrlr/browserline.cxx |2 --
 extensions/source/propctrlr/defaultforminspection.cxx   |1 -
 extensions/source/propctrlr/defaulthelpprovider.cxx |1 -
 extensions/source/propctrlr/objectinspectormodel.cxx|1 -
 extensions/source/propctrlr/propertycontrolextender.cxx |1 -
 forms/source/component/propertybaghelper.cxx|1 -
 forms/source/helper/commandimageprovider.cxx|2 --
 forms/source/runtime/formoperations.cxx |1 -
 forms/source/xforms/binding.cxx |1 -
 forms/source/xforms/model.cxx   |1 -
 fpicker/source/office/contentenumeration.cxx|2 --
 framework/source/fwe/helper/documentundoguard.cxx   |1 -
 oox/source/helper/propertymap.cxx   |3 ---
 20 files changed, 26 deletions(-)

New commits:
commit 890bf59e0a3507b009284d81632a3381fbe9a70f
Author: Gabor Kelemen 
AuthorDate: Wed Apr 12 00:26:41 2023 +0200
Commit: Thorsten Behrens 
CommitDate: Thu Apr 20 13:14:37 2023 +0200

Run clang-tidy with misc-unused-using-decls on modules [d-o]*

To remove unneeded using declarations.

Via the simple script:

for i in $(find $dirname -name "*cxx" -o -name "*hxx" ); do
clang-tidy-12  --checks="-*,misc-unused-using-decls" "$i";
done

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

diff --git a/dbaccess/source/core/misc/objectnameapproval.cxx 
b/dbaccess/source/core/misc/objectnameapproval.cxx
index 5b7faa6ada9b..fa03e81e3d09 100644
--- a/dbaccess/source/core/misc/objectnameapproval.cxx
+++ b/dbaccess/source/core/misc/objectnameapproval.cxx
@@ -27,13 +27,11 @@ namespace dbaccess
 {
 
 using ::com::sun::star::sdbc::XConnection;
-using ::com::sun::star::uno::WeakReference;
 using ::com::sun::star::uno::Reference;
 using ::com::sun::star::lang::DisposedException;
 using ::com::sun::star::sdb::tools::XConnectionTools;
 using ::com::sun::star::uno::UNO_QUERY_THROW;
 using ::com::sun::star::sdb::tools::XObjectNames;
-using ::com::sun::star::uno::XInterface;
 
 namespace CommandType = com::sun::star::sdb::CommandType;
 
diff --git a/dbaccess/source/core/recovery/storagestream.cxx 
b/dbaccess/source/core/recovery/storagestream.cxx
index 232657cf6ea5..613bfb729903 100644
--- a/dbaccess/source/core/recovery/storagestream.cxx
+++ b/dbaccess/source/core/recovery/storagestream.cxx
@@ -27,7 +27,6 @@ namespace dbaccess
 {
 
 using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
 using ::com::sun::star::uno::UNO_SET_THROW;
 using ::com::sun::star::embed::XStorage;
 using ::com::sun::star::io::XStream;
diff --git a/dbaccess/source/core/recovery/storagetextstream.cxx 
b/dbaccess/source/core/recovery/storagetextstream.cxx
index 582e1b78e676..3d5a6a12bff3 100644
--- a/dbaccess/source/core/recovery/storagetextstream.cxx
+++ b/dbaccess/source/core/recovery/storagetextstream.cxx
@@ -28,7 +28,6 @@ namespace dbaccess
 using ::com::sun::star::uno::XComponentContext;
 using ::com::sun::star::embed::XStorage;
 using ::com::sun::star::io::TextOutputStream;
-using ::com::sun::star::io::XTextOutputStream2;
 
 constexpr OUStringLiteral sLineFeed = u"\n";
 
diff --git a/dbaccess/source/ui/inc/dbwiz.hxx b/dbaccess/source/ui/inc/dbwiz.hxx
index 0c51ab1a9cfb..744c308a6822 100644
--- a/dbaccess/source/ui/inc/dbwiz.hxx
+++ b/dbaccess/source/ui/inc/dbwiz.hxx
@@ -37,7 +37,6 @@ namespace com::sun::star {
 }
 
 using vcl::WizardTypes::WizardState;
-using vcl::WizardTypes::CommitPageReason;
 
 namespace dbaccess
 {
diff --git a/dbaccess/source/ui/inc/dbwizsetup.hxx 
b/dbaccess/source/ui/inc/dbwizsetup.hxx
index 0829b328d2fd..f902f35e4c9b 100644
--- a/dbaccess/source/ui/inc/dbwizsetup.hxx
+++ b/dbaccess/source/ui/inc/dbwizsetup.hxx
@@ -38,7 +38,6 @@ namespace com::sun::star {
 }
 
 using vcl::WizardTypes::WizardState;
-using vcl::WizardTypes::CommitPageReason;
 using vcl::RoadmapWizardTypes::PathId;
 
 namespace dbaui
diff --git a/dbaccess/source/ui/misc/defaultobjectnamecheck.cxx 
b/dbaccess/source/ui/misc/defaultobjectnamecheck.cxx
index 736d9378ae9b..960219223051 100644
--- a/dbaccess/source/ui/misc/defaultobjectnamecheck.cxx
+++ b/dbaccess/source/ui/misc/defaultobjectnamecheck.cxx
@@ -46,7 +46,6 @@ namespace 

[Libreoffice-commits] core.git: dbaccess/source editeng/source include/tools svtools/source sw/inc sw/source tools/source vcl/source

2023-04-11 Thread Mike Kaganski (via logerrit)
 dbaccess/source/ui/misc/TokenWriter.cxx |   20 +++
 editeng/source/editeng/impedit4.cxx |   54 +-
 include/tools/stream.hxx|4 -
 svtools/source/svrtf/rtfout.cxx |4 -
 sw/inc/shellio.hxx  |4 -
 sw/source/filter/writer/writer.cxx  |   35 
 sw/source/filter/ww8/rtfattributeoutput.cxx |   67 +++
 sw/source/filter/ww8/rtfexport.cxx  |   62 ++---
 sw/source/filter/ww8/rtfexport.hxx  |2 
 tools/source/stream/stream.cxx  |   10 ---
 vcl/source/filter/ipdf/pdfdocument.cxx  |   80 ++--
 11 files changed, 145 insertions(+), 197 deletions(-)

New commits:
commit 1155def95bfe5b43f2b68e6c85632716df87bcf8
Author: Mike Kaganski 
AuthorDate: Tue Apr 11 00:04:24 2023 +0300
Commit: Mike Kaganski 
CommitDate: Tue Apr 11 09:06:10 2023 +0200

Drop Writer::OutLong

... and use SvStream::WriteNumberAsString, replacing Write[U]Int32AsString

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

diff --git a/dbaccess/source/ui/misc/TokenWriter.cxx 
b/dbaccess/source/ui/misc/TokenWriter.cxx
index dea0a750646d..8d898fe24e1f 100644
--- a/dbaccess/source/ui/misc/TokenWriter.cxx
+++ b/dbaccess/source/ui/misc/TokenWriter.cxx
@@ -324,7 +324,7 @@ bool ORTFImportExport::Write()
 m_pStream->WriteOString(OOO_STRING_SVTOOLS_RTF_ANSI);
 if (sal_uInt32 nCpg = rtl_getWindowsCodePageFromTextEncoding(m_eDestEnc); 
nCpg && nCpg != 65001)
 {
-
m_pStream->WriteOString(OOO_STRING_SVTOOLS_RTF_ANSICPG).WriteUInt32AsString(nCpg);
+
m_pStream->WriteOString(OOO_STRING_SVTOOLS_RTF_ANSICPG).WriteNumberAsString(nCpg);
 }
 m_pStream->WriteOString(SAL_NEWLINE_STRING);
 
@@ -351,7 +351,7 @@ bool ORTFImportExport::Write()
 sal_Int32 nTok{-1}; // to compensate pre-increment
 do {
 m_pStream->WriteOString( "\\f" );
-m_pStream->WriteInt32AsString(++nTok);
+m_pStream->WriteNumberAsString(++nTok);
 m_pStream->WriteOString( "\\fcharset0\\fnil " );
 m_pStream->WriteOString( o3tl::getToken(aFonts, 0, ';', nIdx) );
 m_pStream->WriteChar( ';' );
@@ -361,11 +361,11 @@ bool ORTFImportExport::Write()
 m_pStream->WriteOString( SAL_NEWLINE_STRING );
 // write the rtf color table
 m_pStream->WriteChar( '{' ).WriteOString( OOO_STRING_SVTOOLS_RTF_COLORTBL 
).WriteOString( OOO_STRING_SVTOOLS_RTF_RED );
-m_pStream->WriteUInt32AsString(aColor.GetRed());
+m_pStream->WriteNumberAsString(aColor.GetRed());
 m_pStream->WriteOString( OOO_STRING_SVTOOLS_RTF_GREEN );
-m_pStream->WriteUInt32AsString(aColor.GetGreen());
+m_pStream->WriteNumberAsString(aColor.GetGreen());
 m_pStream->WriteOString( OOO_STRING_SVTOOLS_RTF_BLUE );
-m_pStream->WriteUInt32AsString(aColor.GetBlue());
+m_pStream->WriteNumberAsString(aColor.GetBlue());
 
 m_pStream->WriteOString( 
";\\red255\\green255\\blue255;\\red192\\green192\\blue192;}" )
 .WriteOString( SAL_NEWLINE_STRING );
@@ -373,7 +373,7 @@ bool ORTFImportExport::Write()
 static char const aCell1[] = 
"\\clbrdrl\\brdrs\\brdrcf0\\clbrdrt\\brdrs\\brdrcf0\\clbrdrb\\brdrs\\brdrcf0\\clbrdrr\\brdrs\\brdrcf0\\clshdng1\\clcfpat2\\cellx";
 
 m_pStream->WriteOString( OOO_STRING_SVTOOLS_RTF_TROWD ).WriteOString( 
OOO_STRING_SVTOOLS_RTF_TRGAPH );
-m_pStream->WriteInt32AsString(40);
+m_pStream->WriteOString("40");
 m_pStream->WriteOString( SAL_NEWLINE_STRING );
 
 if(m_xObject.is())
@@ -394,7 +394,7 @@ bool ORTFImportExport::Write()
 for( sal_Int32 i=1; i<=nCount; ++i )
 {
 m_pStream->WriteOString( aCell1 );
-m_pStream->WriteInt32AsString(i*CELL_X);
+m_pStream->WriteNumberAsString(i*CELL_X);
 m_pStream->WriteOString( SAL_NEWLINE_STRING );
 }
 
@@ -497,7 +497,7 @@ void ORTFImportExport::appendRow(OString const * 
pHorzChar,sal_Int32 _nColumnCou
 {
 ++kk;
 m_pStream->WriteOString( OOO_STRING_SVTOOLS_RTF_TROWD ).WriteOString( 
OOO_STRING_SVTOOLS_RTF_TRGAPH );
-m_pStream->WriteInt32AsString(40);
+m_pStream->WriteOString("40");
 m_pStream->WriteOString( SAL_NEWLINE_STRING );
 
 static char const aCell2[] = 
"\\clbrdrl\\brdrs\\brdrcf2\\clbrdrt\\brdrs\\brdrcf2\\clbrdrb\\brdrs\\brdrcf2\\clbrdrr\\brdrs\\brdrcf2\\clshdng1\\clcfpat1\\cellx";
@@ -505,7 +505,7 @@ void ORTFImportExport::appendRow(OString const * 
pHorzChar,sal_Int32 _nColumnCou
 for ( sal_Int32 i=1; i<=_nColumnCount; ++i )
 {
 m_pStream->WriteOString( aCell2 );
-m_pStream->WriteInt32AsString(i*CELL_X);
+m_pStream->WriteNumberAsString(i*CELL_X);
 m_pStream->WriteOString( SAL_NEWLINE_STRING );
 }
 
@@ -649,7 

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

2023-03-26 Thread Mike Kaganski (via logerrit)
 dbaccess/source/filter/hsqldb/fbcreateparser.cxx |   33 ---
 1 file changed, 12 insertions(+), 21 deletions(-)

New commits:
commit b6dc6712aef820c2d296101961b163d665633d9a
Author: Mike Kaganski 
AuthorDate: Sun Mar 26 10:02:26 2023 +0300
Commit: Mike Kaganski 
CommitDate: Sun Mar 26 08:04:42 2023 +

Simplify FbCreateStmtParser::compose

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

diff --git a/dbaccess/source/filter/hsqldb/fbcreateparser.cxx 
b/dbaccess/source/filter/hsqldb/fbcreateparser.cxx
index 1740998c62d2..5d4244f8085b 100644
--- a/dbaccess/source/filter/hsqldb/fbcreateparser.cxx
+++ b/dbaccess/source/filter/hsqldb/fbcreateparser.cxx
@@ -29,12 +29,6 @@ using namespace css::sdbc;
 
 namespace
 {
-void lcl_appendWithSpace(OUStringBuffer& sBuff, std::u16string_view sStr)
-{
-sBuff.append(" ");
-sBuff.append(sStr);
-}
-
 OUString lcl_DataTypetoFbTypeName(sal_Int32 eType)
 {
 switch (eType)
@@ -110,8 +104,7 @@ void 
FbCreateStmtParser::appendPrimaryKeyPart(OUStringBuffer& rSql) const
 if (sPrimaryKeys.empty())
 return; // no primary key specified
 
-rSql.append(",");
-rSql.append("PRIMARY KEY(");
+rSql.append(",PRIMARY KEY(");
 auto it = sPrimaryKeys.cbegin();
 while (it != sPrimaryKeys.end())
 {
@@ -135,15 +128,14 @@ OUString FbCreateStmtParser::compose() const
 {
 ensureProperTableLengths();
 OUStringBuffer sSql(128);
-sSql.append("CREATE TABLE " + getTableName());
+sSql.append("CREATE TABLE " + getTableName() + " ("); // column declaration
 
-lcl_appendWithSpace(sSql, u"("); // column declaration
 auto& rColumns = getColumnDef();
 auto columnIter = rColumns.cbegin();
 while (columnIter != rColumns.end())
 {
-lcl_appendWithSpace(sSql, columnIter->getName());
-lcl_appendWithSpace(sSql, 
lcl_DataTypetoFbTypeName(columnIter->getDataType()));
+sSql.append(" " + columnIter->getName() + " "
++ lcl_DataTypetoFbTypeName(columnIter->getDataType()));
 
 std::vector params{ columnIter->getParams() };
 
@@ -173,31 +165,30 @@ OUString FbCreateStmtParser::compose() const
 // special modifiers here, based on type (e.g. charset, subtype)
 OUString sModifier = lcl_getTypeModifier(columnIter->getDataType());
 if (!sModifier.isEmpty())
-lcl_appendWithSpace(sSql, sModifier);
+sSql.append(" " + sModifier);
 
 if (columnIter->isAutoIncremental())
 {
-lcl_appendWithSpace(sSql, u"GENERATED BY DEFAULT AS IDENTITY 
(START WITH ");
-
 // start with 0:
 // HSQLDB: first value will be 0.
 // Firebird: first value will be 1.
-sSql.append(OUString::number(columnIter->getStartValue() - 1) + 
")");
+sSql.append(" GENERATED BY DEFAULT AS IDENTITY (START WITH "
++ OUString::number(columnIter->getStartValue() - 1) + 
")");
 }
 else if (!columnIter->isNullable())
-lcl_appendWithSpace(sSql, u"NOT NULL");
+sSql.append(" NOT NULL");
 
 if (columnIter->isCaseInsensitive())
-lcl_appendWithSpace(sSql, u"COLLATE UNICODE_CI");
+sSql.append(" COLLATE UNICODE_CI");
 
 const OUString& sDefaultVal = columnIter->getDefault();
 if (!sDefaultVal.isEmpty())
 {
-lcl_appendWithSpace(sSql, u"DEFAULT");
+sSql.append(" DEFAULT ");
 if (sDefaultVal.equalsIgnoreAsciiCase("NOW"))
-lcl_appendWithSpace(sSql, u"\'NOW\'"); // Fb likes it single 
quoted
+sSql.append("'NOW'"); // Fb likes it single quoted
 else
-lcl_appendWithSpace(sSql, sDefaultVal);
+sSql.append(sDefaultVal);
 }
 
 ++columnIter;


[Libreoffice-commits] core.git: dbaccess/source desktop/source

2023-03-25 Thread Noel Grandin (via logerrit)
 dbaccess/source/filter/hsqldb/fbalterparser.cxx   |6 --
 dbaccess/source/filter/hsqldb/fbcreateparser.cxx  |6 --
 dbaccess/source/filter/hsqldb/hsqlimport.cxx  |8 ---
 dbaccess/source/ui/misc/DExport.cxx   |3 -
 dbaccess/source/ui/misc/WCopyTable.cxx|3 -
 dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx  |3 -
 dbaccess/source/ui/misc/defaultobjectnamecheck.cxx|3 -
 dbaccess/source/ui/querydesign/QueryDesignView.cxx|   24 --
 desktop/source/app/officeipcthread.cxx|8 +--
 desktop/source/deployment/gui/dp_gui_extlistbox.cxx   |4 -
 desktop/source/deployment/gui/dp_gui_updatedialog.cxx |   14 +
 desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx  |5 --
 desktop/source/deployment/manager/dp_manager.cxx  |   11 ++--
 desktop/source/deployment/misc/dp_misc.cxx|3 -
 desktop/source/deployment/registry/component/dp_component.cxx |   14 +
 desktop/source/deployment/registry/dp_registry.cxx|8 +--
 desktop/source/lib/init.cxx   |7 +-
 desktop/source/migration/migration.cxx|7 +-
 desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx|7 --
 desktop/source/pkgchk/unopkg/unopkg_misc.cxx  |7 --
 20 files changed, 54 insertions(+), 97 deletions(-)

New commits:
commit d638a512ac19fa68f7760ff110469337f061f481
Author: Noel Grandin 
AuthorDate: Fri Mar 24 19:08:40 2023 +0200
Commit: Noel Grandin 
CommitDate: Sat Mar 25 06:21:25 2023 +

loplugin:stringadd in d*

after my patch to merge the bufferadd loplugin into stringadd

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

diff --git a/dbaccess/source/filter/hsqldb/fbalterparser.cxx 
b/dbaccess/source/filter/hsqldb/fbalterparser.cxx
index 024598c0b319..a8948069e4e6 100644
--- a/dbaccess/source/filter/hsqldb/fbalterparser.cxx
+++ b/dbaccess/source/filter/hsqldb/fbalterparser.cxx
@@ -32,15 +32,13 @@ OUString FbAlterStmtParser::compose() const
 }
 else if (getActionType() == AlterAction::ADD_FOREIGN)
 return getStatement(); // do nothing with that
-OUStringBuffer sSql("ALTER TABLE ");
-sSql.append(getTableName());
+OUStringBuffer sSql("ALTER TABLE " + getTableName());
 
 if (getActionType() == AlterAction::IDENTITY_RESTART)
 {
 sSql.append(" ALTER COLUMN ");
 }
-sSql.append(getColumnName());
-sSql.append(" RESTART WITH ");
+sSql.append(getColumnName() + " RESTART WITH ");
 
 // Firebird: restart with 0 means the first number is 1, not 0.
 sSql.append(getIdentityParam() - 1);
diff --git a/dbaccess/source/filter/hsqldb/fbcreateparser.cxx 
b/dbaccess/source/filter/hsqldb/fbcreateparser.cxx
index f3399474c272..1740998c62d2 100644
--- a/dbaccess/source/filter/hsqldb/fbcreateparser.cxx
+++ b/dbaccess/source/filter/hsqldb/fbcreateparser.cxx
@@ -135,8 +135,7 @@ OUString FbCreateStmtParser::compose() const
 {
 ensureProperTableLengths();
 OUStringBuffer sSql(128);
-sSql.append("CREATE TABLE ");
-sSql.append(getTableName());
+sSql.append("CREATE TABLE " + getTableName());
 
 lcl_appendWithSpace(sSql, u"("); // column declaration
 auto& rColumns = getColumnDef();
@@ -183,8 +182,7 @@ OUString FbCreateStmtParser::compose() const
 // start with 0:
 // HSQLDB: first value will be 0.
 // Firebird: first value will be 1.
-sSql.append(columnIter->getStartValue() - 1);
-sSql.append(")");
+sSql.append(OUString::number(columnIter->getStartValue() - 1) + 
")");
 }
 else if (!columnIter->isNullable())
 lcl_appendWithSpace(sSql, u"NOT NULL");
diff --git a/dbaccess/source/filter/hsqldb/hsqlimport.cxx 
b/dbaccess/source/filter/hsqldb/hsqlimport.cxx
index 045a32f93ce3..af9b637cb862 100644
--- a/dbaccess/source/filter/hsqldb/hsqlimport.cxx
+++ b/dbaccess/source/filter/hsqldb/hsqlimport.cxx
@@ -180,9 +180,7 @@ OUString lcl_createInsertStatement(std::u16string_view 
sTableName,
const 
std::vector& rColTypes)
 {
 assert(rColTypes.size() > 0);
-OUStringBuffer sql("INSERT INTO ");
-sql.append(sTableName);
-sql.append(" (");
+OUStringBuffer sql(OUString::Concat("INSERT INTO ") + sTableName + " (");
 
 // column names
 for (size_t i = 0; i < rColTypes.size(); ++i)
@@ -191,9 +189,7 @@ OUString lcl_createInsertStatement(std::u16string_view 
sTableName,
 if (i < rColTypes.size() - 1)
 sql.append(", ");
 }
-sql.append(")");
-
-sql.append(" VALUES (");
+sql.append(") VALUES (");
 for (size_t i = 0; i < 

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

2023-03-16 Thread Caolán McNamara (via logerrit)
 dbaccess/source/ui/querydesign/JoinTableView.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 89657b5309a276f6be59d74651a94132590be028
Author: Caolán McNamara 
AuthorDate: Thu Mar 16 09:11:47 2023 +
Commit: Caolán McNamara 
CommitDate: Thu Mar 16 11:37:57 2023 +

Resolves: tdf#153908 scrolling relationships moves the wrong direction

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

diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx 
b/dbaccess/source/ui/querydesign/JoinTableView.cxx
index 2068e2a48ff2..e816dfa9e585 100644
--- a/dbaccess/source/ui/querydesign/JoinTableView.cxx
+++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx
@@ -197,13 +197,13 @@ void OJoinTableView::dispose()
 IMPL_LINK(OJoinTableView, HorzScrollHdl, weld::Scrollbar&, rScrollbar, void)
 {
 // move all windows
-ScrollPane(m_aScrollOffset.X() - rScrollbar.adjustment_get_value(), true, 
false);
+ScrollPane(rScrollbar.adjustment_get_value() - m_aScrollOffset.X(), true, 
false);
 }
 
 IMPL_LINK(OJoinTableView, VertScrollHdl, weld::Scrollbar&, rScrollbar, void)
 {
 // move all windows
-ScrollPane(m_aScrollOffset.Y() - rScrollbar.adjustment_get_value(), false, 
false);
+ScrollPane(rScrollbar.adjustment_get_value() - m_aScrollOffset.Y(), false, 
false);
 }
 
 void OJoinTableView::Resize()


[Libreoffice-commits] core.git: dbaccess/source forms/source i18npool/source sc/source starmath/source svl/source svx/source xmloff/source

2023-03-13 Thread Noel Grandin (via logerrit)
 dbaccess/source/ui/browser/unodatbr.cxx   |3 -
 forms/source/xforms/model_ui.cxx  |6 --
 i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx |2 
 sc/source/ui/xmlsource/xmlsourcedlg.cxx   |7 +-
 starmath/source/mathtype.cxx  |   12 
+---
 svl/source/numbers/zforlist.cxx   |   26 
+++---
 svx/source/svdraw/svdattr.cxx |3 -
 xmloff/source/style/xmlnumfi.cxx  |4 -
 8 files changed, 22 insertions(+), 41 deletions(-)

New commits:
commit 13d3ae64dbf2ac4bda8e831c1da890b09024a8bb
Author: Noel Grandin 
AuthorDate: Mon Mar 13 12:51:29 2023 +0200
Commit: Noel Grandin 
CommitDate: Mon Mar 13 16:47:32 2023 +

make more use of OUStringBuffer::append(OUStringConcat)

where we can avoid constructing temporary OUStrings

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

diff --git a/dbaccess/source/ui/browser/unodatbr.cxx 
b/dbaccess/source/ui/browser/unodatbr.cxx
index 0a54ccb4051d..06081b665108 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -2541,8 +2541,7 @@ bool SbaTableQueryBrowser::implSelect(const 
weld::TreeIter* pEntry)
 {
 while (rTreeView.iter_compare(*xNextTemp, *xConnection) != 0)
 {
-sNameBuffer.insert(0,'/');
-sNameBuffer.insert(0, rTreeView.get_text(*xTemp));
+sNameBuffer.insert(0, rTreeView.get_text(*xTemp) + "/");
 rTreeView.copy_iterator(*xNextTemp, *xTemp);
 if (!rTreeView.iter_parent(*xNextTemp))
 break;
diff --git a/forms/source/xforms/model_ui.cxx b/forms/source/xforms/model_ui.cxx
index 616ea8863180..e8208565f4fe 100644
--- a/forms/source/xforms/model_ui.cxx
+++ b/forms/source/xforms/model_ui.cxx
@@ -159,8 +159,7 @@ static void lcl_OutName( OUStringBuffer& rBuffer,
 OUString sPrefix = xNode->getPrefix();
 if( !sPrefix.isEmpty() )
 {
-rBuffer.insert( 0, ':' );
-rBuffer.insert( 0, sPrefix );
+rBuffer.insert( 0, sPrefix + ":" );
 }
 }
 
@@ -194,8 +193,7 @@ static void lcl_OutInstance( OUStringBuffer& rBuffer,
 sInstanceName = sId;
 }
 
-rBuffer.insert( 0, sInstanceName );
-rBuffer.insert( 0, "instance('" );
+rBuffer.insert( 0, "instance('" + sInstanceName );
 }
 
 OUString Model::getDefaultBindingExpressionForNode(
diff --git 
a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx 
b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
index 7d807a31ac8d..68e0fe2bb704 100644
--- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
+++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
@@ -452,7 +452,7 @@ void lcl_formatPersianWord( sal_Int32 nNumber, OUString& 
rsResult )
 {
 if (nSection > SAL_N_ELEMENTS( table_PersianWord_decadeX))
 throw IllegalArgumentException();   // does not happen with 
sal_Int32
-aTemp.insert( 0, asPersianWord_conjunction).insert( 0, 
table_PersianWord_decadeX[nSection-1]);
+aTemp.insert( 0, table_PersianWord_decadeX[nSection-1] + 
asPersianWord_conjunction );
 }
 
 unsigned int nDigit;
diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx 
b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
index 663db63475d8..f82b693e6073 100644
--- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx
+++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
@@ -49,11 +49,12 @@ OUString getXPath(
 rNamespaces.push_back(pData->mnNamespaceID);
 
 // element separator is '/' whereas attribute separator is '/@' in 
xpath.
-aBuf.insert(0, rTree.get_text(*xEntry, 0));
+std::u16string_view sSeparator;
 if (isAttribute(rTree, *xEntry))
-aBuf.insert(0, "/@");
+sSeparator = u"/@";
 else
-aBuf.insert(0, '/');
+sSeparator = u"/";
+aBuf.insert(0, sSeparator + rTree.get_text(*xEntry, 0));
 }
 while (rTree.iter_parent(*xEntry));
 
diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx
index 9273a4498b61..a3199c06c686 100644
--- a/starmath/source/mathtype.cxx
+++ b/starmath/source/mathtype.cxx
@@ -683,8 +683,7 @@ bool MathType::HandleRecords(int nLevel, sal_uInt8 
nSelector,
 {
 OUString aStr;
 TypeFaceToString(aStr,nTypeFace);
-aStr += "\"";
-rRet.insert(nTextStart,aStr);
+rRet.insert(nTextStart, aStr + "\"");
 rRet.append("\"");
 }
 else if 

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

2023-03-07 Thread Mike Kaganski (via logerrit)
 dbaccess/source/filter/xml/xmlExport.hxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit e385534e1fcbb626e50076d69e91bd31f537527f
Author: Mike Kaganski 
AuthorDate: Wed Mar 8 09:16:09 2023 +0300
Commit: Mike Kaganski 
CommitDate: Wed Mar 8 06:37:10 2023 +

Fix no-PCH build

Change-Id: Ie3a60558c9a459d2809883590649bee75244a8df
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148453
Reviewed-by: Michael Weghorn 
Tested-by: Mike Kaganski 

diff --git a/dbaccess/source/filter/xml/xmlExport.hxx 
b/dbaccess/source/filter/xml/xmlExport.hxx
index e35800efd298..4dbd3f165204 100644
--- a/dbaccess/source/filter/xml/xmlExport.hxx
+++ b/dbaccess/source/filter/xml/xmlExport.hxx
@@ -25,6 +25,8 @@
 #include 
 #include 
 #include 
+
+#include 
 #include 
 #include 
 #include 


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

2023-02-27 Thread Noel Grandin (via logerrit)
 dbaccess/source/core/dataaccess/documenteventexecutor.cxx |   32 ++--
 dbaccess/source/core/dataaccess/documenteventexecutor.hxx |9 +-
 dbaccess/source/core/dataaccess/documentevents.cxx|   53 -
 dbaccess/source/core/inc/documentevents.hxx   |8 --
 dbaccess/source/core/inc/recovery/dbdocrecovery.hxx   |4 -
 dbaccess/source/core/recovery/dbdocrecovery.cxx   |   21 +
 dbaccess/source/core/recovery/storagetextstream.cxx   |   19 +---
 dbaccess/source/core/recovery/storagetextstream.hxx   |7 -
 dbaccess/source/core/recovery/storagexmlstream.cxx|   54 +-
 dbaccess/source/core/recovery/storagexmlstream.hxx|   15 ++-
 dbaccess/source/core/recovery/subcomponentrecovery.cxx|4 -
 dbaccess/source/ui/inc/imageprovider.hxx  |   14 ++-
 dbaccess/source/ui/inc/singledoccontroller.hxx|6 -
 dbaccess/source/ui/misc/imageprovider.cxx |   38 +++--
 dbaccess/source/ui/misc/singledoccontroller.cxx   |   20 +
 15 files changed, 111 insertions(+), 193 deletions(-)

New commits:
commit 5993c41c75974c507683cdd1f19db45dd0c03dbf
Author: Noel Grandin 
AuthorDate: Mon Feb 27 10:18:54 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Feb 28 07:15:33 2023 +

flatten some internal classes in dbaccess

no need for the pimpl pattern here

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

diff --git a/dbaccess/source/core/dataaccess/documenteventexecutor.cxx 
b/dbaccess/source/core/dataaccess/documenteventexecutor.cxx
index c3f8a01ea3e4..e1cb9f3f4e57 100644
--- a/dbaccess/source/core/dataaccess/documenteventexecutor.cxx
+++ b/dbaccess/source/core/dataaccess/documenteventexecutor.cxx
@@ -57,24 +57,14 @@ namespace dbaccess
 
 using namespace ::com::sun::star;
 
-// DocumentEventExecutor_Data
-struct DocumentEventExecutor_Data
-{
-WeakReference< XEventsSupplier >xDocument;
-Reference< XURLTransformer >xURLTransformer;
-
-explicit DocumentEventExecutor_Data( const Reference< XEventsSupplier 
>& _rxDocument )
-:xDocument( _rxDocument )
-{
-}
-};
-
 namespace
 {
-void lcl_dispatchScriptURL_throw( DocumentEventExecutor_Data const & 
_rDocExecData,
+void lcl_dispatchScriptURL_throw(
+css::uno::WeakReference< css::document::XEventsSupplier > const & 
xWeakDocument,
+css::uno::Reference< css::util::XURLTransformer > const & 
xURLTransformer,
 const OUString& _rScriptURL, const DocumentEvent& _rTrigger )
 {
-Reference< XModel > xDocument( _rDocExecData.xDocument.get(), 
UNO_QUERY_THROW );
+Reference< XModel > xDocument( xWeakDocument.get(), 
UNO_QUERY_THROW );
 
 Reference< XController > xController( 
xDocument->getCurrentController() );
 Reference< XDispatchProvider > xDispProv;
@@ -88,8 +78,8 @@ namespace dbaccess
 
 URL aScriptURL;
 aScriptURL.Complete = _rScriptURL;
-if ( _rDocExecData.xURLTransformer.is() )
-_rDocExecData.xURLTransformer->parseStrict( aScriptURL );
+if ( xURLTransformer.is() )
+xURLTransformer->parseStrict( aScriptURL );
 
 // unfortunately, executing a script can trigger all kind of 
complex stuff, and unfortunately, not
 // every component involved into this properly cares for thread 
safety. To be on the safe side,
@@ -113,7 +103,7 @@ namespace dbaccess
 // DocumentEventExecutor
 DocumentEventExecutor::DocumentEventExecutor( const 
Reference & _rContext,
 const Reference< XEventsSupplier >& _rxDocument )
-:m_pData( new DocumentEventExecutor_Data( _rxDocument ) )
+:mxDocument( _rxDocument )
 {
 Reference< XDocumentEventBroadcaster > xBroadcaster( _rxDocument, 
UNO_QUERY_THROW );
 
@@ -125,7 +115,7 @@ namespace dbaccess
 
 try
 {
-m_pData->xURLTransformer = URLTransformer::create(_rContext);
+mxURLTransformer = URLTransformer::create(_rContext);
 }
 catch( const Exception& )
 {
@@ -139,8 +129,8 @@ namespace dbaccess
 
 void SAL_CALL DocumentEventExecutor::documentEventOccured( const 
DocumentEvent& Event )
 {
-Reference< XEventsSupplier > xEventsSupplier( 
m_pData->xDocument.get(), UNO_QUERY );
-if ( !xEventsSupplier.is() )
+Reference< XEventsSupplier > xEventsSupplier( mxDocument.get(), 
UNO_QUERY );
+if ( !xEventsSupplier )
 {
 OSL_FAIL( "DocumentEventExecutor::documentEventOccurred: no 
document anymore, but still being notified?" );
 return;
@@ -179,7 +169,7 @@ namespace dbaccess
 
 if ( bDispatchScriptURL && 

[Libreoffice-commits] core.git: dbaccess/source include/svx svx/source

2023-02-21 Thread Noel Grandin (via logerrit)
 dbaccess/source/ui/browser/sbagrid.cxx |   37 ++---
 dbaccess/source/ui/inc/sbagrid.hxx |6 +-
 include/svx/fmgridif.hxx   |   14 +++---
 svx/source/fmcomp/fmgridif.cxx |   69 +++--
 4 files changed, 72 insertions(+), 54 deletions(-)

New commits:
commit c2c22a8ca6e04779c4daada73003b03c963b4cfd
Author: Noel Grandin 
AuthorDate: Tue Feb 21 10:02:50 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Feb 21 10:39:38 2023 +

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

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

diff --git a/dbaccess/source/ui/browser/sbagrid.cxx 
b/dbaccess/source/ui/browser/sbagrid.cxx
index 03b81526a372..99ee5c30eb73 100644
--- a/dbaccess/source/ui/browser/sbagrid.cxx
+++ b/dbaccess/source/ui/browser/sbagrid.cxx
@@ -237,7 +237,6 @@ void SAL_CALL SbaXGridControl::dispose()
 // SbaXGridPeer
 SbaXGridPeer::SbaXGridPeer(const Reference< XComponentContext >& _rM)
 : FmXGridPeer(_rM)
-,m_aStatusListeners(m_aMutex)
 {
 }
 
@@ -247,10 +246,11 @@ SbaXGridPeer::~SbaXGridPeer()
 
 void SAL_CALL SbaXGridPeer::dispose()
 {
-EventObject aEvt(*this);
-
-m_aStatusListeners.disposeAndClear(aEvt);
-
+{
+std::unique_lock g(m_aMutex);
+EventObject aEvt(*this);
+m_aStatusListeners.disposeAndClear(g, aEvt);
+}
 FmXGridPeer::dispose();
 }
 
@@ -275,12 +275,13 @@ void SbaXGridPeer::NotifyStatusChanged(const 
css::util::URL& _rUrl, const Refere
 xControl->statusChanged(aEvt);
 else
 {
-::comphelper::OInterfaceContainerHelper3 
* pIter
-= m_aStatusListeners.getContainer(_rUrl);
+std::unique_lock g(m_aMutex);
+::comphelper::OInterfaceContainerHelper4 
* pIter
+= m_aStatusListeners.getContainer(g, _rUrl);
 
 if (pIter)
 {
-pIter->notifyEach( ::statusChanged, aEvt );
+pIter->notifyEach( g, ::statusChanged, aEvt );
 }
 }
 }
@@ -439,20 +440,24 @@ void SAL_CALL SbaXGridPeer::dispatch(const URL& aURL, 
const Sequence< PropertyVa
 
 void SAL_CALL SbaXGridPeer::addStatusListener(const Reference< 
css::frame::XStatusListener > & xControl, const css::util::URL& aURL)
 {
-::comphelper::OInterfaceContainerHelper3< css::frame::XStatusListener >* 
pCont
-= m_aStatusListeners.getContainer(aURL);
-if (!pCont)
-m_aStatusListeners.addInterface(aURL,xControl);
-else
-pCont->addInterface(xControl);
+{
+std::unique_lock g(m_aMutex);
+::comphelper::OInterfaceContainerHelper4< css::frame::XStatusListener 
>* pCont
+= m_aStatusListeners.getContainer(g, aURL);
+if (!pCont)
+m_aStatusListeners.addInterface(g, aURL,xControl);
+else
+pCont->addInterface(g, xControl);
+}
 NotifyStatusChanged(aURL, xControl);
 }
 
 void SAL_CALL SbaXGridPeer::removeStatusListener(const Reference< 
css::frame::XStatusListener > & xControl, const css::util::URL& aURL)
 {
-::comphelper::OInterfaceContainerHelper3< css::frame::XStatusListener >* 
pCont = m_aStatusListeners.getContainer(aURL);
+std::unique_lock g(m_aMutex);
+::comphelper::OInterfaceContainerHelper4< css::frame::XStatusListener >* 
pCont = m_aStatusListeners.getContainer(g, aURL);
 if ( pCont )
-pCont->removeInterface(xControl);
+pCont->removeInterface(g, xControl);
 }
 
 Sequence< Type > SAL_CALL SbaXGridPeer::getTypes()
diff --git a/dbaccess/source/ui/inc/sbagrid.hxx 
b/dbaccess/source/ui/inc/sbagrid.hxx
index 22af70834425..4c0f37654647 100644
--- a/dbaccess/source/ui/inc/sbagrid.hxx
+++ b/dbaccess/source/ui/inc/sbagrid.hxx
@@ -25,7 +25,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include "sbamultiplex.hxx"
@@ -93,8 +93,8 @@ namespace dbaui
 :public FmXGridPeer
 ,public css::frame::XDispatch
 {
-comphelper::OMultiTypeInterfaceContainerHelperVar3< 
css::frame::XStatusListener,
-css::util::URL, SbaURLCompare>  m_aStatusListeners;
+comphelper::OMultiTypeInterfaceContainerHelperVar4< css::util::URL, 
css::frame::XStatusListener,
+SbaURLCompare>  m_aStatusListeners;
 
 public:
 SbaXGridPeer(const css::uno::Reference< css::uno::XComponentContext 
>&);
diff --git a/include/svx/fmgridif.hxx b/include/svx/fmgridif.hxx
index e3cce3952b3a..f978b70b546e 100644
--- a/include/svx/fmgridif.hxx
+++ b/include/svx/fmgridif.hxx
@@ -44,7 +44,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -342,16 +342,16 @@ class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC FmXGridPeer:
 {
 protected:
 css::uno::Reference< css::uno::XComponentContext >m_xContext;
-::osl::Mutex  m_aMutex;
+std::mutex 

[Libreoffice-commits] core.git: dbaccess/source include/dbaccess

2023-02-18 Thread Noel Grandin (via logerrit)
 dbaccess/source/ui/browser/AsynchronousLink.cxx |   12 ++--
 include/dbaccess/AsynchronousLink.hxx   |6 +++---
 2 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit aa4d174103f5422168a29b83f596953098e4794c
Author: Noel Grandin 
AuthorDate: Fri Feb 17 13:23:44 2023 +0200
Commit: Noel Grandin 
CommitDate: Sat Feb 18 09:48:30 2023 +

osl::Mutex->std::mutex in dbaui::OAsynchronousLink

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

diff --git a/dbaccess/source/ui/browser/AsynchronousLink.cxx 
b/dbaccess/source/ui/browser/AsynchronousLink.cxx
index e4dcdb2f9eeb..538ea702c4ac 100644
--- a/dbaccess/source/ui/browser/AsynchronousLink.cxx
+++ b/dbaccess/source/ui/browser/AsynchronousLink.cxx
@@ -31,14 +31,14 @@ OAsynchronousLink::OAsynchronousLink(const Link& _rHandler)
 OAsynchronousLink::~OAsynchronousLink()
 {
 {
-::osl::MutexGuard aEventGuard(m_aEventSafety);
+std::unique_lock aEventGuard(m_aEventSafety);
 if (m_nEventId)
 Application::RemoveUserEvent(m_nEventId);
 m_nEventId = nullptr;
 }
 
 {
-::osl::MutexGuard aDestructionGuard(m_aDestructionSafety);
+std::unique_lock aDestructionGuard(m_aDestructionSafety);
 // this is just for the case we're deleted while another thread just 
handled the event :
 // if this other thread called our link while we were deleting the 
event here, the
 // link handler blocked. With leaving the above block it continued, 
but now we are prevented
@@ -48,7 +48,7 @@ OAsynchronousLink::~OAsynchronousLink()
 
 void OAsynchronousLink::Call(void* _pArgument)
 {
-::osl::MutexGuard aEventGuard(m_aEventSafety);
+std::unique_lock aEventGuard(m_aEventSafety);
 if (m_nEventId)
 Application::RemoveUserEvent(m_nEventId);
 m_nEventId = Application::PostUserEvent(LINK(this, OAsynchronousLink, 
OnAsyncCall), _pArgument);
@@ -56,7 +56,7 @@ void OAsynchronousLink::Call(void* _pArgument)
 
 void OAsynchronousLink::CancelCall()
 {
-::osl::MutexGuard aEventGuard(m_aEventSafety);
+std::unique_lock aEventGuard(m_aEventSafety);
 if (m_nEventId)
 Application::RemoveUserEvent(m_nEventId);
 m_nEventId = nullptr;
@@ -65,9 +65,9 @@ void OAsynchronousLink::CancelCall()
 IMPL_LINK(OAsynchronousLink, OnAsyncCall, void*, _pArg, void)
 {
 {
-::osl::MutexGuard aDestructionGuard(m_aDestructionSafety);
+std::unique_lock aDestructionGuard(m_aDestructionSafety);
 {
-::osl::MutexGuard aEventGuard(m_aEventSafety);
+std::unique_lock aEventGuard(m_aEventSafety);
 if (!m_nEventId)
 // our destructor deleted the event just while we are waiting 
for m_aEventSafety
 // -> get outta here
diff --git a/include/dbaccess/AsynchronousLink.hxx 
b/include/dbaccess/AsynchronousLink.hxx
index 0b63cbed957d..22c40dc5b714 100644
--- a/include/dbaccess/AsynchronousLink.hxx
+++ b/include/dbaccess/AsynchronousLink.hxx
@@ -19,7 +19,7 @@
 
 #pragma once
 
-#include 
+#include 
 #include 
 
 struct ImplSVEvent;
@@ -38,8 +38,8 @@ namespace dbaui
 class OAsynchronousLink final
 {
 Linkm_aHandler;
-::osl::Mutexm_aEventSafety;
-::osl::Mutexm_aDestructionSafety;
+std::mutex  m_aEventSafety;
+std::mutex  m_aDestructionSafety;
 ImplSVEvent *   m_nEventId;
 DECL_LINK(OnAsyncCall, void*, void);
 


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

2023-01-20 Thread Stephan Bergmann (via logerrit)
 dbaccess/source/ui/browser/sbagrid.cxx |4 ++--
 dbaccess/source/ui/inc/sbagrid.hxx |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 16f59f4b2b50dbca353aa468512e7f704fa903ad
Author: Stephan Bergmann 
AuthorDate: Fri Jan 20 09:26:51 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Fri Jan 20 10:16:32 2023 +

Fix SbaXGridControl queryAggregation

The base UnoControl uses WeakAggImplHelper9, so (for better or worse) 
derives
from XAggregation, but SbaXGridControl failed to properly implement the
XAggregation protocol.

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

diff --git a/dbaccess/source/ui/browser/sbagrid.cxx 
b/dbaccess/source/ui/browser/sbagrid.cxx
index 9db34b530119..03b81526a372 100644
--- a/dbaccess/source/ui/browser/sbagrid.cxx
+++ b/dbaccess/source/ui/browser/sbagrid.cxx
@@ -127,9 +127,9 @@ rtl::Reference 
SbaXGridControl::imp_CreatePeer(vcl::Window* pParent
 return pReturn;
 }
 
-Any SAL_CALL SbaXGridControl::queryInterface(const Type& _rType)
+Any SAL_CALL SbaXGridControl::queryAggregation(const Type& _rType)
 {
-Any aRet = FmXGridControl::queryInterface(_rType);
+Any aRet = FmXGridControl::queryAggregation(_rType);
 return aRet.hasValue() ? aRet : 
::cppu::queryInterface(_rType,static_cast(this));
 }
 
diff --git a/dbaccess/source/ui/inc/sbagrid.hxx 
b/dbaccess/source/ui/inc/sbagrid.hxx
index 5dbffa6717a2..22af70834425 100644
--- a/dbaccess/source/ui/inc/sbagrid.hxx
+++ b/dbaccess/source/ui/inc/sbagrid.hxx
@@ -62,8 +62,8 @@ namespace dbaui
 virtual ~SbaXGridControl() override;
 
 // UNO
-DECLARE_UNO3_DEFAULTS(SbaXGridControl, FmXGridControl)
-virtual css::uno::Any  SAL_CALL queryInterface(const css::uno::Type& 
_rType) override;
+DECLARE_UNO3_AGG_DEFAULTS(SbaXGridControl, FmXGridControl)
+virtual css::uno::Any  SAL_CALL queryAggregation(const css::uno::Type& 
_rType) override;
 
 // XTypeProvider
 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes(  ) 
override;


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

2023-01-17 Thread Noel Grandin (via logerrit)
 dbaccess/source/core/dataaccess/databasecontext.cxx  |   11 ---
 dbaccess/source/core/dataaccess/databasedocument.cxx |8 
 dbaccess/source/core/inc/databasecontext.hxx |6 --
 3 files changed, 4 insertions(+), 21 deletions(-)

New commits:
commit c1d50d738fd9fcae5e621efcd687121ef5219f1f
Author: Noel Grandin 
AuthorDate: Sat Jan 14 12:37:35 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Jan 17 11:51:25 2023 +

XUnoTunnel->dynamic_cast in ODatabaseContext

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

diff --git a/dbaccess/source/core/dataaccess/databasecontext.cxx 
b/dbaccess/source/core/dataaccess/databasecontext.cxx
index c4ca08ce0a08..dce39f3badd4 100644
--- a/dbaccess/source/core/dataaccess/databasecontext.cxx
+++ b/dbaccess/source/core/dataaccess/databasecontext.cxx
@@ -707,17 +707,6 @@ void ODatabaseContext::databaseDocumentURLChange( const 
OUString& _rOldURL, cons
 m_aDatabaseObjects.erase( oldPos );
 }
 
-sal_Int64 SAL_CALL ODatabaseContext::getSomething( const Sequence< sal_Int8 >& 
rId )
-{
-return comphelper::getSomethingImpl(rId, this);
-}
-
-const Sequence< sal_Int8 > & ODatabaseContext::getUnoTunnelId()
-{
-static const comphelper::UnoIdInit implId;
-return implId.getSeq();
-}
-
 void ODatabaseContext::onBasicManagerCreated( const Reference< XModel >& 
_rxForDocument, BasicManager& _rBasicManager )
 {
 #if !HAVE_FEATURE_SCRIPTING
diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx 
b/dbaccess/source/core/dataaccess/databasedocument.cxx
index fb4ed754380b..2aa2710006c0 100644
--- a/dbaccess/source/core/dataaccess/databasedocument.cxx
+++ b/dbaccess/source/core/dataaccess/databasedocument.cxx
@@ -2196,11 +2196,11 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
 com_sun_star_comp_dba_ODatabaseDocument(css::uno::XComponentContext* context,
 css::uno::Sequence const &)
 {
-Reference xDBContextTunnel(DatabaseContext::create(context), 
UNO_QUERY_THROW);
-dbaccess::ODatabaseContext* pContext
-= 
comphelper::getFromUnoTunnel(xDBContextTunnel);
+Reference xDBContextTunnel(DatabaseContext::create(context), 
UNO_QUERY_THROW);
+rtl::Reference pContext
+= dynamic_cast(xDBContextTunnel.get());
 assert(pContext);
-
+
 rtl::Reference pImpl(
 new dbaccess::ODatabaseModelImpl(context, *pContext));
 css::uno::Reference 
inst(pImpl->createNewModel_deliverOwnership());
diff --git a/dbaccess/source/core/inc/databasecontext.hxx 
b/dbaccess/source/core/inc/databasecontext.hxx
index 89662ad2281d..2f9bf326c9e0 100644
--- a/dbaccess/source/core/inc/databasecontext.hxx
+++ b/dbaccess/source/core/inc/databasecontext.hxx
@@ -28,7 +28,6 @@
 #include "ModelImpl.hxx"
 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -55,7 +54,6 @@ class DatabaseDocumentLoader;
 
 typedef ::cppu::WeakComponentImplHelper<   css::lang::XServiceInfo
,   css::sdb::XDatabaseContext
-   ,   css::lang::XUnoTunnel
>   DatabaseAccessContext_Base;
 
 class ODatabaseContext  :public DatabaseAccessContext_Base
@@ -155,10 +153,6 @@ public:
 virtual void SAL_CALL addContainerListener( const css::uno::Reference< 
css::container::XContainerListener >& xListener ) override;
 virtual void SAL_CALL removeContainerListener( const css::uno::Reference< 
css::container::XContainerListener >& xListener ) override;
 
-// css::lang::XUnoTunnel
-virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< 
sal_Int8 >& aIdentifier ) override;
-static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
-
 void registerDatabaseDocument( ODatabaseModelImpl& _rModelImpl);
 void revokeDatabaseDocument( const ODatabaseModelImpl& _rModelImpl);
 void databaseDocumentURLChange(const OUString& _sOldName, const OUString& 
_sNewName);


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

2023-01-16 Thread Noel Grandin (via logerrit)
 dbaccess/source/core/dataaccess/ContentHelper.cxx   |   12 
 dbaccess/source/core/dataaccess/definitioncontainer.cxx |4 ++--
 dbaccess/source/core/dataaccess/documentcontainer.cxx   |2 +-
 dbaccess/source/core/inc/ContentHelper.hxx  |6 --
 4 files changed, 3 insertions(+), 21 deletions(-)

New commits:
commit 45a2d738c498feed80bc04e7bdf800cb0bf63fd3
Author: Noel Grandin 
AuthorDate: Sat Jan 14 12:32:23 2023 +0200
Commit: Noel Grandin 
CommitDate: Mon Jan 16 19:37:34 2023 +

XUnoTunnel->dynamic_cast in OContentHelper

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

diff --git a/dbaccess/source/core/dataaccess/ContentHelper.cxx 
b/dbaccess/source/core/dataaccess/ContentHelper.cxx
index a45dd916068c..d7a8f63efd3c 100644
--- a/dbaccess/source/core/dataaccess/ContentHelper.cxx
+++ b/dbaccess/source/core/dataaccess/ContentHelper.cxx
@@ -105,12 +105,6 @@ css::uno::Sequence< OUString > SAL_CALL 
OContentHelper::getSupportedServiceNames
 }
 
 
-const css::uno::Sequence & OContentHelper::getUnoTunnelId()
-{
-static const comphelper::UnoIdInit aId;
-return aId.getSeq();
-}
-
 css::uno::Sequence OContentHelper::getImplementationId()
 {
 return css::uno::Sequence();
@@ -552,12 +546,6 @@ void OContentHelper::notifyPropertiesChange( const 
Sequence< PropertyChangeEvent
 }
 }
 
-// css::lang::XUnoTunnel
-sal_Int64 OContentHelper::getSomething( const Sequence< sal_Int8 > & rId )
-{
-return comphelper::getSomethingImpl(rId, this);
-}
-
 Reference< XInterface > SAL_CALL OContentHelper::getParent(  )
 {
 ::osl::MutexGuard aGuard(m_aMutex);
diff --git a/dbaccess/source/core/dataaccess/definitioncontainer.cxx 
b/dbaccess/source/core/dataaccess/definitioncontainer.cxx
index df121daaba84..807dc5ec98c3 100644
--- a/dbaccess/source/core/dataaccess/definitioncontainer.cxx
+++ b/dbaccess/source/core/dataaccess/definitioncontainer.cxx
@@ -533,7 +533,7 @@ void ODefinitionContainer::implAppend(const OUString& 
_rName, const Reference< X
 // #i44786#
 lcl_ensureName( _rxNewObject, _rName );
 
-::rtl::Reference< OContentHelper > pContent = 
comphelper::getFromUnoTunnel( _rxNewObject );
+::rtl::Reference< OContentHelper > pContent = 
dynamic_cast( _rxNewObject.get() );
 if ( pContent.is() )
 {
 TContentPtr pImpl = pContent->getImpl();
@@ -592,7 +592,7 @@ void ODefinitionContainer::approveNewObject(const OUString& 
_sName,const Referen
 DBA_RES( RID_STR_NAME_ALREADY_USED ),
 *this );
 
-::rtl::Reference< OContentHelper > pContent( 
comphelper::getFromUnoTunnel( _rxObject ) );
+::rtl::Reference< OContentHelper > pContent( 
dynamic_cast( _rxObject.get() ) );
 if ( !pContent.is() )
 throw IllegalArgumentException(
 DBA_RES( RID_STR_OBJECT_CONTAINER_MISMATCH ),
diff --git a/dbaccess/source/core/dataaccess/documentcontainer.cxx 
b/dbaccess/source/core/dataaccess/documentcontainer.cxx
index 6ac383e85a99..33dea6873692 100644
--- a/dbaccess/source/core/dataaccess/documentcontainer.cxx
+++ b/dbaccess/source/core/dataaccess/documentcontainer.cxx
@@ -668,7 +668,7 @@ OUString SAL_CALL 
ODocumentContainer::composeHierarchicalName( const OUString& i
 ::rtl::Reference pContent;
 try
 {
-pContent = 
comphelper::getFromUnoTunnel(const_cast(this)->implGetByName(
 _sName, true ));
+pContent = 
dynamic_cast(const_cast(this)->implGetByName(
 _sName, true ).get());
 }
 catch(const Exception&)
 {
diff --git a/dbaccess/source/core/inc/ContentHelper.hxx 
b/dbaccess/source/core/inc/ContentHelper.hxx
index 2035a35c1f8c..d60521a4328d 100644
--- a/dbaccess/source/core/inc/ContentHelper.hxx
+++ b/dbaccess/source/core/inc/ContentHelper.hxx
@@ -25,7 +25,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -80,7 +79,6 @@ namespace dbaccess
,   
css::beans::XPropertiesChangeNotifier
,   css::beans::XPropertyContainer
,   css::lang::XInitialization
-   ,   css::lang::XUnoTunnel
,   css::container::XChild
,   css::sdbcx::XRename
>   OContentHelper_COMPBASE;
@@ -155,10 +153,6 @@ namespace dbaccess
 // XInitialization
 virtual void SAL_CALL initialize( const css::uno::Sequence< 
css::uno::Any >& aArguments ) override;
 
-// css::lang::XUnoTunnel
-virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< 
sal_Int8 >& aIdentifier ) override;
-static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
-
 

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

2023-01-15 Thread Julien Nabet (via logerrit)
 dbaccess/source/ui/uno/copytablewizard.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9d2355b674d103fe8a73d2db716389980bb69e55
Author: Julien Nabet 
AuthorDate: Sun Jan 15 10:46:46 2023 +0100
Commit: Julien Nabet 
CommitDate: Sun Jan 15 10:36:20 2023 +

tdf#153004: error when copying content to a table without autovalue primary 
key

In fact, hsql is well managed without extra code.

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

diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx 
b/dbaccess/source/ui/uno/copytablewizard.cxx
index c886995398a7..85000f2dc9f8 100644
--- a/dbaccess/source/ui/uno/copytablewizard.cxx
+++ b/dbaccess/source/ui/uno/copytablewizard.cxx
@@ -1361,7 +1361,7 @@ void CopyTableWizard::impl_doCopy_nothrow()
 OUString sDatabaseDest = 
xDestMetaData->getDatabaseProductName().toAsciiLowerCase();
 // If we created a new primary key, then it won't necessarily 
be an IDENTITY column
 const bool bShouldCreatePrimaryKey = 
rWizard.shouldCreatePrimaryKey();
-if ( !bShouldCreatePrimaryKey && 
((sDatabaseDest.indexOf("hsql") != -1) || (sDatabaseDest.indexOf("firebird") != 
-1)) )
+if ( !bShouldCreatePrimaryKey && 
(sDatabaseDest.indexOf("firebird") != -1) )
 {
 const OUString sComposedTableName = 
::dbtools::composeTableName( xDestMetaData, xTable, 
::dbtools::EComposeRule::InDataManipulation, true );
 


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

2023-01-13 Thread Julien Nabet (via logerrit)
 dbaccess/source/ui/uno/copytablewizard.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c9b0eacae71f111209cb77f14f2693d73e5e8d90
Author: Julien Nabet 
AuthorDate: Fri Jan 13 22:05:35 2023 +0100
Commit: Julien Nabet 
CommitDate: Fri Jan 13 22:32:26 2023 +

Related tdf#153003: Copying a query and pasting as table in same DB 
impossible

It might be a regression from ca82061c2cad00aeddb17b766063776fee0ee41a
"make ValueTransfer easier to understand

storing references to local variables makes it harder to figure out what
the control flow is doing.
"
in peculiar:
-sal_Int32 nDestColumn( 0 );
-sal_Int32 nSourceColumn( 1 );
-ValueTransfer aTransfer( nSourceColumn, nDestColumn, 
std::vector(aSourceColTypes), xRow, xStatementParams );
+sal_Int32 nSourceColumn( 0 );
+ValueTransfer aTransfer( aSourceColTypes, xRow, 
xStatementParams );

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

diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx 
b/dbaccess/source/ui/uno/copytablewizard.cxx
index fab5e3966cbd..c886995398a7 100644
--- a/dbaccess/source/ui/uno/copytablewizard.cxx
+++ b/dbaccess/source/ui/uno/copytablewizard.cxx
@@ -1141,7 +1141,7 @@ void CopyTableWizard::impl_copyRows_throw( const 
Reference< XResultSet >& _rxSou
 // notify listeners
 m_aCopyTableListeners.notifyEach( ::copyingRow, 
aCopyEvent );
 
-sal_Int32 nSourceColumn( 0 );
+sal_Int32 nSourceColumn( 1 );
 ValueTransfer aTransfer( aSourceColTypes, xRow, xStatementParams );
 
 for ( auto const& rColumnPos : aColumnPositions )


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

2023-01-13 Thread Stephan Bergmann (via logerrit)
 dbaccess/source/core/api/RowSet.cxx|4 -
 dbaccess/source/core/api/callablestatement.cxx |   44 +--
 dbaccess/source/core/api/preparedstatement.cxx |   56 +++
 dbaccess/source/core/api/statement.cxx |   34 -
 dbaccess/source/core/misc/apitools.cxx |   93 +
 dbaccess/source/inc/apitools.hxx   |8 --
 6 files changed, 106 insertions(+), 133 deletions(-)

New commits:
commit 4aa8f40f666b87038c6399c8cd2782e7d8e9c527
Author: Stephan Bergmann 
AuthorDate: Fri Jan 13 11:03:18 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Fri Jan 13 15:58:28 2023 +

Base OSubComponent on cppu::WeakComponentImplHelper

...rather than on cppu::OComponentHelper (which derives from XAggregation) 
and
then manually suppressing support for XAggregation in
OSubComponent::queryInterface

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

diff --git a/dbaccess/source/core/api/RowSet.cxx 
b/dbaccess/source/core/api/RowSet.cxx
index 69f61044f0a9..ed47c1657eba 100644
--- a/dbaccess/source/core/api/RowSet.cxx
+++ b/dbaccess/source/core/api/RowSet.cxx
@@ -2737,7 +2737,7 @@ void 
ORowSet::impl_rebuild_throw(::osl::ResettableMutexGuard& _rGuard)
 
 ORowSetClone::ORowSetClone( const Reference& _rContext, 
ORowSet& rParent, ::osl::Mutex* _pMutex )
  :OSubComponent(m_aMutex, rParent)
- ,ORowSetBase( _rContext, OComponentHelper::rBHelper, _pMutex )
+ ,ORowSetBase( _rContext, WeakComponentImplHelper::rBHelper, 
_pMutex )
  ,m_pParent()
  ,m_nFetchDirection(rParent.m_nFetchDirection)
  ,m_nFetchSize(rParent.m_nFetchSize)
@@ -2883,7 +2883,7 @@ void ORowSetClone::close()
 {
 {
 MutexGuard aGuard( m_aMutex );
-if (OComponentHelper::rBHelper.bDisposed)
+if (WeakComponentImplHelper::rBHelper.bDisposed)
 throw DisposedException();
 }
 dispose();
diff --git a/dbaccess/source/core/api/callablestatement.cxx 
b/dbaccess/source/core/api/callablestatement.cxx
index 8f864fbe04dd..59615c4cd260 100644
--- a/dbaccess/source/core/api/callablestatement.cxx
+++ b/dbaccess/source/core/api/callablestatement.cxx
@@ -84,7 +84,7 @@ void SAL_CALL OCallableStatement::registerOutParameter( 
sal_Int32 parameterIndex
 {
 MutexGuard aGuard(m_aMutex);
 
-::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
 
 Reference< XOutParameters >(m_xAggregateAsSet, 
UNO_QUERY_THROW)->registerOutParameter( parameterIndex, sqlType, typeName );
 }
@@ -92,7 +92,7 @@ void SAL_CALL OCallableStatement::registerOutParameter( 
sal_Int32 parameterIndex
 void SAL_CALL OCallableStatement::registerNumericOutParameter( sal_Int32 
parameterIndex, sal_Int32 sqlType, sal_Int32 scale )
 {
 MutexGuard aGuard(m_aMutex);
-::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
 
 Reference< XOutParameters >(m_xAggregateAsSet, 
UNO_QUERY_THROW)->registerNumericOutParameter( parameterIndex, sqlType, scale );
 }
@@ -101,7 +101,7 @@ void SAL_CALL 
OCallableStatement::registerNumericOutParameter( sal_Int32 paramet
 sal_Bool SAL_CALL OCallableStatement::wasNull(  )
 {
 MutexGuard aGuard(m_aMutex);
-::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
 
 return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->wasNull();
 }
@@ -109,7 +109,7 @@ sal_Bool SAL_CALL OCallableStatement::wasNull(  )
 OUString SAL_CALL OCallableStatement::getString( sal_Int32 columnIndex )
 {
 MutexGuard aGuard(m_aMutex);
-::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
 
 return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getString( 
columnIndex );
 }
@@ -117,7 +117,7 @@ OUString SAL_CALL OCallableStatement::getString( sal_Int32 
columnIndex )
 sal_Bool SAL_CALL OCallableStatement::getBoolean( sal_Int32 columnIndex )
 {
 MutexGuard aGuard(m_aMutex);
-::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed);
 
 return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getBoolean( 
columnIndex );
 }
@@ -125,7 +125,7 @@ sal_Bool SAL_CALL OCallableStatement::getBoolean( sal_Int32 
columnIndex )
 sal_Int8 SAL_CALL OCallableStatement::getByte( sal_Int32 columnIndex )
 {
 MutexGuard aGuard(m_aMutex);
-::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
+

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

2023-01-06 Thread Julien Nabet (via logerrit)
 dbaccess/source/ui/misc/WCPage.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 5effc24969e5f326ef094419631d14d4d3030ed6
Author: Julien Nabet 
AuthorDate: Fri Jan 6 17:11:47 2023 +0100
Commit: Julien Nabet 
CommitDate: Fri Jan 6 17:02:44 2023 +

tdf#152900: "Create new field as primary key" disabled...

when pasting data as new table

Regression from 3f8e50f9b2fb35db190ce0204981f3f02d1d5ae6 (05/2021)
"merge handlers into single toggle handler"

Change-Id: I05376f288c1687978225bd98da21a5e21810292a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145151
Reviewed-by: Caolán McNamara 
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/dbaccess/source/ui/misc/WCPage.cxx 
b/dbaccess/source/ui/misc/WCPage.cxx
index 738c85124708..602edd2d6e24 100644
--- a/dbaccess/source/ui/misc/WCPage.cxx
+++ b/dbaccess/source/ui/misc/WCPage.cxx
@@ -106,8 +106,8 @@ IMPL_LINK(OCopyTable, RadioChangeHdl, weld::Toggleable&, 
rButton, void)
 SetAppendDataRadio();
 return;
 }
-m_pParent->EnableNextButton(m_xRB_View->get_active());
-bool bKey = m_bPKeyAllowed && m_xRB_View->get_active();
+m_pParent->EnableNextButton(!m_xRB_View->get_active());
+bool bKey = m_bPKeyAllowed && !m_xRB_View->get_active();
 m_xFT_KeyName->set_sensitive(bKey && m_xCB_PrimaryColumn->get_active());
 m_xEdKeyName->set_sensitive(bKey && m_xCB_PrimaryColumn->get_active());
 m_xCB_PrimaryColumn->set_sensitive(bKey);


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

2022-12-09 Thread Julien Nabet (via logerrit)
 dbaccess/source/ui/browser/unodatbr.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0390479ccf454cd87997fe97d640caf9f8c45a13
Author: Julien Nabet 
AuthorDate: Fri Dec 9 20:42:26 2022 +0100
Commit: Lionel Mamane 
CommitDate: Sat Dec 10 06:17:58 2022 +

Related tdf#152381: fix "lengths do not match"

On console, I noticed these:
warn:dbaccess:111457:111457:dbaccess/source/ui/browser/unodatbr.cxx:754: 
DBG_UNHANDLED_EXCEPTION in InitializeGridModel exception: 
com.sun.star.lang.IllegalArgumentException message: "lengths do not match at 
/home/julien/lo/libreoffice/cppuhelper/source/propshlp.cxx:872" 
ArgumentPosition: -1

0  
cppu::OPropertySetHelper::setPropertyValues(com::sun::star::uno::Sequence
 const&, com::sun::star::uno::Sequence const&)
(this=0x55eca23d3b90, rPropertyNames=uno::Sequence of length 6 = {...}, 
rValues=uno::Sequence of length 7 = {...}) at cppuhelper/source/propshlp.cxx:872
1  0x7f39c7a7ecb6 in 
comphelper::OPropertySetAggregationHelper::setPropertyValues(com::sun::star::uno::Sequence
 const&, com::sun::star::uno::Sequence const&)
(this=0x55eca23d3b90, _rPropertyNames=uno::Sequence of length 6 = 
{...}, _rValues=uno::Sequence of length 7 = {...}) at 
comphelper/source/property/propagg.cxx:589
2  0x7f39ac81f057 in 
dbaui::SbaTableQueryBrowser::InitializeGridModel(com::sun::star::uno::Reference
 const&)
 (this=0x55eca23b1960, xGrid=uno::Reference to (frm::OGridControlModel 
*) 0x55eca23d3c30) at dbaccess/source/ui/browser/unodatbr.cxx:594
3  0x7f39ac834d46 in 
dbaui::SbaTableQueryBrowser::implLoadAnything(rtl::OUString const&, 
rtl::OUString const&, int, bool, 
utl::SharedUNOComponent const&) (this=0x55eca23b1960, 
_rDataSourceName="file:///tmp/Table_Default_Firebird.odb", _rCommand="Table2", 
nCommandType=0, _bEscapeProcessing=true, _rxConnection=...)
at dbaccess/source/ui/browser/unodatbr.cxx:2384
4  0x7f39ac8312ee in 
dbaui::SbaTableQueryBrowser::implSelect(weld::TreeIter const*) 
(this=0x55eca23b1960, pEntry=0x55eca243bd90) at 
dbaccess/source/ui/browser/unodatbr.cxx:2678
5  0x7f39ac8343e2 in 
dbaui::SbaTableQueryBrowser::implSelect(rtl::OUString const&, rtl::OUString 
const&, int, bool, utl::SharedUNOComponent const&, bool) (this=0x55eca23b1960, 
_rDataSourceName="file:///tmp/Table_Default_Firebird.odb", _rCommand="Table2", 
nCommandType=0, _bEscapeProcessing=true, _rxConnection=..., _bSelectDirect=true)
at dbaccess/source/ui/browser/unodatbr.cxx:2445
6  0x7f39ac8398c5 in dbaui::SbaTableQueryBrowser::impl_initialize() 
(this=0x55eca23b1960) at dbaccess/source/ui/browser/unodatbr.cxx:3251
7  0x7f39ac7a3eee in 
dbaui::OGenericUnoController::initialize(com::sun::star::uno::Sequence
 const&) (this=0x55eca23b1960, aArguments=uno::Sequence of length 17 = {...})
at dbaccess/source/ui/browser/genericcontroller.cxx:259
8  0x7f39ac718dd7 in (anonymous 
namespace)::DBContentLoader::load(com::sun::star::uno::Reference
 const&, rtl::OUString const&, 
com::sun::star::uno::Sequence const&, 
com::sun::star::uno::Reference 
const&)
 (this=0x55eca23aacf0, rFrame=uno::Reference to ((anonymous 
namespace)::XFrameImpl *) 0x55eca1f13750, 
rURL=".component:DB/DataSourceBrowser", rArgs=uno::Sequence of length 16 = 
{...}, rListener=uno::Reference to (framework::(anonymous 
namespace)::LoadEnvListener *) 0x55eca23b0828) at 
dbaccess/source/ui/browser/dbloader.cxx:230
9  0x7f39c65f5f13 in framework::LoadEnv::impl_loadContent() 
(this=0x7fff7788a6e8) at framework/source/loadenv/loadenv.cxx:1154

At least from 59bc10eb4609c "INTEGRATION: CWS insight01 (1.152.38); FILE 
MERGED" (2004-08-02)
this part seems the root pb:
-Sequence< ::rtl::OUString> aProperties(6);
-Sequence< Any> aValues(6);
+Sequence< ::rtl::OUString> aProperties(6 + ( m_bPreview ? 
5 : 0 ));
+Sequence< Any> aValues(7 + ( m_bPreview ? 5 : 0 ));
if m_bPreview is false, there are only 6 attributes:
- PROPERTY_FONT
- PROPERTY_TEXTEMPHASIS
- PROPERTY_TEXTRELIEF
- PROPERTY_ROW_HEIGHT
- PROPERTY_TEXTCOLOR
- PROPERTY_TEXTLINECOLOR

Change-Id: I91cd81f87ae0685123e273fa6d106fdd22003147
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143889
Reviewed-by: Julien Nabet 
Tested-by: Jenkins
Reviewed-by: Lionel Mamane 

diff --git a/dbaccess/source/ui/browser/unodatbr.cxx 
b/dbaccess/source/ui/browser/unodatbr.cxx
index ee300a8862ed..0a54ccb4051d 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -547,7 +547,7 @@ void SbaTableQueryBrowser::InitializeGridModel(const 
Reference< css::form::XForm
 if (m_xCurrentlyDisplayed)
 {
 Sequence< OUString> aProperties(6 + ( m_bPreview ? 5 : 0 ));
-Sequence< Any> aValues(7 + ( 

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

2022-12-08 Thread Bogdan B (via logerrit)
 dbaccess/source/ui/browser/dbtreemodel.hxx |3 ---
 1 file changed, 3 deletions(-)

New commits:
commit 0569a84c16e6ee6ed6f4fb52c23ed6dfe4225cdf
Author: Bogdan B 
AuthorDate: Mon Nov 28 21:00:11 2022 +0100
Commit: Hossein 
CommitDate: Thu Dec 8 22:38:23 2022 +

tdf#152299 - Remove unused define(s) from C/C++ files

Change-Id: I22185ee21af426974cf57bda288320413bd119a1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143434
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/dbaccess/source/ui/browser/dbtreemodel.hxx 
b/dbaccess/source/ui/browser/dbtreemodel.hxx
index 2ea11b900975..53a34a8e4247 100644
--- a/dbaccess/source/ui/browser/dbtreemodel.hxx
+++ b/dbaccess/source/ui/browser/dbtreemodel.hxx
@@ -29,9 +29,6 @@
 //   tables holds the nameaccess for the tables
 // tableholds the table
 
-#define CONTAINER_QUERIES   sal_uLong( 0 )
-#define CONTAINER_TABLESsal_uLong( 1 )
-
 namespace com::sun::star::lang { class XMultiServiceFactory; }
 
 namespace dbaui


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

2022-11-13 Thread Harshita Nag (via logerrit)
 dbaccess/source/ui/tabledesign/TableUndo.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 75b569890a6630bb2a5b727c8567f7ea59ccb62e
Author: Harshita Nag 
AuthorDate: Sat Nov 12 17:52:02 2022 +0530
Commit: Julien Nabet 
CommitDate: Sun Nov 13 11:56:35 2022 +0100

tdf#114441: Convert use of sal_uLong to better integer types

The above change was possible because GetPos() returns value of type 
sal_Int32

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

diff --git a/dbaccess/source/ui/tabledesign/TableUndo.cxx 
b/dbaccess/source/ui/tabledesign/TableUndo.cxx
index 3769e5fd08cb..7829a09d6959 100644
--- a/dbaccess/source/ui/tabledesign/TableUndo.cxx
+++ b/dbaccess/source/ui/tabledesign/TableUndo.cxx
@@ -179,7 +179,7 @@ OTableEditorDelUndoAct::~OTableEditorDelUndoAct()
 void OTableEditorDelUndoAct::Undo()
 {
 // Insert the deleted line
-sal_uLong nPos;
+sal_Int32 nPos;
 
 std::shared_ptr  pNewOrigRow;
 std::vector< std::shared_ptr >* pOriginalRows = 
pTabEdCtrl->GetRowList();


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

2022-11-11 Thread Stephan Bergmann (via logerrit)
 dbaccess/source/core/api/HelperCollections.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d5f53a97c9468a0dbe31212053c5686afd8450d4
Author: Stephan Bergmann 
AuthorDate: Thu Nov 10 18:37:11 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Fri Nov 11 11:12:27 2022 +0100

Drop a counterproductive const&

...that was apparently left by accident by
c7f8a54e05dab430cf2f5b3e1fa90e729c7a5601 "loplugin:moveparam in dbaccess",
thwarting the use of std::move here.

(I came across this code with an upcoming loplugin:constmove that flags
suspicious uses of std::move involving const-qualified types.)

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

diff --git a/dbaccess/source/core/api/HelperCollections.hxx 
b/dbaccess/source/core/api/HelperCollections.hxx
index 050b4a23fb3e..b7f69b8bac96 100644
--- a/dbaccess/source/core/api/HelperCollections.hxx
+++ b/dbaccess/source/core/api/HelperCollections.hxx
@@ -83,7 +83,7 @@ namespace dbaccess
 return nullptr;
 }
 public:
-OPrivateTables( const OSQLTables& _rTables,
+OPrivateTables( OSQLTables _rTables,
 bool _bCase,
 ::cppu::OWeakObject& _rParent,
 ::osl::Mutex& _rMutex,


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

2022-11-01 Thread Noel Grandin (via logerrit)
 dbaccess/source/ui/uno/copytablewizard.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 85a5233275ab83fe0d6b943b298695387d97accd
Author: Noel Grandin 
AuthorDate: Mon Oct 31 12:08:50 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Nov 1 11:39:57 2022 +0100

error when copying table and the copy table wizard creates the primary key

then the primary key will not be IDENTITY column, and the
   ALTER TABLE...RESTART WITH
will product an error

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

diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx 
b/dbaccess/source/ui/uno/copytablewizard.cxx
index 995ca99ed022..5fd10ee37e75 100644
--- a/dbaccess/source/ui/uno/copytablewizard.cxx
+++ b/dbaccess/source/ui/uno/copytablewizard.cxx
@@ -1359,7 +1359,9 @@ void CopyTableWizard::impl_doCopy_nothrow()
 // tdf#119962
 const Reference< XDatabaseMetaData > xDestMetaData( 
m_xDestConnection->getMetaData(), UNO_SET_THROW );
 OUString sDatabaseDest = 
xDestMetaData->getDatabaseProductName().toAsciiLowerCase();
-if ( (sDatabaseDest.indexOf("hsql") != -1) || 
(sDatabaseDest.indexOf("firebird") != -1) )
+// If we created a new primary key, then it won't necessarily 
be an IDENTITY column
+const bool bShouldCreatePrimaryKey = 
rWizard.shouldCreatePrimaryKey();
+if ( !bShouldCreatePrimaryKey && 
((sDatabaseDest.indexOf("hsql") != -1) || (sDatabaseDest.indexOf("firebird") != 
-1)) )
 {
 const OUString sComposedTableName = 
::dbtools::composeTableName( xDestMetaData, xTable, 
::dbtools::EComposeRule::InDataManipulation, true );
 


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

2022-10-28 Thread Noel Grandin (via logerrit)
 dbaccess/source/ui/uno/copytablewizard.cxx |   14 ++
 1 file changed, 14 insertions(+)

New commits:
commit 0325be6f3de622be6af9b2f686e3c7afae0405b1
Author: Noel Grandin 
AuthorDate: Fri Oct 28 12:26:00 2022 +0200
Commit: Noel Grandin 
CommitDate: Fri Oct 28 14:46:24 2022 +0200

Fix bug in copying table where we need to create a primary key

The problem seems to be that

commit fa177231cd20bf3c3f4bb9b50f6646da139c6766
Author: Tamas Bunth 
Date:   Fri Aug 30 14:57:31 2019 +0200
tdf#127093, tdf#127092 Fix pasting autoincremented

was reverted in commit d783017c1ccb4e62e99f26b42250ac4e15780cff.

But the follow-on commit
commit 376cc3ea0fc2e0f209763a2a27c5852136332c86
Author: Tamas Bunth 
Date:   Sat Aug 31 18:27:44 2019 +0200
dbaccess: delete old paste autoincrement logic

was not reverted.

This is not a straight revert of the second commit, because
autoincrement has since been improved with

commit 2a8e120db1c3175ff937cdbe6d0ade23dc380c01
Author: Oleksii Makhotin 
Date:   Tue Apr 6 16:03:41 2021 +0300
tdf#119962 Fix autoincrement for copied table

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

diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx 
b/dbaccess/source/ui/uno/copytablewizard.cxx
index 49cbb81d5c9f..995ca99ed022 100644
--- a/dbaccess/source/ui/uno/copytablewizard.cxx
+++ b/dbaccess/source/ui/uno/copytablewizard.cxx
@@ -1065,6 +1065,7 @@ void CopyTableWizard::impl_copyRows_throw( const 
Reference< XResultSet >& _rxSou
 
 const OCopyTableWizard& rWizard = impl_getDialog_throw();
 ODatabaseExport::TPositions aColumnPositions = 
rWizard.GetColumnPositions();
+const bool bShouldCreatePrimaryKey = rWizard.shouldCreatePrimaryKey();
 
 Reference< XRow > xRow  ( _rxSourceResultSet, UNO_QUERY_THROW 
);
 Reference< XRowLocate > xRowLocate  ( _rxSourceResultSet, UNO_QUERY_THROW 
);
@@ -1096,6 +1097,7 @@ void CopyTableWizard::impl_copyRows_throw( const 
Reference< XResultSet >& _rxSou
 const Any* pSelectedRow = m_aSourceSelection.getConstArray();
 const Any* pSelEnd  = pSelectedRow + 
m_aSourceSelection.getLength();
 
+sal_Int32 nRowCount = 0;
 bool bContinue = false;
 
 CopyTableRowEvent aCopyEvent;
@@ -1130,9 +1132,12 @@ void CopyTableWizard::impl_copyRows_throw( const 
Reference< XResultSet >& _rxSou
 break;
 }
 
+++nRowCount;
+
 aCopyEvent.Error.clear();
 try
 {
+bool bInsertedPrimaryKey = false;
 // notify listeners
 m_aCopyTableListeners.notifyEach( ::copyingRow, 
aCopyEvent );
 
@@ -1149,6 +1154,14 @@ void CopyTableWizard::impl_copyRows_throw( const 
Reference< XResultSet >& _rxSou
 continue;
 }
 
+if ( bShouldCreatePrimaryKey && !bInsertedPrimaryKey )
+{
+xStatementParams->setInt( 1, nRowCount );
+++nSourceColumn;
+bInsertedPrimaryKey = true;
+continue;
+}
+
 if ( ( nSourceColumn < 1 ) || ( 
o3tl::make_unsigned(nSourceColumn) >= aSourceColTypes.size() ) )
 {   // ( we have to check here against 1 because the 
parameters are 1 based)
 ::dbtools::throwSQLException("Internal error: invalid 
column type index.",
@@ -1250,6 +1263,7 @@ void CopyTableWizard::impl_copyRows_throw( const 
Reference< XResultSet >& _rxSou
 }
 catch( const Exception& )
 {
+TOOLS_WARN_EXCEPTION("dbaccess", "");
 aCopyEvent.Error = ::cppu::getCaughtException();
 }
 


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

2022-10-28 Thread Noel Grandin (via logerrit)
 dbaccess/source/ui/uno/copytablewizard.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit f27bf3e888c6e98c4a723eb0a00c57f0197f1ed2
Author: Noel Grandin 
AuthorDate: Fri Oct 28 11:48:56 2022 +0200
Commit: Noel Grandin 
CommitDate: Fri Oct 28 14:43:08 2022 +0200

add TOOLS_WARN

to make future debugging easier

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

diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx 
b/dbaccess/source/ui/uno/copytablewizard.cxx
index 9a77d4ed7f22..49cbb81d5c9f 100644
--- a/dbaccess/source/ui/uno/copytablewizard.cxx
+++ b/dbaccess/source/ui/uno/copytablewizard.cxx
@@ -1400,6 +1400,7 @@ void CopyTableWizard::impl_doCopy_nothrow()
 }
 catch( const Exception& )
 {
+TOOLS_WARN_EXCEPTION("dbaccess", "");
 aError = ::cppu::getCaughtException();
 
 // silence the error of the user cancelling the parameter's dialog


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

2022-10-28 Thread Noel Grandin (via logerrit)
 dbaccess/source/ui/uno/copytablewizard.cxx |   68 ++---
 1 file changed, 33 insertions(+), 35 deletions(-)

New commits:
commit ca82061c2cad00aeddb17b766063776fee0ee41a
Author: Noel Grandin 
AuthorDate: Fri Oct 28 11:28:58 2022 +0200
Commit: Noel Grandin 
CommitDate: Fri Oct 28 14:42:51 2022 +0200

make ValueTransfer easier to understand

storing references to local variables makes it harder to figure out what
the control flow is doing.

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

diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx 
b/dbaccess/source/ui/uno/copytablewizard.cxx
index 95a94a57aadf..9a77d4ed7f22 100644
--- a/dbaccess/source/ui/uno/copytablewizard.cxx
+++ b/dbaccess/source/ui/uno/copytablewizard.cxx
@@ -941,40 +941,39 @@ namespace
 class ValueTransfer
 {
 public:
-ValueTransfer( const sal_Int32& _rSourcePos, const sal_Int32& 
_rDestPos, std::vector< sal_Int32 >&& _rColTypes,
+ValueTransfer( std::vector< sal_Int32 > _rColTypes,
 const Reference< XRow >& _rxSource, const Reference< XParameters 
>& _rxDest )
-:m_rSourcePos( _rSourcePos )
-,m_rDestPos( _rDestPos )
-,m_rColTypes( std::move(_rColTypes) )
+:m_ColTypes( std::move(_rColTypes) )
 ,m_xSource( _rxSource )
 ,m_xDest( _rxDest )
 {
 }
 
 template< typename VALUE_TYPE >
-void transferValue( VALUE_TYPE ( SAL_CALL XRow::*_pGetter )( sal_Int32 ),
+void transferValue( sal_Int32 _nSourcePos, sal_Int32 _nDestPos,
+VALUE_TYPE ( SAL_CALL XRow::*_pGetter )( sal_Int32 ),
 void (SAL_CALL XParameters::*_pSetter)( sal_Int32, VALUE_TYPE ) )
 {
-VALUE_TYPE value( (m_xSource.get()->*_pGetter)( m_rSourcePos ) );
+VALUE_TYPE value( (m_xSource.get()->*_pGetter)( _nSourcePos ) );
 if ( m_xSource->wasNull() )
-m_xDest->setNull( m_rDestPos, m_rColTypes[ m_rSourcePos ] );
+m_xDest->setNull( _nDestPos, m_ColTypes[ _nSourcePos ] );
 else
-(m_xDest.get()->*_pSetter)( m_rDestPos, value );
+(m_xDest.get()->*_pSetter)( _nDestPos, value );
 }
- template< typename VALUE_TYPE >
-void transferComplexValue( VALUE_TYPE ( SAL_CALL XRow::*_pGetter )( 
sal_Int32 ),
+
+template< typename VALUE_TYPE >
+void transferComplexValue( sal_Int32 _nSourcePos, sal_Int32 _nDestPos,
+VALUE_TYPE ( SAL_CALL XRow::*_pGetter )( sal_Int32 ),
 void (SAL_CALL XParameters::*_pSetter)( sal_Int32, const VALUE_TYPE& ) 
)
 {
-const VALUE_TYPE value( (m_xSource.get()->*_pGetter)( m_rSourcePos ) );
+const VALUE_TYPE value( (m_xSource.get()->*_pGetter)( _nSourcePos ) );
 if ( m_xSource->wasNull() )
-m_xDest->setNull( m_rDestPos, m_rColTypes[ m_rSourcePos ] );
+m_xDest->setNull( _nDestPos, m_ColTypes[ _nSourcePos ] );
 else
-(m_xDest.get()->*_pSetter)( m_rDestPos, value );
+(m_xDest.get()->*_pSetter)( _nDestPos, value );
 }
 private:
-const sal_Int32&m_rSourcePos;
-const sal_Int32&m_rDestPos;
-const std::vector< sal_Int32 >m_rColTypes;
+const std::vector< sal_Int32 >  m_ColTypes;
 const Reference< XRow > m_xSource;
 const Reference< XParameters >  m_xDest;
 };
@@ -1137,13 +1136,12 @@ void CopyTableWizard::impl_copyRows_throw( const 
Reference< XResultSet >& _rxSou
 // notify listeners
 m_aCopyTableListeners.notifyEach( ::copyingRow, 
aCopyEvent );
 
-sal_Int32 nDestColumn( 0 );
-sal_Int32 nSourceColumn( 1 );
-ValueTransfer aTransfer( nSourceColumn, nDestColumn, 
std::vector(aSourceColTypes), xRow, xStatementParams );
+sal_Int32 nSourceColumn( 0 );
+ValueTransfer aTransfer( aSourceColTypes, xRow, xStatementParams );
 
 for ( auto const& rColumnPos : aColumnPositions )
 {
-nDestColumn = rColumnPos.first;
+sal_Int32 nDestColumn = rColumnPos.first;
 if ( nDestColumn == COLUMN_POSITION_NOT_FOUND )
 {
 ++nSourceColumn;
@@ -1161,7 +1159,7 @@ void CopyTableWizard::impl_copyRows_throw( const 
Reference< XResultSet >& _rxSou
 {
 case DataType::DOUBLE:
 case DataType::REAL:
-aTransfer.transferValue( ::getDouble, 
::setDouble );
+aTransfer.transferValue( nSourceColumn, nDestColumn, 
::getDouble, ::setDouble );
 break;
 
 case DataType::CHAR:
@@ -1169,64 +1167,64 @@ void CopyTableWizard::impl_copyRows_throw( const 
Reference< 

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

2022-10-28 Thread Noel Grandin (via logerrit)
 dbaccess/source/ui/inc/DExport.hxx |2 +-
 dbaccess/source/ui/misc/DExport.cxx|4 ++--
 dbaccess/source/ui/uno/copytablewizard.cxx |2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 7c754a226e63415a4f95be47ba30bde5029fee21
Author: Noel Grandin 
AuthorDate: Fri Oct 28 11:15:45 2022 +0200
Commit: Noel Grandin 
CommitDate: Fri Oct 28 13:41:03 2022 +0200

rename createPreparedStatment->createPreparedStatement

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

diff --git a/dbaccess/source/ui/inc/DExport.hxx 
b/dbaccess/source/ui/inc/DExport.hxx
index ab7c85811778..a7647077 100644
--- a/dbaccess/source/ui/inc/DExport.hxx
+++ b/dbaccess/source/ui/inc/DExport.hxx
@@ -153,7 +153,7 @@ namespace dbaui
 void enableCheckOnly() { m_bCheckOnly = true; }
 bool isCheckEnabled() const { return m_bCheckOnly; }
 
-static css::uno::Reference< css::sdbc::XPreparedStatement > 
createPreparedStatment( const css::uno::Reference< 
css::sdbc::XDatabaseMetaData>& _xMetaData
+static css::uno::Reference< css::sdbc::XPreparedStatement > 
createPreparedStatement( const css::uno::Reference< 
css::sdbc::XDatabaseMetaData>& _xMetaData
,const 
css::uno::Reference< css::beans::XPropertySet>& _xDestTable
,const TPositions& 
_rvColumnPositions);
 };
diff --git a/dbaccess/source/ui/misc/DExport.cxx 
b/dbaccess/source/ui/misc/DExport.cxx
index 46a53788429d..d45b791af1af 100644
--- a/dbaccess/source/ui/misc/DExport.cxx
+++ b/dbaccess/source/ui/misc/DExport.cxx
@@ -655,7 +655,7 @@ void ODatabaseExport::CreateDefaultColumn(const OUString& 
_rColumnName)
 
 void ODatabaseExport::createRowSet()
 {
-m_pUpdateHelper = 
std::make_shared(createPreparedStatment(m_xConnection->getMetaData(),m_xTable,m_vColumnPositions));
+m_pUpdateHelper = 
std::make_shared(createPreparedStatement(m_xConnection->getMetaData(),m_xTable,m_vColumnPositions));
 }
 
 bool ODatabaseExport::executeWizard(const OUString& _rTableName, const Any& 
_aTextColor, const FontDescriptor& _rFont)
@@ -778,7 +778,7 @@ void ODatabaseExport::ensureFormatter()
 }
 }
 
-Reference< XPreparedStatement > ODatabaseExport::createPreparedStatment( const 
Reference& _xMetaData
+Reference< XPreparedStatement > ODatabaseExport::createPreparedStatement( 
const Reference& _xMetaData
,const 
Reference& _xDestTable
,const TPositions& 
_rvColumns)
 {
diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx 
b/dbaccess/source/ui/uno/copytablewizard.cxx
index 640fed998318..95a94a57aadf 100644
--- a/dbaccess/source/ui/uno/copytablewizard.cxx
+++ b/dbaccess/source/ui/uno/copytablewizard.cxx
@@ -1090,7 +1090,7 @@ void CopyTableWizard::impl_copyRows_throw( const 
Reference< XResultSet >& _rxSou
 }
 
 // now create, fill and execute the prepared statement
-Reference< XPreparedStatement > xStatement( 
ODatabaseExport::createPreparedStatment( xDestMetaData, _rxDestTable, 
aColumnPositions ), UNO_SET_THROW );
+Reference< XPreparedStatement > xStatement( 
ODatabaseExport::createPreparedStatement( xDestMetaData, _rxDestTable, 
aColumnPositions ), UNO_SET_THROW );
 Reference< XParameters > xStatementParams( xStatement, UNO_QUERY_THROW );
 
 const bool bSelectedRecordsOnly = m_aSourceSelection.hasElements();


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

2022-10-23 Thread Christian Lohmaier (via logerrit)
 dbaccess/source/core/misc/dsntypes.cxx |3 ++-
 dbaccess/source/ui/dlg/generalpage.cxx |3 +++
 2 files changed, 5 insertions(+), 1 deletion(-)

New commits:
commit d0a20b67ae7ee1691409b4a1665853a182c46b7b
Author: Christian Lohmaier 
AuthorDate: Fri Oct 21 15:48:30 2022 +0200
Commit: Christian Lohmaier 
CommitDate: Sun Oct 23 12:22:31 2022 +0200

tdf#151073 - enable firebird for appstore build w/o experimental mode

also don't default to hsqldb as embedded database when a build is done
without java support. Mainly to hide an UI bug - apparently the dialog
should show a non-supported message for known embedded drivers
at least that is what 04d1e80ac7091ec2bf31c8617e832d5fe15350be suggests
"
  // this indicates it's really a type which is known in general, but not 
supported on the current platform
  // show a message saying so
  //  eSpecialMessage = smUnsupportedType;
  insertDatasourceTypeEntryData( m_eCurrentSelection, sDisplayName );
  // remember this type so we can show the special message again if the 
user selects this
  // type again (without changing the data source)
  m_eNotSupportedKnownType = m_pCollection->determineType( 
m_eCurrentSelection );
"
but that doesn't work, at least not anymore. m_eNotSupportedKnownType was
since removed, no attempts are made in showing an error/warning message
returning the hsqldb driver results in an empty (no display string)
entry as the default element in the dropdown in the dialog, that still
allows to create a database file (but of course one that you cannot add
any actual database tables to) without any error message. At the very
least it is inconsistent with the rest of the dialog's code that clears
the input name for stuff that shouldn't be shown.

Change-Id: I8419888018be2a556c49d32e40f02c0ac1801930
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141631
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier 

diff --git a/dbaccess/source/core/misc/dsntypes.cxx 
b/dbaccess/source/core/misc/dsntypes.cxx
index 0038e0968c77..28f89b4c7b26 100644
--- a/dbaccess/source/core/misc/dsntypes.cxx
+++ b/dbaccess/source/core/misc/dsntypes.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -288,7 +289,7 @@ bool ODsnTypeCollection::isEmbeddedDatabase( 
std::u16string_view _sURL )
 
 OUString ODsnTypeCollection::getEmbeddedDatabase()
 {
-if (officecfg::Office::Common::Misc::ExperimentalMode::get())
+if (!HAVE_FEATURE_JAVA || 
officecfg::Office::Common::Misc::ExperimentalMode::get())
 return "sdbc:embedded:firebird";
 else
 return "sdbc:embedded:hsqldb";
diff --git a/dbaccess/source/ui/dlg/generalpage.cxx 
b/dbaccess/source/ui/dlg/generalpage.cxx
index 4b3b293348dd..a4ce5402a480 100644
--- a/dbaccess/source/ui/dlg/generalpage.cxx
+++ b/dbaccess/source/ui/dlg/generalpage.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
 #include 
 #include "dsnItem.hxx"
 #include "generalpage.hxx"
@@ -155,9 +156,11 @@ namespace dbaui
 if (m_xEmbeddedDBType->find_text(sDisplayName) == -1 &&
 
dbaccess::ODsnTypeCollection::isEmbeddedDatabase(sURLPrefix))
 {
+#if !HAVE_FEATURE_MACOSX_SANDBOX
 if( 
!officecfg::Office::Common::Misc::ExperimentalMode::get()
 && sURLPrefix.startsWith("sdbc:embedded:firebird") )
 continue;
+#endif
 aDisplayedTypes.emplace_back( sURLPrefix, sDisplayName );
 m_bIsDisplayedTypesEmpty = false;
 }


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

2022-10-20 Thread Calvince Otieno (via logerrit)
 dbaccess/source/ui/inc/JoinTableView.hxx |2 +-
 dbaccess/source/ui/querydesign/JoinTableView.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit b74e7c0fef80336de1d0c2d0737c2fd2db56cbd9
Author: Calvince Otieno 
AuthorDate: Tue Oct 18 22:46:11 2022 +0300
Commit: Ilmari Lauhakangas 
CommitDate: Thu Oct 20 12:10:00 2022 +0200

tdf#114441 sal_uLong type to sal_uInt32 type

Change-Id: Icaa9c0a45f257c8c8d5e9d80785554ac82902c59
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141514
Tested-by: Ilmari Lauhakangas 
Reviewed-by: Ilmari Lauhakangas 

diff --git a/dbaccess/source/ui/inc/JoinTableView.hxx 
b/dbaccess/source/ui/inc/JoinTableView.hxx
index 1b6c8c79ed16..b0b6ece88454 100644
--- a/dbaccess/source/ui/inc/JoinTableView.hxx
+++ b/dbaccess/source/ui/inc/JoinTableView.hxx
@@ -163,7 +163,7 @@ namespace dbaui
 void addConnection(OTableConnection* _pConnection,bool _bAddData = 
true);
 
 bool ScrollPane( tools::Long nDelta, bool bHoriz, bool 
bPaintScrollBars );
-sal_uLong GetTabWinCount() const;
+sal_uInt32 GetTabWinCount() const;
 const Point& GetScrollOffset() const { return m_aScrollOffset; }
 
 OJoinDesignView* getDesignView() const { return m_pView; }
diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx 
b/dbaccess/source/ui/querydesign/JoinTableView.cxx
index 87cf5b8aea5b..21259b590fca 100644
--- a/dbaccess/source/ui/querydesign/JoinTableView.cxx
+++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx
@@ -236,7 +236,7 @@ void OJoinTableView::Resize()
 }
 }
 
-sal_uLong OJoinTableView::GetTabWinCount() const
+sal_uInt32 OJoinTableView::GetTabWinCount() const
 {
 return m_aTableMap.size();
 }


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

2022-10-10 Thread Caolán McNamara (via logerrit)
 dbaccess/source/ui/control/dbtreelistbox.cxx |   12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 5f6596bd125aa8309875d970318f18d4d9704705
Author: Caolán McNamara 
AuthorDate: Sun Oct 9 20:40:41 2022 +0100
Commit: Caolán McNamara 
CommitDate: Mon Oct 10 10:26:44 2022 +0200

Resolves: tdf#151441 queries don't show any content

Change-Id: I66ec14c7cb8816bc2181cc25f7d7f31fdc7d1604
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141146
Tested-by: Jenkins
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 
Reviewed-by: Caolán McNamara 

diff --git a/dbaccess/source/ui/control/dbtreelistbox.cxx 
b/dbaccess/source/ui/control/dbtreelistbox.cxx
index 24c9a83d2190..be900d650f63 100644
--- a/dbaccess/source/ui/control/dbtreelistbox.cxx
+++ b/dbaccess/source/ui/control/dbtreelistbox.cxx
@@ -187,8 +187,16 @@ TreeListBox::~TreeListBox()
 std::unique_ptr 
TreeListBox::GetEntryPosByName(std::u16string_view aName, const weld::TreeIter* 
pStart, const IEntryFilter* _pFilter) const
 {
 auto xEntry(m_xTreeView->make_iterator(pStart));
-if (!pStart && !m_xTreeView->get_iter_first(*xEntry))
-return nullptr;
+if (pStart)
+{
+if (!m_xTreeView->iter_children(*xEntry))
+return nullptr;
+}
+else
+{
+if (!m_xTreeView->get_iter_first(*xEntry))
+return nullptr;
+}
 
 do
 {


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

2022-10-05 Thread Caolán McNamara (via logerrit)
 dbaccess/source/ui/control/dbtreelistbox.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6aaeeb5a2a0cd7bc8c511c1bf7515e0943940797
Author: Caolán McNamara 
AuthorDate: Wed Oct 5 16:11:44 2022 +0100
Commit: Caolán McNamara 
CommitDate: Wed Oct 5 20:14:37 2022 +0200

Resolves: tdf#149277 we don't want to search the whole tree for dups

just the immediate children of the supplied parent node

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

diff --git a/dbaccess/source/ui/control/dbtreelistbox.cxx 
b/dbaccess/source/ui/control/dbtreelistbox.cxx
index 1dd94c35ee4f..24c9a83d2190 100644
--- a/dbaccess/source/ui/control/dbtreelistbox.cxx
+++ b/dbaccess/source/ui/control/dbtreelistbox.cxx
@@ -200,7 +200,7 @@ std::unique_ptr 
TreeListBox::GetEntryPosByName(std::u16string_vi
 return xEntry;
 }
 }
-} while (m_xTreeView->iter_next(*xEntry));
+} while (m_xTreeView->iter_next_sibling(*xEntry));
 
 return nullptr;
 }


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

2022-09-26 Thread Noel Grandin (via logerrit)
 dbaccess/source/core/api/SingleSelectQueryComposer.cxx |8 ++---
 dbaccess/source/core/misc/dsntypes.cxx |4 +-
 dbaccess/source/core/recovery/dbdocrecovery.cxx|   23 -
 dbaccess/source/filter/hsqldb/rowinputbinary.cxx   |4 +-
 dbaccess/source/filter/hsqldb/utils.cxx|4 +-
 dbaccess/source/filter/hsqldb/utils.hxx|2 -
 dbaccess/source/inc/dsntypes.hxx   |2 -
 dbaccess/source/ui/control/SqlNameEdit.cxx |8 ++---
 dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx  |2 -
 dbaccess/source/ui/dlg/DbAdminImpl.hxx |4 +-
 dbaccess/source/ui/dlg/TextConnectionHelper.cxx|   14 +++---
 dbaccess/source/ui/dlg/dbwizsetup.cxx  |8 ++---
 dbaccess/source/ui/inc/SqlNameEdit.hxx |2 -
 13 files changed, 46 insertions(+), 39 deletions(-)

New commits:
commit 1026527a517fbdf35392d97f89b470a02d2e40e0
Author: Noel Grandin 
AuthorDate: Mon Sep 26 15:50:56 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Sep 27 07:59:08 2022 +0200

use more string_view in dbaccess

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

diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx 
b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
index f69742d4422a..45d9a8ce6595 100644
--- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
+++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
@@ -1524,9 +1524,9 @@ OUString OSingleSelectQueryComposer::getStatementPart( 
TGetParseNode const & _aG
 
 namespace
 {
-OUString lcl_getDecomposedColumnName(const OUString& rComposedName, const 
OUString& rQuoteString)
+OUString lcl_getDecomposedColumnName(const OUString& rComposedName, 
std::u16string_view rQuoteString)
 {
-const sal_Int32 nQuoteLength = rQuoteString.getLength();
+const size_t nQuoteLength = rQuoteString.size();
 OUString sName = rComposedName.trim();
 OUString sColumnName;
 sal_Int32 nPos, nRPos = 0;
@@ -1539,7 +1539,7 @@ namespace
 nRPos = sName.indexOf( rQuoteString, nPos + nQuoteLength );
 if ( nRPos > nPos )
 {
-if ( nRPos + nQuoteLength < sName.getLength() )
+if ( static_cast(nRPos + nQuoteLength) < 
sName.getLength() )
 {
 nRPos += nQuoteLength; // -1 + 1 skip dot
 }
@@ -1561,7 +1561,7 @@ namespace
 OUString lcl_getCondition(const Sequence< Sequence< PropertyValue > >& 
filter,
 const OPredicateInputController& i_aPredicateInputController,
 const Reference< XNameAccess >& i_xSelectColumns,
-const OUString& rQuoteString)
+std::u16string_view rQuoteString)
 {
 OUStringBuffer sRet;
 const Sequence< PropertyValue >* pOrIter = filter.getConstArray();
diff --git a/dbaccess/source/core/misc/dsntypes.cxx 
b/dbaccess/source/core/misc/dsntypes.cxx
index 91b93f353946..0038e0968c77 100644
--- a/dbaccess/source/core/misc/dsntypes.cxx
+++ b/dbaccess/source/core/misc/dsntypes.cxx
@@ -106,7 +106,7 @@ OUString ODsnTypeCollection::cutPrefix(std::u16string_view 
_sURL) const
 return sRet;
 }
 
-OUString ODsnTypeCollection::getPrefix(const OUString& _sURL) const
+OUString ODsnTypeCollection::getPrefix(std::u16string_view _sURL) const
 {
 OUString sRet;
 OUString sOldPattern;
@@ -119,7 +119,7 @@ OUString ODsnTypeCollection::getPrefix(const OUString& 
_sURL) const
 //   foo*
 // that is, the very concept of "prefix" applies.
 sRet = comphelper::string::stripEnd(dsnPrefix, '*');
-OSL_ENSURE(sRet.getLength() <= _sURL.getLength(), "How can A match 
B when A shorter than B?");
+OSL_ENSURE(sRet.getLength() <= 
static_cast(_sURL.size()), "How can A match B when A shorter than 
B?");
 sOldPattern = dsnPrefix;
 }
 }
diff --git a/dbaccess/source/core/recovery/dbdocrecovery.cxx 
b/dbaccess/source/core/recovery/dbdocrecovery.cxx
index e027cc834e37..1c8763c02b4c 100644
--- a/dbaccess/source/core/recovery/dbdocrecovery.cxx
+++ b/dbaccess/source/core/recovery/dbdocrecovery.cxx
@@ -28,6 +28,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -65,23 +66,23 @@ namespace dbaccess
 o_rBuffer.append( sal_Unicode( i_rComponentDesc.second.bForEditing 
? '1' : '0' ) );
 }
 
-bool lcl_extractCompDesc( const OUString& i_rIniLine, OUString& 
o_rStorName, SubComponentDescriptor& o_rCompDesc )
+bool lcl_extractCompDesc( std::u16string_view i_rIniLine, OUString& 
o_rStorName, SubComponentDescriptor& o_rCompDesc )
 {
-const sal_Int32 nEqualSignPos = i_rIniLine.indexOf( '=' );
-

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

2022-09-12 Thread Caolán McNamara (via logerrit)
 dbaccess/source/filter/hsqldb/utils.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 6f7d8e1b239438ac0f6d8e17b7441b7c65ab4fde
Author: Caolán McNamara 
AuthorDate: Mon Sep 12 11:25:46 2022 +0100
Commit: Caolán McNamara 
CommitDate: Mon Sep 12 22:06:40 2022 +0200

cid#1509268 Out-of-bounds access

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

diff --git a/dbaccess/source/filter/hsqldb/utils.cxx 
b/dbaccess/source/filter/hsqldb/utils.cxx
index 724ffccfb37f..8387a34e0bf4 100644
--- a/dbaccess/source/filter/hsqldb/utils.cxx
+++ b/dbaccess/source/filter/hsqldb/utils.cxx
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "utils.hxx"
 
@@ -109,6 +110,11 @@ OUString utils::getTableNameFromStmt(std::u16string_view 
sSql)
 while (!bProperEndAposFound)
 {
 nAposEnd = sSql.find('"', nAposEnd + 1);
+if (nAposEnd == std::u16string_view::npos)
+{
+SAL_WARN("dbaccess", "no matching \"");
+return OUString();
+}
 if (sSql[nAposEnd - 1] != u'\\')
 bProperEndAposFound = true;
 }


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

2022-09-09 Thread Noel Grandin (via logerrit)
 dbaccess/source/core/api/RowSet.cxx |   10 +-
 dbaccess/source/core/api/RowSetBase.cxx |   30 +++---
 dbaccess/source/core/api/RowSetBase.hxx |   10 +-
 3 files changed, 25 insertions(+), 25 deletions(-)

New commits:
commit 270df129a428a7346f87ebd760cfd51780750592
Author: Noel Grandin 
AuthorDate: Wed Sep 7 08:46:02 2022 +0200
Commit: Noel Grandin 
CommitDate: Fri Sep 9 22:15:51 2022 +0200

convert CursorMoveDirection to scoped enum

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

diff --git a/dbaccess/source/core/api/RowSet.cxx 
b/dbaccess/source/core/api/RowSet.cxx
index bd826fcf5797..69f61044f0a9 100644
--- a/dbaccess/source/core/api/RowSet.cxx
+++ b/dbaccess/source/core/api/RowSet.cxx
@@ -974,7 +974,7 @@ void SAL_CALL ORowSet::deleteRow(  )
 
 // this call position the cache indirect
 Any aBookmarkToDelete( m_aBookmark );
-positionCache( MOVE_NONE );
+positionCache( CursorMoveDirection::Current );
 sal_Int32 nDeletePosition = m_pCache->getRow();
 
 notifyRowSetAndClonesRowDelete( aBookmarkToDelete );
@@ -1021,7 +1021,7 @@ void ORowSet::implCancelRowUpdates( bool _bNotifyModified 
)
 if ( m_bNew || m_nResultSetConcurrency == ResultSetConcurrency::READ_ONLY )
 throwFunctionSequenceException(*this);
 
-positionCache( MOVE_NONE );
+positionCache( CursorMoveDirection::Current );
 
 ORowSetRow aOldValues;
 if ( !m_bModified && _bNotifyModified && !m_aCurrentRow.isNull() )
@@ -1171,12 +1171,12 @@ void SAL_CALL ORowSet::moveToInsertRow(  )
 ORowSetRow aOldValues;
 if ( rowDeleted() )
 {
-positionCache( MOVE_FORWARD );
+positionCache( CursorMoveDirection::Forward );
 m_pCache->next();
 setCurrentRow( true, false, aOldValues, aGuard);
 }
 else
-positionCache( MOVE_NONE );
+positionCache( CursorMoveDirection::Current );
 
 // check before because the resultset could be empty
 if  (   !m_bBeforeFirst
@@ -1265,7 +1265,7 @@ void SAL_CALL ORowSet::moveToCurrentRow(  )
 if ( !notifyAllListenersCursorBeforeMove( aGuard ) )
 return;
 
-positionCache( MOVE_NONE_REFRESH );
+positionCache( CursorMoveDirection::CurrentRefresh );
 
 ORowSetNotifier aNotifier( this );
 
diff --git a/dbaccess/source/core/api/RowSetBase.cxx 
b/dbaccess/source/core/api/RowSetBase.cxx
index e6eddc57eef5..753c857eecc0 100644
--- a/dbaccess/source/core/api/RowSetBase.cxx
+++ b/dbaccess/source/core/api/RowSetBase.cxx
@@ -207,7 +207,7 @@ const ORowSetValue& ORowSetBase::impl_getValue(sal_Int32 
columnIndex)
 if ( !bValidCurrentRow )
 {
 // currentrow is null when the clone moves the window
-positionCache( MOVE_NONE );
+positionCache( CursorMoveDirection::Current );
 m_aCurrentRow   = m_pCache->m_aMatrixIter;
 m_bIsInsertRow  = false;
 OSL_ENSURE(!m_aCurrentRow.isNull(),"ORowSetBase::getValue: we don't 
stand on a valid row! Row is null.");
@@ -338,7 +338,7 @@ Reference< css::io::XInputStream > SAL_CALL 
ORowSetBase::getBinaryStream( sal_In
 bool bValidCurrentRow = ( !m_aCurrentRow.isNull() && m_aCurrentRow != 
m_pCache->getEnd() && m_aCurrentRow->is() );
 if ( !bValidCurrentRow )
 {
-positionCache( MOVE_NONE );
+positionCache( CursorMoveDirection::Current );
 m_aCurrentRow   = m_pCache->m_aMatrixIter;
 m_bIsInsertRow  = false;
 OSL_ENSURE(!m_aCurrentRow.isNull(),"ORowSetBase::getBinaryStream: we 
don't stand on a valid row! Row is null.");
@@ -579,7 +579,7 @@ sal_Bool SAL_CALL ORowSetBase::next(  )
 
 ORowSetRow aOldValues = getOldRow(bWasNew);
 
-positionCache( MOVE_FORWARD );
+positionCache( CursorMoveDirection::Forward );
 bool bAfterLast = m_pCache->isAfterLast();
 bRet = m_pCache->next();
 doCancelModification( );
@@ -662,7 +662,7 @@ sal_Bool SAL_CALL ORowSetBase::isFirst(  )
 if ( impl_rowDeleted() )
 return ( m_nDeletedPosition == 1 );
 
-positionCache( MOVE_NONE );
+positionCache( CursorMoveDirection::Current );
 bool bIsFirst = m_pCache->isFirst();
 
 SAL_INFO("dbaccess", "ORowSetBase::isFirst() = " << bIsFirst << " Clone = 
" << m_bClone);
@@ -692,7 +692,7 @@ sal_Bool SAL_CALL ORowSetBase::isLast(  )
 return ( m_nDeletedPosition == impl_getRowCount() );
 }
 
-positionCache( MOVE_NONE );
+positionCache( CursorMoveDirection::Current );
 bool bIsLast = m_pCache->isLast();
 
 SAL_INFO("dbaccess", "ORowSetBase::isLast() = " << bIsLast << " Clone = " 
<< m_bClone);
@@ -864,7 +864,7 @@ sal_Int32 ORowSetBase::impl_getRow()
 nPos = 0;
 else
 {
-positionCache( MOVE_NONE );
+positionCache( CursorMoveDirection::Current );
 nPos = m_pCache->getRow();
 }
 

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

2022-09-08 Thread Noel Grandin (via logerrit)
 dbaccess/source/ui/dlg/dlgsave.cxx |8 ++--
 dbaccess/source/ui/inc/dlgsave.hxx |2 --
 2 files changed, 2 insertions(+), 8 deletions(-)

New commits:
commit 75fcdffdcb1be4bab1f7e7c015ccf05ceef9d700
Author: Noel Grandin 
AuthorDate: Thu Sep 8 12:13:14 2022 +0200
Commit: Noel Grandin 
CommitDate: Thu Sep 8 15:30:40 2022 +0200

loplugin:unusedfields

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

diff --git a/dbaccess/source/ui/dlg/dlgsave.cxx 
b/dbaccess/source/ui/dlg/dlgsave.cxx
index 9aeecae139ed..23f6dbe373e4 100644
--- a/dbaccess/source/ui/dlg/dlgsave.cxx
+++ b/dbaccess/source/ui/dlg/dlgsave.cxx
@@ -84,8 +84,6 @@ OSaveAsDlg::OSaveAsDlg( weld::Window * pParent,
 SADFlags _nFlags)
 : GenericDialogController(pParent, "dbaccess/ui/savedialog.ui", 
"SaveDialog")
 , m_xContext( _rxContext )
-, m_aQryLabel(DBA_RES(STR_QRY_LABEL))
-, m_sTblLabel(DBA_RES(STR_TBL_LABEL))
 , m_aName(rDefault)
 , m_rObjectNameCheck( _rObjectNameCheck )
 , m_nType(_rType)
@@ -115,13 +113,13 @@ OSaveAsDlg::OSaveAsDlg( weld::Window * pParent,
 
 switch (_rType) {
 case CommandType::QUERY:
-implInitOnlyTitle(m_aQryLabel);
+implInitOnlyTitle(DBA_RES(STR_QRY_LABEL));
 break;
 
 case CommandType::TABLE:
 OSL_ENSURE( m_xMetaData.is(), "OSaveAsDlg::OSaveAsDlg: no meta data 
for entering table names: this will crash!" );
 {
-m_xLabel->set_label(m_sTblLabel);
+m_xLabel->set_label(DBA_RES(STR_TBL_LABEL));
 if(m_xMetaData.is() && 
!m_xMetaData->supportsCatalogsInTableDefinitions()) {
 m_xCatalogLbl->hide();
 m_xCatalog->hide();
@@ -191,8 +189,6 @@ OSaveAsDlg::OSaveAsDlg(weld::Window * pParent,
SADFlags _nFlags)
 : GenericDialogController(pParent, "dbaccess/ui/savedialog.ui", 
"SaveDialog")
 , m_xContext( _rxContext )
-, m_aQryLabel(DBA_RES(STR_QRY_LABEL))
-, m_sTblLabel(DBA_RES(STR_TBL_LABEL))
 , m_aName(rDefault)
 , m_rObjectNameCheck( _rObjectNameCheck )
 , m_nType(CommandType::COMMAND)
diff --git a/dbaccess/source/ui/inc/dlgsave.hxx 
b/dbaccess/source/ui/inc/dlgsave.hxx
index c5bc9d8037e1..f3b33a278500 100644
--- a/dbaccess/source/ui/inc/dlgsave.hxx
+++ b/dbaccess/source/ui/inc/dlgsave.hxx
@@ -49,8 +49,6 @@ namespace dbaui
 {
 private:
 css::uno::Reference< css::uno::XComponentContext >m_xContext;
-OUString   m_aQryLabel;
-OUString   m_sTblLabel;
 OUString   m_aName;
 const IObjectNameCheck&m_rObjectNameCheck;
 css::uno::Reference< css::sdbc::XDatabaseMetaData>
m_xMetaData;


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

2022-09-07 Thread Noel Grandin (via logerrit)
 dbaccess/source/core/dataaccess/ModelImpl.cxx  |   23 -
 dbaccess/source/core/dataaccess/databasedocument.cxx   |8 ++---
 dbaccess/source/core/dataaccess/datasource.cxx |4 +-
 dbaccess/source/core/dataaccess/documentcontainer.cxx  |2 -
 dbaccess/source/core/dataaccess/documentdefinition.cxx |4 +-
 dbaccess/source/core/inc/ModelImpl.hxx |   16 +++
 6 files changed, 31 insertions(+), 26 deletions(-)

New commits:
commit e801c211911deb673c8f75b5072a58c88832b720
Author: Noel Grandin 
AuthorDate: Tue Sep 6 21:42:56 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed Sep 7 09:24:55 2022 +0200

convert ObjectType to scoped enum

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

diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx 
b/dbaccess/source/core/dataaccess/ModelImpl.cxx
index c482e09eb2ae..14d05bb53b35 100644
--- a/dbaccess/source/core/dataaccess/ModelImpl.cxx
+++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx
@@ -354,7 +354,7 @@ void SAL_CALL DocumentStorageAccess::disposing( const 
css::lang::EventObject& So
 // ODatabaseModelImpl
 
 ODatabaseModelImpl::ODatabaseModelImpl( const Reference< XComponentContext >& 
_rxContext, ODatabaseContext& _rDBContext )
-:m_aContainer(4)
+:m_aContainer()
 ,m_aMacroMode( *this )
 ,m_nImposedMacroExecMode( MacroExecMode::NEVER_EXECUTE )
 ,m_rDBContext( _rDBContext )
@@ -384,7 +384,7 @@ ODatabaseModelImpl::ODatabaseModelImpl(
 const Reference< XComponentContext >& _rxContext,
 ODatabaseContext& _rDBContext
 )
-:m_aContainer(4)
+:m_aContainer()
 ,m_aMacroMode( *this )
 ,m_nImposedMacroExecMode( MacroExecMode::NEVER_EXECUTE )
 ,m_rDBContext( _rDBContext )
@@ -468,10 +468,10 @@ namespace
 const char* pAsciiName( nullptr );
 switch ( _eType )
 {
-case ODatabaseModelImpl::E_FORM:   pAsciiName = "forms"; break;
-case ODatabaseModelImpl::E_REPORT: pAsciiName = "reports"; break;
-case ODatabaseModelImpl::E_QUERY:  pAsciiName = "queries"; break;
-case ODatabaseModelImpl::E_TABLE:  pAsciiName = "tables"; break;
+case ODatabaseModelImpl::ObjectType::Form:   pAsciiName = "forms"; 
break;
+case ODatabaseModelImpl::ObjectType::Report: pAsciiName = "reports"; 
break;
+case ODatabaseModelImpl::ObjectType::Query:  pAsciiName = "queries"; 
break;
+case ODatabaseModelImpl::ObjectType::Table:  pAsciiName = "tables"; 
break;
 default:
 throw RuntimeException();
 }
@@ -561,7 +561,8 @@ bool ODatabaseModelImpl::objectHasMacros( const Reference< 
XStorage >& _rxContai
 void ODatabaseModelImpl::reset()
 {
 m_bReadOnly = false;
-std::vector(4).swap(m_aContainer);
+for (auto & i : m_aContainer)
+i.reset();
 
 if ( m_pStorageAccess.is() )
 {
@@ -650,7 +651,8 @@ void ODatabaseModelImpl::dispose()
 if ( elem )
 elem->m_pDataSource = nullptr;
 }
-m_aContainer.clear();
+for (auto & i : m_aContainer)
+i.reset();
 
 clearConnections();
 
@@ -1103,7 +1105,6 @@ const AsciiPropertyValue* 
ODatabaseModelImpl::getDefaultDataSourceSettings()
 
 TContentPtr& ODatabaseModelImpl::getObjectContainer( ObjectType _eType )
 {
-OSL_PRECOND( _eType >= E_FORM && _eType <= E_TABLE, 
"ODatabaseModelImpl::getObjectContainer: illegal index!" );
 TContentPtr& rContentPtr = m_aContainer[ _eType ];
 
 if ( !rContentPtr )
@@ -1324,8 +1325,8 @@ ODatabaseModelImpl::EmbeddedMacros 
ODatabaseModelImpl::determineEmbeddedMacros()
 {
 m_aEmbeddedMacros = eDocumentWideMacros;
 }
-else if (   lcl_hasObjectsWithMacros_nothrow( *this, E_FORM )
-||  lcl_hasObjectsWithMacros_nothrow( *this, E_REPORT )
+else if (   lcl_hasObjectsWithMacros_nothrow( *this, ObjectType::Form )
+||  lcl_hasObjectsWithMacros_nothrow( *this, 
ObjectType::Report )
 )
 {
 m_aEmbeddedMacros = eSubDocumentMacros;
diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx 
b/dbaccess/source/core/dataaccess/databasedocument.cxx
index 5fed5b674e9a..681966020696 100644
--- a/dbaccess/source/core/dataaccess/databasedocument.cxx
+++ b/dbaccess/source/core/dataaccess/databasedocument.cxx
@@ -1413,10 +1413,10 @@ void ODatabaseDocument::clearObjectContainer( 
WeakReference< XNameAccess >& _rxC
 
 Reference< XNameAccess > ODatabaseDocument::impl_getDocumentContainer_throw( 
ODatabaseModelImpl::ObjectType _eType )
 {
-if ( ( _eType != ODatabaseModelImpl::E_FORM ) && ( _eType != 
ODatabaseModelImpl::E_REPORT ) )
+if ( ( _eType != ODatabaseModelImpl::ObjectType::Form ) 

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

2022-09-05 Thread jsala (via logerrit)
 dbaccess/source/core/misc/DatabaseDataProvider.cxx|2 
 dbaccess/source/sdbtools/connection/tablename.cxx |   11 +---
 dbaccess/source/ui/app/templwin.cxx   |   11 +---
 dbaccess/source/ui/browser/unodatbr.cxx   |2 
 dbaccess/source/ui/control/FieldDescControl.cxx   |   41 +-
 dbaccess/source/ui/dlg/TextConnectionHelper.cxx   |   11 ++--
 dbaccess/source/ui/dlg/dbadmin.cxx|2 
 dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx |8 +--
 8 files changed, 41 insertions(+), 47 deletions(-)

New commits:
commit 35a7e40d372d3211061465346825cf543a095f6d
Author: jsala 
AuthorDate: Fri Jun 24 18:44:20 2022 +0200
Commit: Hossein 
CommitDate: Mon Sep 5 17:16:42 2022 +0200

tdf#147021 Use std::size() instead of SAL_N_ELEMENTS() macro

Also change some integer by std::size_t

Change-Id: I6a0fda3ba44815aac3312d523be04f4f973ce84f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137142
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/dbaccess/source/core/misc/DatabaseDataProvider.cxx 
b/dbaccess/source/core/misc/DatabaseDataProvider.cxx
index 3a59cd9b821a..90b808712042 100644
--- a/dbaccess/source/core/misc/DatabaseDataProvider.cxx
+++ b/dbaccess/source/core/misc/DatabaseDataProvider.cxx
@@ -756,7 +756,7 @@ void 
DatabaseDataProvider::impl_fillInternalDataProvider_throw(bool _bHasCategor
 {
 aRowLabels.push_back(OUString::number(h+1));
 std::vector< double > aRow;
-const sal_Int32 nSize = SAL_N_ELEMENTS(fDefaultData);
+const sal_Int32 nSize = std::size(fDefaultData);
 for (size_t j = 0; j < (aColumns.size()-1); ++j,++k)
 {
 if ( k >= nSize )
diff --git a/dbaccess/source/sdbtools/connection/tablename.cxx 
b/dbaccess/source/sdbtools/connection/tablename.cxx
index 8698cef6d75b..2b275c0f31eb 100644
--- a/dbaccess/source/sdbtools/connection/tablename.cxx
+++ b/dbaccess/source/sdbtools/connection/tablename.cxx
@@ -190,19 +190,16 @@ namespace sdbtools
 { CompositionType::Complete, 
EComposeRule::Complete }
 };
 
-bool found = false;
-size_t i = 0;
-for ( ; i < SAL_N_ELEMENTS( TypeTable ) && !found; ++i )
-if ( TypeTable[i].nCompositionType == _nType )
-found = true;
-if ( !found )
+auto const found = std::find_if(std::begin(TypeTable), 
std::end(TypeTable)
+, [_nType](auto const & type){ 
return type.nCompositionType == _nType; });
+if (found == std::end(TypeTable))
 throw IllegalArgumentException(
 DBA_RES( STR_INVALID_COMPOSITION_TYPE ),
 nullptr,
 0
 );
 
-return TypeTable[i].eComposeRule;
+return found->eComposeRule;
 }
 }
 
diff --git a/dbaccess/source/ui/app/templwin.cxx 
b/dbaccess/source/ui/app/templwin.cxx
index e9940782d630..224d8be0aed9 100644
--- a/dbaccess/source/ui/app/templwin.cxx
+++ b/dbaccess/source/ui/app/templwin.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
 #include 
 #include 
 #include "templwin.hxx"
@@ -25,13 +26,9 @@ namespace SvtDocInfoTable_Impl
 {
 OUString GetString(int nId)
 {
-for (size_t i = 0; i < SAL_N_ELEMENTS(STRARY_SVT_DOCINFO); ++i)
-{
-if (STRARY_SVT_DOCINFO[i].second == nId)
-return DBA_RES(STRARY_SVT_DOCINFO[i].first);
-}
-
-return OUString();
+auto const found = std::find_if(std::begin(STRARY_SVT_DOCINFO), 
std::end(STRARY_SVT_DOCINFO)
+, [nId](auto const & docinfo){ return 
docinfo.second == nId; });
+return (found != std::end(STRARY_SVT_DOCINFO)) ? DBA_RES(found->first) 
: OUString();
 }
 }
 
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx 
b/dbaccess/source/ui/browser/unodatbr.cxx
index 4cea7af77f36..ee300a8862ed 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -1240,7 +1240,7 @@ void SbaTableQueryBrowser::connectExternalDispatches()
 ID_BROWSER_INSERTCONTENT
 };
 
-for ( size_t i=0; i < SAL_N_ELEMENTS( pURLs ); ++i )
+for ( size_t i=0; i < std::size( pURLs ); ++i )
 {
 URL aURL;
 aURL.Complete = OUString::createFromAscii( pURLs[i] );
diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx 
b/dbaccess/source/ui/control/FieldDescControl.cxx
index 0b18c3907e7a..1416b43fc2ed 100644
--- a/dbaccess/source/ui/control/FieldDescControl.cxx
+++ b/dbaccess/source/ui/control/FieldDescControl.cxx
@@ -164,27 +164,28 @@ void OFieldDescControl::Init()
 void OFieldDescControl::SetReadOnly( bool bReadOnly )
 {
 // 

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

2022-09-05 Thread Noel Grandin (via logerrit)
 dbaccess/source/core/dataaccess/myucp_datasupplier.cxx |  143 +
 dbaccess/source/core/dataaccess/myucp_datasupplier.hxx |   20 ++
 2 files changed, 67 insertions(+), 96 deletions(-)

New commits:
commit 11999e2114040ba165da29ca6811d8e09e735413
Author: Noel Grandin 
AuthorDate: Sun Sep 4 21:34:25 2022 +0200
Commit: Noel Grandin 
CommitDate: Mon Sep 5 12:43:01 2022 +0200

dbaccess::DataSupplier doesn't need a pimpl

it is module private

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

diff --git a/dbaccess/source/core/dataaccess/myucp_datasupplier.cxx 
b/dbaccess/source/core/dataaccess/myucp_datasupplier.cxx
index e86efdb50cca..04a64e02050d 100644
--- a/dbaccess/source/core/dataaccess/myucp_datasupplier.cxx
+++ b/dbaccess/source/core/dataaccess/myucp_datasupplier.cxx
@@ -20,8 +20,6 @@
 #include 
 #include 
 
-#include 
-
 #include "myucp_datasupplier.hxx"
 #include 
 #include 
@@ -34,66 +32,25 @@ using namespace ::com::sun::star::sdbc;
 using namespace ::com::sun::star::io;
 using namespace ::com::sun::star::container;
 
-// @@@ Adjust namespace name.
 using namespace dbaccess;
 
-// @@@ Adjust namespace name.
-namespace dbaccess
-{
-
-namespace {
-
-// struct ResultListEntry.
-struct ResultListEntry
-{
-OUString   aId;
-Reference< XContentIdentifier > xId;
-::rtl::Reference< OContentHelper >  xContent;
-Reference< XRow >   xRow;
-const ContentProperties&rData;
-
-explicit ResultListEntry(const ContentProperties& rEntry) : rData( rEntry 
) {}
-};
-
-}
-
-// struct DataSupplier_Impl.
-struct DataSupplier_Impl
-{
-osl::Mutex   m_aMutex;
-std::vector< std::unique_ptr > m_aResults;
-rtl::Reference< ODocumentContainer > m_xContent;
-bool m_bCountFinal;
-
-explicit DataSupplier_Impl(rtl::Reference< ODocumentContainer > xContent)
-: m_xContent(std::move(xContent))
-, m_bCountFinal(false)
-{
-}
-};
-
-}
-
-// DataSupplier Implementation.
 
 DataSupplier::DataSupplier( const rtl::Reference< ODocumentContainer >& 
rContent )
-: m_pImpl( new DataSupplier_Impl( rContent ) )
+: m_xContent( rContent )
 {
-
 }
 
 DataSupplier::~DataSupplier()
 {
-
 }
 
 OUString DataSupplier::queryContentIdentifierString( sal_uInt32 nIndex )
 {
-osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex );
+osl::Guard< osl::Mutex > aGuard( m_aMutex );
 
-if ( static_cast(nIndex) < m_pImpl->m_aResults.size() )
+if ( static_cast(nIndex) < m_aResults.size() )
 {
-OUString aId = m_pImpl->m_aResults[ nIndex ]->aId;
+OUString aId = m_aResults[ nIndex ]->aId;
 if ( !aId.isEmpty() )
 {
 // Already cached.
@@ -103,14 +60,14 @@ OUString DataSupplier::queryContentIdentifierString( 
sal_uInt32 nIndex )
 
 if ( getResult( nIndex ) )
 {
-OUString aId = 
m_pImpl->m_xContent->getIdentifier()->getContentIdentifier();
+OUString aId = m_xContent->getIdentifier()->getContentIdentifier();
 
 if ( !aId.isEmpty() )
 aId += "/";
 
-aId += m_pImpl->m_aResults[ nIndex ]->rData.aTitle;
+aId += m_aResults[ nIndex ]->rData.aTitle;
 
-m_pImpl->m_aResults[ nIndex ]->aId = aId;
+m_aResults[ nIndex ]->aId = aId;
 return aId;
 }
 return OUString();
@@ -119,11 +76,11 @@ OUString DataSupplier::queryContentIdentifierString( 
sal_uInt32 nIndex )
 Reference< XContentIdentifier >
 DataSupplier::queryContentIdentifier( sal_uInt32 nIndex )
 {
-osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex );
+osl::Guard< osl::Mutex > aGuard( m_aMutex );
 
-if ( static_cast(nIndex) < m_pImpl->m_aResults.size() )
+if ( static_cast(nIndex) < m_aResults.size() )
 {
-Reference< XContentIdentifier > xId = m_pImpl->m_aResults[ nIndex 
]->xId;
+Reference< XContentIdentifier > xId = m_aResults[ nIndex ]->xId;
 if ( xId.is() )
 {
 // Already cached.
@@ -135,7 +92,7 @@ DataSupplier::queryContentIdentifier( sal_uInt32 nIndex )
 if ( !aId.isEmpty() )
 {
 Reference< XContentIdentifier > xId = new 
::ucbhelper::ContentIdentifier( aId );
-m_pImpl->m_aResults[ nIndex ]->xId = xId;
+m_aResults[ nIndex ]->xId = xId;
 return xId;
 }
 return Reference< XContentIdentifier >();
@@ -144,11 +101,11 @@ DataSupplier::queryContentIdentifier( sal_uInt32 nIndex )
 Reference< XContent >
 DataSupplier::queryContent( sal_uInt32 _nIndex )
 {
-osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex );
+osl::Guard< osl::Mutex > aGuard( m_aMutex );
 
-if ( static_cast(_nIndex) < m_pImpl->m_aResults.size() )
+if ( static_cast(_nIndex) < m_aResults.size() )
 {
-Reference< XContent > 

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

2022-09-05 Thread Noel Grandin (via logerrit)
 dbaccess/source/ui/dlg/dlgsave.cxx |  261 ++---
 dbaccess/source/ui/inc/dlgsave.hxx |   25 +++
 2 files changed, 124 insertions(+), 162 deletions(-)

New commits:
commit a80a7e286481ea668d33cdf9fcbf45d02fb10915
Author: Noel Grandin 
AuthorDate: Sun Sep 4 21:21:17 2022 +0200
Commit: Noel Grandin 
CommitDate: Mon Sep 5 11:47:26 2022 +0200

OSaveAsDlg doesn't need a pimpl

it is module private

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

diff --git a/dbaccess/source/ui/dlg/dlgsave.cxx 
b/dbaccess/source/ui/dlg/dlgsave.cxx
index 608e962b4669..9aeecae139ed 100644
--- a/dbaccess/source/ui/dlg/dlgsave.cxx
+++ b/dbaccess/source/ui/dlg/dlgsave.cxx
@@ -24,8 +24,6 @@
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
 #include 
 #include 
@@ -36,47 +34,10 @@ using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::container;
 using namespace ::com::sun::star::sdb;
 using namespace ::com::sun::star::sdbc;
-namespace dbaui
-{
+using namespace ::com::sun::star::lang;
 
-class OSaveAsDlgImpl
-{
-public:
-OUString   m_aQryLabel;
-OUString   m_sTblLabel;
-OUString   m_aName;
-const IObjectNameCheck&m_rObjectNameCheck;
-css::uno::Reference< css::sdbc::XDatabaseMetaData>m_xMetaData;
-sal_Int32  m_nType;
-SADFlags   m_nFlags;
-
-OSQLNameCheckerm_aChecker;
-
-std::unique_ptr m_xDescription;
-std::unique_ptr m_xCatalogLbl;
-std::unique_ptr m_xCatalog;
-std::unique_ptr m_xSchemaLbl;
-std::unique_ptr m_xSchema;
-std::unique_ptr m_xLabel;
-std::unique_ptr m_xTitle;
-std::unique_ptr m_xPB_OK;
-
-DECL_LINK(TextFilterHdl, OUString&, bool);
-
-OSaveAsDlgImpl( weld::Builder* pParent, sal_Int32 _rType,
-const css::uno::Reference< css::sdbc::XConnection>& 
_xConnection,
-OUString sDefault,
-const IObjectNameCheck& _rObjectNameCheck,
-SADFlags _nFlags);
-OSaveAsDlgImpl( weld::Builder* pParent,
-OUString sDefault,
-const IObjectNameCheck& _rObjectNameCheck,
-SADFlags _nFlags);
-};
-
-} // dbaui
-
-IMPL_LINK(OSaveAsDlgImpl, TextFilterHdl, OUString&, rTest, bool)
+
+IMPL_LINK(OSaveAsDlg, TextFilterHdl, OUString&, rTest, bool)
 {
 OUString sCorrected;
 if (m_aChecker.checkString(rTest, sCorrected))
@@ -84,69 +45,6 @@ IMPL_LINK(OSaveAsDlgImpl, TextFilterHdl, OUString&, rTest, 
bool)
 return true;
 }
 
-OSaveAsDlgImpl::OSaveAsDlgImpl(weld::Builder* pBuilder,
-   sal_Int32 _rType,
-   const Reference< XConnection>& _xConnection,
-   OUString sDefault,
-   const IObjectNameCheck& _rObjectNameCheck,
-   SADFlags _nFlags)
-: m_aQryLabel(DBA_RES(STR_QRY_LABEL))
-, m_sTblLabel(DBA_RES(STR_TBL_LABEL))
-, m_aName(std::move(sDefault))
-, m_rObjectNameCheck( _rObjectNameCheck )
-, m_nType(_rType)
-, m_nFlags(_nFlags)
-, m_aChecker(OUString())
-, m_xDescription(pBuilder->weld_label("descriptionft"))
-, m_xCatalogLbl(pBuilder->weld_label("catalogft"))
-, m_xCatalog(pBuilder->weld_combo_box("catalog"))
-, m_xSchemaLbl(pBuilder->weld_label("schemaft"))
-, m_xSchema(pBuilder->weld_combo_box("schema"))
-, m_xLabel(pBuilder->weld_label("titleft"))
-, m_xTitle(pBuilder->weld_entry("title"))
-, m_xPB_OK(pBuilder->weld_button("ok"))
-{
-if ( _xConnection.is() )
-m_xMetaData = _xConnection->getMetaData();
-
-if (m_xMetaData.is())
-{
-OUString sExtraNameChars(m_xMetaData->getExtraNameCharacters());
-m_aChecker.setAllowedChars(sExtraNameChars);
-}
-
-m_xTitle->connect_insert_text(LINK(this, OSaveAsDlgImpl, TextFilterHdl));
-m_xSchema->connect_entry_insert_text(LINK(this, OSaveAsDlgImpl, 
TextFilterHdl));
-m_xCatalog->connect_entry_insert_text(LINK(this, OSaveAsDlgImpl, 
TextFilterHdl));
-}
-
-OSaveAsDlgImpl::OSaveAsDlgImpl(weld::Builder* pBuilder,
-   OUString sDefault,
-   const IObjectNameCheck& _rObjectNameCheck,
-   SADFlags _nFlags)
-: m_aQryLabel(DBA_RES(STR_QRY_LABEL))
-, m_sTblLabel(DBA_RES(STR_TBL_LABEL))
-, m_aName(std::move(sDefault))
-, m_rObjectNameCheck( _rObjectNameCheck )
-, m_nType(CommandType::COMMAND)
-, m_nFlags(_nFlags)
-, m_aChecker(OUString())
-, m_xDescription(pBuilder->weld_label("descriptionft"))
-, m_xCatalogLbl(pBuilder->weld_label("catalogft"))
-, m_xCatalog(pBuilder->weld_combo_box("catalog"))
-, 

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

2022-09-05 Thread Noel Grandin (via logerrit)
 dbaccess/source/ui/inc/defaultobjectnamecheck.hxx  |5 +++--
 dbaccess/source/ui/misc/defaultobjectnamecheck.cxx |   17 -
 2 files changed, 7 insertions(+), 15 deletions(-)

New commits:
commit 5f194a2705449698a4760982913fc2592720be6b
Author: Noel Grandin 
AuthorDate: Sun Sep 4 15:04:52 2022 +0200
Commit: Noel Grandin 
CommitDate: Mon Sep 5 08:56:41 2022 +0200

DynamicTableOrQueryNameCheck doesn't need a pimpl

it is already module private

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

diff --git a/dbaccess/source/ui/inc/defaultobjectnamecheck.hxx 
b/dbaccess/source/ui/inc/defaultobjectnamecheck.hxx
index 59705fe61260..157f201ddc6a 100644
--- a/dbaccess/source/ui/inc/defaultobjectnamecheck.hxx
+++ b/dbaccess/source/ui/inc/defaultobjectnamecheck.hxx
@@ -23,6 +23,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -67,7 +68,6 @@ namespace dbaui
 };
 
 // DynamicTableOrQueryNameCheck
-struct DynamicTableOrQueryNameCheck_Impl;
 /** class implementing the IObjectNameCheck interface, and checking a 
given name
 for being valid as either a query or a table name.
 
@@ -84,7 +84,8 @@ namespace dbaui
 class DynamicTableOrQueryNameCheck  :public IObjectNameCheck
 {
 private:
-std::unique_ptr< DynamicTableOrQueryNameCheck_Impl > m_pImpl;
+sal_Int32 mnCommandType;
+css::uno::Reference< css::sdb::tools::XObjectNames >  mxObjectNames;
 
 public:
 /** constructs a DynamicTableOrQueryNameCheck instance
diff --git a/dbaccess/source/ui/misc/defaultobjectnamecheck.cxx 
b/dbaccess/source/ui/misc/defaultobjectnamecheck.cxx
index 5c70cc421f61..809e90a777cc 100644
--- a/dbaccess/source/ui/misc/defaultobjectnamecheck.cxx
+++ b/dbaccess/source/ui/misc/defaultobjectnamecheck.cxx
@@ -24,7 +24,6 @@
 
 #include 
 #include 
-#include 
 #include 
 
 #include 
@@ -115,26 +114,18 @@ namespace dbaui
 return false;
 }
 
-// DynamicTableOrQueryNameCheck_Impl
-struct DynamicTableOrQueryNameCheck_Impl
-{
-sal_Int32   nCommandType;
-Reference< XObjectNames >   xObjectNames;
-};
-
 // DynamicTableOrQueryNameCheck
 DynamicTableOrQueryNameCheck::DynamicTableOrQueryNameCheck( const 
Reference< XConnection >& _rxSdbLevelConnection, sal_Int32 _nCommandType )
-:m_pImpl( new DynamicTableOrQueryNameCheck_Impl )
 {
 Reference< XConnectionTools > xConnTools( _rxSdbLevelConnection, 
UNO_QUERY );
 if ( xConnTools.is() )
-m_pImpl->xObjectNames.set( xConnTools->getObjectNames() );
-if ( !m_pImpl->xObjectNames.is() )
+mxObjectNames.set( xConnTools->getObjectNames() );
+if ( !mxObjectNames.is() )
 throw IllegalArgumentException();
 
 if ( ( _nCommandType != CommandType::QUERY ) && ( _nCommandType != 
CommandType::TABLE ) )
 throw IllegalArgumentException();
-m_pImpl->nCommandType = _nCommandType;
+mnCommandType = _nCommandType;
 }
 
 DynamicTableOrQueryNameCheck::~DynamicTableOrQueryNameCheck()
@@ -145,7 +136,7 @@ namespace dbaui
 {
 try
 {
-m_pImpl->xObjectNames->checkNameForCreate( m_pImpl->nCommandType, 
_rObjectName );
+mxObjectNames->checkNameForCreate( mnCommandType, _rObjectName );
 return true;
 }
 catch( const SQLException& )


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

2022-09-05 Thread Noel Grandin (via logerrit)
 dbaccess/source/core/inc/objectnameapproval.hxx  |6 +++---
 dbaccess/source/core/misc/objectnameapproval.cxx |   18 --
 2 files changed, 7 insertions(+), 17 deletions(-)

New commits:
commit f69971ac3a0aa25e6302d9e6f81fa757612085cb
Author: Noel Grandin 
AuthorDate: Sun Sep 4 14:58:49 2022 +0200
Commit: Noel Grandin 
CommitDate: Mon Sep 5 08:56:25 2022 +0200

ObjectNameApproval doesn't need a pimpl

it is already module private

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

diff --git a/dbaccess/source/core/inc/objectnameapproval.hxx 
b/dbaccess/source/core/inc/objectnameapproval.hxx
index ddd538c79edb..e503c347ea4e 100644
--- a/dbaccess/source/core/inc/objectnameapproval.hxx
+++ b/dbaccess/source/core/inc/objectnameapproval.hxx
@@ -21,14 +21,13 @@
 
 #include 
 #include "containerapprove.hxx"
-
+#include 
 #include 
 
 namespace dbaccess
 {
 
 // ObjectNameApproval
-struct ObjectNameApproval_Impl;
 /** implementation of the IContainerApprove interface which approves
 elements for insertion into a query or tables container.
 
@@ -40,7 +39,8 @@ namespace dbaccess
 */
 class ObjectNameApproval : public IContainerApprove
 {
-std::unique_ptr< ObjectNameApproval_Impl >   m_pImpl;
+css::uno::WeakReference< css::sdbc::XConnection > mxConnection;
+sal_Int32 mnCommandType;
 
 public:
 enum ObjectType
diff --git a/dbaccess/source/core/misc/objectnameapproval.cxx 
b/dbaccess/source/core/misc/objectnameapproval.cxx
index 3ec15caaa4fd..5b7faa6ada9b 100644
--- a/dbaccess/source/core/misc/objectnameapproval.cxx
+++ b/dbaccess/source/core/misc/objectnameapproval.cxx
@@ -23,8 +23,6 @@
 #include 
 #include 
 
-#include 
-
 namespace dbaccess
 {
 
@@ -39,19 +37,11 @@ namespace dbaccess
 
 namespace CommandType = com::sun::star::sdb::CommandType;
 
-// ObjectNameApproval_Impl
-struct ObjectNameApproval_Impl
-{
-WeakReference< XConnection >aConnection;
-sal_Int32   nCommandType;
-};
-
 // ObjectNameApproval
 ObjectNameApproval::ObjectNameApproval( const Reference< XConnection >& 
_rxConnection, ObjectType _eType )
-:m_pImpl( new ObjectNameApproval_Impl )
 {
-m_pImpl->aConnection = _rxConnection;
-m_pImpl->nCommandType = _eType == TypeQuery ? CommandType::QUERY : 
CommandType::TABLE;
+mxConnection = _rxConnection;
+mnCommandType = _eType == TypeQuery ? CommandType::QUERY : 
CommandType::TABLE;
 }
 
 ObjectNameApproval::~ObjectNameApproval()
@@ -60,13 +50,13 @@ namespace dbaccess
 
 void ObjectNameApproval::approveElement( const OUString& _rName )
 {
-Reference< XConnection > xConnection( m_pImpl->aConnection );
+Reference< XConnection > xConnection( mxConnection );
 if ( !xConnection.is() )
 throw DisposedException();
 
 Reference< XConnectionTools > xConnectionTools( xConnection, 
UNO_QUERY_THROW );
 Reference< XObjectNames > xObjectNames( 
xConnectionTools->getObjectNames(), css::uno::UNO_SET_THROW );
-xObjectNames->checkNameForCreate( m_pImpl->nCommandType, _rName );
+xObjectNames->checkNameForCreate( mnCommandType, _rName );
 }
 
 } // namespace dbaccess


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

2022-09-05 Thread Noel Grandin (via logerrit)
 dbaccess/source/core/api/RowSetBase.cxx |   29 -
 dbaccess/source/core/api/RowSetBase.hxx |8 
 2 files changed, 12 insertions(+), 25 deletions(-)

New commits:
commit dd39a3b25af74511c108d4f71302b15fd9942e21
Author: Noel Grandin 
AuthorDate: Sun Sep 4 14:53:35 2022 +0200
Commit: Noel Grandin 
CommitDate: Mon Sep 5 08:55:11 2022 +0200

RowSet doesn't need a pimpl

it is module internal

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

diff --git a/dbaccess/source/core/api/RowSetBase.cxx 
b/dbaccess/source/core/api/RowSetBase.cxx
index 3a17ee27fdd3..e6eddc57eef5 100644
--- a/dbaccess/source/core/api/RowSetBase.cxx
+++ b/dbaccess/source/core/api/RowSetBase.cxx
@@ -1358,12 +1358,6 @@ sal_Int32 ORowSetBase::impl_getRowCount() const
 return nRowCount;
 }
 
-struct ORowSetNotifierImpl
-{
-std::vectoraChangedColumns;
-ORowSetValueVector::Vector  aRow;
-};
-
 
 ORowSetNotifier::ORowSetNotifier( ORowSetBase* _pRowSet )
 :m_pRowSet( _pRowSet )
@@ -1383,14 +1377,12 @@ ORowSetNotifier::ORowSetNotifier( ORowSetBase* _pRowSet 
)
 }
 
 ORowSetNotifier::ORowSetNotifier( ORowSetBase* _pRowSet, 
ORowSetValueVector::Vector&& i_aRow )
-:m_pImpl(new ORowSetNotifierImpl)
-,m_pRowSet( _pRowSet )
+:m_pRowSet( _pRowSet )
 ,m_bWasNew( false )
 ,m_bWasModified( false )
 {
-
 OSL_ENSURE( m_pRowSet, "ORowSetNotifier::ORowSetNotifier: invalid row set. 
This will crash." );
-m_pImpl->aRow = std::move(i_aRow); // yes, create a copy to store the old 
values
+aRow = std::move(i_aRow); // yes, create a copy to store the old values
 }
 
 ORowSetNotifier::~ORowSetNotifier( )
@@ -1413,24 +1405,19 @@ void ORowSetNotifier::fire()
 m_pRowSet->fireProperty( PROPERTY_ID_ISNEW, false, true, 
ORowSetBase::GrantNotifierAccess() );
 }
 
-std::vector& ORowSetNotifier::getChangedColumns() const
+std::vector& ORowSetNotifier::getChangedColumns()
 {
-OSL_ENSURE(m_pImpl, "Illegal CTor call, use the other one!");
-return m_pImpl->aChangedColumns;
+return aChangedColumns;
 }
 
 void ORowSetNotifier::firePropertyChange()
 {
-OSL_ENSURE(m_pImpl, "Illegal CTor call, use the other one!");
-if (m_pImpl)
+for (auto const& changedColumn : aChangedColumns)
 {
-for (auto const& changedColumn : m_pImpl->aChangedColumns)
-{
-m_pRowSet->firePropertyChange(changedColumn-1 
,m_pImpl->aRow[changedColumn-1], ORowSetBase::GrantNotifierAccess());
-}
-if ( !m_pImpl->aChangedColumns.empty() )
-m_pRowSet->fireProperty(PROPERTY_ID_ISMODIFIED,true,false, 
ORowSetBase::GrantNotifierAccess());
+m_pRowSet->firePropertyChange(changedColumn-1, aRow[changedColumn-1], 
ORowSetBase::GrantNotifierAccess());
 }
+if ( !aChangedColumns.empty() )
+m_pRowSet->fireProperty(PROPERTY_ID_ISMODIFIED,true,false, 
ORowSetBase::GrantNotifierAccess());
 }
 
 }   // namespace dbaccess
diff --git a/dbaccess/source/core/api/RowSetBase.hxx 
b/dbaccess/source/core/api/RowSetBase.hxx
index f5443a2afcad..8cce9d46f3f3 100644
--- a/dbaccess/source/core/api/RowSetBase.hxx
+++ b/dbaccess/source/core/api/RowSetBase.hxx
@@ -347,11 +347,11 @@ namespace dbaccess
 
 The class can only be used on the stack, within a method of 
ORowSetBase (or derivees)
 */
-struct ORowSetNotifierImpl;
 class ORowSetNotifier
 {
 private:
-std::unique_ptr m_pImpl;
+std::vectoraChangedColumns;
+ORowSetValueVector::Vector  aRow;
 ORowSetBase*m_pRowSet;
 // not acquired! This is not necessary because this class here is 
to be used on the stack within
 // a method of ORowSetBase (or derivees)
@@ -391,9 +391,9 @@ namespace dbaccess
 */
 voidfirePropertyChange();
 
-/** use this one to store the inde of the changed column values
+/** use this one to store the index of the changed column values
 */
-std::vector& getChangedColumns() const;
+std::vector& getChangedColumns();
 
 };
 


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

2022-08-20 Thread Caolán McNamara (via logerrit)
 dbaccess/source/ui/querydesign/querycontroller.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 5eac26e79ef1482ebea31c8cd416c53f9d1714a9
Author: Caolán McNamara 
AuthorDate: Sat Aug 20 11:03:49 2022 +0100
Commit: Caolán McNamara 
CommitDate: Sat Aug 20 20:44:33 2022 +0200

cid#735694 silence Dereference after null check

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

diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx 
b/dbaccess/source/ui/querydesign/querycontroller.cxx
index 2d137acd5d46..38caed31a79f 100644
--- a/dbaccess/source/ui/querydesign/querycontroller.cxx
+++ b/dbaccess/source/ui/querydesign/querycontroller.cxx
@@ -480,6 +480,7 @@ void OQueryController::Execute(sal_uInt16 _nId, const 
Sequence< PropertyValue >&
 std::unique_ptr<::connectivity::OSQLParseNode> pNode = 
m_aSqlParser.parseTree(aErrorMsg,m_sStatement,m_bGraphicalDesign);
 if ( pNode )
 {
+assert(m_pSqlIterator && "SqlIterator must exist");
 delete m_pSqlIterator->getParseTree();
 m_pSqlIterator->setParseTree(pNode.release());
 m_pSqlIterator->traverseAll();


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

2022-08-16 Thread Caolán McNamara (via logerrit)
 dbaccess/source/ui/dlg/DbAdminImpl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f7e0493987f4d2d821d2724e9fef018676af5ddf
Author: Caolán McNamara 
AuthorDate: Tue Aug 16 09:29:20 2022 +0100
Commit: Caolán McNamara 
CommitDate: Wed Aug 17 00:43:37 2022 +0200

cid#1509203 Dereference after null check

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

diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx 
b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
index ca20930ef8df..8609c939cfe1 100644
--- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx
+++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
@@ -530,7 +530,7 @@ OUString 
ODbDataSourceAdministrationHelper::getConnectionURL() const
 }
 if ( !sNewUrl.isEmpty() )
 sNewUrl = pCollection->getPrefix(eType) + sNewUrl;
-else
+else if (pUrlItem)
 sNewUrl = pUrlItem->GetValue();
 
 return sNewUrl;


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

2022-08-16 Thread Caolán McNamara (via logerrit)
 dbaccess/source/ui/dlg/generalpage.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a51c1df3c2bad14de49a381945f4c55d4bccf8a8
Author: Caolán McNamara 
AuthorDate: Tue Aug 16 09:08:05 2022 +0100
Commit: Caolán McNamara 
CommitDate: Tue Aug 16 12:19:05 2022 +0200

cid#1500395 Dereference after null check

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

diff --git a/dbaccess/source/ui/dlg/generalpage.cxx 
b/dbaccess/source/ui/dlg/generalpage.cxx
index f2a11bfc9b24..4b3b293348dd 100644
--- a/dbaccess/source/ui/dlg/generalpage.cxx
+++ b/dbaccess/source/ui/dlg/generalpage.cxx
@@ -678,7 +678,7 @@ namespace dbaui
 // check for aFileDlg.GetCurrentFilter used to be here but current 
fpicker filter
 // can be set to anything, see tdf#125267 how this breaks if other 
value
 // than 'ODF Database' is selected. Let's therefore check only if 
wildcard matches
-if ( !pFilter->GetWildcard().Matches(sPath) )
+if (pFilter && !pFilter->GetWildcard().Matches(sPath))
 {
 OUString sMessage(DBA_RES(STR_ERR_USE_CONNECT_TO));
 std::unique_ptr 
xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),


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

2022-08-06 Thread Caolán McNamara (via logerrit)
 dbaccess/source/ui/inc/JoinTableView.hxx |   16 +---
 dbaccess/source/ui/querydesign/JoinTableView.cxx |   21 +
 2 files changed, 22 insertions(+), 15 deletions(-)

New commits:
commit 59a2650101a0ce711151bfd39af1bbb69f71f318
Author: Caolán McNamara 
AuthorDate: Fri Aug 5 15:51:46 2022 +0100
Commit: Caolán McNamara 
CommitDate: Sat Aug 6 13:07:49 2022 +0200

tdf#117388 use native scrollbar under gtk in database scrolled window

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

diff --git a/dbaccess/source/ui/inc/JoinTableView.hxx 
b/dbaccess/source/ui/inc/JoinTableView.hxx
index 80de958ea627..4dedc70e3c6c 100644
--- a/dbaccess/source/ui/inc/JoinTableView.hxx
+++ b/dbaccess/source/ui/inc/JoinTableView.hxx
@@ -18,6 +18,7 @@
  */
 #pragma once
 
+#include 
 #include 
 #include 
 #include 
@@ -50,8 +51,8 @@ namespace dbaui
 class OJoinTableView;
 class OScrollWindowHelper : public vcl::Window
 {
-VclPtr  m_aHScrollBar;
-VclPtr  m_aVScrollBar;
+VclPtr  m_aHScrollBar;
+VclPtr  m_aVScrollBar;
 VclPtrm_pCornerWindow;
 VclPtr m_pTableView;
 
@@ -68,8 +69,8 @@ namespace dbaui
 void resetRange(const Point& _aSize);
 
 // own methods
-ScrollBar& GetHScrollBar() { return *m_aHScrollBar; }
-ScrollBar& GetVScrollBar() { return *m_aVScrollBar; }
+ScrollAdaptor& GetHScrollBar() { return *m_aHScrollBar; }
+ScrollAdaptor& GetVScrollBar() { return *m_aVScrollBar; }
 };
 
 
@@ -121,9 +122,10 @@ namespace dbaui
 virtual css::uno::Reference< css::accessibility::XAccessible > 
CreateAccessible() override;
 
 // own methods
-ScrollBar& GetHScrollBar() { return 
static_cast(GetParent())->GetHScrollBar(); }
-ScrollBar& GetVScrollBar() { return 
static_cast(GetParent())->GetVScrollBar(); }
-DECL_LINK( ScrollHdl, ScrollBar*, void );
+ScrollAdaptor& GetHScrollBar() { return 
static_cast(GetParent())->GetHScrollBar(); }
+ScrollAdaptor& GetVScrollBar() { return 
static_cast(GetParent())->GetVScrollBar(); }
+DECL_LINK(VertScrollHdl, weld::Scrollbar&, void);
+DECL_LINK(HorzScrollHdl, weld::Scrollbar&, void);
 
 void DrawConnections(vcl::RenderContext& rRenderContext, const 
tools::Rectangle& rRect);
 void InvalidateConnections();
diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx 
b/dbaccess/source/ui/querydesign/JoinTableView.cxx
index 05562813379d..5cd3ec1f41ed 100644
--- a/dbaccess/source/ui/querydesign/JoinTableView.cxx
+++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx
@@ -66,12 +66,11 @@ using namespace ::com::sun::star::lang;
 #define TABWIN_HEIGHT_STD   120
 
 OScrollWindowHelper::OScrollWindowHelper( vcl::Window* pParent) : Window( 
pParent)
-,m_aHScrollBar( VclPtr::Create(this, 
WB_HSCROLL|WB_REPEAT|WB_DRAG) )
-,m_aVScrollBar( VclPtr::Create(this, 
WB_VSCROLL|WB_REPEAT|WB_DRAG) )
+,m_aHScrollBar( VclPtr::Create(this, true) )
+,m_aVScrollBar( VclPtr::Create(this, false) )
 ,m_pCornerWindow(VclPtr::Create(this, WB_3DLOOK))
 ,m_pTableView(nullptr)
 {
-
 // ScrollBars
 
 GetHScrollBar().SetRange( Range(0, 1000) );
@@ -106,8 +105,8 @@ void OScrollWindowHelper::setTableView(OJoinTableView* 
_pTableView)
 {
 m_pTableView = _pTableView;
 // ScrollBars
-GetHScrollBar().SetScrollHdl( LINK(m_pTableView, OJoinTableView, 
ScrollHdl) );
-GetVScrollBar().SetScrollHdl( LINK(m_pTableView, OJoinTableView, 
ScrollHdl) );
+GetHScrollBar().SetScrollHdl( LINK(m_pTableView, OJoinTableView, 
HorzScrollHdl) );
+GetVScrollBar().SetScrollHdl( LINK(m_pTableView, OJoinTableView, 
VertScrollHdl) );
 }
 
 void OScrollWindowHelper::resetRange(const Point& _aSize)
@@ -201,10 +200,16 @@ void OJoinTableView::dispose()
 vcl::Window::dispose();
 }
 
-IMPL_LINK( OJoinTableView, ScrollHdl, ScrollBar*, pScrollBar, void )
+IMPL_LINK(OJoinTableView, HorzScrollHdl, weld::Scrollbar&, rScrollbar, void)
+{
+// move all windows
+ScrollPane(m_aScrollOffset.X() - rScrollbar.adjustment_get_value(), true, 
false);
+}
+
+IMPL_LINK(OJoinTableView, VertScrollHdl, weld::Scrollbar&, rScrollbar, void)
 {
 // move all windows
-ScrollPane( pScrollBar->GetDelta(), (pScrollBar == ()), 
false );
+ScrollPane(m_aScrollOffset.Y() - rScrollbar.adjustment_get_value(), false, 
false);
 }
 
 void OJoinTableView::Resize()
@@ -405,7 +410,7 @@ namespace
 bool isScrollAllowed( OJoinTableView* _pView,tools::Long nDelta, bool 
bHoriz)
 {
 // adjust ScrollBar-Positions
-ScrollBar& rBar = bHoriz ? _pView->GetHScrollBar() : 
_pView->GetVScrollBar() ;
+ScrollAdaptor& rBar = bHoriz ? _pView->GetHScrollBar() : 
_pView->GetVScrollBar();
 
 tools::Long 

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

2022-07-27 Thread Julien Nabet (via logerrit)
 dbaccess/source/ui/uno/copytablewizard.cxx |   58 +++--
 1 file changed, 31 insertions(+), 27 deletions(-)

New commits:
commit 4d855bb916bd41221e2b23d6d782e19b4b2740f9
Author: Julien Nabet 
AuthorDate: Wed Jul 27 13:34:22 2022 +0200
Commit: Julien Nabet 
CommitDate: Wed Jul 27 14:42:15 2022 +0200

tdf#150089: not all databases know "RESTART WITH"

Regression from:
https://cgit.freedesktop.org/libreoffice/core/commit
tdf#119962 Fix autoincrement for copied table
in 2021

so use the block added in the patch only when detecting "hsql" or "firebird"
in the string returned by getDatabaseProductName put in lowercase

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

diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx 
b/dbaccess/source/ui/uno/copytablewizard.cxx
index 6196cba6678c..f7cf836be721 100644
--- a/dbaccess/source/ui/uno/copytablewizard.cxx
+++ b/dbaccess/source/ui/uno/copytablewizard.cxx
@@ -1346,42 +1346,46 @@ void CopyTableWizard::impl_doCopy_nothrow()
 
 // tdf#119962
 const Reference< XDatabaseMetaData > xDestMetaData( 
m_xDestConnection->getMetaData(), UNO_SET_THROW );
-const OUString sComposedTableName = 
::dbtools::composeTableName( xDestMetaData, xTable, 
::dbtools::EComposeRule::InDataManipulation, true );
+OUString sDatabaseDest = 
xDestMetaData->getDatabaseProductName().toAsciiLowerCase();
+if ( (sDatabaseDest.indexOf("hsql") != -1) || 
(sDatabaseDest.indexOf("firebird") != -1) )
+{
+const OUString sComposedTableName = 
::dbtools::composeTableName( xDestMetaData, xTable, 
::dbtools::EComposeRule::InDataManipulation, true );
 
-OUString aSchema,aTable;
-xTable->getPropertyValue("SchemaName") >>= aSchema;
-xTable->getPropertyValue("Name")   >>= aTable;
-Any aCatalog = xTable->getPropertyValue("CatalogName");
+OUString aSchema,aTable;
+xTable->getPropertyValue("SchemaName") >>= aSchema;
+xTable->getPropertyValue("Name")   >>= aTable;
+Any aCatalog = xTable->getPropertyValue("CatalogName");
 
-const Reference< XResultSet > 
xResultPKCL(xDestMetaData->getPrimaryKeys(aCatalog,aSchema,aTable));
-Reference< XRow > xRowPKCL(xResultPKCL, UNO_QUERY_THROW);
-OUString sPKCL;
-if ( xRowPKCL.is() )
-{
-if (xResultPKCL->next())
+const Reference< XResultSet > 
xResultPKCL(xDestMetaData->getPrimaryKeys(aCatalog,aSchema,aTable));
+Reference< XRow > xRowPKCL(xResultPKCL, UNO_QUERY_THROW);
+OUString sPKCL;
+if ( xRowPKCL.is() )
 {
-sPKCL = xRowPKCL->getString(4);
+if (xResultPKCL->next())
+{
+sPKCL = xRowPKCL->getString(4);
+}
 }
-}
 
-if (!sPKCL.isEmpty())
-{
-OUString strSql = "SELECT MAX(\"" + sPKCL + "\") FROM " + 
sComposedTableName;
+if (!sPKCL.isEmpty())
+{
+OUString strSql = "SELECT MAX(\"" + sPKCL + "\") FROM 
" + sComposedTableName;
 
-Reference< XResultSet > 
xResultMAXNUM(m_xDestConnection->createStatement()->executeQuery(strSql));
-Reference< XRow > xRow(xResultMAXNUM, UNO_QUERY_THROW);
+Reference< XResultSet > 
xResultMAXNUM(m_xDestConnection->createStatement()->executeQuery(strSql));
+Reference< XRow > xRow(xResultMAXNUM, UNO_QUERY_THROW);
 
-sal_Int64 maxVal = -1L;
-if (xResultMAXNUM->next())
-{
-maxVal = xRow->getLong(1);
-}
+sal_Int64 maxVal = -1L;
+if (xResultMAXNUM->next())
+{
+maxVal = xRow->getLong(1);
+}
 
-if (maxVal > 0L)
-{
-strSql = "ALTER TABLE " + sComposedTableName + " ALTER 
\"" + sPKCL + "\" RESTART WITH " + OUString::number(maxVal + 1);
+if (maxVal > 0L)
+{
+strSql = "ALTER TABLE " + sComposedTableName + " 
ALTER \"" + sPKCL + "\" RESTART WITH " + OUString::number(maxVal + 1);
 
-m_xDestConnection->createStatement()->execute(strSql);
+

[Libreoffice-commits] core.git: dbaccess/source include/dbaccess

2022-06-13 Thread Noel Grandin (via logerrit)
 dbaccess/source/core/api/CIndexes.hxx  |5 +++--
 dbaccess/source/core/api/CRowSetDataColumn.cxx |   17 +
 dbaccess/source/core/api/CRowSetDataColumn.hxx |8 
 dbaccess/source/core/api/HelperCollections.cxx |5 +++--
 dbaccess/source/core/api/HelperCollections.hxx |2 +-
 dbaccess/source/core/api/KeySet.cxx|9 +
 dbaccess/source/core/api/KeySet.hxx|9 +
 dbaccess/source/core/api/RowSetCacheIterator.hxx   |5 +++--
 dbaccess/source/core/api/RowSetRow.hxx |5 +++--
 dbaccess/source/core/api/column.cxx|5 +++--
 dbaccess/source/core/api/definitioncolumn.cxx  |5 +++--
 dbaccess/source/core/dataaccess/ContentHelper.cxx  |5 +++--
 dbaccess/source/core/dataaccess/ModelImpl.cxx  |9 +
 dbaccess/source/core/dataaccess/myucp_datasupplier.cxx |5 +++--
 dbaccess/source/core/dataaccess/myucp_resultset.cxx|6 --
 dbaccess/source/core/dataaccess/myucp_resultset.hxx|2 +-
 dbaccess/source/core/inc/ContentHelper.hxx |2 +-
 dbaccess/source/core/inc/ModelImpl.hxx |4 ++--
 dbaccess/source/core/inc/PropertyForward.hxx   |2 +-
 dbaccess/source/core/inc/column.hxx|2 +-
 dbaccess/source/core/inc/definitioncolumn.hxx  |2 +-
 dbaccess/source/core/inc/veto.hxx  |2 +-
 dbaccess/source/core/misc/DatabaseDataProvider.cxx |5 +++--
 dbaccess/source/core/misc/PropertyForward.cxx  |5 +++--
 dbaccess/source/core/misc/dsntypes.cxx |5 +++--
 dbaccess/source/core/misc/veto.cxx |5 +++--
 dbaccess/source/core/recovery/subcomponentrecovery.hxx |5 +++--
 dbaccess/source/filter/hsqldb/columndef.cxx|9 +
 dbaccess/source/filter/hsqldb/columndef.hxx|4 ++--
 dbaccess/source/filter/hsqldb/parseschema.cxx  |5 +++--
 dbaccess/source/filter/xml/xmlDocuments.cxx|   13 +++--
 dbaccess/source/filter/xml/xmlDocuments.hxx|6 +++---
 dbaccess/source/filter/xml/xmlExport.cxx   |9 +
 dbaccess/source/filter/xml/xmlExport.hxx   |7 ---
 dbaccess/source/filter/xml/xmlHierarchyCollection.cxx  |5 +++--
 dbaccess/source/filter/xml/xmlHierarchyCollection.hxx  |2 +-
 dbaccess/source/filter/xml/xmlTable.cxx|5 +++--
 dbaccess/source/filter/xml/xmlTable.hxx|2 +-
 dbaccess/source/sdbtools/connection/objectnames.cxx|7 ---
 dbaccess/source/sdbtools/inc/connectiondependent.hxx   |5 +++--
 dbaccess/source/ui/app/subcomponentmanager.cxx |   13 +++--
 dbaccess/source/ui/browser/unodatbr.cxx|3 ++-
 dbaccess/source/ui/control/dbtreelistbox.cxx   |5 +++--
 dbaccess/source/ui/dlg/CollectionView.cxx  |5 +++--
 dbaccess/source/ui/dlg/dbfindex.cxx|5 +++--
 dbaccess/source/ui/dlg/dbfindex.hxx|7 ---
 dbaccess/source/ui/dlg/dbwizsetup.cxx  |7 ---
 dbaccess/source/ui/dlg/dlgsave.cxx |   13 +++--
 dbaccess/source/ui/dlg/generalpage.cxx |3 ++-
 dbaccess/source/ui/dlg/sqlmessage.cxx  |9 +
 dbaccess/source/ui/inc/CollectionView.hxx  |2 +-
 dbaccess/source/ui/inc/ConnectionLine.hxx  |2 +-
 dbaccess/source/ui/inc/ConnectionLineData.hxx  |2 +-
 dbaccess/source/ui/inc/SqlNameEdit.hxx |5 +++--
 dbaccess/source/ui/inc/TableConnection.hxx |2 +-
 dbaccess/source/ui/inc/TableConnectionData.hxx |4 ++--
 dbaccess/source/ui/inc/TableWindow.hxx |2 +-
 dbaccess/source/ui/inc/TableWindowData.hxx |6 +++---
 dbaccess/source/ui/inc/TokenWriter.hxx |2 +-
 dbaccess/source/ui/inc/WCopyTable.hxx  |4 ++--
 dbaccess/source/ui/inc/charsets.hxx|4 ++--
 dbaccess/source/ui/inc/databaseobjectview.hxx  |2 +-
 dbaccess/source/ui/inc/datasourceconnector.hxx |2 +-
 dbaccess/source/ui/inc/linkeddocuments.hxx |2 +-
 dbaccess/source/ui/inc/sqlmessage.hxx  |2 +-
 dbaccess/source/ui/inc/unodatbr.hxx|3 ++-
 dbaccess/source/ui/misc/TokenWriter.cxx|5 +++--
 dbaccess/source/ui/misc/WCopyTable.cxx |9 +
 dbaccess/source/ui/misc/charsets.cxx   |9 +
 dbaccess/source/ui/misc/databaseobjectview.cxx |5 +++--
 dbaccess/source/ui/misc/datasourceconnector.cxx|5 +++--
 dbaccess/source/ui/misc/dsmeta.cxx |6 +++---
 

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

2022-06-05 Thread Caolán McNamara (via logerrit)
 dbaccess/source/ui/dlg/dbadmin.cxx|   10 ++
 dbaccess/source/ui/dlg/dbwiz.cxx  |5 +++--
 dbaccess/source/ui/dlg/dbwizsetup.cxx |5 +++--
 3 files changed, 12 insertions(+), 8 deletions(-)

New commits:
commit 86d39afd85ed929dcfb8e1497680605cb095fc41
Author: Caolán McNamara 
AuthorDate: Sun Jun 5 14:44:35 2022 +0100
Commit: Caolán McNamara 
CommitDate: Sun Jun 5 18:32:19 2022 +0200

cid#1504593 silence Dereference null return value

and

cid#1504597 Dereference null return value
cid#1504595 Dereference null return value
cid#1504666 Dereference null return value

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

diff --git a/dbaccess/source/ui/dlg/dbadmin.cxx 
b/dbaccess/source/ui/dlg/dbadmin.cxx
index 3b528ba0b070..c6ca46f75324 100644
--- a/dbaccess/source/ui/dlg/dbadmin.cxx
+++ b/dbaccess/source/ui/dlg/dbadmin.cxx
@@ -91,8 +91,9 @@ void ODbAdminDialog::impl_selectDataSource(const 
css::uno::Any& _aDataSourceName
 Reference< XPropertySet > xDatasource = m_pImpl->getCurrentDataSource();
 impl_resetPages( xDatasource );
 
-const DbuTypeCollectionItem& rCollectionItem = dynamic_cast(*getOutputSet()->GetItem(DSID_TYPECOLLECTION));
-::dbaccess::ODsnTypeCollection* pCollection = 
rCollectionItem.getCollection();
+const DbuTypeCollectionItem* pCollectionItem = dynamic_cast(getOutputSet()->GetItem(DSID_TYPECOLLECTION));
+assert(pCollectionItem && "must exist");
+::dbaccess::ODsnTypeCollection* pCollection = 
pCollectionItem->getCollection();
 ::dbaccess::DATASOURCE_TYPE eType = 
pCollection->determineType(getDatasourceType(*getOutputSet()));
 
 // and insert the new ones
@@ -177,8 +178,9 @@ void ODbAdminDialog::impl_resetPages(const Reference< 
XPropertySet >& _rxDatasou
 
 // special case: MySQL Native does not have the generic "advanced" page
 
-const DbuTypeCollectionItem& rCollectionItem = dynamic_cast(*getOutputSet()->GetItem(DSID_TYPECOLLECTION));
-::dbaccess::ODsnTypeCollection* pCollection = 
rCollectionItem.getCollection();
+const DbuTypeCollectionItem* pCollectionItem = dynamic_cast(getOutputSet()->GetItem(DSID_TYPECOLLECTION));
+assert(pCollectionItem && "must exist");
+::dbaccess::ODsnTypeCollection* pCollection = 
pCollectionItem->getCollection();
 if ( pCollection->determineType(getDatasourceType( *m_xExampleSet )) == 
::dbaccess::DST_MYSQL_NATIVE )
 {
 OString sMySqlNative("mysqlnative");
diff --git a/dbaccess/source/ui/dlg/dbwiz.cxx b/dbaccess/source/ui/dlg/dbwiz.cxx
index 6f90f3e499d6..fa06535022e0 100644
--- a/dbaccess/source/ui/dlg/dbwiz.cxx
+++ b/dbaccess/source/ui/dlg/dbwiz.cxx
@@ -77,8 +77,9 @@ ODbTypeWizDialog::ODbTypeWizDialog(weld::Window* _pParent, 
SfxItemSet const * _p
 m_xFinish->set_help_id(HID_DBWIZ_FINISH);
 // no local resources needed anymore
 
-const DbuTypeCollectionItem& rCollectionItem = dynamic_cast(*_pItems->GetItem(DSID_TYPECOLLECTION));
-m_pCollection = rCollectionItem.getCollection();
+const DbuTypeCollectionItem* pCollectionItem = dynamic_cast(_pItems->GetItem(DSID_TYPECOLLECTION));
+assert(pCollectionItem && "must exist");
+m_pCollection = pCollectionItem->getCollection();
 
 ActivatePage();
 setTitleBase(DBA_RES(STR_DATABASE_TYPE_CHANGE));
diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx 
b/dbaccess/source/ui/dlg/dbwizsetup.cxx
index 2c3e8fb7bb36..f687740dd696 100644
--- a/dbaccess/source/ui/dlg/dbwizsetup.cxx
+++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx
@@ -117,8 +117,9 @@ ODbTypeWizDialogSetup::ODbTypeWizDialogSetup(weld::Window* 
_pParent
 {
 // no local resources needed anymore
 // extract the datasource type collection from the item set
-const DbuTypeCollectionItem& rCollectionItem = dynamic_cast(*_pItems->GetItem(DSID_TYPECOLLECTION));
-m_pCollection = rCollectionItem.getCollection();
+const DbuTypeCollectionItem* pCollectionItem = dynamic_cast(_pItems->GetItem(DSID_TYPECOLLECTION));
+assert(pCollectionItem && "must exist");
+m_pCollection = pCollectionItem->getCollection();
 
 assert(m_pCollection && "ODbTypeWizDialogSetup::ODbTypeWizDialogSetup : 
really need a DSN type collection !");
 


[Libreoffice-commits] core.git: dbaccess/source desktop/source

2022-06-03 Thread Noel Grandin (via logerrit)
 dbaccess/source/core/api/CacheSet.cxx|4 +--
 dbaccess/source/core/api/KeySet.cxx  |   12 +--
 dbaccess/source/core/api/OptimisticSet.cxx   |4 +--
 dbaccess/source/ui/dlg/directsql.cxx |2 -
 dbaccess/source/ui/querydesign/QueryDesignView.cxx   |9 
 dbaccess/source/ui/uno/copytablewizard.cxx   |2 -
 desktop/source/app/cmdlineargs.cxx   |2 -
 desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx |2 -
 desktop/source/deployment/registry/dp_registry.cxx   |2 -
 9 files changed, 20 insertions(+), 19 deletions(-)

New commits:
commit c1965859c05ccd13859198fe1479167afb4efc7c
Author: Noel Grandin 
AuthorDate: Fri Jun 3 10:17:13 2022 +0200
Commit: Noel Grandin 
CommitDate: Fri Jun 3 11:34:19 2022 +0200

elide some makeStringAndClear() class

when we are passing the result to a string_view, it is pointless.

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

diff --git a/dbaccess/source/core/api/CacheSet.cxx 
b/dbaccess/source/core/api/CacheSet.cxx
index 366a727be58d..9774877e6255 100644
--- a/dbaccess/source/core/api/CacheSet.cxx
+++ b/dbaccess/source/core/api/CacheSet.cxx
@@ -167,7 +167,7 @@ void OCacheSet::insertRow( const ORowSetRow& 
_rInsertRow,const connectivity::OSQ
 aSql[aSql.getLength() - 1] = ')';
 aValues[aValues.getLength() - 1] = ')';
 
-aSql.append(aValues.makeStringAndClear());
+aSql.append(aValues);
 // now create end execute the prepared statement
 {
 Reference< XPreparedStatement > 
xPrep(m_xConnection->prepareStatement(aSql.makeStringAndClear()));
@@ -282,7 +282,7 @@ void OCacheSet::updateRow(const ORowSetRow& _rInsertRow 
,const ORowSetRow& _rOri
 {
 aCondition.setLength(aCondition.getLength()-5);
 
-aSql.append(" WHERE " + aCondition.makeStringAndClear());
+aSql.append(" WHERE " + aCondition);
 }
 else
 ::dbtools::throwSQLException(
diff --git a/dbaccess/source/core/api/KeySet.cxx 
b/dbaccess/source/core/api/KeySet.cxx
index 577088aaad33..338d4d7f87aa 100644
--- a/dbaccess/source/core/api/KeySet.cxx
+++ b/dbaccess/source/core/api/KeySet.cxx
@@ -512,15 +512,15 @@ void OKeySet::updateRow(const ORowSetRow& _rInsertRow 
,const ORowSetRow& _rOrigi
 aSql.append(" WHERE ");
 if(!sKeyCondition.isEmpty() && !sIndexCondition.isEmpty())
 {
-aSql.append(sKeyCondition.makeStringAndClear() + 
sIndexCondition.makeStringAndClear());
+aSql.append(sKeyCondition + sIndexCondition);
 }
 else if(!sKeyCondition.isEmpty())
 {
-aSql.append(sKeyCondition.makeStringAndClear());
+aSql.append(sKeyCondition);
 }
 else if(!sIndexCondition.isEmpty())
 {
-aSql.append(sIndexCondition.makeStringAndClear());
+aSql.append(sIndexCondition);
 }
 aSql.setLength(aSql.getLength()-5); // remove the last AND
 }
@@ -620,7 +620,7 @@ void OKeySet::insertRow( const ORowSetRow& 
_rInsertRow,const connectivity::OSQLT
 
 aSql[aSql.getLength() - 1] = ')';
 aValues[aValues.getLength() - 1] = ')';
-aSql.append(aValues.makeStringAndClear());
+aSql.append(aValues);
 // now create,fill and execute the prepared statement
 executeInsert(_rInsertRow,aSql.makeStringAndClear(),u"",bRefetch);
 }
@@ -723,7 +723,7 @@ void OKeySet::executeInsert( const ORowSetRow& 
_rInsertRow,const OUString& i_sSQ
 if(!sMaxStmt.isEmpty())
 {
 sMaxStmt[sMaxStmt.getLength()-1] = ' ';
-OUString sStmt = "SELECT " + sMaxStmt.makeStringAndClear() + "FROM 
";
+OUString sStmt = "SELECT " + sMaxStmt + "FROM ";
 OUString sCatalog,sSchema,sTable;
 
::dbtools::qualifiedNameComponents(m_xConnection->getMetaData(),m_sUpdateTableName,sCatalog,sSchema,sTable,::dbtools::EComposeRule::InDataManipulation);
 sStmt += ::dbtools::composeTableNameForSelect( m_xConnection, 
sCatalog, sSchema, sTable );
@@ -884,7 +884,7 @@ void OKeySet::deleteRow(const ORowSetRow& _rDeleteRow,const 
connectivity::OSQLTa
 }
 }
 }
-aSql.append(sIndexCondition.makeStringAndClear());
+aSql.append(sIndexCondition);
 aSql.setLength(aSql.getLength()-5);
 
 // now create end execute the prepared statement
diff --git a/dbaccess/source/core/api/OptimisticSet.cxx 
b/dbaccess/source/core/api/OptimisticSet.cxx
index a95384eed2b7..d1d70955f674 100644
--- a/dbaccess/source/core/api/OptimisticSet.cxx
+++ b/dbaccess/source/core/api/OptimisticSet.cxx
@@ -544,8 +544,8 @@ void 
OptimisticSet::fillMissingValues(ORowSetValueVector::Vector& io_aRow) const
 OUString sCatalog,sSchema,sTable;
  

[Libreoffice-commits] core.git: dbaccess/source linguistic/source sc/source sw/source

2022-05-18 Thread Noel Grandin (via logerrit)
 dbaccess/source/core/dataaccess/bookmarkcontainer.cxx |1 -
 linguistic/source/convdiclist.cxx |1 -
 sc/source/ui/unoobj/TablePivotCharts.cxx  |1 -
 sc/source/ui/unoobj/afmtuno.cxx   |2 --
 sc/source/ui/unoobj/appluno.cxx   |1 -
 sc/source/ui/unoobj/cellsuno.cxx  |4 
 sc/source/ui/unoobj/chartuno.cxx  |1 -
 sc/source/ui/unoobj/dapiuno.cxx   |5 -
 sc/source/ui/unoobj/datauno.cxx   |2 --
 sc/source/ui/unoobj/docuno.cxx|6 --
 sc/source/ui/unoobj/eventuno.cxx  |1 -
 sc/source/ui/unoobj/fielduno.cxx  |2 --
 sc/source/ui/unoobj/fmtuno.cxx|1 -
 sc/source/ui/unoobj/linkuno.cxx   |5 -
 sc/source/ui/unoobj/nameuno.cxx   |3 ---
 sc/source/ui/unoobj/styleuno.cxx  |2 --
 sc/source/ui/unoobj/viewuno.cxx   |1 -
 sw/source/uibase/uno/unotxdoc.cxx |1 -
 18 files changed, 40 deletions(-)

New commits:
commit 75b72f5652b9067eee24b1dd76c9076fd9317e28
Author: Noel Grandin 
AuthorDate: Wed May 18 16:28:26 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed May 18 20:14:32 2022 +0200

no need to take a lock when returning static data

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

diff --git a/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx 
b/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx
index 3ffa2c6fe6a6..4072002ba326 100644
--- a/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx
+++ b/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx
@@ -179,7 +179,6 @@ void SAL_CALL OBookmarkContainer::removeContainerListener( 
const Reference< XCon
 // XElementAccess
 Type SAL_CALL OBookmarkContainer::getElementType( )
 {
-MutexGuard aGuard(m_rMutex);
 return ::cppu::UnoType::get();
 }
 
diff --git a/linguistic/source/convdiclist.cxx 
b/linguistic/source/convdiclist.cxx
index 396c7427cd3a..6be588ea1a8c 100644
--- a/linguistic/source/convdiclist.cxx
+++ b/linguistic/source/convdiclist.cxx
@@ -163,7 +163,6 @@ uno::Reference< XConversionDictionary > 
ConvDicNameContainer::GetByName(
 
 uno::Type SAL_CALL ConvDicNameContainer::getElementType(  )
 {
-MutexGuard  aGuard( GetLinguMutex() );
 return cppu::UnoType::get();
 }
 
diff --git a/sc/source/ui/unoobj/TablePivotCharts.cxx 
b/sc/source/ui/unoobj/TablePivotCharts.cxx
index 8e9203fe4223..b3a32cd457a0 100644
--- a/sc/source/ui/unoobj/TablePivotCharts.cxx
+++ b/sc/source/ui/unoobj/TablePivotCharts.cxx
@@ -223,7 +223,6 @@ uno::Any SAL_CALL TablePivotCharts::getByIndex(sal_Int32 
nIndex)
 
 uno::Type SAL_CALL TablePivotCharts::getElementType()
 {
-SolarMutexGuard aGuard;
 return cppu::UnoType::get();
 }
 
diff --git a/sc/source/ui/unoobj/afmtuno.cxx b/sc/source/ui/unoobj/afmtuno.cxx
index 6507ce6e2ec2..ce0300628ae4 100644
--- a/sc/source/ui/unoobj/afmtuno.cxx
+++ b/sc/source/ui/unoobj/afmtuno.cxx
@@ -285,7 +285,6 @@ uno::Any SAL_CALL ScAutoFormatsObj::getByIndex( sal_Int32 
nIndex )
 
 uno::Type SAL_CALL ScAutoFormatsObj::getElementType()
 {
-SolarMutexGuard aGuard;
 return cppu::UnoType::get();// must match getByIndex
 }
 
@@ -403,7 +402,6 @@ uno::Any SAL_CALL ScAutoFormatObj::getByIndex( sal_Int32 
nIndex )
 
 uno::Type SAL_CALL ScAutoFormatObj::getElementType()
 {
-SolarMutexGuard aGuard;
 return cppu::UnoType::get();  // must match getByIndex
 }
 
diff --git a/sc/source/ui/unoobj/appluno.cxx b/sc/source/ui/unoobj/appluno.cxx
index 841d9b2f0315..4096c5f4c384 100644
--- a/sc/source/ui/unoobj/appluno.cxx
+++ b/sc/source/ui/unoobj/appluno.cxx
@@ -570,7 +570,6 @@ uno::Reference SAL_CALL 
ScFunctionListObj::createEnumer
 
 uno::Type SAL_CALL ScFunctionListObj::getElementType()
 {
-SolarMutexGuard aGuard;
 return cppu::UnoType>::get();
 }
 
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 9901466102e4..38289f0108b2 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -4488,7 +4488,6 @@ uno::Any SAL_CALL ScCellRangesObj::getByIndex( sal_Int32 
nIndex )
 
 uno::Type SAL_CALL ScCellRangesObj::getElementType()
 {
-SolarMutexGuard aGuard;
 return cppu::UnoType::get();
 }
 
@@ -8644,7 +8643,6 @@ uno::Reference SAL_CALL 
ScCellsObj::createEnumeration()
 
 uno::Type SAL_CALL ScCellsObj::getElementType()
 {
-SolarMutexGuard aGuard;
 return cppu::UnoType::get();
 }
 
@@ -8883,7 +8881,6 @@ uno::Any SAL_CALL ScCellFormatsObj::getByIndex( sal_Int32 
nIndex )
 
 uno::Type SAL_CALL ScCellFormatsObj::getElementType()
 {
-SolarMutexGuard aGuard;
 return cppu::UnoType::get();
 }
 
@@ 

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

2022-05-09 Thread Andrea Gelmini (via logerrit)
 dbaccess/source/core/dataaccess/documentdefinition.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1f37a0ff46a7f1a2a52ee78ff99731cfb3bbc2f8
Author: Andrea Gelmini 
AuthorDate: Mon May 9 12:17:19 2022 +0200
Commit: Julien Nabet 
CommitDate: Mon May 9 19:51:05 2022 +0200

Fix typo in code

I find _rContext not _rContxt

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

diff --git a/dbaccess/source/core/dataaccess/documentdefinition.hxx 
b/dbaccess/source/core/dataaccess/documentdefinition.hxx
index 389ab601f2ab..5569276d4a7d 100644
--- a/dbaccess/source/core/dataaccess/documentdefinition.hxx
+++ b/dbaccess/source/core/dataaccess/documentdefinition.hxx
@@ -207,7 +207,7 @@ private:
 @throws css::uno::RuntimeException
 */
 static void impl_removeFrameFromDesktop_throw(
-const css::uno::Reference< css::uno::XComponentContext >& 
_rContxt,
+const css::uno::Reference< css::uno::XComponentContext >& 
_rContext,
 const css::uno::Reference< css::frame::XFrame >& _rxFrame
 );
 


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

2022-05-04 Thread Stephan Bergmann (via logerrit)
 dbaccess/source/core/api/KeySet.cxx|6 
 dbaccess/source/core/api/RowSet.cxx|   28 +--
 dbaccess/source/core/api/RowSetBase.cxx|6 
 dbaccess/source/core/api/RowSetCache.cxx   |4 
 dbaccess/source/core/api/SingleSelectQueryComposer.cxx |   12 -
 dbaccess/source/core/api/StaticSet.cxx |2 
 dbaccess/source/core/api/WrappedResultSet.cxx  |2 
 dbaccess/source/core/api/querycontainer.cxx|6 
 dbaccess/source/core/api/resultcolumn.cxx  |2 
 dbaccess/source/core/api/tablecontainer.cxx|4 
 dbaccess/source/core/dataaccess/ContentHelper.cxx  |8 
 dbaccess/source/core/dataaccess/ModelImpl.cxx  |  106 ++---
 dbaccess/source/core/dataaccess/bookmarkcontainer.cxx  |   10 -
 dbaccess/source/core/dataaccess/commanddefinition.cxx  |4 
 dbaccess/source/core/dataaccess/connection.cxx |2 
 dbaccess/source/core/dataaccess/databasecontext.cxx|   12 -
 dbaccess/source/core/dataaccess/databasedocument.cxx   |   48 ++---
 dbaccess/source/core/dataaccess/databaseregistrations.cxx  |8 
 dbaccess/source/core/dataaccess/datasource.cxx |6 
 dbaccess/source/core/dataaccess/definitioncontainer.cxx|6 
 dbaccess/source/core/dataaccess/documentcontainer.cxx  |   12 -
 dbaccess/source/core/dataaccess/documentdefinition.cxx |   46 ++---
 dbaccess/source/core/inc/DatabaseDataProvider.hxx  |2 
 dbaccess/source/core/misc/DatabaseDataProvider.cxx |   30 +--
 dbaccess/source/filter/hsqldb/rowinputbinary.cxx   |   22 +-
 dbaccess/source/filter/xml/dbloader2.cxx   |2 
 dbaccess/source/filter/xml/xmlColumn.cxx   |6 
 dbaccess/source/filter/xml/xmlComponent.cxx|2 
 dbaccess/source/filter/xml/xmlConnectionResource.cxx   |2 
 dbaccess/source/filter/xml/xmlDataSource.cxx   |6 
 dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx|2 
 dbaccess/source/filter/xml/xmlHierarchyCollection.cxx  |2 
 dbaccess/source/filter/xml/xmlLogin.cxx|4 
 dbaccess/source/filter/xml/xmlQuery.cxx|   12 -
 dbaccess/source/filter/xml/xmlServerDatabase.cxx   |2 
 dbaccess/source/filter/xml/xmlTable.cxx|   10 -
 dbaccess/source/filter/xml/xmlTableFilterList.cxx  |4 
 dbaccess/source/filter/xml/xmlfilter.cxx   |4 
 dbaccess/source/ui/app/AppController.cxx   |8 
 dbaccess/source/ui/app/AppControllerDnD.cxx|6 
 dbaccess/source/ui/app/AppControllerGen.cxx|8 
 dbaccess/source/ui/app/AppDetailPageHelper.cxx |8 
 dbaccess/source/ui/app/subcomponentmanager.cxx |4 
 dbaccess/source/ui/browser/brwctrlr.cxx|   26 +--
 dbaccess/source/ui/browser/dbloader.cxx|2 
 dbaccess/source/ui/browser/exsrcbrw.cxx|2 
 dbaccess/source/ui/browser/formadapter.cxx |   10 -
 dbaccess/source/ui/browser/genericcontroller.cxx   |6 
 dbaccess/source/ui/browser/unodatbr.cxx|   58 +++
 dbaccess/source/ui/control/FieldDescControl.cxx|4 
 dbaccess/source/ui/dlg/CollectionView.cxx  |2 
 dbaccess/source/ui/dlg/DbAdminImpl.cxx |   16 -
 dbaccess/source/ui/dlg/UserAdmin.cxx   |4 
 dbaccess/source/ui/dlg/dbfindex.cxx|2 
 dbaccess/source/ui/dlg/dbwizsetup.cxx  |6 
 dbaccess/source/ui/dlg/directsql.cxx   |2 
 dbaccess/source/ui/dlg/tablespage.cxx  |4 
 dbaccess/source/ui/misc/DExport.cxx|2 
 dbaccess/source/ui/misc/HtmlReader.cxx |2 
 dbaccess/source/ui/misc/TableCopyHelper.cxx|   14 -
 dbaccess/source/ui/misc/TokenWriter.cxx|6 
 dbaccess/source/ui/misc/UITools.cxx|   36 ++--
 dbaccess/source/ui/misc/WCopyTable.cxx |   18 +-
 dbaccess/source/ui/misc/databaseobjectview.cxx |2 
 dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx   |2 
 dbaccess/source/ui/misc/indexcollection.cxx|8 
 dbaccess/source/ui/querydesign/JoinTableView.cxx   |8 
 dbaccess/source/ui/querydesign/QueryTableView.cxx  |4 
 dbaccess/source/ui/querydesign/querycontroller.cxx |   44 ++---
 dbaccess/source/ui/relationdesign/RTableConnectionData.cxx |   14 -
 dbaccess/source/ui/relationdesign/RelationController.cxx   |2 
 dbaccess/source/ui/relationdesign/RelationTableView.cxx|2 
 

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

2022-04-18 Thread Siddhant Chaudhary (via logerrit)
 dbaccess/source/core/api/FilteredContainer.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 370077502210f4d41a1d2014c3e3f99536217ce7
Author: Siddhant Chaudhary 
AuthorDate: Sun Apr 17 00:49:07 2022 +0530
Commit: Stephan Bergmann 
CommitDate: Mon Apr 18 08:42:46 2022 +0200

tdf#42982 Improved UNO API error reporting.

Messages to thrown `RuntimeException` instances have been added to make
the error clearer.

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

diff --git a/dbaccess/source/core/api/FilteredContainer.cxx 
b/dbaccess/source/core/api/FilteredContainer.cxx
index 70eb85210a80..a5cf0b156327 100644
--- a/dbaccess/source/core/api/FilteredContainer.cxx
+++ b/dbaccess/source/core/api/FilteredContainer.cxx
@@ -132,7 +132,7 @@ static sal_Int32 createWildCardVector(Sequence< OUString >& 
_rTableFilter, std::
 static void lcl_ensureComposedName( TableInfo& _io_tableInfo, const 
Reference< XDatabaseMetaData >& _metaData )
 {
 if ( !_metaData.is() )
-throw RuntimeException();
+throw RuntimeException("lcl_ensureComposedName: _metaData cannot 
be null!");
 
 if ( !_io_tableInfo.sComposedName )
 {
@@ -153,7 +153,7 @@ static sal_Int32 createWildCardVector(Sequence< OUString >& 
_rTableFilter, std::
 lcl_ensureComposedName( _io_tableInfo, _metaData );
 
 if ( !_masterContainer.is() )
-throw RuntimeException();
+throw RuntimeException("lcl_ensureType: _masterContainer cannot be 
null!");
 
 OUString sTypeName;
 try


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

2022-04-17 Thread Andrea Gelmini (via logerrit)
 dbaccess/source/filter/hsqldb/createparser.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit c69db531ede119b950fbe1f35560f94e762e1070
Author: Andrea Gelmini 
AuthorDate: Thu Apr 14 18:14:28 2022 +0200
Commit: Julien Nabet 
CommitDate: Sun Apr 17 10:29:41 2022 +0200

Removed duplicated include

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

diff --git a/dbaccess/source/filter/hsqldb/createparser.cxx 
b/dbaccess/source/filter/hsqldb/createparser.cxx
index 03952655dfd8..cfff560c0de5 100644
--- a/dbaccess/source/filter/hsqldb/createparser.cxx
+++ b/dbaccess/source/filter/hsqldb/createparser.cxx
@@ -23,7 +23,6 @@
 #include "createparser.hxx"
 #include "utils.hxx"
 #include 
-#include 
 
 using namespace ::comphelper;
 using namespace css::sdbc;


[Libreoffice-commits] core.git: dbaccess/source filter/source vcl/workben

2022-03-31 Thread pragat-pandya (via logerrit)
 dbaccess/source/ui/querydesign/ConnectionLine.cxx |2 -
 filter/source/graphicfilter/icgm/bitmap.cxx   |4 +--
 filter/source/graphicfilter/icgm/class4.cxx   |   24 +++---
 filter/source/svg/svgwriter.cxx   |3 --
 vcl/workben/svptest.cxx   |6 ++---
 5 files changed, 19 insertions(+), 20 deletions(-)

New commits:
commit a31aadb1ef7dfdd4ae76a15707ab51a82c95d868
Author: pragat-pandya 
AuthorDate: Tue Mar 29 16:25:15 2022 +0530
Commit: Hossein 
CommitDate: Thu Mar 31 13:51:34 2022 +0200

tdf#147906 Use std::hypot for Pythagorean addition

Change-Id: I38166d36e9e8518ab86ded7ab630a35f3a0c39d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132268
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/dbaccess/source/ui/querydesign/ConnectionLine.cxx 
b/dbaccess/source/ui/querydesign/ConnectionLine.cxx
index 96086d60b682..77a67004e995 100644
--- a/dbaccess/source/ui/querydesign/ConnectionLine.cxx
+++ b/dbaccess/source/ui/querydesign/ConnectionLine.cxx
@@ -307,7 +307,7 @@ static double dist_Euklid(const Point , const Point& 
p2,const Point& pM, Poin
 {
 Point v(p2 - p1);
 Point w(pM - p1);
-double a = sqrt(static_cast(v.X()*v.X() + v.Y()*v.Y()));
+double a = std::hypot(v.X(), v.Y());
 double l = (v.X() * w.Y() - v.Y() * w.X()) / a;
 double a2 = w.X()*v.X()+w.Y()*v.Y();
 a = a2 / (a * a);
diff --git a/filter/source/graphicfilter/icgm/bitmap.cxx 
b/filter/source/graphicfilter/icgm/bitmap.cxx
index 2dc6ff370757..67652d9eccd6 100644
--- a/filter/source/graphicfilter/icgm/bitmap.cxx
+++ b/filter/source/graphicfilter/icgm/bitmap.cxx
@@ -216,12 +216,12 @@ void CGMBitmap::ImplGetBitmap( CGMBitmapDescriptor& rDesc 
)
 double nX = rDesc.mnR.X - rDesc.mnQ.X;
 double nY = rDesc.mnR.Y - rDesc.mnQ.Y;
 
-rDesc.mndy = sqrt( nX * nX + nY * nY );
+rDesc.mndy = std::hypot(nX, nY);
 
 nX = rDesc.mnR.X - rDesc.mnP.X;
 nY = rDesc.mnR.Y - rDesc.mnP.Y;
 
-rDesc.mndx = sqrt( nX * nX + nY * nY );
+rDesc.mndx = std::hypot(nX, nY);
 
 nX = rDesc.mnR.X - rDesc.mnP.X;
 nY = rDesc.mnR.Y - rDesc.mnP.Y;
diff --git a/filter/source/graphicfilter/icgm/class4.cxx 
b/filter/source/graphicfilter/icgm/class4.cxx
index c915576c2bdb..4ef817844570 100644
--- a/filter/source/graphicfilter/icgm/class4.cxx
+++ b/filter/source/graphicfilter/icgm/class4.cxx
@@ -89,10 +89,10 @@ bool CGM::ImplGetEllipse( FloatPoint& rCenter, FloatPoint& 
rRadius, double& rAng
 rAngle = ImplGetOrientation( rCenter, aPoint1 );
 aPoint1.X -= rCenter.X;
 aPoint1.Y -= rCenter.Y;
-rRadius.X = sqrt( aPoint1.X * aPoint1.X + aPoint1.Y * aPoint1.Y );
+rRadius.X = std::hypot(aPoint1.X, aPoint1.Y);
 aPoint2.X -= rCenter.X;
 aPoint2.Y -= rCenter.Y;
-rRadius.Y = sqrt( aPoint2.X * aPoint2.X + aPoint2.Y * aPoint2.Y );
+rRadius.Y = std::hypot(aPoint2.X, aPoint2.Y);
 
 if ( fRot1 > fRot2 )
 {
@@ -418,7 +418,7 @@ void CGM::ImplDoClass4()
 fStartAngle = fEndAngle;
 fEndAngle = fG;
 }
-double fRadius = sqrt( pow( ( aStartingPoint.X - 
aCenterPoint.X ), 2 ) + pow( ( aStartingPoint.Y - aCenterPoint.Y ), 2 ) ) ;
+double fRadius = std::hypot(aStartingPoint.X - 
aCenterPoint.X, aStartingPoint.Y - aCenterPoint.Y);
 
 if ( mbFigure )
 {
@@ -508,7 +508,7 @@ void CGM::ImplDoClass4()
 fEndAngle = fG;
 }
 FloatPoint fRadius;
-fRadius.Y = fRadius.X = sqrt( pow( ( aStartingPoint.X - 
aCenterPoint.X ), 2 ) + pow( ( aStartingPoint.Y - aCenterPoint.Y ), 2 ) ) ;
+fRadius.Y = fRadius.X = std::hypot(aStartingPoint.X - 
aCenterPoint.X, aStartingPoint.Y - aCenterPoint.Y);
 
 sal_uInt32 nType = ImplGetUI16();
 if ( nType == 0 )
@@ -548,9 +548,9 @@ void CGM::ImplDoClass4()
 bool bUseless = useless(vector[0]) || useless(vector[1]) || 
useless(vector[2]) || useless(vector[3]);
 if (!bUseless)
 {
-const double fStartSqrt = sqrt(vector[0] * vector[ 0 ] + 
vector[1] * vector[1]);
+const double fStartSqrt = std::hypot(vector[0], vector[1]);
 fStartAngle = fStartSqrt != 0.0 ? 
basegfx::rad2deg(acos(vector[0] / fStartSqrt)) : 0.0;
-const double fEndSqrt = sqrt(vector[2] * vector[ 2 ] + 
vector[3] * vector[3]);
+const double fEndSqrt = std::hypot(vector[2], vector[3]);
 fEndAngle = fEndSqrt != 0.0 ? 
basegfx::rad2deg(acos(vector[ 2 ] / fEndSqrt)) : 0.0;
 
 if ( vector[ 1 ] > 0 )
@@ -626,9 +626,9 @@ void CGM::ImplDoClass4()
 bool bUseless = useless(vector[0]) || useless(vector[1]) 

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

2022-03-28 Thread Stephan Bergmann (via logerrit)
 dbaccess/source/ui/uno/copytablewizard.cxx |3 ---
 1 file changed, 3 deletions(-)

New commits:
commit 2866b1a84e2667c9dd58955d3cd73b262ff6860b
Author: Stephan Bergmann 
AuthorDate: Mon Mar 28 17:02:34 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Mon Mar 28 23:23:06 2022 +0200

-Werror,-Wunused-but-set-variable

...since 376cc3ea0fc2e0f209763a2a27c5852136332c86 "dbaccess: delete old 
paste
autoincrement logic"

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

diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx 
b/dbaccess/source/ui/uno/copytablewizard.cxx
index 51420d74995c..eb6d7fa2325b 100644
--- a/dbaccess/source/ui/uno/copytablewizard.cxx
+++ b/dbaccess/source/ui/uno/copytablewizard.cxx
@@ -1098,7 +1098,6 @@ void CopyTableWizard::impl_copyRows_throw( const 
Reference< XResultSet >& _rxSou
 const Any* pSelectedRow = m_aSourceSelection.getConstArray();
 const Any* pSelEnd  = pSelectedRow + 
m_aSourceSelection.getLength();
 
-sal_Int32 nRowCount = 0;
 bool bContinue = false;
 
 CopyTableRowEvent aCopyEvent;
@@ -1133,8 +1132,6 @@ void CopyTableWizard::impl_copyRows_throw( const 
Reference< XResultSet >& _rxSou
 break;
 }
 
-++nRowCount;
-
 aCopyEvent.Error.clear();
 try
 {


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

2022-03-28 Thread Stephan Bergmann (via logerrit)
 dbaccess/source/ui/misc/TokenWriter.cxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit 5b3c7ad096193ede848c2ad216d48160e266adbd
Author: Stephan Bergmann 
AuthorDate: Mon Mar 28 17:00:29 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Mon Mar 28 20:40:31 2022 +0200

-Werror,-Wunused-but-set-variable

...since 0b6d0ac41afc72a0043e6ccdc6cdfd8648a5efdc "m_pRowMarker is unused"

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

diff --git a/dbaccess/source/ui/misc/TokenWriter.cxx 
b/dbaccess/source/ui/misc/TokenWriter.cxx
index 7b2ff6d8f6f7..08e8fcc76c0d 100644
--- a/dbaccess/source/ui/misc/TokenWriter.cxx
+++ b/dbaccess/source/ui/misc/TokenWriter.cxx
@@ -791,14 +791,12 @@ void OHTMLImportExport::WriteTables()
 
 // 2. and now the data
 Reference< XRowSet > xRowSet(m_xRow,UNO_QUERY);
-sal_Int32 kk=0;
 m_xResultSet->beforeFirst(); // set back before the first row
 while(m_xResultSet->next())
 {
 IncIndent(1);
 HTMLOutFuncs::Out_AsciiTag(*m_pStream, 
OOO_STRING_SVTOOLS_HTML_tablerow).WriteCharPtr(SAL_NEWLINE_STRING).WriteCharPtr(GetIndentStr());
 
-++kk;
 for(sal_Int32 i=1;i<=aNames.getLength();++i)
 {
 if(i == aNames.getLength())


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

2022-03-28 Thread Stephan Bergmann (via logerrit)
 dbaccess/source/core/api/KeySet.cxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit 04ccd3fab8e620633a11c84a642378b0b241c3a0
Author: Stephan Bergmann 
AuthorDate: Mon Mar 28 16:51:33 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Mon Mar 28 20:06:41 2022 +0200

-Werror,-Wunused-but-set-variable

...since 35dce7a06088386f13636bc355bc35e93be6ba5d "INTEGRATION: CWS 
warnings01"

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

diff --git a/dbaccess/source/core/api/KeySet.cxx 
b/dbaccess/source/core/api/KeySet.cxx
index 847a9c1a07cc..ba712b574bc4 100644
--- a/dbaccess/source/core/api/KeySet.cxx
+++ b/dbaccess/source/core/api/KeySet.cxx
@@ -463,7 +463,6 @@ void OKeySet::updateRow(const ORowSetRow& _rInsertRow 
,const ORowSetRow& _rOrigi
 std::vector aIndexColumnPositions;
 
 const sal_Int32 nOldLength = aSql.getLength();
-sal_Int32 i = 1;
 // here we build the condition part for the update statement
 for (auto const& columnName : *m_pColumnNames)
 {
@@ -499,7 +498,6 @@ void OKeySet::updateRow(const ORowSetRow& _rInsertRow 
,const ORowSetRow& _rOrigi
 {
 aSql.append(::dbtools::quoteName( 
aQuote,columnName.second.sRealName) + aPara);
 }
-++i;
 }
 
 if( aSql.getLength() != nOldLength )


[Libreoffice-commits] core.git: dbaccess/source include/dbaccess

2022-03-24 Thread Mike Kaganski (via logerrit)
 dbaccess/source/ui/browser/genericcontroller.cxx |4 ++--
 include/dbaccess/genericcontroller.hxx   |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 1e2483a3ab9d32266cba73db250ff4c517bbe4f8
Author: Mike Kaganski 
AuthorDate: Thu Mar 24 10:49:31 2022 +0300
Commit: Mike Kaganski 
CommitDate: Thu Mar 24 12:02:37 2022 +0100

Create OUString from ASCII literal instead of createFromAscii

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

diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx 
b/dbaccess/source/ui/browser/genericcontroller.cxx
index 05aabe1855fa..eab8c16d7ca0 100644
--- a/dbaccess/source/ui/browser/genericcontroller.cxx
+++ b/dbaccess/source/ui/browser/genericcontroller.cxx
@@ -755,7 +755,7 @@ void OGenericUnoController::frameAction(const 
FrameActionEvent& aEvent)
 m_aCurrentFrame.frameAction( aEvent.Action );
 }
 
-void OGenericUnoController::implDescribeSupportedFeature( const char* 
_pAsciiCommandURL,
+void OGenericUnoController::implDescribeSupportedFeature( const OUString& 
_rCommandURL,
 sal_uInt16 _nFeatureId, sal_Int16 _nCommandGroup )
 {
 #ifdef DBG_UTIL
@@ -765,7 +765,7 @@ void OGenericUnoController::implDescribeSupportedFeature( 
const char* _pAsciiCom
 "OGenericUnoController::implDescribeSupportedFeature: invalid 
feature id!" );
 
 ControllerFeature aFeature;
-aFeature.Command = OUString::createFromAscii( _pAsciiCommandURL );
+aFeature.Command = _rCommandURL;
 aFeature.nFeatureId = _nFeatureId;
 aFeature.GroupId = _nCommandGroup;
 
diff --git a/include/dbaccess/genericcontroller.hxx 
b/include/dbaccess/genericcontroller.hxx
index 7ce10174e3d1..50b939791654 100644
--- a/include/dbaccess/genericcontroller.hxx
+++ b/include/dbaccess/genericcontroller.hxx
@@ -289,7 +289,7 @@ namespace dbaui
 
 Must not be called outside 
describeSupportedFeatures.
 
-@param _pAsciiCommandURL
+@param _rCommandURL
 the URL of the feature command
 @param _nFeatureId
 the id of the feature. Later references to this feature 
usually happen by id, not by
@@ -299,7 +299,7 @@ namespace dbaui
 by the user, see also CommandGroup.
 */
 voidimplDescribeSupportedFeature(
-const char* _pAsciiCommandURL,
+const OUString& _rCommandURL,
 sal_uInt16 _nFeatureId,
 sal_Int16 _nCommandGroup = 
css::frame::CommandGroup::INTERNAL
 );


[Libreoffice-commits] core.git: dbaccess/source forms/source include/svx include/toolkit svx/source toolkit/inc toolkit/source

2022-03-05 Thread Noel Grandin (via logerrit)
 dbaccess/source/ui/uno/ColumnControl.cxx |2 -
 dbaccess/source/ui/uno/ColumnControl.hxx |2 -
 forms/source/component/Filter.cxx|2 -
 forms/source/component/Filter.hxx|2 -
 include/svx/fmgridif.hxx |2 -
 include/toolkit/controls/unocontrol.hxx  |2 -
 include/toolkit/controls/unocontrolbase.hxx  |2 -
 include/toolkit/controls/unocontrols.hxx |   36 +--
 svx/source/fmcomp/fmgridif.cxx   |2 -
 svx/source/form/formcontroller.cxx   |2 -
 toolkit/inc/controls/dialogcontrol.hxx   |8 +++---
 toolkit/inc/controls/formattedcontrol.hxx|2 -
 toolkit/inc/controls/roadmapcontrol.hxx  |2 -
 toolkit/inc/controls/tabpagecontainer.hxx|2 -
 toolkit/inc/controls/tabpagemodel.hxx|2 -
 toolkit/inc/controls/tkscrollbar.hxx |2 -
 toolkit/source/controls/animatedimages.cxx   |4 +--
 toolkit/source/controls/dialogcontrol.cxx|8 +++---
 toolkit/source/controls/formattedcontrol.cxx |2 -
 toolkit/source/controls/grid/gridcontrol.cxx |2 -
 toolkit/source/controls/grid/gridcontrol.hxx |2 -
 toolkit/source/controls/roadmapcontrol.cxx   |2 -
 toolkit/source/controls/tabpagecontainer.cxx |2 -
 toolkit/source/controls/tabpagemodel.cxx |2 -
 toolkit/source/controls/tkscrollbar.cxx  |2 -
 toolkit/source/controls/tkspinbutton.cxx |4 +--
 toolkit/source/controls/tree/treecontrol.cxx |4 +--
 toolkit/source/controls/unocontrol.cxx   |2 -
 toolkit/source/controls/unocontrolbase.cxx   |2 -
 toolkit/source/controls/unocontrols.cxx  |   36 +--
 30 files changed, 73 insertions(+), 73 deletions(-)

New commits:
commit 492098417a590521506e41c05d3ab0f09628d39a
Author: Noel Grandin 
AuthorDate: Sat Mar 5 09:16:53 2022 +0200
Commit: Noel Grandin 
CommitDate: Sat Mar 5 15:19:15 2022 +0100

GetComponentServiceName can be const

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

diff --git a/dbaccess/source/ui/uno/ColumnControl.cxx 
b/dbaccess/source/ui/uno/ColumnControl.cxx
index 0d26048f8e32..9295b9954333 100644
--- a/dbaccess/source/ui/uno/ColumnControl.cxx
+++ b/dbaccess/source/ui/uno/ColumnControl.cxx
@@ -61,7 +61,7 @@ css::uno::Sequence< OUString > SAL_CALL 
OColumnControl::getSupportedServiceNames
 return { 
"com.sun.star.awt.UnoControl","com.sun.star.sdb.ColumnDescriptorControl" };
 }
 
-OUString OColumnControl::GetComponentServiceName()
+OUString OColumnControl::GetComponentServiceName() const
 {
 return "com.sun.star.sdb.ColumnDescriptorControl";
 }
diff --git a/dbaccess/source/ui/uno/ColumnControl.hxx 
b/dbaccess/source/ui/uno/ColumnControl.hxx
index 9c6054d623e2..63f06651284c 100644
--- a/dbaccess/source/ui/uno/ColumnControl.hxx
+++ b/dbaccess/source/ui/uno/ColumnControl.hxx
@@ -33,7 +33,7 @@ namespace dbaui
 explicit OColumnControl(const css::uno::Reference< 
css::uno::XComponentContext>& rxContext);
 
 // UnoControl
-virtual OUString GetComponentServiceName() override;
+virtual OUString GetComponentServiceName() const override;
 
 // XServiceInfo
 DECLARE_SERVICE_INFO();
diff --git a/forms/source/component/Filter.cxx 
b/forms/source/component/Filter.cxx
index cc57cecf027a..4713f6b4 100644
--- a/forms/source/component/Filter.cxx
+++ b/forms/source/component/Filter.cxx
@@ -135,7 +135,7 @@ namespace frm
 }
 
 
-OUString OFilterControl::GetComponentServiceName()
+OUString OFilterControl::GetComponentServiceName() const
 {
 OUString aServiceName;
 switch (m_nControlClass)
diff --git a/forms/source/component/Filter.hxx 
b/forms/source/component/Filter.hxx
index 8561d2f5d5af..8815f5f11a02 100644
--- a/forms/source/component/Filter.hxx
+++ b/forms/source/component/Filter.hxx
@@ -80,7 +80,7 @@ namespace frm
 DECLARE_UNO3_AGG_DEFAULTS(OFilterControl,OWeakAggObject)
 css::uno::Any  SAL_CALL queryAggregation( const css::uno::Type & rType 
) override;
 
-virtual OUString GetComponentServiceName() override;
+virtual OUString GetComponentServiceName() const override;
 virtual void SAL_CALL   createPeer( const css::uno::Reference< 
css::awt::XToolkit > & rxToolkit, const css::uno::Reference< 
css::awt::XWindowPeer >  & rParentPeer ) override;
 
 // css::lang::XComponent
diff --git a/include/svx/fmgridif.hxx b/include/svx/fmgridif.hxx
index e0f43fcf069c..668eb13350fe 100644
--- a/include/svx/fmgridif.hxx
+++ b/include/svx/fmgridif.hxx
@@ -277,7 +277,7 @@ public:
 virtual css::uno::Sequence< css::uno::Any > SAL_CALL queryFieldData( 
sal_Int32 nRow, const css::uno::Type& xType ) override;
 
 // UnoControl
-virtual OUString GetComponentServiceName() override;
+virtual OUString 

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

2022-02-21 Thread Caolán McNamara (via logerrit)
 dbaccess/source/ui/querydesign/JoinController.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit e73c1e127b3395a9a65c55d4f978f2368b7ec3dd
Author: Caolán McNamara 
AuthorDate: Mon Feb 21 12:13:12 2022 +
Commit: Caolán McNamara 
CommitDate: Mon Feb 21 15:39:35 2022 +0100

cid#1500396 silence Dereference after null check

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

diff --git a/dbaccess/source/ui/querydesign/JoinController.cxx 
b/dbaccess/source/ui/querydesign/JoinController.cxx
index 114f77d99865..0857e0448e8b 100644
--- a/dbaccess/source/ui/querydesign/JoinController.cxx
+++ b/dbaccess/source/ui/querydesign/JoinController.cxx
@@ -204,6 +204,7 @@ AddTableDialogContext& 
OJoinController::impl_getDialogContext() const
 OJoinController* pNonConstThis = const_cast< OJoinController* >( this 
);
 pNonConstThis->m_pDialogContext.reset( new AddTableDialogContext( 
*pNonConstThis ) );
 }
+assert(m_pDialogContext && "always exists at this point");
 return *m_pDialogContext;
 }
 


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

2022-02-19 Thread Julien Nabet (via logerrit)
 dbaccess/source/core/api/CRowSetColumn.cxx |   51 +++-
 dbaccess/source/core/api/CRowSetDataColumn.cxx |   50 +++-
 dbaccess/source/core/api/resultcolumn.cxx  |   52 -
 dbaccess/source/core/api/resultset.cxx |   22 +-
 dbaccess/source/core/api/statement.cxx |   30 +++---
 dbaccess/source/core/dataaccess/datasource.cxx |   38 +-
 6 files changed, 119 insertions(+), 124 deletions(-)

New commits:
commit ec41dcdddb47f39ede581ce00dc20ecd4fe3458b
Author: Julien Nabet 
AuthorDate: Sat Feb 19 11:00:59 2022 +0100
Commit: Julien Nabet 
CommitDate: Sat Feb 19 11:51:59 2022 +0100

Simplify sequence of Property in dbaccess

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

diff --git a/dbaccess/source/core/api/CRowSetColumn.cxx 
b/dbaccess/source/core/api/CRowSetColumn.cxx
index 56328bd18009..98435b7c4498 100644
--- a/dbaccess/source/core/api/CRowSetColumn.cxx
+++ b/dbaccess/source/core/api/CRowSetColumn.cxx
@@ -44,33 +44,30 @@ ORowSetColumn::ORowSetColumn( const Reference < 
XResultSetMetaData >& _xMetaData
 
 ::cppu::IPropertyArrayHelper* ORowSetColumn::createArrayHelper( ) const
 {
-css::uno::Sequence< css::beans::Property> aDescriptor(21);
-css::beans::Property* pDesc = aDescriptor.getArray();
-sal_Int32 nPos = 0;
-
-pDesc[nPos++] = css::beans::Property(PROPERTY_CATALOGNAME, 
PROPERTY_ID_CATALOGNAME, cppu::UnoType::get(), 
css::beans::PropertyAttribute::READONLY );
-pDesc[nPos++] = css::beans::Property(PROPERTY_DISPLAYSIZE, 
PROPERTY_ID_DISPLAYSIZE, cppu::UnoType::get(), 
css::beans::PropertyAttribute::READONLY );
-pDesc[nPos++] = css::beans::Property(PROPERTY_ISAUTOINCREMENT, 
PROPERTY_ID_ISAUTOINCREMENT, cppu::UnoType::get(), 
css::beans::PropertyAttribute::READONLY );
-pDesc[nPos++] = css::beans::Property(PROPERTY_ISCASESENSITIVE, 
PROPERTY_ID_ISCASESENSITIVE, cppu::UnoType::get(), 
css::beans::PropertyAttribute::READONLY );
-pDesc[nPos++] = css::beans::Property(PROPERTY_ISCURRENCY, 
PROPERTY_ID_ISCURRENCY, cppu::UnoType::get(), 
css::beans::PropertyAttribute::READONLY );
-pDesc[nPos++] = css::beans::Property(PROPERTY_ISDEFINITELYWRITABLE, 
PROPERTY_ID_ISDEFINITELYWRITABLE, cppu::UnoType::get(), 
css::beans::PropertyAttribute::READONLY );
-pDesc[nPos++] = css::beans::Property(PROPERTY_ISNULLABLE, 
PROPERTY_ID_ISNULLABLE, cppu::UnoType::get(), 
css::beans::PropertyAttribute::READONLY );
-pDesc[nPos++] = css::beans::Property(PROPERTY_ISREADONLY, 
PROPERTY_ID_ISREADONLY, cppu::UnoType::get(), 
css::beans::PropertyAttribute::BOUND );
-pDesc[nPos++] = css::beans::Property(PROPERTY_ISROWVERSION, 
PROPERTY_ID_ISROWVERSION, cppu::UnoType::get(), 
css::beans::PropertyAttribute::READONLY );
-pDesc[nPos++] = css::beans::Property(PROPERTY_ISSEARCHABLE, 
PROPERTY_ID_ISSEARCHABLE, cppu::UnoType::get(), 
css::beans::PropertyAttribute::READONLY );
-pDesc[nPos++] = css::beans::Property(PROPERTY_ISSIGNED, 
PROPERTY_ID_ISSIGNED, cppu::UnoType::get(), 
css::beans::PropertyAttribute::READONLY );
-pDesc[nPos++] = css::beans::Property(PROPERTY_ISWRITABLE, 
PROPERTY_ID_ISWRITABLE, cppu::UnoType::get(), 
css::beans::PropertyAttribute::READONLY );
-pDesc[nPos++] = css::beans::Property(PROPERTY_LABEL, PROPERTY_ID_LABEL, 
cppu::UnoType::get(), css::beans::PropertyAttribute::READONLY );
-pDesc[nPos++] = css::beans::Property(PROPERTY_PRECISION, 
PROPERTY_ID_PRECISION, cppu::UnoType::get(), 
css::beans::PropertyAttribute::READONLY );
-pDesc[nPos++] = css::beans::Property(PROPERTY_SCALE, PROPERTY_ID_SCALE, 
cppu::UnoType::get(), css::beans::PropertyAttribute::READONLY );
-pDesc[nPos++] = css::beans::Property(PROPERTY_SCHEMANAME, 
PROPERTY_ID_SCHEMANAME, cppu::UnoType::get(), 
css::beans::PropertyAttribute::READONLY );
-pDesc[nPos++] = css::beans::Property(PROPERTY_SERVICENAME, 
PROPERTY_ID_SERVICENAME, cppu::UnoType::get(), 
css::beans::PropertyAttribute::READONLY );
-pDesc[nPos++] = css::beans::Property(PROPERTY_TABLENAME, 
PROPERTY_ID_TABLENAME, cppu::UnoType::get(), 
css::beans::PropertyAttribute::READONLY );
-pDesc[nPos++] = css::beans::Property(PROPERTY_TYPE, PROPERTY_ID_TYPE, 
cppu::UnoType::get(), css::beans::PropertyAttribute::READONLY );
-pDesc[nPos++] = css::beans::Property(PROPERTY_TYPENAME, 
PROPERTY_ID_TYPENAME, cppu::UnoType::get(), 
css::beans::PropertyAttribute::READONLY );
-pDesc[nPos++] = css::beans::Property(PROPERTY_VALUE, PROPERTY_ID_VALUE, 
cppu::UnoType::get(), css::beans::PropertyAttribute::READONLY | 
css::beans::PropertyAttribute::BOUND);
-
-OSL_ENSURE(nPos == aDescriptor.getLength(), "forgot to adjust the count 
?");
+css::uno::Sequence< css::beans::Property> aDescriptor
+{
+{ PROPERTY_CATALOGNAME, PROPERTY_ID_CATALOGNAME, 

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

2022-02-11 Thread Caolán McNamara (via logerrit)
 dbaccess/source/ui/querydesign/QueryTextView.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit a4b8925e57fa727c980157ebeef83100386c7444
Author: Caolán McNamara 
AuthorDate: Fri Feb 11 14:54:45 2022 +
Commit: Caolán McNamara 
CommitDate: Fri Feb 11 17:53:51 2022 +0100

Resolves: tdf#147325 "Edit in SQL View" should accept tab

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

diff --git a/dbaccess/source/ui/querydesign/QueryTextView.cxx 
b/dbaccess/source/ui/querydesign/QueryTextView.cxx
index 9805c2aca62e..daeb6ee14f7d 100644
--- a/dbaccess/source/ui/querydesign/QueryTextView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTextView.cxx
@@ -42,6 +42,7 @@ OQueryTextView::OQueryTextView(OQueryContainerWindow* 
pParent, OQueryController&
 m_xSQL->DisableInternalUndo();
 m_xSQL->SetHelpId(HID_CTL_QRYSQLEDIT);
 m_xSQL->SetModifyHdl(LINK(this, OQueryTextView, ModifyHdl));
+m_xSQL->SetAcceptsTab(true);
 
 m_timerUndoActionCreation.SetTimeout(1000);
 m_timerUndoActionCreation.SetInvokeHandler(LINK(this, OQueryTextView, 
OnUndoActionTimer));


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

2022-02-07 Thread Caolán McNamara (via logerrit)
 dbaccess/source/filter/hsqldb/rowinputbinary.cxx |   19 +++
 1 file changed, 7 insertions(+), 12 deletions(-)

New commits:
commit 2d21560b780060114c2e9ab95d6a4680a590ab0f
Author: Caolán McNamara 
AuthorDate: Mon Feb 7 11:21:37 2022 +
Commit: Caolán McNamara 
CommitDate: Mon Feb 7 16:02:14 2022 +0100

sal_uInt8 is typedefed as unsigned char so this casting isn't needed

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

diff --git a/dbaccess/source/filter/hsqldb/rowinputbinary.cxx 
b/dbaccess/source/filter/hsqldb/rowinputbinary.cxx
index 1a71ad9276e1..f7a927a487de 100644
--- a/dbaccess/source/filter/hsqldb/rowinputbinary.cxx
+++ b/dbaccess/source/filter/hsqldb/rowinputbinary.cxx
@@ -165,9 +165,8 @@ OUString HsqlRowInputStream::readUTF(sal_Int32 nUTFLen)
 sal_Int32 nStrLen = 0;
 while (nCount < nUTFLen)
 {
-unsigned char cIn = 0;
-m_pStream->ReadUChar(cIn);
-sal_uInt8 c = reinterpret_cast(cIn);
+sal_uInt8 c = 0;
+m_pStream->ReadUChar(c);
 sal_uInt8 char2, char3;
 switch (c >> 4)
 {
@@ -193,8 +192,7 @@ OUString HsqlRowInputStream::readUTF(sal_Int32 nUTFLen)
 throw WrongFormatException();
 }
 
-m_pStream->ReadUChar(cIn);
-char2 = reinterpret_cast(cIn);
+m_pStream->ReadUChar(char2);
 if ((char2 & 0xC0) != 0x80)
 {
 throw WrongFormatException();
@@ -211,10 +209,8 @@ OUString HsqlRowInputStream::readUTF(sal_Int32 nUTFLen)
 throw WrongFormatException();
 }
 
-m_pStream->ReadUChar(cIn);
-char2 = reinterpret_cast(cIn);
-m_pStream->ReadUChar(cIn);
-char3 = reinterpret_cast(cIn);
+m_pStream->ReadUChar(char2);
+m_pStream->ReadUChar(char3);
 
 if (((char2 & 0xC0) != 0x80) || ((char3 & 0xC0) != 0x80))
 {
@@ -234,9 +230,8 @@ OUString HsqlRowInputStream::readUTF(sal_Int32 nUTFLen)
 
 bool HsqlRowInputStream::checkNull()
 {
-unsigned char cIn = 0;
-m_pStream->ReadUChar(cIn);
-sal_uInt8 nNull = reinterpret_cast(cIn);
+sal_uInt8 nNull = 0;
+m_pStream->ReadUChar(nNull);
 return nNull == 0;
 }
 


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

2022-02-04 Thread Julien Nabet (via logerrit)
 dbaccess/source/core/dataaccess/databasedocument.cxx |   11 ---
 1 file changed, 4 insertions(+), 7 deletions(-)

New commits:
commit b63a080c0c1dc9c3f2fc82e03d97d45d91dd7d16
Author: Julien Nabet 
AuthorDate: Fri Feb 4 12:55:41 2022 +0100
Commit: Julien Nabet 
CommitDate: Sat Feb 5 08:48:27 2022 +0100

Following simplify a bit ODatabaseDocument::impl_getUntitledHelper_throw

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

diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx 
b/dbaccess/source/core/dataaccess/databasedocument.cxx
index 51a3457f7668..2bb57d234d42 100644
--- a/dbaccess/source/core/dataaccess/databasedocument.cxx
+++ b/dbaccess/source/core/dataaccess/databasedocument.cxx
@@ -2108,15 +2108,12 @@ uno::Reference< frame::XUntitledNumbers > 
ODatabaseDocument::impl_getUntitledHel
 m_xModuleManager.set( ModuleManager::create(m_pImpl->m_aContext) );
 
 OUString sModuleId;
-uno::Reference< frame::XUntitledNumbers > xNumberedControllers;
-TNumberedController::const_iterator aFind = m_aNumberedControllers.end();
-
 if (_xComponent.is())
-{
-sModuleId = m_xModuleManager->identify( _xComponent );
-aFind = m_aNumberedControllers.find(sModuleId);
-}
+sModuleId = m_xModuleManager->identify(_xComponent);
+
+uno::Reference< frame::XUntitledNumbers > xNumberedControllers;
 
+TNumberedController::const_iterator aFind = 
m_aNumberedControllers.find(sModuleId);
 if ( aFind == m_aNumberedControllers.end() )
 {
 rtl::Reference<::comphelper::NumberedCollection> pHelper = new 
::comphelper::NumberedCollection();


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

2022-02-03 Thread Julien Nabet (via logerrit)
 dbaccess/source/ui/browser/unodatbr.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit bcd5a154e4284848553f994d4d0612182130c271
Author: Julien Nabet 
AuthorDate: Thu Feb 3 22:12:53 2022 +0100
Commit: Julien Nabet 
CommitDate: Fri Feb 4 08:01:35 2022 +0100

Use only toUInt64 for reinterpret_cast

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

diff --git a/dbaccess/source/ui/browser/unodatbr.cxx 
b/dbaccess/source/ui/browser/unodatbr.cxx
index ee07b531f8b2..4d6cb342dc44 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -2150,7 +2150,7 @@ IMPL_LINK(SbaTableQueryBrowser, OnExpandEntry, const 
weld::TreeIter&, rParent, b
 std::unique_ptr xFirstParent = 
m_pTreeView->GetRootLevelParent();
 OSL_ENSURE(xFirstParent,"SbaTableQueryBrowser::OnExpandEntry: No 
rootlevelparent!");
 
-DBTreeListUserData* pData = 
reinterpret_cast(rTreeView.get_id(rParent).toInt64());
+DBTreeListUserData* pData = 
reinterpret_cast(rTreeView.get_id(rParent).toUInt64());
 assert(pData && "SbaTableQueryBrowser::OnExpandEntry: No user data!");
 
 if (etTableContainer == pData->eType)
@@ -2482,11 +2482,11 @@ std::unique_ptr 
SbaTableQueryBrowser::implGetConnectionEntry(con
 {
 weld::TreeView& rTreeView = m_pTreeView->GetWidget();
 std::unique_ptr 
xCurrentEntry(rTreeView.make_iterator());
-DBTreeListUserData* pEntryData = 
reinterpret_cast(rTreeView.get_id(*xCurrentEntry).toInt64());
+DBTreeListUserData* pEntryData = 
reinterpret_cast(rTreeView.get_id(*xCurrentEntry).toUInt64());
 while (pEntryData->eType != etDatasource)
 {
 rTreeView.iter_parent(*xCurrentEntry);
-pEntryData = 
reinterpret_cast(rTreeView.get_id(*xCurrentEntry).toInt64());
+pEntryData = 
reinterpret_cast(rTreeView.get_id(*xCurrentEntry).toUInt64());
 }
 return xCurrentEntry;
 }


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

2022-02-03 Thread Julien Nabet (via logerrit)
 dbaccess/source/core/dataaccess/databasedocument.cxx |   11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

New commits:
commit ebc572c4366b871c737cd4785a48111c1344cad2
Author: Julien Nabet 
AuthorDate: Thu Feb 3 20:57:45 2022 +0100
Commit: Julien Nabet 
CommitDate: Fri Feb 4 08:00:52 2022 +0100

Simplify a bit ODatabaseDocument::impl_getUntitledHelper_throw

No need to call "m_xModuleManager->identify" which throws if the component 
var
is an empty ref then do nothing with the exception.

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

diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx 
b/dbaccess/source/core/dataaccess/databasedocument.cxx
index 4fce39de0b35..51a3457f7668 100644
--- a/dbaccess/source/core/dataaccess/databasedocument.cxx
+++ b/dbaccess/source/core/dataaccess/databasedocument.cxx
@@ -2108,16 +2108,15 @@ uno::Reference< frame::XUntitledNumbers > 
ODatabaseDocument::impl_getUntitledHel
 m_xModuleManager.set( ModuleManager::create(m_pImpl->m_aContext) );
 
 OUString sModuleId;
-try
+uno::Reference< frame::XUntitledNumbers > xNumberedControllers;
+TNumberedController::const_iterator aFind = m_aNumberedControllers.end();
+
+if (_xComponent.is())
 {
 sModuleId = m_xModuleManager->identify( _xComponent );
+aFind = m_aNumberedControllers.find(sModuleId);
 }
-catch(const uno::Exception&)
-{
-}
-uno::Reference< frame::XUntitledNumbers > xNumberedControllers;
 
-TNumberedController::const_iterator aFind = 
m_aNumberedControllers.find(sModuleId);
 if ( aFind == m_aNumberedControllers.end() )
 {
 rtl::Reference<::comphelper::NumberedCollection> pHelper = new 
::comphelper::NumberedCollection();


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

2022-01-26 Thread Julien Nabet (via logerrit)
 dbaccess/source/core/dataaccess/ModelImpl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5e80706dca6395dfac006cfc7009a2dfe388a46e
Author: Julien Nabet 
AuthorDate: Wed Jan 26 20:32:54 2022 +0100
Commit: Julien Nabet 
CommitDate: Thu Jan 27 08:36:54 2022 +0100

Avoid 
warn:dbaccess:828616:828616:dbaccess/source/core/dataaccess/ModelImpl.cxx

Just open an odb with embedded Firebird, browse tables panel and close LO
Full message:

warn:dbaccess:828616:828616:dbaccess/source/core/dataaccess/ModelImpl.cxx:923:
com.sun.star.container.NoSuchElementException message: 
"/home/julien/lo/libreoffice/package/source/xstor/xstorage.cxx:2974:
at /home/julien/lo/libreoffice/package/source/xstor/xstorage.cxx:2974"

Change-Id: Ibcea49b5ae28fd42cc1008c74f8cd5a9b7434068
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129009
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 
Reviewed-by: Julien Nabet 

diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx 
b/dbaccess/source/core/dataaccess/ModelImpl.cxx
index 49a74717e559..0a1ef938d53b 100644
--- a/dbaccess/source/core/dataaccess/ModelImpl.cxx
+++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx
@@ -887,7 +887,7 @@ bool 
ODatabaseModelImpl::commitStorageIfWriteable_ignoreErrors( const Reference<
 
 uno::Reference xTargetMetaInf
 = _rxStorage->openStorageElement("META-INF", 
embed::ElementModes::READWRITE);
-if (xMetaInf.is() && xTargetMetaInf.is())
+if (xMetaInf.is() && xTargetMetaInf.is() && 
xMetaInf->hasByName(aScriptSignName))
 {
 xMetaInf->copyElementTo(aScriptSignName, xTargetMetaInf, 
aScriptSignName);
 


[Libreoffice-commits] core.git: dbaccess/source solenv/clang-format

2022-01-10 Thread Gabor Kelemen (via logerrit)
 dbaccess/source/shared/registrationhelper.cxx |  152 --
 solenv/clang-format/excludelist   |1 
 2 files changed, 153 deletions(-)

New commits:
commit 4af29b3e75dc7bf50309be726d02ed82cf962813
Author: Gabor Kelemen 
AuthorDate: Mon Jan 10 08:56:54 2022 +0100
Commit: Noel Grandin 
CommitDate: Tue Jan 11 07:22:02 2022 +0100

Drop unused file dbaccess/source/shared/registrationhelper.cxx

since commit d29a314300d523d29ed894f187497fcb68f8

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

diff --git a/dbaccess/source/shared/registrationhelper.cxx 
b/dbaccess/source/shared/registrationhelper.cxx
deleted file mode 100644
index 2c9fbc1f1042..
--- a/dbaccess/source/shared/registrationhelper.cxx
+++ /dev/null
@@ -1,152 +0,0 @@
-/* -*- 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 .
- */
-
-// be included in other cxx files
-
-#ifndef REGISTRATIONHELPER_CXX_INCLUDED_INDIRECTLY_
-#error "don't build this file directly! use dbu_reghelper.cxx instead!"
-#endif
-
-using namespace ::com::sun::star;
-using namespace ::comphelper;
-using namespace ::cppu;
-
-uno::Sequence< OUString >*   
OModuleRegistration::s_pImplementationNames = nullptr;
-uno::Sequence< uno::Sequence< OUString > >*  
OModuleRegistration::s_pSupportedServices = nullptr;
-uno::Sequence< sal_Int64 >* 
OModuleRegistration::s_pCreationFunctionPointers = nullptr;
-uno::Sequence< sal_Int64 >* 
OModuleRegistration::s_pFactoryFunctionPointers = nullptr;
-
-void OModuleRegistration::registerComponent(
-const OUString& _rImplementationName,
-const uno::Sequence< OUString >& _rServiceNames,
-ComponentInstantiation _pCreateFunction,
-FactoryInstantiation _pFactoryFunction)
-{
-if (!s_pImplementationNames)
-{
-OSL_ENSURE(!s_pSupportedServices && !s_pCreationFunctionPointers && 
!s_pFactoryFunctionPointers,
-"OModuleRegistration::registerComponent : inconsistent state (the 
pointers (1)) !");
-s_pImplementationNames = new uno::Sequence< OUString >;
-s_pSupportedServices = new uno::Sequence< uno::Sequence< OUString > >;
-s_pCreationFunctionPointers = new uno::Sequence< sal_Int64 >;
-s_pFactoryFunctionPointers = new uno::Sequence< sal_Int64 >;
-}
-OSL_ENSURE(s_pImplementationNames && s_pSupportedServices && 
s_pCreationFunctionPointers && s_pFactoryFunctionPointers,
-"OModuleRegistration::registerComponent : inconsistent state (the 
pointers (2)) !");
-
-OSL_ENSURE( (s_pImplementationNames->getLength() == 
s_pSupportedServices->getLength())
-&&  (s_pImplementationNames->getLength() == 
s_pCreationFunctionPointers->getLength())
-&&  (s_pImplementationNames->getLength() == 
s_pFactoryFunctionPointers->getLength()),
-"OModuleRegistration::registerComponent : inconsistent state !");
-
-sal_Int32 nOldLen = s_pImplementationNames->getLength();
-s_pImplementationNames->realloc(nOldLen + 1);
-s_pSupportedServices->realloc(nOldLen + 1);
-s_pCreationFunctionPointers->realloc(nOldLen + 1);
-s_pFactoryFunctionPointers->realloc(nOldLen + 1);
-
-s_pImplementationNames->getArray()[nOldLen] = _rImplementationName;
-s_pSupportedServices->getArray()[nOldLen] = _rServiceNames;
-s_pCreationFunctionPointers->getArray()[nOldLen] = 
reinterpret_cast(_pCreateFunction);
-s_pFactoryFunctionPointers->getArray()[nOldLen] = 
reinterpret_cast(_pFactoryFunction);
-}
-
-void OModuleRegistration::revokeComponent(const OUString& _rImplementationName)
-{
-if (!s_pImplementationNames)
-{
-OSL_FAIL("OModuleRegistration::revokeComponent : have no class infos ! 
Are you sure called this method at the right time ?");
-return;
-}
-OSL_ENSURE(s_pImplementationNames && s_pSupportedServices && 
s_pCreationFunctionPointers && s_pFactoryFunctionPointers,
-"OModuleRegistration::revokeComponent : inconsistent state (the 

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

2022-01-06 Thread Julien Nabet (via logerrit)
 dbaccess/source/ui/dlg/adminpages.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 470d1be4ec5a3a5a0aba8febda06600ea39852c5
Author: Julien Nabet 
AuthorDate: Wed Jan 5 22:22:52 2022 +0100
Commit: Julien Nabet 
CommitDate: Thu Jan 6 10:27:31 2022 +0100

tdf#68341: trim some variables passed on Base wizard

Here is a git grep -n fillString:
dbaccess/source/ui/dlg/ConnectionPage.cxx:232:
fillString(*_rSet,m_xJavaDriver.get(), DSID_JDBCDRIVERCLASS, bChangedSomething);
dbaccess/source/ui/dlg/ConnectionPage.cxx:235:
fillString(*_rSet,m_xConnectionURL.get(), DSID_CONNECTURL, bChangedSomething);
dbaccess/source/ui/dlg/ConnectionPageSetup.cxx:134:
fillString(*_rSet,m_xConnectionURL.get(), DSID_CONNECTURL, bChangedSomething);
dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx:144:
fillString(*_rSet,m_xETBaseDN.get(),DSID_CONN_LDAP_BASEDN, bChangedSomething);
dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx:416:
fillString(*_rSet,m_xETDriverClass.get(),DSID_JDBCDRIVERCLASS,bChangedSomething);
dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx:417:
fillString(*_rSet,m_xETHostname.get(),DSID_CONN_HOSTNAME,bChangedSomething);
dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx:418:
fillString(*_rSet,m_xETDatabasename.get(),DSID_DATABASENAME,bChangedSomething);
dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx:531:
fillString(*_rSet,m_xETDriverClass.get(),DSID_JDBCDRIVERCLASS,bChangedSomething);
dbaccess/source/ui/dlg/admincontrols.cxx:117:
OGenericAdministrationPage::fillString( *_rSet, m_xHostName.get(), 
DSID_CONN_HOSTNAME,bChangedSomething );
dbaccess/source/ui/dlg/admincontrols.cxx:118:
OGenericAdministrationPage::fillString( *_rSet, m_xDatabaseName.get(), 
DSID_DATABASENAME, bChangedSomething );
dbaccess/source/ui/dlg/admincontrols.cxx:121:
OGenericAdministrationPage::fillString( *_rSet, m_xSocket.get(),   
DSID_CONN_SOCKET,  bChangedSomething );
dbaccess/source/ui/dlg/admincontrols.cxx:123:
OGenericAdministrationPage::fillString( *_rSet, m_xNamedPipe.get(),
DSID_NAMED_PIPE,   bChangedSomething );
dbaccess/source/ui/dlg/adminpages.cxx:219:void 
OGenericAdministrationPage::fillString(SfxItemSet& _rSet, const weld::Entry* 
pEdit, sal_uInt16 _nID, bool& _bChangedSomething)
dbaccess/source/ui/dlg/adminpages.cxx:227:void 
OGenericAdministrationPage::fillString(SfxItemSet& _rSet, const 
dbaui::OConnectionURLEdit* pEdit, sal_uInt16 _nID, bool& _bChangedSomething)
dbaccess/source/ui/dlg/adminpages.hxx:218:static void 
fillString(SfxItemSet& _rSet,const weld::Entry* pEdit,sal_uInt16 _nID, bool& 
_bChangedSomething);
dbaccess/source/ui/dlg/adminpages.hxx:219:static void 
fillString(SfxItemSet& _rSet,const dbaui::OConnectionURLEdit* pEdit,sal_uInt16 
_nID, bool& _bChangedSomething);
dbaccess/source/ui/dlg/advancedsettings.cxx:351:fillString( *_rSet, 
m_xAutoIncrement.get(), DSID_AUTOINCREMENTVALUE, bChangedSomething );
dbaccess/source/ui/dlg/advancedsettings.cxx:353:fillString( *_rSet, 
m_xAutoRetrieving.get(), DSID_AUTORETRIEVEVALUE, bChangedSomething );
dbaccess/source/ui/dlg/detailpages.cxx:146:
fillString(*_rSet,m_xOptions.get(),DSID_ADDITIONALOPTIONS,bChangedSomething);
dbaccess/source/ui/dlg/detailpages.cxx:303:
fillString(*_rSet,m_xEDHostname.get(),DSID_CONN_HOSTNAME,bChangedSomething);
dbaccess/source/ui/dlg/detailpages.cxx:406:
fillString(*_rSet,m_xEDDriverClass.get(),DSID_JDBCDRIVERCLASS,bChangedSomething);
dbaccess/source/ui/dlg/detailpages.cxx:407:
fillString(*_rSet,m_xEDHostname.get(),DSID_CONN_HOSTNAME,bChangedSomething);
dbaccess/source/ui/dlg/detailpages.cxx:408:
fillString(*_rSet,m_xEDSocket.get(),DSID_CONN_SOCKET,bChangedSomething);
dbaccess/source/ui/dlg/detailpages.cxx:608:
fillString(*_rSet,m_xETBaseDN.get(),DSID_CONN_LDAP_BASEDN,bChangedSomething);

So I don't think that trimming these may be harmful.
Now we could also add a boolean fillString to indicated if a trim is needed
but does it worth it?

Change-Id: I6fa841a0c062d4b81a09549cbe865fd627d070cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128029
Tested-by: Jenkins
Reviewed-by: Lionel Mamane 

diff --git a/dbaccess/source/ui/dlg/adminpages.cxx 
b/dbaccess/source/ui/dlg/adminpages.cxx
index 9806c3d7199a..5f0eedbb0496 100644
--- a/dbaccess/source/ui/dlg/adminpages.cxx
+++ b/dbaccess/source/ui/dlg/adminpages.cxx
@@ -220,7 +220,7 @@ namespace dbaui
 {
 if (pEdit && pEdit->get_value_changed_from_saved())
 {
-_rSet.Put(SfxStringItem(_nID, pEdit->get_text()));
+_rSet.Put(SfxStringItem(_nID, pEdit->get_text().trim()));
 _bChangedSomething = true;
 }
 }
@@ -228,7 +228,7 @@ 

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

2021-12-26 Thread Julien Nabet (via logerrit)
 dbaccess/source/ui/app/AppController.cxx|2 +-
 dbaccess/source/ui/app/AppController.hxx|2 +-
 dbaccess/source/ui/app/AppControllerDnD.cxx |2 +-
 dbaccess/source/ui/app/AppControllerGen.cxx |4 ++--
 dbaccess/source/ui/dlg/CollectionView.cxx   |2 +-
 dbaccess/source/ui/inc/UITools.hxx  |2 +-
 dbaccess/source/ui/misc/UITools.cxx |6 +++---
 7 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit de47e94bf8468d0da4b39c6dab1281e750e6c426
Author: Julien Nabet 
AuthorDate: Sun Dec 26 18:13:20 2021 +0100
Commit: Julien Nabet 
CommitDate: Sun Dec 26 19:07:11 2021 +0100

Typo: insertHierachyElement->insertHierarchyElement

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

diff --git a/dbaccess/source/ui/app/AppController.cxx 
b/dbaccess/source/ui/app/AppController.cxx
index f6837cfdbe65..96e23f041d6d 100644
--- a/dbaccess/source/ui/app/AppController.cxx
+++ b/dbaccess/source/ui/app/AppController.cxx
@@ -1197,7 +1197,7 @@ void OApplicationController::Execute(sal_uInt16 _nId, 
const Sequence< PropertyVa
 {
 ElementType eType = getContainer()->getElementType();
 OUString sName = getContainer()->getQualifiedName( nullptr 
);
-insertHierachyElement(eType,sName);
+insertHierarchyElement(eType,sName);
 }
 break;
 case ID_NEW_VIEW_DESIGN:
diff --git a/dbaccess/source/ui/app/AppController.hxx 
b/dbaccess/source/ui/app/AppController.hxx
index cf9306cdb3a2..b7579c0cf156 100644
--- a/dbaccess/source/ui/app/AppController.hxx
+++ b/dbaccess/source/ui/app/AppController.hxx
@@ -316,7 +316,7 @@ namespace dbaui
 @return
  if the insert operations was successful, otherwise 
.
 */
-bool insertHierachyElement(  ElementType _eType
+bool insertHierarchyElement(  ElementType _eType
 ,const OUString& _sParentFolder
 ,bool _bCollection = true
 ,const css::uno::Reference< 
css::ucb::XContent>& _xContent = css::uno::Reference< css::ucb::XContent>()
diff --git a/dbaccess/source/ui/app/AppControllerDnD.cxx 
b/dbaccess/source/ui/app/AppControllerDnD.cxx
index 09919dda7e61..4ba805904387 100644
--- a/dbaccess/source/ui/app/AppControllerDnD.cxx
+++ b/dbaccess/source/ui/app/AppControllerDnD.cxx
@@ -786,7 +786,7 @@ bool OApplicationController::paste( ElementType _eType, 
const svx::ODataAccessDe
 {
 Reference xContent;
 _rPasteData[DataAccessDescriptorProperty::Component] >>= xContent;
-return 
insertHierachyElement(_eType,_sParentFolder,Reference(xContent,UNO_QUERY).is(),xContent,_bMove);
+return 
insertHierarchyElement(_eType,_sParentFolder,Reference(xContent,UNO_QUERY).is(),xContent,_bMove);
 }
 }
 catch(const SQLException&) { showError( SQLExceptionInfo( 
::cppu::getCaughtException() ) ); }
diff --git a/dbaccess/source/ui/app/AppControllerGen.cxx 
b/dbaccess/source/ui/app/AppControllerGen.cxx
index 3ec1094eeb9e..44e1a3b9666e 100644
--- a/dbaccess/source/ui/app/AppControllerGen.cxx
+++ b/dbaccess/source/ui/app/AppControllerGen.cxx
@@ -580,10 +580,10 @@ void OApplicationController::onDocumentOpened( const 
OUString& _rName, const sal
 }
 }
 
-bool OApplicationController::insertHierachyElement(ElementType _eType, const 
OUString& _sParentFolder, bool _bCollection, const Reference& 
_xContent, bool _bMove)
+bool OApplicationController::insertHierarchyElement(ElementType _eType, const 
OUString& _sParentFolder, bool _bCollection, const Reference& 
_xContent, bool _bMove)
 {
 Reference xNames(getElements(_eType), 
UNO_QUERY);
-return dbaui::insertHierachyElement(getFrameWeld()
+return dbaui::insertHierarchyElement(getFrameWeld()
,getORB()
,xNames
,_sParentFolder
diff --git a/dbaccess/source/ui/dlg/CollectionView.cxx 
b/dbaccess/source/ui/dlg/CollectionView.cxx
index 75973ad1e780..0ca6502ca93e 100644
--- a/dbaccess/source/ui/dlg/CollectionView.cxx
+++ b/dbaccess/source/ui/dlg/CollectionView.cxx
@@ -177,7 +177,7 @@ IMPL_LINK_NOARG(OCollectionView, NewFolder_Click, 
weld::Button&, void)
 try
 {
 Reference 
xNameContainer(m_xContent,UNO_QUERY);
-if ( 
dbaui::insertHierachyElement(m_xDialog.get(),m_xContext,xNameContainer,OUString(),m_bCreateForm)
 )
+if ( 
dbaui::insertHierarchyElement(m_xDialog.get(),m_xContext,xNameContainer,OUString(),m_bCreateForm)
 )
 Initialize();
 }
 catch( const SQLException& )
diff --git a/dbaccess/source/ui/inc/UITools.hxx 
b/dbaccess/source/ui/inc/UITools.hxx
index 0a0918ab99b0..34249933f9b6 100644
--- 

[Libreoffice-commits] core.git: dbaccess/source desktop/source drawinglayer/source

2021-12-21 Thread Noel Grandin (via logerrit)
 dbaccess/source/core/api/tablecontainer.cxx|   30 +--
 dbaccess/source/filter/xml/xmlfilter.cxx   |   56 ++---
 dbaccess/source/ui/app/AppController.cxx   |  123 ++--
 dbaccess/source/ui/browser/unodatbr.cxx|  126 ++---
 dbaccess/source/ui/dlg/indexdialog.cxx |   36 +--
 dbaccess/source/ui/misc/WTypeSelect.cxx|   26 +-
 dbaccess/source/ui/querydesign/QueryDesignView.cxx |   33 +--
 dbaccess/source/ui/tabledesign/TableRow.cxx|   85 
 desktop/source/deployment/gui/dp_gui_extlistbox.cxx|   48 ++--
 desktop/source/deployment/misc/dp_interact.cxx |   40 ++--
 desktop/source/deployment/registry/script/dp_script.cxx|   46 ++--
 desktop/source/lib/init.cxx|   84 
 drawinglayer/source/primitive2d/borderlineprimitive2d.cxx  |   24 +-
 drawinglayer/source/primitive2d/controlprimitive2d.cxx |   49 ++---
 drawinglayer/source/primitive2d/sceneprimitive2d.cxx   |   58 ++---
 drawinglayer/source/primitive2d/svggradientprimitive2d.cxx |   58 ++---
 drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx |   32 +--
 17 files changed, 471 insertions(+), 483 deletions(-)

New commits:
commit 82233965486f88f4ce1313dcf35b4bc688e1832a
Author: Noel Grandin 
AuthorDate: Tue Dec 21 13:51:03 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Dec 21 17:14:42 2021 +0100

loplugin:flatten in desktop..drawinglayer

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

diff --git a/dbaccess/source/core/api/tablecontainer.cxx 
b/dbaccess/source/core/api/tablecontainer.cxx
index 7aefea3e2306..9bcf4b610eec 100644
--- a/dbaccess/source/core/api/tablecontainer.cxx
+++ b/dbaccess/source/core/api/tablecontainer.cxx
@@ -62,26 +62,24 @@ namespace
 bool lcl_isPropertySetDefaulted(const Sequence< OUString>& _aNames,const 
Reference& _xProp)
 {
 Reference xState(_xProp,UNO_QUERY);
-if ( xState.is() )
+if ( !xState )
+return false;
+const OUString* pIter = _aNames.getConstArray();
+const OUString* pEnd   = pIter + _aNames.getLength();
+for(;pIter != pEnd;++pIter)
 {
-const OUString* pIter = _aNames.getConstArray();
-const OUString* pEnd   = pIter + _aNames.getLength();
-for(;pIter != pEnd;++pIter)
+try
 {
-try
-{
-PropertyState aState = xState->getPropertyState(*pIter);
-if ( aState != PropertyState_DEFAULT_VALUE )
-break;
-}
-catch(const Exception&)
-{
-TOOLS_WARN_EXCEPTION("dbaccess", "" );
-}
+PropertyState aState = xState->getPropertyState(*pIter);
+if ( aState != PropertyState_DEFAULT_VALUE )
+break;
+}
+catch(const Exception&)
+{
+TOOLS_WARN_EXCEPTION("dbaccess", "" );
 }
-return ( pIter == pEnd );
 }
-return false;
+return ( pIter == pEnd );
 }
 }
 
diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx 
b/dbaccess/source/filter/xml/xmlfilter.cxx
index 88765c186961..6848d5a1bb2d 100644
--- a/dbaccess/source/filter/xml/xmlfilter.cxx
+++ b/dbaccess/source/filter/xml/xmlfilter.cxx
@@ -132,42 +132,40 @@ static ErrCode ReadThroughComponent(
 OSL_ENSURE( xStorage.is(), "Need storage!");
 OSL_ENSURE(nullptr != pStreamName, "Please, please, give me a name!");
 
-if ( xStorage.is() )
-{
-uno::Reference< io::XStream > xDocStream;
+if ( !xStorage )
+// TODO/LATER: better error handling
+return ErrCode(1);
 
-try
-{
-// open stream (and set parser input)
-OUString sStreamName = OUString::createFromAscii(pStreamName);
-if ( !xStorage->hasByName( sStreamName ) || 
!xStorage->isStreamElement( sStreamName ) )
-{
-// stream name not found! return immediately with OK signal
-return ERRCODE_NONE;
-}
+uno::Reference< io::XStream > xDocStream;
 
-// get input stream
-xDocStream = xStorage->openStreamElement( sStreamName, 
embed::ElementModes::READ );
-}
-catch (const packages::WrongPasswordException&)
-{
-return ERRCODE_SFX_WRONGPASSWORD;
-}
-catch (const uno::Exception&)
+try
+{
+// open stream (and set parser input)
+OUString sStreamName = OUString::createFromAscii(pStreamName);
+if ( !xStorage->hasByName( sStreamName ) || 
!xStorage->isStreamElement( sStreamName ) )
 {
- 

  1   2   3   4   5   6   7   8   9   10   >