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

2023-05-27 Thread Eike Rathke (via logerrit)
 include/tools/datetime.hxx |3 ++
 tools/source/datetime/datetime.cxx |   48 +++--
 2 files changed, 18 insertions(+), 33 deletions(-)

New commits:
commit 7e3ddf1e5aae5e4e956495e3d86a8cbf6e251b5e
Author: Eike Rathke 
AuthorDate: Sat May 27 23:14:30 2023 +0200
Commit: Eike Rathke 
CommitDate: Sun May 28 03:49:55 2023 +0200

Factor out DateTime::NormalizeTimeRemainderAndApply(tools::Time& rTime)

Change-Id: Ie520b10baaeb4c94973c44435c3241e5d2254968
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152345
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/include/tools/datetime.hxx b/include/tools/datetime.hxx
index 7b78b29bdfc5..dd435e3994ba 100644
--- a/include/tools/datetime.hxx
+++ b/include/tools/datetime.hxx
@@ -83,6 +83,9 @@ public:
 voidAddTime( double fTimeInDays );
 DateTime&   operator +=( const tools::Time& rTime );
 DateTime&   operator -=( const tools::Time& rTime );
+private:
+voidNormalizeTimeRemainderAndApply( tools::Time& rTime );
+public:
 
 TOOLS_DLLPUBLIC friend DateTime operator +( const DateTime& rDateTime, 
sal_Int32 nDays );
 TOOLS_DLLPUBLIC friend DateTime operator -( const DateTime& rDateTime, 
sal_Int32 nDays );
diff --git a/tools/source/datetime/datetime.cxx 
b/tools/source/datetime/datetime.cxx
index efdb928986c3..47dc0555bc87 100644
--- a/tools/source/datetime/datetime.cxx
+++ b/tools/source/datetime/datetime.cxx
@@ -94,33 +94,37 @@ sal_Int64 DateTime::GetSecFromDateTime( const Date& rDate ) 
const
 }
 }
 
-DateTime& DateTime::operator +=( const tools::Time& rTime )
+void DateTime::NormalizeTimeRemainderAndApply( tools::Time& rTime )
 {
-tools::Time aTime = *this;
-aTime += rTime;
-sal_uInt16 nHours = aTime.GetHour();
-if ( aTime.GetTime() > 0 )
+sal_uInt16 nHours = rTime.GetHour();
+if ( rTime.GetTime() > 0 )
 {
 if (nHours >= 24)
 {
 AddDays( nHours / 24 );
 nHours %= 24;
-aTime.SetHour( nHours );
+rTime.SetHour( nHours );
 }
 }
-else if ( aTime.GetTime() != 0 )
+else if ( rTime.GetTime() != 0 )
 {
 if (nHours >= 24)
 {
 AddDays( -static_cast(nHours) / 24 );
 nHours %= 24;
-aTime.SetHour( nHours );
+rTime.SetHour( nHours );
 }
 Date::operator--();
-aTime = Time( 24, 0, 0 )+aTime;
+rTime = Time( 24, 0, 0 ) + rTime;
 }
-tools::Time::operator=( aTime );
+tools::Time::operator=( rTime );
+}
 
+DateTime& DateTime::operator +=( const tools::Time& rTime )
+{
+tools::Time aTime = *this;
+aTime += rTime;
+NormalizeTimeRemainderAndApply(aTime);
 return *this;
 }
 
@@ -128,29 +132,7 @@ DateTime& DateTime::operator -=( const tools::Time& rTime )
 {
 tools::Time aTime = *this;
 aTime -= rTime;
-sal_uInt16 nHours = aTime.GetHour();
-if ( aTime.GetTime() > 0 )
-{
-if (nHours >= 24)
-{
-AddDays( nHours / 24 );
-nHours %= 24;
-aTime.SetHour( nHours );
-}
-}
-else if ( aTime.GetTime() != 0 )
-{
-if (nHours >= 24)
-{
-AddDays( -static_cast(nHours) / 24 );
-nHours %= 24;
-aTime.SetHour( nHours );
-}
-Date::operator--();
-aTime = Time( 24, 0, 0 )+aTime;
-}
-tools::Time::operator=( aTime );
-
+NormalizeTimeRemainderAndApply(aTime);
 return *this;
 }
 


Re: [libreoffice-marketing] Development will branch off of 7.6 on Jun 5. Please communicate the next version number

2023-05-27 Thread Italo Vignoli

On 26/05/23 12:46, Justin Luth wrote:


It would be nice to have the proper next version number (after 7.6)
ready when master branches in a few weeks, and for the new release plan.
Has that been finalized yet? If not, can we get the decision made before
7.6 branches off? NOW is the appropriate time for deciding if we go to
7.7, or 8.0 or 24.02. (Justin)



+ my option (Justin): 24.02 is fine - good fit for regular, timed releases.


The next major release after LibreOffice 7.6 will be LibreOffice 24.2 
(February), which will be followed by LibreOffice 24.8 (August)


* Given the current level of maturity of the LibreOffice Technology 
development platform, it is increasingly difficult to provide a number 
of significant new features for each major release based on the current 
numbering scheme (while new features are key for media coverage, if we 
maintain the current numbering scheme)


* By choosing a calendar based numbering scheme, we decouple the 
expectation of significant new features from each new major release: if 
we have significant new features they will be welcomed by the media, but 
if we don't have them the media will not be disappointed (and will write 
about LibreOffice)


* We have already started to adapt our communication strategy to the new 
numbering scheme by meeting journalists independently from announcements


* At LibreOffice Conference we will provide additional information about 
the communication strategy, and how this will help increasing the update 
frequency by users (which is now rather low, apart from a very small 
percentage of users)

--
Italo Vignoli - it...@vignoli.org
mobile/signal +39.348.5653829
hangout/jabber italo.vign...@gmail.com
GPG Key ID - 0xAAB8D5C0
DB75 1534 3FD0 EA5F 56B5 FDA6 DE82 934C AAB8 D5C0



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

2023-05-27 Thread Caolán McNamara (via logerrit)
 sw/source/uibase/uiview/viewtab.cxx |   19 +++
 1 file changed, 11 insertions(+), 8 deletions(-)

New commits:
commit 20873f073ae4a9478f0a84355f779a2176bd2ec8
Author: Caolán McNamara 
AuthorDate: Sat May 27 16:17:32 2023 +0100
Commit: Caolán McNamara 
CommitDate: Sat May 27 22:17:19 2023 +0200

cid#1448540 Dereference null return value

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

diff --git a/sw/source/uibase/uiview/viewtab.cxx 
b/sw/source/uibase/uiview/viewtab.cxx
index 87cac898cf1d..d99e27f7fb58 100644
--- a/sw/source/uibase/uiview/viewtab.cxx
+++ b/sw/source/uibase/uiview/viewtab.cxx
@@ -2467,15 +2467,18 @@ void SwView::StateTabWin(SfxItemSet& rSet)
 const SwFormatFooter& rFooter = rDesc.GetMaster().GetFooter();
 bool bFooterOn = rFooter.IsActive();
 rSet.Put( SfxBoolItem(SID_ATTR_PAGE_FOOTER, bFooterOn ) );
