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

2023-05-12 Thread Supriyo Paul (via logerrit)
 basctl/source/basicide/localizationmgr.cxx |   64 +++--
 1 file changed, 17 insertions(+), 47 deletions(-)

New commits:
commit e08c910f9ee520ce00fe99d6dab9988138996ee3
Author: Supriyo Paul 
AuthorDate: Thu Mar 2 20:17:30 2023 +0530
Commit: Hossein 
CommitDate: Sat May 13 00:54:00 2023 +0200

tdf#145538: traditional for loops to range-based for loops

changes traditional for to ranged based for in localizationmgr.cxx
goal: better readability for programmers

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

diff --git a/basctl/source/basicide/localizationmgr.cxx 
b/basctl/source/basicide/localizationmgr.cxx
index ef3a1ed9ff90..22e44c09c6aa 100644
--- a/basctl/source/basicide/localizationmgr.cxx
+++ b/basctl/source/basicide/localizationmgr.cxx
@@ -926,15 +926,10 @@ void LocalizationMgr::renameStringResourceIDs( const 
ScriptDocument& rDocument,
 xDummyStringResolver, RENAME_DIALOG_IDS );
 
 // Handle all controls
-Sequence< OUString > aNames = xDialogModel->getElementNames();
-const OUString* pNames = aNames.getConstArray();
-sal_Int32 nCtrls = aNames.getLength();
-for( sal_Int32 i = 0 ; i < nCtrls ; ++i )
-{
-OUString aCtrlName( pNames[i] );
-Any aCtrl = xDialogModel->getByName( aCtrlName );
+for(const auto& rCtrlName : xDialogModel->getElementNames()) {
+Any aCtrl = xDialogModel->getByName( rCtrlName );
 implHandleControlResourceProperties( aCtrl, aDlgName,
-aCtrlName, xStringResourceManager,
+rCtrlName, xStringResourceManager,
 xDummyStringResolver, RENAME_DIALOG_IDS );
 }
 }
@@ -957,15 +952,10 @@ void LocalizationMgr::removeResourceForDialog( const 
ScriptDocument& rDocument,
 xDummyStringResolver, REMOVE_IDS_FROM_RESOURCE );
 
 // Handle all controls
-Sequence< OUString > aNames = xDialogModel->getElementNames();
-const OUString* pNames = aNames.getConstArray();
-sal_Int32 nCtrls = aNames.getLength();
-for( sal_Int32 i = 0 ; i < nCtrls ; ++i )
-{
-OUString aCtrlName( pNames[i] );
-Any aCtrl = xDialogModel->getByName( aCtrlName );
+for(const auto& rCtrlName : xDialogModel->getElementNames()) {
+Any aCtrl = xDialogModel->getByName( rCtrlName );
 implHandleControlResourceProperties( aCtrl, aDlgName,
-aCtrlName, xStringResourceManager,
+rCtrlName, xStringResourceManager,
 xDummyStringResolver, REMOVE_IDS_FROM_RESOURCE );
 }
 }
@@ -985,15 +975,10 @@ void LocalizationMgr::resetResourceForDialog( const 
Reference< container::XNameC
 aDummyName, xStringResourceManager, xDummyStringResolver, RESET_IDS );
 
 // Handle all controls
-Sequence< OUString > aNames = xDialogModel->getElementNames();
-const OUString* pNames = aNames.getConstArray();
-sal_Int32 nCtrls = aNames.getLength();
-for( sal_Int32 i = 0 ; i < nCtrls ; ++i )
-{
-OUString aCtrlName( pNames[i] );
-Any aCtrl = xDialogModel->getByName( aCtrlName );
+for(const auto& rCtrlName : xDialogModel->getElementNames()){
+Any aCtrl = xDialogModel->getByName( rCtrlName );
 implHandleControlResourceProperties( aCtrl, aDummyName,
-aCtrlName, xStringResourceManager, xDummyStringResolver, RESET_IDS 
);
+rCtrlName, xStringResourceManager, xDummyStringResolver, RESET_IDS 
);
 }
 }
 
@@ -1012,15 +997,10 @@ void LocalizationMgr::setResourceIDsForDialog( const 
Reference< container::XName
 aDummyName, xStringResourceManager, xDummyStringResolver, SET_IDS );
 
 // Handle all controls
-Sequence< OUString > aNames = xDialogModel->getElementNames();
-const OUString* pNames = aNames.getConstArray();
-sal_Int32 nCtrls = aNames.getLength();
-for( sal_Int32 i = 0 ; i < nCtrls ; ++i )
-{
-OUString aCtrlName( pNames[i] );
-Any aCtrl = xDialogModel->getByName( aCtrlName );
+for(const auto& rCtrlName : xDialogModel->getElementNames()) {
+Any aCtrl = xDialogModel->getByName( rCtrlName );
 implHandleControlResourceProperties( aCtrl, aDummyName,
-aCtrlName, xStringResourceManager, xDummyStringResolver, SET_IDS );
+rCtrlName, xStringResourceManager, xDummyStringResolver, SET_IDS );
 }
 }
 