-if(bFooterOn)
+if (bFooterOn)
 {
-const SvxLRSpaceItem* rLR = 
rFooter.GetFooterFormat()->GetAttrSet().GetItem(SID_ATTR_LRSPACE);
-const SvxULSpaceItem* rUL = 
rFooter.GetFooterFormat()->GetAttrSet().GetItem(SID_ATTR_ULSPACE);
-SvxLongLRSpaceItem aLR(rLR->GetLeft(), rLR->GetRight(), 
SID_ATTR_PAGE_FOOTER_LRMARGIN);
-rSet.Put(aLR);
-SvxLongULSpaceItem aUL( rUL->GetUpper(), rUL->GetLower(), 
SID_ATTR_PAGE_FOOTER_SPACING);
-rSet.Put(aUL);
-
+if (const SvxLRSpaceItem* rLR = 
rFooter.GetFooterFormat()->GetAttrSet().GetItem(SID_ATTR_LRSPACE))
+{
+SvxLongLRSpaceItem aLR(rLR->GetLeft(), rLR->GetRight(), 
SID_ATTR_PAGE_FOOTER_LRMARGIN);
+rSet.Put(aLR);
+}
+if (const SvxULSpaceItem* rUL = 
rFooter.GetFooterFormat()->GetAttrSet().GetItem(SID_ATTR_ULSPACE))
+{
+SvxLongULSpaceItem aUL( rUL->GetUpper(), rUL->GetLower(), 
SID_ATTR_PAGE_FOOTER_SPACING);
+rSet.Put(aUL);
+}
 bool bShared = !rDesc.IsFooterShared();
 bool bFirst = !rDesc.IsFirstShared(); // FIXME control changes 
for both header footer - tdf#100287
 sal_uInt16 nLayout = (static_cast(bShared)<<1) + 
static_cast(bFirst);


[Libreoffice-commits] core.git: 2 commits - include/editeng sc/source

2023-05-27 Thread Caolán McNamara (via logerrit)
 include/editeng/svxrtf.hxx|2 +-
 sc/source/filter/oox/autofilterbuffer.cxx |   10 ++
 2 files changed, 7 insertions(+), 5 deletions(-)

New commits:
commit fc1eb075a5bbddebd3359dae79713af3094bfd38
Author: Caolán McNamara 
AuthorDate: Sat May 27 16:16:24 2023 +0100
Commit: Caolán McNamara 
CommitDate: Sat May 27 20:57:05 2023 +0200

cid#1531780 Dereference null return value

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

diff --git a/sc/source/filter/oox/autofilterbuffer.cxx 
b/sc/source/filter/oox/autofilterbuffer.cxx
index 8c8050509f38..9fa6de21d46b 100644
--- a/sc/source/filter/oox/autofilterbuffer.cxx
+++ b/sc/source/filter/oox/autofilterbuffer.cxx
@@ -440,10 +440,12 @@ ApiFilterSettings ColorFilter::finalizeImport()
 
 const SfxItemSet& rItemSet = pStyleSheet->GetItemSet();
 // Color (whether text or background color) is always stored in 
ATTR_BACKGROUND
-const SvxBrushItem* pItem = 
rItemSet.GetItem(ATTR_BACKGROUND);
-::Color aColor = pItem->GetFiltColor();
-util::Color nColor(aColor);
-aSettings.appendField(true, nColor, mbIsBackgroundColor);
+if (const SvxBrushItem* pItem = 
rItemSet.GetItem(ATTR_BACKGROUND))
+{
+::Color aColor = pItem->GetFiltColor();
+util::Color nColor(aColor);
+aSettings.appendField(true, nColor, mbIsBackgroundColor);
+}
 return aSettings;
 }
 
commit 2743839c4ac3aaaf6bafc31bebfb67254173f7ee
Author: Caolán McNamara 
AuthorDate: Sat May 27 16:12:18 2023 +0100
Commit: Caolán McNamara 
CommitDate: Sat May 27 20:56:57 2023 +0200

ofz#59362 aPardMap returns 0 'Which' for SID_ATTR_BORDER_OUTER

since:

commit 839c5010241842835a1c066be0838df4a8a53dc7
Date:   Wed May 24 16:40:59 2023 +0200

use more TypedWhichId in editeng

cause operato[] is just a getter now

Change-Id: I2c5cc21131dffd0e9840b65185c2491ed6183bd1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152341
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
Reviewed-by: Caolán McNamara 

diff --git a/include/editeng/svxrtf.hxx b/include/editeng/svxrtf.hxx
index a70264381d51..33e6eaf32b11 100644
--- a/include/editeng/svxrtf.hxx
+++ b/include/editeng/svxrtf.hxx
@@ -212,7 +212,7 @@ public:
 void SetAttrPool( SfxItemPool* pNewPool )   { pAttrPool = pNewPool; }
 // to set different WhichIds for a different pool.
 template
-void SetPardMap(TypedWhichId wid, TypedWhichId widTrue) { 
aPardMap[wid] = widTrue; }
+void SetPardMap(TypedWhichId wid, TypedWhichId widTrue) { 
aPardMap.set(wid, widTrue); }
 // to be able to assign them from the outside as for example table cells
 void ReadBorderAttr( int nToken, SfxItemSet& rSet, bool bTableDef=false );
 void ReadBackgroundAttr( int nToken, SfxItemSet& rSet, bool 
bTableDef=false  );


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

2023-05-27 Thread Mike Kaganski (via logerrit)
 testtools/source/bridgetest/bridgetest.cxx   |3 +--
 testtools/source/bridgetest/constructors.cxx |4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 42a5f14edcea5d2fd2e92955cd70a163a1a27804
Author: Mike Kaganski 
AuthorDate: Sun Apr 23 20:15:11 2023 +0300
Commit: Mike Kaganski 
CommitDate: Sat May 27 20:14:56 2023 +0200

Use getXWeak in testtools

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

diff --git a/testtools/source/bridgetest/bridgetest.cxx 
b/testtools/source/bridgetest/bridgetest.cxx
index 7de0ee794720..9e3eb90c1de9 100644
--- a/testtools/source/bridgetest/bridgetest.cxx
+++ b/testtools/source/bridgetest/bridgetest.cxx
@@ -1303,8 +1303,7 @@ Sequence< OUString > 
TestBridgeImpl::getSupportedServiceNames()
 static Reference< XInterface > TestBridgeImpl_create(
 const Reference< XComponentContext > & xContext )
 {
-return Reference< XInterface >(
-static_cast< OWeakObject * >( new TestBridgeImpl( xContext ) ) );
+return getXWeak( new TestBridgeImpl( xContext ) );
 }
 
 }
diff --git a/testtools/source/bridgetest/constructors.cxx 
b/testtools/source/bridgetest/constructors.cxx
index 04b953fff0e2..47be30649a42 100644
--- a/testtools/source/bridgetest/constructors.cxx
+++ b/testtools/source/bridgetest/constructors.cxx
@@ -407,7 +407,7 @@ css::uno::Reference< css::uno::XInterface > create(
 SAL_UNUSED_PARAMETER css::uno::Reference< css::uno::XComponentContext >
 const &)
 {
-return static_cast< ::cppu::OWeakObject * >(new Impl);
+return getXWeak(new Impl);
 }
 
 OUString getImplementationName() {
@@ -423,7 +423,7 @@ css::uno::Reference< css::uno::XInterface > create2(
 SAL_UNUSED_PARAMETER css::uno::Reference< css::uno::XComponentContext >
 const &)
 {
-return static_cast< ::cppu::OWeakObject * >(new Impl2);
+return getXWeak(new Impl2);
 }
 
 OUString getImplementationName2() {


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

2023-05-27 Thread Mike Kaganski (via logerrit)
 ucbhelper/source/provider/contenthelper.cxx   |   12 ++--
 ucbhelper/source/provider/resultset.cxx   |4 ++--
 ucbhelper/source/provider/resultsethelper.cxx |2 +-
 3 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit d4182557b5cba1d56041792dfddbd89a131f6ada
Author: Mike Kaganski 
AuthorDate: Sun Apr 23 20:15:21 2023 +0300
Commit: Mike Kaganski 
CommitDate: Sat May 27 20:14:40 2023 +0200

Use getXWeak in ucbhelper

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

diff --git a/ucbhelper/source/provider/contenthelper.cxx 
b/ucbhelper/source/provider/contenthelper.cxx
index 3a8b8f19a604..1e5147f6fb7b 100644
--- a/ucbhelper/source/provider/contenthelper.cxx
+++ b/ucbhelper/source/provider/contenthelper.cxx
@@ -455,7 +455,7 @@ void SAL_CALL ContentImplHelper::addProperty(
  m_pImpl->m_pPropSetChangeListeners->getLength() )
 {
 beans::PropertySetInfoChangeEvent evt(
-static_cast< cppu::OWeakObject * >( this ),
+getXWeak(),
 Name,
 -1, // No handle available
 beans::PropertySetInfoChange::PROPERTY_INSERTED );
@@ -551,7 +551,7 @@ void SAL_CALL ContentImplHelper::removeProperty( const 
OUString& Name )
  m_pImpl->m_pPropSetChangeListeners->getLength() )
 {
 beans::PropertySetInfoChangeEvent evt(
-static_cast< cppu::OWeakObject * >( this ),
+getXWeak(),
 Name,
 -1, // No handle available
 beans::PropertySetInfoChange::PROPERTY_REMOVED );
@@ -752,7 +752,7 @@ void ContentImplHelper::inserted()
 if ( xParent.is() )
 {
 css::ucb::ContentEvent aEvt(
-static_cast< cppu::OWeakObject * >( xParent.get() ), // Source
+xParent->getXWeak(), // Source
 css::ucb::ContentAction::INSERTED,// Action
 this,// Content
 xParent->getIdentifier() );  // Id
@@ -771,7 +771,7 @@ void ContentImplHelper::deleted()
 {
 // Let parent notify "REMOVED" event.
 css::ucb::ContentEvent aEvt(
-static_cast< cppu::OWeakObject * >( xParent.get() ),
+xParent->getXWeak(),
 css::ucb::ContentAction::REMOVED,
 this,
 xParent->getIdentifier());
@@ -780,7 +780,7 @@ void ContentImplHelper::deleted()
 
 // Notify "DELETED" event.
 css::ucb::ContentEvent aEvt1(
-static_cast< cppu::OWeakObject * >( this ),
+getXWeak(),
 css::ucb::ContentAction::DELETED,
 this,
 getIdentifier() );
@@ -818,7 +818,7 @@ bool ContentImplHelper::exchange(
 
 // Notify "EXCHANGED" event.
 css::ucb::ContentEvent aEvt(
-static_cast< cppu::OWeakObject * >( this ),
+getXWeak(),
 css::ucb::ContentAction::EXCHANGED,
 this,
 xOldId );
diff --git a/ucbhelper/source/provider/resultset.cxx 
b/ucbhelper/source/provider/resultset.cxx
index b443a32e1b39..61682f4fd539 100644
--- a/ucbhelper/source/provider/resultset.cxx
+++ b/ucbhelper/source/provider/resultset.cxx
@@ -1329,7 +1329,7 @@ void ResultSet::rowCountChanged( sal_uInt32 nOld, 
sal_uInt32 nNew )
 
 propertyChanged(
 beans::PropertyChangeEvent(
-static_cast< cppu::OWeakObject * >( this ),
+getXWeak(),
 "RowCount",
 false,
 1001,
@@ -1345,7 +1345,7 @@ void ResultSet::rowCountFinal()
 
 propertyChanged(
 beans::PropertyChangeEvent(
-static_cast< cppu::OWeakObject * >( this ),
+getXWeak(),
 "IsRowCountFinal",
 false,
 1000,
diff --git a/ucbhelper/source/provider/resultsethelper.cxx 
b/ucbhelper/source/provider/resultsethelper.cxx
index 3d45f8a5a8a3..788e6811a100 100644
--- a/ucbhelper/source/provider/resultsethelper.cxx
+++ b/ucbhelper/source/provider/resultsethelper.cxx
@@ -169,7 +169,7 @@ void SAL_CALL ResultSetImplHelper::setListener(
 
 Listener->notify(
 css::ucb::ListEvent(
-static_cast< cppu::OWeakObject * >( this ), aActions ) );
+getXWeak(), aActions ) );
 }
 
 


[Libreoffice-commits] core.git: io/source io/test

2023-05-27 Thread Mike Kaganski (via logerrit)
 io/source/stm/opump.cxx  |4 ++--
 io/test/stm/datatest.cxx |9 +++--
 io/test/stm/marktest.cxx |6 ++
 io/test/stm/pipetest.cxx |4 +---
 4 files changed, 8 insertions(+), 15 deletions(-)

New commits:
commit 87276a497d9aa8a3f8ac0bfceb75d64938945f9a
Author: Mike Kaganski 
AuthorDate: Sun Apr 23 20:14:07 2023 +0300
Commit: Mike Kaganski 
CommitDate: Sat May 27 18:08:00 2023 +0200

Use getXWeak in io

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

diff --git a/io/source/stm/opump.cxx b/io/source/stm/opump.cxx
index fc751b677f95..df3e6132319d 100644
--- a/io/source/stm/opump.cxx
+++ b/io/source/stm/opump.cxx
@@ -263,14 +263,14 @@ void Pump::run()
 
 if( ! rInput.is() )
 {
-throw NotConnectedException( "no input stream set", 
static_cast(this) );
+throw NotConnectedException( "no input stream set", getXWeak() 
);
 }
 Sequence< sal_Int8 > aData;
 while( rInput->readSomeBytes( aData, 65536 ) )
 {
 if( ! rOutput.is() )
 {
-throw NotConnectedException( "no output stream set", 
static_cast(this) );
+throw NotConnectedException( "no output stream set", 
getXWeak() );
 }
 rOutput->writeBytes( aData );
 osl_yieldThread();
diff --git a/io/test/stm/datatest.cxx b/io/test/stm/datatest.cxx
index a085bf6d7d5b..ef31f099d496 100644
--- a/io/test/stm/datatest.cxx
+++ b/io/test/stm/datatest.cxx
@@ -326,8 +326,7 @@ void ODataStreamTest::testSimple(   const Reference < 
XDataInputStream > &rInput
 **/
 Reference < XInterface > SAL_CALL ODataStreamTest_CreateInstance( const 
Reference < XMultiServiceFactory > & rSMgr ) throw(Exception)
 {
-ODataStreamTest *p = new ODataStreamTest( rSMgr );
-return Reference < XInterface > ( (static_cast< OWeakObject *  >(p)) );
+return getXWeak(new ODataStreamTest( rSMgr ));
 }
 
 Sequence ODataStreamTest_getSupportedServiceNames( int i) throw ()
@@ -596,8 +595,7 @@ Reference < XInterface > SAL_CALL 
OMyPersistObject_CreateInstance(
 const Reference < XMultiServiceFactory > & rSMgr )
 throw(Exception)
 {
-MyPersistObject *p = new MyPersistObject( );
-return Reference < XInterface > ( (static_cast< OWeakObject *  >(p)) );
+return getXWeak(new MyPersistObject( ));
 }
 
 Sequence OMyPersistObject_getSupportedServiceNames( ) throw ()
@@ -1040,8 +1038,7 @@ void OObjectStreamTest::testObject( const Reference<  
XObjectOutputStream >
 
 Reference < XInterface > SAL_CALL OObjectStreamTest_CreateInstance( const 
Reference < XMultiServiceFactory > & rSMgr ) throw(Exception)
 {
-OObjectStreamTest *p = new OObjectStreamTest( rSMgr );
-return Reference < XInterface > ( (static_cast< OWeakObject *  >(p)) );
+return getXWeak(new OObjectStreamTest( rSMgr ));
 }
 
 Sequence OObjectStreamTest_getSupportedServiceNames( int i) throw ()
diff --git a/io/test/stm/marktest.cxx b/io/test/stm/marktest.cxx
index fbfc2008214f..0dd01a7f7747 100644
--- a/io/test/stm/marktest.cxx
+++ b/io/test/stm/marktest.cxx
@@ -360,8 +360,7 @@ void OMarkableOutputStreamTest::testSimple( const 
Reference< XOutputStream >
 **/
 Reference < XInterface > SAL_CALL OMarkableOutputStreamTest_CreateInstance( 
const Reference< XMultiServiceFactory > & rSMgr ) throw(Exception)
 {
-OMarkableOutputStreamTest *p = new OMarkableOutputStreamTest( rSMgr );
-return Reference < XInterface > ( (static_cast< OWeakObject *  >(p)) );
+return getXWeak(new OMarkableOutputStreamTest( rSMgr ));
 }
 
 
@@ -619,8 +618,7 @@ void OMarkableInputStreamTest::testSimple(  const 
Reference< XOutputStream >
 **/
 Reference < XInterface > SAL_CALL OMarkableInputStreamTest_CreateInstance( 
const Reference< XMultiServiceFactory > & rSMgr ) throw(Exception)
 {
-OMarkableInputStreamTest *p = new OMarkableInputStreamTest( rSMgr );
-return Reference < XInterface > ( (static_cast< OWeakObject *  >(p)) );
+return getXWeak(new OMarkableInputStreamTest( rSMgr ));
 }
 
 
diff --git a/io/test/stm/pipetest.cxx b/io/test/stm/pipetest.cxx
index 46637f3f245a..da5c5f20ba49 100644
--- a/io/test/stm/pipetest.cxx
+++ b/io/test/stm/pipetest.cxx
@@ -392,9 +392,7 @@ void OPipeTest::testMultithreading( const Reference < 
XInterface > &r )
 **/
 Reference < XInterface > SAL_CALL OPipeTest_CreateInstance( const Reference< 
XMultiServiceFactory>  & rSMgr ) throw (Exception)
 {
-OPipeTest *p = new OPipeTest( rSMgr );
-Reference< XInterface > x ( (static_cast< OWeakObject *  >(p)) );
-return x;
+return getXWeak(new OPipeTest( rSMgr ));
 }
 
 


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

2023-05-27 Thread Mike Kaganski (via logerrit)
 fpicker/source/aqua/SalAquaFolderPicker.mm |4 ++--
 fpicker/source/office/OfficeFilePicker.cxx |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit efcbd2306f0310809f2d6f1db086b839055c77f6
Author: Mike Kaganski 
AuthorDate: Sun Apr 23 20:13:53 2023 +0300
Commit: Mike Kaganski 
CommitDate: Sat May 27 17:09:53 2023 +0200

Use getXWeak in fpicker

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

diff --git a/fpicker/source/aqua/SalAquaFolderPicker.mm 
b/fpicker/source/aqua/SalAquaFolderPicker.mm
index 3dabf488a365..00021a487398 100644
--- a/fpicker/source/aqua/SalAquaFolderPicker.mm
+++ b/fpicker/source/aqua/SalAquaFolderPicker.mm
@@ -79,7 +79,7 @@ sal_Int16 SAL_CALL SalAquaFolderPicker::execute()
 break;
 
 default:
-throw uno::RuntimeException("The dialog returned with an unknown 
result!", static_cast< cppu::OWeakObject * >( this ));
+throw uno::RuntimeException("The dialog returned with an unknown 
result!", getXWeak());
 break;
 }
 
@@ -117,7 +117,7 @@ OUString SAL_CALL SalAquaFolderPicker::getDirectory()
 SAL_INFO("fpicker.aqua", "# of items: " << nFiles);
 
 if (nFiles < 1) {
-throw uno::RuntimeException("no directory selected", static_cast< 
cppu::OWeakObject * >( this ));
+throw uno::RuntimeException("no directory selected", getXWeak());
 }
 
 OUString aDirectory;
diff --git a/fpicker/source/office/OfficeFilePicker.cxx 
b/fpicker/source/office/OfficeFilePicker.cxx
index 6d84f92af512..723a8a279918 100644
--- a/fpicker/source/office/OfficeFilePicker.cxx
+++ b/fpicker/source/office/OfficeFilePicker.cxx
@@ -881,7 +881,7 @@ void SAL_CALL SvtFilePicker::appendFilterGroup( const 
OUString& sGroupTitle,
 if ( FilterNameExists( aFilters ) )
 throw IllegalArgumentException(
 "filter name exists",
-static_cast< OWeakObject * >(this), 1);
+getXWeak(), 1);
 
 // ensure that we have a filter list
 OUString sInitialCurrentFilter;


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

2023-05-27 Thread Mike Kaganski (via logerrit)
 UnoControls/source/base/basecontainercontrol.cxx |2 +-
 UnoControls/source/controls/framecontrol.cxx |2 +-
 UnoControls/source/controls/statusindicator.cxx  |4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 5c1c768e128d9356cbe17adb96ef6290ec3bb1ad
Author: Mike Kaganski 
AuthorDate: Sun Apr 23 20:15:24 2023 +0300
Commit: Mike Kaganski 
CommitDate: Sat May 27 15:20:51 2023 +0200

Use getXWeak in UnoControls

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

diff --git a/UnoControls/source/base/basecontainercontrol.cxx 
b/UnoControls/source/base/basecontainercontrol.cxx
index 7a6bd508e5b8..bf638a9c56a4 100644
--- a/UnoControls/source/base/basecontainercontrol.cxx
+++ b/UnoControls/source/base/basecontainercontrol.cxx
@@ -185,7 +185,7 @@ void SAL_CALL BaseContainerControl::addControl ( const 
OUString& rName, const Re
 maControlInfoList.emplace_back( aNewControl );
 
 // initialize new control
-aNewControl.xControl->setContext   ( static_cast(this)   
 );
+aNewControl.xControl->setContext   (getXWeak());
 aNewControl.xControl->addEventListener ( static_cast< XEventListener* >( 
static_cast< XWindowListener* >( this ) ) );
 
 // when container has a peer...
diff --git a/UnoControls/source/controls/framecontrol.cxx 
b/UnoControls/source/controls/framecontrol.cxx
index 54a0f36f6d05..87dd4a07f6f9 100644
--- a/UnoControls/source/controls/framecontrol.cxx
+++ b/UnoControls/source/controls/framecontrol.cxx
@@ -252,7 +252,7 @@ sal_Bool FrameControl::convertFastPropertyValue(
Any&rConvertedVa
 
 if ( !bReturn )
 {
-throw IllegalArgumentException("unknown handle " + 
OUString::number(nHandle), static_cast(this), 1);
+throw IllegalArgumentException("unknown handle " + 
OUString::number(nHandle), getXWeak(), 1);
 }
 
 return bReturn;
diff --git a/UnoControls/source/controls/statusindicator.cxx 
b/UnoControls/source/controls/statusindicator.cxx
index ac4b1c86b7b2..448b193d9a61 100644
--- a/UnoControls/source/controls/statusindicator.cxx
+++ b/UnoControls/source/controls/statusindicator.cxx
@@ -139,7 +139,7 @@ void SAL_CALL StatusIndicator::start( const OUString& 
sText, sal_Int32 nRange )
 m_xText->setText( sText );
 m_xProgressBar->setRange( 0, nRange );
 // force repaint ... fixedtext has changed !
-impl_recalcLayout ( WindowEvent(static_cast< OWeakObject* 
>(this),0,0,impl_getWidth(),impl_getHeight(),0,0,0,0) );
+impl_recalcLayout ( 
WindowEvent(getXWeak(),0,0,impl_getWidth(),impl_getHeight(),0,0,0,0) );
 }
 
 //  XStatusIndicator
@@ -311,7 +311,7 @@ void SAL_CALL StatusIndicator::setPosSize (
)
 {
 // calc new layout for controls
-impl_recalcLayout ( WindowEvent(static_cast< OWeakObject* 
>(this),0,0,nWidth,nHeight,0,0,0,0) );
+impl_recalcLayout ( WindowEvent(getXWeak(),0,0,nWidth,nHeight,0,0,0,0) 
);
 // clear background (!)
 // [Children were repainted in "recalcLayout" by setPosSize() 
automatically!]
 getPeer()->invalidate(2);


[Libreoffice-commits] core.git: sw/qa sw/source

2023-05-27 Thread Mike Kaganski (via logerrit)
 sw/qa/extras/htmlexport/data/tableRight.fodt |   22 ++
 sw/qa/extras/htmlexport/htmlexport.cxx   |   14 ++
 sw/source/filter/html/htmltabw.cxx   |   18 ++
 3 files changed, 50 insertions(+), 4 deletions(-)

New commits:
commit 1aba7cd7385a08e450a4b86ce0b378be5eedb903
Author: Mike Kaganski 
AuthorDate: Sat May 27 11:02:06 2023 +0300
Commit: Mike Kaganski 
CommitDate: Sat May 27 15:19:47 2023 +0200

ReqIF: do not write 'align' attribute to 'div' element

To keep the alignment information, use 'style' in this case. Maybe it
makes sense to unify on 'style' also in normal case in a later change.

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

diff --git a/sw/qa/extras/htmlexport/data/tableRight.fodt 
b/sw/qa/extras/htmlexport/data/tableRight.fodt
new file mode 100644
index ..374364750f51
--- /dev/null
+++ b/sw/qa/extras/htmlexport/data/tableRight.fodt
@@ -0,0 +1,22 @@
+
+
+
+ 
+  
+   
+  
+ 
+ 
+  
+   This is a right aligned table:
+   
+
+
+ 
+ 
+
+   
+   
+  
+ 
+
\ No newline at end of file
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx 
b/sw/qa/extras/htmlexport/htmlexport.cxx
index 105b19c7ea8d..da0b8bd4c673 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -2645,6 +2645,20 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testTdf155496)
 CPPUNIT_ASSERT_EQUAL(OUString("list 1 item 1\n\t\tsub-header"), 
aContent.trim());
 }
 
+CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqIF_RightAlignedTable)
+{
+createSwDoc("tableRight.fodt");
+ExportToReqif();
+
+SvMemoryStream aStream;
+WrapReqifFromTempFile(aStream);
+xmlDocUniquePtr pDoc = parseXmlStream(&aStream);
+CPPUNIT_ASSERT(pDoc);
+
+// No 'align' attribute must be present in 'div'
+assertXPathNoAttribute(pDoc, 
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:div", "align");
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/html/htmltabw.cxx 
b/sw/source/filter/html/htmltabw.cxx
index db18995ebb25..d7e5e107969d 100644
--- a/sw/source/filter/html/htmltabw.cxx
+++ b/sw/source/filter/html/htmltabw.cxx
@@ -1113,10 +1113,20 @@ SwHTMLWriter& OutHTML_SwTableNode( SwHTMLWriter& rWrt, 
SwTableNode & rNode,
 }
 else
 {
-OStringLiteral sOut = OOO_STRING_SVTOOLS_HTML_division
-" " OOO_STRING_SVTOOLS_HTML_O_align "=\""
-OOO_STRING_SVTOOLS_HTML_AL_right "\"";
-HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), 
Concat2View(rWrt.GetNamespace() + sOut) );
+if (rWrt.mbReqIF)
+{
+// In ReqIF, div cannot have an 'align' attribute. For now, 
use 'style' only
+// for ReqIF; maybe it makes sense to use it in both cases?
+static constexpr char sOut[] = OOO_STRING_SVTOOLS_HTML_division
+" style=\"display: flex; flex-direction: column; 
align-items: flex-end\"";
+HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), 
Concat2View(rWrt.GetNamespace() + sOut));
+}
+else
+{
+static constexpr char sOut[] = OOO_STRING_SVTOOLS_HTML_division
+" " OOO_STRING_SVTOOLS_HTML_O_align "=\"" 
OOO_STRING_SVTOOLS_HTML_AL_right "\"";
+HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), 
Concat2View(rWrt.GetNamespace() + sOut));
+}
 }
 rWrt.IncIndentLevel();  // indent content of 
 rWrt.m_bLFPossible = true;


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

2023-05-27 Thread Andrea Gelmini (via logerrit)
 wizards/source/sfdialogs/SF_Dialog.xba |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit e1f1f2b85379faa79e2b52ee221089b1d01646f7
Author: Andrea Gelmini 
AuthorDate: Sat May 27 07:21:44 2023 +0200
Commit: Julien Nabet 
CommitDate: Sat May 27 13:50:12 2023 +0200

Fix typo

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

diff --git a/wizards/source/sfdialogs/SF_Dialog.xba 
b/wizards/source/sfdialogs/SF_Dialog.xba
index a81e83494dc5..f08a6ad7b45d 100644
--- a/wizards/source/sfdialogs/SF_Dialog.xba
+++ b/wizards/source/sfdialogs/SF_Dialog.xba
@@ -2581,7 +2581,7 @@ Try:
'  Set dimension and position
With oControlModel
If IsArray(Place) Then
-   '  Ignore width and height when new control is 
cloed from an existing one
+   '  Ignore width and height when new control is 
cloned from an existing one
If UBound(Place) >= 1 Then
.PositionX = Place(0)
.PositionY = Place(1)
@@ -3119,4 +3119,4 @@ Private Function _Repr() As String
 End Function   '  SFDialogs.SF_Dialog._Repr
 
 REM  END OF SFDIALOGS.SF_DIALOG
-
\ No newline at end of file
+


New Defects reported by Coverity Scan for LibreOffice

2023-05-27 Thread scan-admin
Hi,

Please find the latest report on new defect(s) introduced to LibreOffice found 
with Coverity Scan.

1 new defect(s) introduced to LibreOffice found with Coverity Scan.


New defect(s) Reported-by: Coverity Scan
Showing 1 of 1 defect(s)


** CID 1531780:  Null pointer dereferences  (NULL_RETURNS)
/sc/source/filter/oox/autofilterbuffer.cxx: 444 in 
oox::xls::ColorFilter::finalizeImport()()



*** CID 1531780:  Null pointer dereferences  (NULL_RETURNS)
/sc/source/filter/oox/autofilterbuffer.cxx: 444 in 
oox::xls::ColorFilter::finalizeImport()()
438 if (!pStyleSheet)
439 return aSettings;
440 
441 const SfxItemSet& rItemSet = pStyleSheet->GetItemSet();
442 // Color (whether text or background color) is always stored in 
ATTR_BACKGROUND
443 const SvxBrushItem* pItem = 
rItemSet.GetItem(ATTR_BACKGROUND);
>>> CID 1531780:  Null pointer dereferences  (NULL_RETURNS)
>>> Dereferencing "pItem->GetFiltColor()", which is known to be "nullptr".
444 ::Color aColor = pItem->GetFiltColor();
445 util::Color nColor(aColor);
446 aSettings.appendField(true, nColor, mbIsBackgroundColor);
447 return aSettings;
448 }
449 



To view the defects in Coverity Scan visit, 
https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50ypSs1kiFPuCn2xFdlMIFBirii0zZ9j2-2F9F2XPBcBm2BNgi9duPy3v-2FzgFDd2LJ-2BDKI-3DjTil_OTq2XUZbbipYjyLSo6GRo-2FpVxQ9OzkDINu9UTS-2FQhSdO0F0jQniitrGlNxDIzPJiGs-2F8cYct9ORVxABPoYjGwgQrEUP2P7kVdPgjBGSOTLZBueMpZNtNlbLS9ouJlaUdKJDeD1krKFQ8UR14BKlWIk7pw4-2Bk30ZkYzM68p311XC2us2rvnPDaxsyG5MVSxaTIfUsF21YVftRrIkALP9KBe1-2BD5-2FlbB5cva6Y-2BS9CiNQ-3D



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

2023-05-27 Thread Mike Kaganski (via logerrit)
 unoxml/source/dom/attributesmap.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit dccf807b7585c0b73700c54642c37821c0836ae3
Author: Mike Kaganski 
AuthorDate: Sun Apr 23 20:15:34 2023 +0300
Commit: Mike Kaganski 
CommitDate: Sat May 27 12:46:01 2023 +0200

Use getXWeak in unoxml

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

diff --git a/unoxml/source/dom/attributesmap.cxx 
b/unoxml/source/dom/attributesmap.cxx
index b11dcc6a1e01..f629d4cb3f31 100644
--- a/unoxml/source/dom/attributesmap.cxx
+++ b/unoxml/source/dom/attributesmap.cxx
@@ -164,7 +164,7 @@ namespace DOM
 if (!xAttr.is()) {
 throw DOMException(
 "CAttributesMap::removeNamedItem: no such attribute",
-static_cast(this),
+getXWeak(),
 DOMExceptionType_NOT_FOUND_ERR);
 }
 return m_pElement->removeAttributeNode(xAttr);
@@ -183,7 +183,7 @@ namespace DOM
 if (!xAttr.is()) {
 throw DOMException(
 "CAttributesMap::removeNamedItemNS: no such attribute",
-static_cast(this),
+getXWeak(),
 DOMExceptionType_NOT_FOUND_ERR);
 }
 return m_pElement->removeAttributeNode(xAttr);
@@ -199,7 +199,7 @@ namespace DOM
 if (!xNode.is()) {
 throw DOMException(
 "CAttributesMap::setNamedItem: XAttr argument expected",
-static_cast(this),
+getXWeak(),
 DOMExceptionType_HIERARCHY_REQUEST_ERR);
 }
 // no MutexGuard needed: m_pElement is const
@@ -216,7 +216,7 @@ namespace DOM
 if (!xNode.is()) {
 throw DOMException(
 "CAttributesMap::setNamedItemNS: XAttr argument expected",
-static_cast(this),
+getXWeak(),
 DOMExceptionType_HIERARCHY_REQUEST_ERR);
 }
 // no MutexGuard needed: m_pElement is const


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

2023-05-27 Thread Mike Kaganski (via logerrit)
 unodevtools/source/skeletonmaker/cppcompskeleton.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 35eb21d563418bdd664677d073c5653ace3da957
Author: Mike Kaganski 
AuthorDate: Sun Apr 23 20:15:27 2023 +0300
Commit: Mike Kaganski 
CommitDate: Sat May 27 12:44:52 2023 +0200

Use getXWeak in unodevtools

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

diff --git a/unodevtools/source/skeletonmaker/cppcompskeleton.cxx 
b/unodevtools/source/skeletonmaker/cppcompskeleton.cxx
index b17c35c90c84..a550a8e63c85 100644
--- a/unodevtools/source/skeletonmaker/cppcompskeleton.cxx
+++ b/unodevtools/source/skeletonmaker/cppcompskeleton.cxx
@@ -160,7 +160,7 @@ static void generateCompHelperDefinition(std::ostream & o,
 o << "css::uno::Reference< css::uno::XInterface > SAL_CALL _create("
  "\nconst css::uno::Reference< css::uno::XComponentContext > & "
  "context)\n{\n"
- "return static_cast< ::cppu::OWeakObject * >(new "
+ "return getXWeak(new "
   << classname <<  "(context));\n}\n\n";
 
 // close namespace


[Libreoffice-commits] core.git: include/rtl

2023-05-27 Thread Mike Kaganski (via logerrit)
 include/rtl/stringconcat.hxx |9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

New commits:
commit 1f91efaea987c78c2755ea5d02eb3b1cb50743bd
Author: Mike Kaganski 
AuthorDate: Sat May 27 11:14:32 2023 +0200
Commit: Mike Kaganski 
CommitDate: Sat May 27 12:43:42 2023 +0200

Unify Concat2View

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

diff --git a/include/rtl/stringconcat.hxx b/include/rtl/stringconcat.hxx
index fd9a6f7a938a..0bed28ac810c 100644
--- a/include/rtl/stringconcat.hxx
+++ b/include/rtl/stringconcat.hxx
@@ -312,14 +312,9 @@ private:
 std::unique_ptr buffer_;
 };
 
-template  auto Concat2View(OStringConcat 
const& c)
+template  auto 
Concat2View(StringConcat const& c)
 {
-return StringConcatenation(c);
-}
-
-template  auto Concat2View(OUStringConcat 
const& c)
-{
-return StringConcatenation(c);
+return StringConcatenation(c);
 }
 
 /**


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

2023-05-27 Thread Andrea Gelmini (via logerrit)
 wizards/source/sfdialogs/SF_Dialog.xba |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 42df2445f3bc34cf006f9b4433671e21a179ff5c
Author: Andrea Gelmini 
AuthorDate: Sat May 27 07:22:06 2023 +0200
Commit: Julien Nabet 
CommitDate: Sat May 27 12:34:14 2023 +0200

Fix typo

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

diff --git a/wizards/source/sfdialogs/SF_Dialog.xba 
b/wizards/source/sfdialogs/SF_Dialog.xba
index 21e307b5..a81e83494dc5 100644
--- a/wizards/source/sfdialogs/SF_Dialog.xba
+++ b/wizards/source/sfdialogs/SF_Dialog.xba
@@ -2570,7 +2570,7 @@ Check:
If IsMissing(ArgValues) Or IsEmpty(ArgValues) Then ArgValues = Array()
 
 Try:
-   '  When rhe model is a string, create a new (empty) model instance
+   '  When the model is a string, create a new (empty) model instance
Select Case VarType(pvModel)
Case V_STRING   :   Set 
oControlModel = _DialogModel.createInstance("com.sun.star.awt." & 
pvModel)
Case ScriptForge.V_OBJECT   :   Set oControlModel = 
pvModel


[Libreoffice-commits] core.git: svl/qa

2023-05-27 Thread Andrea Gelmini (via logerrit)
 svl/qa/unit/svl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5ab3a2fae34a000e27a9e44accdcc7bcbae60246
Author: Andrea Gelmini 
AuthorDate: Sat May 27 07:22:32 2023 +0200
Commit: Julien Nabet 
CommitDate: Sat May 27 12:33:46 2023 +0200

Fix typo

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

diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx
index 8f5070c934bb..9a682fc08751 100644
--- a/svl/qa/unit/svl.cxx
+++ b/svl/qa/unit/svl.cxx
@@ -1728,7 +1728,7 @@ void Test::testUserDefinedNumberFormats()
 sExpected = "1900-01-02 23:53.605";
 checkPreviewString(aFormatter, sCode, M_PI, eLang, sExpected);
 }
-{   // tdf#150028 decimals of seconds fraction withtout truncate on 
overflow
+{   // tdf#150028 decimals of seconds fraction without truncate on overflow
 sCode = "[SS]";
 sExpected = "271434";
 checkPreviewString(aFormatter, sCode, M_PI, eLang, sExpected);


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

2023-05-27 Thread Mike Kaganski (via logerrit)
 ure/source/uretest/cppmain.cc   |8 
 ure/source/uretest/cppserver.cc |2 +-
 ure/source/uretest/cpptest.cc   |4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit d9225a59e89907e9d289ab93c44fd8e6883f1be2
Author: Mike Kaganski 
AuthorDate: Sun Apr 23 20:15:37 2023 +0300
Commit: Mike Kaganski 
CommitDate: Sat May 27 12:05:11 2023 +0200

Use getXWeak in ure

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

diff --git a/ure/source/uretest/cppmain.cc b/ure/source/uretest/cppmain.cc
index fb957d9f221a..3346245ccca4 100644
--- a/ure/source/uretest/cppmain.cc
+++ b/ure/source/uretest/cppmain.cc
@@ -131,12 +131,12 @@ private:
 } catch (css::uno::Exception &) {
 throw css::uno::RuntimeException(
 ::rtl::OUString("error creating instance"),
-static_cast< ::cppu::OWeakObject * >(this));
+getXWeak());
 }
 if (!instance.is()) {
 throw css::uno::RuntimeException(
 "no instance: " + name,
-static_cast< ::cppu::OWeakObject * >(this));
+getXWeak());
 }
 }
 css::beans::Introspection::create(context_);
@@ -195,7 +195,7 @@ void Service::test(
 throw css::uno::RuntimeException(
 (name
  + ::rtl::OUString(".throwException failed")),
-static_cast< ::cppu::OWeakObject * >(this));
+getXWeak());
 }
 }
 
@@ -204,7 +204,7 @@ namespace CppMain {
 css::uno::Reference< css::uno::XInterface > create(
 css::uno::Reference< css::uno::XComponentContext > const & context)
 {
-return static_cast< ::cppu::OWeakObject * >(new Service(context));
+return getXWeak(new Service(context));
 }
 
 rtl::OUString getImplementationName() {
diff --git a/ure/source/uretest/cppserver.cc b/ure/source/uretest/cppserver.cc
index db42c9fb3f9f..6f25bb2591ff 100644
--- a/ure/source/uretest/cppserver.cc
+++ b/ure/source/uretest/cppserver.cc
@@ -57,7 +57,7 @@ namespace CppServer {
 css::uno::Reference< css::uno::XInterface > create(
 css::uno::Reference< css::uno::XComponentContext > const &)
 {
-return static_cast< ::cppu::OWeakObject * >(new Service);
+return getXWeak(new Service);
 }
 
 rtl::OUString getImplementationName() {
diff --git a/ure/source/uretest/cpptest.cc b/ure/source/uretest/cpptest.cc
index b037fdceebfb..38302e1bc0d9 100644
--- a/ure/source/uretest/cpptest.cc
+++ b/ure/source/uretest/cpptest.cc
@@ -44,7 +44,7 @@ public:
 virtual void SAL_CALL throwException() {
 throw test::types::TestException(
 rtl::OUString("test"),
-static_cast< cppu::OWeakObject * >(this));
+getXWeak());
 }
 
 private:
@@ -59,7 +59,7 @@ namespace CppTest {
 css::uno::Reference< css::uno::XInterface > create(
 css::uno::Reference< css::uno::XComponentContext > const &)
 {
-return static_cast< cppu::OWeakObject * >(new Service);
+return getXWeak(new Service);
 }
 
 rtl::OUString getImplementationName() {


[Libreoffice-commits] core.git: cui/source cui/uiconfig officecfg/registry

2023-05-27 Thread Baole Fang (via logerrit)
 cui/source/inc/treeopt.hxx   |2 
 cui/source/options/optsave.cxx   |   40 +++
 cui/source/options/treeopt.cxx   |4 +
 cui/uiconfig/ui/optsavepage.ui   |9 
 officecfg/registry/data/org/openoffice/Office/UI.xcu |   16 +++
 5 files changed, 45 insertions(+), 26 deletions(-)

New commits:
commit 9e92437cbb2180d51fdabc0d5efff24b530ba27a
Author: Baole Fang 
AuthorDate: Sat May 6 22:35:17 2023 -0400
Commit: Mike Kaganski 
CommitDate: Sat May 27 09:00:08 2023 +0200

tdf#148756: Fix document type in option dialog

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

diff --git a/cui/source/inc/treeopt.hxx b/cui/source/inc/treeopt.hxx
index 69278a1b5349..74ca73944b66 100644
--- a/cui/source/inc/treeopt.hxx
+++ b/cui/source/inc/treeopt.hxx
@@ -142,6 +142,7 @@ private:
 
 css::uno::Reference < css::awt::XContainerWindowProvider >
 m_xContainerWinProvider;
+css::uno::Reference m_xFrame;
 
 static LastPageSaver*   pLastPageSaver;
 
@@ -193,6 +194,7 @@ public:
 
 // helper functions to call the language settings TabPage from the 
SpellDialog
 static void ApplyLanguageOptions(const SfxItemSet& rSet);
+static OUString getCurrentFactory_Impl( const css::uno::Reference< 
css::frame::XFrame >& _xFrame );
 
 voidSetNeedsRestart( svtools::RestartReason eReason );
 };
diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx
index 9b2aee019476..7799da84c8b6 100644
--- a/cui/source/options/optsave.cxx
+++ b/cui/source/options/optsave.cxx
@@ -43,6 +43,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -106,13 +107,20 @@ SvxSaveTabPage::SvxSaveTabPage(weld::Container* pPage, 
weld::DialogController* p
 m_xODFVersionLB->set_id(4, OUString::number(SvtSaveOptions::ODFVER_013)); 
// 1.3
 m_xODFVersionLB->set_id(5, 
OUString::number(SvtSaveOptions::ODFVER_LATEST)); // 1.3 Extended (recommended)
 
-m_xDocTypeLB->set_id(0, OUString::number(APP_WRITER)   );
-m_xDocTypeLB->set_id(1, OUString::number(APP_WRITER_WEB)   );
-m_xDocTypeLB->set_id(2, OUString::number(APP_WRITER_GLOBAL));
-m_xDocTypeLB->set_id(3, OUString::number(APP_CALC) );
-m_xDocTypeLB->set_id(4, OUString::number(APP_IMPRESS)  );
-m_xDocTypeLB->set_id(5, OUString::number(APP_DRAW) );
-m_xDocTypeLB->set_id(6, OUString::number(APP_MATH) );
+auto aFilterClassesNode = 
utl::OConfigurationTreeRoot::createWithComponentContext(
+comphelper::getProcessComponentContext(),
+
"org.openoffice.Office.UI/FilterClassification/GlobalFilters/Classes",
+-1,
+utl::OConfigurationTreeRoot::CM_READONLY
+);
+
+m_xDocTypeLB->append(OUString::number(APP_WRITER), 
aFilterClassesNode.getNodeValue("com.sun.star.text.TextDocument/DisplayName").get());
+m_xDocTypeLB->append(OUString::number(APP_WRITER_WEB), 
aFilterClassesNode.getNodeValue("com.sun.star.text.WebDocument/DisplayName").get());
+m_xDocTypeLB->append(OUString::number(APP_WRITER_GLOBAL), 
aFilterClassesNode.getNodeValue("com.sun.star.text.GlobalDocument/DisplayName").get());
+m_xDocTypeLB->append(OUString::number(APP_CALC), 
aFilterClassesNode.getNodeValue("com.sun.star.sheet.SpreadsheetDocument/DisplayName").get());
+m_xDocTypeLB->append(OUString::number(APP_IMPRESS), 
aFilterClassesNode.getNodeValue("com.sun.star.presentation.PresentationDocument/DisplayName").get());
+m_xDocTypeLB->append(OUString::number(APP_DRAW), 
aFilterClassesNode.getNodeValue("com.sun.star.drawing.DrawingDocument/DisplayName").get());
+m_xDocTypeLB->append(OUString::number(APP_MATH), 
aFilterClassesNode.getNodeValue("com.sun.star.formula.FormulaProperties/DisplayName").get());
 
 m_xAutoSaveCB->connect_toggled( LINK( this, SvxSaveTabPage, 
AutoClickHdl_Impl ) );
 
@@ -434,7 +442,23 @@ void SvxSaveTabPage::Reset( const SfxItemSet* )
 pImpl->aODFArr[nData] = lODFList;
 }
 }
-m_xDocTypeLB->set_active(0);
+OUString sModule = 
OfaTreeOptionsDialog::getCurrentFactory_Impl(GetFrame());
+sal_Int32 docId = 0;
+if (sModule == "com.sun.star.text.TextDocument")
+docId = APP_WRITER;
+else if (sModule == "com.sun.star.text.WebDocument")
+docId = APP_WRITER_WEB;
+else if (sModule == "com.sun.star.text.GlobalDocument")
+docId = APP_WRITER_GLOBAL;
+else if (sModule == "com.sun.star.sheet.SpreadsheetDocument")
+docId = APP_CALC;
+else if (sModule == 
"com.sun.star.presentation.PresentationDocument")
+docId = APP_IMPRESS;
+else if (sM