@@ -1066,15 +1046,10 @@ void LocalizationMgr::copyResourceForDroppedDialog( 
const Reference< container::
 std::u16string_view(), xStringResourceManager, xSourceStringResolver, 
MOVE_RESOURCES );
 
 // Handle all controls
-Sequence< OUString > aNames = xDialogModel->getElementNames();
-const OUString* pNames = aNames.getConstArray();
-sal_Int32 nCtrls = aNames.getLength();
-  

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

2023-03-07 Thread Supriyo Paul (via logerrit)
 sc/qa/unit/ucalc.cxx |   16 
 1 file changed, 16 insertions(+)

New commits:
commit e9697e315cd382ce14b5c8efc47a07aa06dea30c
Author: Supriyo Paul 
AuthorDate: Tue Mar 7 15:12:40 2023 +0530
Commit: Xisco Fauli 
CommitDate: Tue Mar 7 18:16:32 2023 +

tdf#94079 sc_ucalc: Add unit test

Change-Id: I2254d924acd05d2322068b7b8df229328dcf21f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148385
Tested-by: Xisco Fauli 
Reviewed-by: Xisco Fauli 

diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index e3f257825e97..b9217b2b5e6e 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -5913,6 +5913,22 @@ CPPUNIT_TEST_FIXTURE(Test, testColumnFindEditCells)
 m_pDoc->DeleteTab(0);
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testTdf94079)
+{
+CPPUNIT_ASSERT(m_pDoc->InsertTab (0, "Test"));
+
+m_pDoc->SetString(ScAddress(0,0,0), "=NOW()"); 
   // A1
+m_pDoc->SetString(ScAddress(0,1,0), "=NETWORKDAYS(NOW();NOW()+6;A1)"); 
   // A2
+double aValue = m_pDoc->GetValue(0,1,0);
+CPPUNIT_ASSERT_EQUAL(4.0, aValue);
+
+clearRange(m_pDoc, ScAddress(0,0,0));  // A1
+m_pDoc->SetString(ScAddress(0,1,0), "=NETWORKDAYS(NOW();NOW()+6;A1)"); 
   // A2
+aValue = m_pDoc->GetValue(0,1,0);
+CPPUNIT_ASSERT_EQUAL(5.0, aValue);
+
+m_pDoc->DeleteTab(0);
+}
 
 CPPUNIT_TEST_FIXTURE(Test, testSetFormula)
 {


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

2023-03-06 Thread Supriyo Paul (via logerrit)
 sc/source/ui/view/hdrcont.cxx |8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

New commits:
commit 9ba89c54076990b21b8e052fdd8d43bf8688edbe
Author: Supriyo Paul 
AuthorDate: Fri Mar 3 23:41:54 2023 +0530
Commit: Hossein 
CommitDate: Mon Mar 6 12:38:57 2023 +

tdf#148251 Use std::swap instead of using temporary values

Part of the code uses a temporary variable for swapping variables.
This is hard to read, so we are now using std::swap which improves
readability. We also remove the temporary local variable.

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

diff --git a/sc/source/ui/view/hdrcont.cxx b/sc/source/ui/view/hdrcont.cxx
index 805326330ae4..305ada306856 100644
--- a/sc/source/ui/view/hdrcont.cxx
+++ b/sc/source/ui/view/hdrcont.cxx
@@ -270,12 +270,8 @@ void ScHeaderControl::Paint( vcl::RenderContext& 
/*rRenderContext*/, const tools
 tools::Long nInitScrPos = 0;
 if ( bLayoutRTL )
 {
-tools::Long nTemp = nPStart;   // swap nPStart / nPEnd
-nPStart = nPEnd;
-nPEnd = nTemp;
-nTemp = nTransStart;// swap nTransStart / nTransEnd
-nTransStart = nTransEnd;
-nTransEnd = nTemp;
+std::swap(nPStart, nPEnd);
+std::swap(nTransStart, nTransEnd);
 if ( bVertical )// start loops from the end
 nInitScrPos = GetSizePixel().Height() - 1;
 else


Supriyo Paul license statement

2023-03-02 Thread Supriyo paul
All of my past & future contributions to LibreOffice may be
licensed under the MPLv2/LGPLv3+ dual license.


Request for GSOC 2023

2023-02-28 Thread Supriyo paul
To whom it may concern,

I am Supriyo Paul, currently an undergraduate, I want to apply for your
organization for this year of GSOC. Can you give me some insights on what I
should do first? And how will this email list help me?