Re: [PATCH] Bug 51309 - Names of DatabaseRanges should not be case sensitive
Hey Mathieu, 2012/11/14 Mathieu D. call.protec...@gmail.com: Hi, Sorry for the last mails. Here is the mail, hopefully correct. I submitted a patch for the bug 51309 - Names of DatabaseRanges should not be case sensitive : https://bugs.freedesktop.org/show_bug.cgi?id=51309 You will the diff file attached and on the bug's page. https://bugs.freedesktop.org/page.cgi?id=splinter.htmlbug=51309attachment=69115 Changes : - ScDBData::less::operator() is modified to compare upper strings - All the calls to NamedDBs::findByName() are now NamedDBs::findByUpperName(). - In case of a call to findByUpperName by an argument, the function ScGlobal::pCharClass-uppercase(aName) was used to ensure upper case. - The definitions of FindByName() are deleted. All of my past and future contributions to LibreOffice may be licensed under the MPL/LGPLv3+ dual license. Thanks, I pushed your patch to master. Do you have any area that you'd like to hack next? Regards, Markus ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[PATCH] Bug 51309 - Names of DatabaseRanges should not be case sensitive
Hi, /Sorry for the last mails. Here is the mail, hopefully correct./ I submitted a patch for the bug 51309 - Names of DatabaseRanges should not be case sensitive : https://bugs.freedesktop.org/show_bug.cgi?id=51309 You will the diff file attached and on the bug's page. https://bugs.freedesktop.org/page.cgi?id=splinter.htmlbug=51309attachment=69115 Changes : - ScDBData::less::operator() is modified to compare upper strings - All the calls to NamedDBs::findByName() are now NamedDBs::findByUpperName(). - In case of a call to findByUpperName by an argument, the function ScGlobal::pCharClass-uppercase(aName) was used to ensure upper case. - The definitions of FindByName() are deleted. *All of my past and future contributions to LibreOffice may be licensed under the MPL/LGPLv3+ dual license. * Should be Ok ! Mat' -- Mathieu D. Author: Mathieu D. call.protec...@gmail.com Date: Fri Oct 26 10:26:33 2012 -0400 Names of DatabaseRanges should not be case sensitive. This patch to LibreOffice is under LGPLv3+ / MPL. diff --git a/sc/inc/dbdata.hxx b/sc/inc/dbdata.hxx index d607b4e..5f7133f 100644 --- a/sc/inc/dbdata.hxx +++ b/sc/inc/dbdata.hxx @@ -185,7 +185,6 @@ public: const_iterator begin() const; const_iterator end() const; ScDBData* findByIndex(sal_uInt16 nIndex); -ScDBData* findByName(const ::rtl::OUString rName); ScDBData* findByUpperName(const ::rtl::OUString rName); bool insert(ScDBData* p); void erase(iterator itr); diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 10db9ae..89e5d0b 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -948,11 +948,11 @@ void ScFiltersTest::testBugFixesODS() { // fdo#40426 -ScDBData* pDBData = pDoc-GetDBCollection()-getNamedDBs().findByName(DBRange1); +ScDBData* pDBData = pDoc-GetDBCollection()-getNamedDBs().findByUpperName(DBRANGE1); CPPUNIT_ASSERT(pDBData); CPPUNIT_ASSERT(pDBData-HasHeader()); // no header -pDBData = pDoc-GetDBCollection()-getNamedDBs().findByName(DBRange2); +pDBData = pDoc-GetDBCollection()-getNamedDBs().findByUpperName(DBRANGE2); CPPUNIT_ASSERT(pDBData); CPPUNIT_ASSERT(!pDBData-HasHeader()); } diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx index e27339e..4c0bd4b 100644 --- a/sc/source/core/data/cell.cxx +++ b/sc/source/core/data/cell.cxx @@ -203,7 +203,7 @@ void adjustDBRange(ScToken* pToken, ScDocument rNewDoc, const ScDocument* pOldD ScDBData* pDBData = aOldNamedDBs.findByIndex(pToken-GetIndex()); if (!pDBData) return; //invalid index -rtl::OUString aDBName = pDBData-GetName(); +rtl::OUString aDBName = pDBData-GetUpperName(); //search in new document ScDBCollection* pNewDBCollection = rNewDoc.GetDBCollection(); @@ -212,7 +212,7 @@ void adjustDBRange(ScToken* pToken, ScDocument rNewDoc, const ScDocument* pOldD pNewDBCollection = new ScDBCollection(rNewDoc); } ScDBCollection::NamedDBs aNewNamedDBs = pNewDBCollection-getNamedDBs(); -ScDBData* pNewDBData = aNewNamedDBs.findByName(aDBName); +ScDBData* pNewDBData = aNewNamedDBs.findByUpperName(aDBName); if (!pNewDBData) { pNewDBData = new ScDBData(*pDBData); diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index 54ce14f..7ed637c 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -250,7 +250,7 @@ void ScDocument::SetDBCollection( ScDBCollection* pNewDBCollection, bool bRemove bool bFound = false; if (pNewDBCollection) { -ScDBData* pNewData = pNewDBCollection-getNamedDBs().findByName(rOldData.GetName()); +ScDBData* pNewData = pNewDBCollection-getNamedDBs().findByUpperName(rOldData.GetUpperName()); if (pNewData) { if (pNewData-HasAutoFilter()) diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx index 7b142cc..3290f18 100644 --- a/sc/source/core/tool/dbdata.cxx +++ b/sc/source/core/tool/dbdata.cxx @@ -53,7 +53,7 @@ using ::std::pair; bool ScDBData::less::operator() (const ScDBData left, const ScDBData right) const { -return ScGlobal::GetpTransliteration()-compareString(left.GetName(), right.GetName()) 0; +return ScGlobal::GetpTransliteration()-compareString(left.GetUpperName(), right.GetUpperName()) 0; } ScDBData::ScDBData( const ::rtl::OUString rName, @@ -643,17 +643,6 @@ public: } }; -class FindByName : public unary_functionScDBData, bool -{ -const ::rtl::OUString mrName; -public: -FindByName(const ::rtl::OUString rName) : mrName(rName) {} -bool operator() (const ScDBData r) const -{ -return r.GetName() ==
Re: [PATCH] Bug 51309 - Names of DatabaseRanges should not be case sensitive
HI, You will find the patch with the correct license statement attached. Regards, Mat' On 10/29/2012 07:22 PM, Markus Mohrhard wrote: Hey Mathieu, 2012/10/26 Mathieu D.call.protec...@gmail.com: Hi, I submitted a patch for the bug 51309 - Names of DatabaseRanges should not be case sensitive : https://bugs.freedesktop.org/show_bug.cgi?id=51309 You will the diff file attached and on the bug's page. https://bugs.freedesktop.org/page.cgi?id=splinter.htmlbug=51309attachment=69115 Changes : - ScDBData::less::operator() is modified to compare upper strings - All the calls to NamedDBs::findByName() are now NamedDBs::findByUpperName(). - In case of a call to findByUpperName by an argument, the function ScGlobal::pCharClass-uppercase(aName) was used to ensure upper case. - The definitions of FindByName() are deleted. The patch looks good. Could you please create the patch with git commit -a git format-patch HEAD~1 so that it includes you correctly as author. And please could you send a licence statement like: All of my past and future contributions to LibreOffice may be licensed under the MPL/LGPLv3+ dual license. to the Mailing so list so that we can keep track of it at http://wiki.documentfoundation.org/Development/Developers Thanks a lot for your great contribution. Are there any areas that interest you? Are you interested in more calc hacking? Regards, Markus -- Mathieu D. From 34f1ab3baaf4c7cccf96a00a16998828933fcb4c Mon Sep 17 00:00:00 2001 From: Mathieu D. anarazel@mint Date: Tue, 30 Oct 2012 11:58:44 -0400 Subject: [PATCH] Patch for bug 51309, Names of DatabaseRanges should not be case-sensitive. All of my past and future contributions to LibreOffice may be licensed under the MPL/LGPLv3+ dual license.. case sensitive --- sc/inc/dbdata.hxx |1 - sc/qa/unit/subsequent_filters-test.cxx |4 ++-- sc/source/core/data/cell.cxx |4 ++-- sc/source/core/data/documen3.cxx |2 +- sc/source/core/tool/dbdata.cxx | 20 +--- sc/source/core/tool/rangeutl.cxx |2 +- sc/source/ui/dbgui/dbnamdlg.cxx|4 ++-- sc/source/ui/docshell/arealink.cxx |4 ++-- sc/source/ui/docshell/dbdocfun.cxx | 12 ++-- sc/source/ui/docshell/docsh4.cxx |2 +- sc/source/ui/docshell/docsh5.cxx |2 +- sc/source/ui/navipi/content.cxx|2 +- sc/source/ui/undo/undodat.cxx |4 ++-- sc/source/ui/unoobj/datauno.cxx|4 ++-- sc/source/ui/view/dbfunc.cxx |2 +- 15 files changed, 25 insertions(+), 44 deletions(-) diff --git a/sc/inc/dbdata.hxx b/sc/inc/dbdata.hxx index d607b4e..5f7133f 100644 --- a/sc/inc/dbdata.hxx +++ b/sc/inc/dbdata.hxx @@ -185,7 +185,6 @@ public: const_iterator begin() const; const_iterator end() const; ScDBData* findByIndex(sal_uInt16 nIndex); -ScDBData* findByName(const ::rtl::OUString rName); ScDBData* findByUpperName(const ::rtl::OUString rName); bool insert(ScDBData* p); void erase(iterator itr); diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 10db9ae..89e5d0b 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -948,11 +948,11 @@ void ScFiltersTest::testBugFixesODS() { // fdo#40426 -ScDBData* pDBData = pDoc-GetDBCollection()-getNamedDBs().findByName(DBRange1); +ScDBData* pDBData = pDoc-GetDBCollection()-getNamedDBs().findByUpperName(DBRANGE1); CPPUNIT_ASSERT(pDBData); CPPUNIT_ASSERT(pDBData-HasHeader()); // no header -pDBData = pDoc-GetDBCollection()-getNamedDBs().findByName(DBRange2); +pDBData = pDoc-GetDBCollection()-getNamedDBs().findByUpperName(DBRANGE2); CPPUNIT_ASSERT(pDBData); CPPUNIT_ASSERT(!pDBData-HasHeader()); } diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx index e27339e..4c0bd4b 100644 --- a/sc/source/core/data/cell.cxx +++ b/sc/source/core/data/cell.cxx @@ -203,7 +203,7 @@ void adjustDBRange(ScToken* pToken, ScDocument rNewDoc, const ScDocument* pOldD ScDBData* pDBData = aOldNamedDBs.findByIndex(pToken-GetIndex()); if (!pDBData) return; //invalid index -rtl::OUString aDBName = pDBData-GetName(); +rtl::OUString aDBName = pDBData-GetUpperName(); //search in new document ScDBCollection* pNewDBCollection = rNewDoc.GetDBCollection(); @@ -212,7 +212,7 @@ void adjustDBRange(ScToken* pToken, ScDocument rNewDoc, const ScDocument* pOldD pNewDBCollection = new ScDBCollection(rNewDoc); } ScDBCollection::NamedDBs aNewNamedDBs = pNewDBCollection-getNamedDBs(); -ScDBData* pNewDBData = aNewNamedDBs.findByName(aDBName); +ScDBData* pNewDBData = aNewNamedDBs.findByUpperName(aDBName); if (!pNewDBData) { pNewDBData = new ScDBData(*pDBData); diff --git
Re: [PATCH] Bug 51309 - Names of DatabaseRanges should not be case sensitive
Hi Mathieu, On 10/30/2012 12:06 PM, Mathieu D. wrote: HI, You will find the patch with the correct license statement attached. Looks like we are having a mis-communication here. What we need from you is another email sent to this list, with the body of the message containing your license statement which can be just as follows: All of my past and future contributions to LibreOffice may be licensed under the MPL/LGPLv3+ dual license. You keep including the license statement in the commit message of your patch, which is NOT what we need. We need it in the body of an email. I hope this clarifies our requirement. Sorry about the confusion, and thanks for the patch. :-) Best, Kohei -- Kohei Yoshida, LibreOffice hacker, Calc ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [PATCH] Bug 51309 - Names of DatabaseRanges should not be case sensitive
Hey Mathieu, 2012/10/26 Mathieu D. call.protec...@gmail.com: Hi, I submitted a patch for the bug 51309 - Names of DatabaseRanges should not be case sensitive : https://bugs.freedesktop.org/show_bug.cgi?id=51309 You will the diff file attached and on the bug's page. https://bugs.freedesktop.org/page.cgi?id=splinter.htmlbug=51309attachment=69115 Changes : - ScDBData::less::operator() is modified to compare upper strings - All the calls to NamedDBs::findByName() are now NamedDBs::findByUpperName(). - In case of a call to findByUpperName by an argument, the function ScGlobal::pCharClass-uppercase(aName) was used to ensure upper case. - The definitions of FindByName() are deleted. The patch looks good. Could you please create the patch with git commit -a git format-patch HEAD~1 so that it includes you correctly as author. And please could you send a licence statement like: All of my past and future contributions to LibreOffice may be licensed under the MPL/LGPLv3+ dual license. to the Mailing so list so that we can keep track of it at http://wiki.documentfoundation.org/Development/Developers Thanks a lot for your great contribution. Are there any areas that interest you? Are you interested in more calc hacking? Regards, Markus ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[PATCH] Bug 51309 - Names of DatabaseRanges should not be case sensitive
Hi, I submitted a patch for the bug 51309 - Names of DatabaseRanges should not be case sensitive : https://bugs.freedesktop.org/show_bug.cgi?id=51309 You will the diff file attached and on the bug's page. https://bugs.freedesktop.org/page.cgi?id=splinter.htmlbug=51309attachment=69115 Changes : - ScDBData::less::operator() is modified to compare upper strings - All the calls to NamedDBs::findByName() are now NamedDBs::findByUpperName(). - In case of a call to findByUpperName by an argument, the function ScGlobal::pCharClass-uppercase(aName) was used to ensure upper case. - The definitions of FindByName() are deleted. Should be Ok ! Mat' -- Mathieu D. Author: Mathieu D. call.protec...@gmail.com Date: Fri Oct 26 10:26:33 2012 -0400 Names of DatabaseRanges should not be case sensitive. This patch to LibreOffice is under LGPLv3+ / MPL. diff --git a/sc/inc/dbdata.hxx b/sc/inc/dbdata.hxx index d607b4e..5f7133f 100644 --- a/sc/inc/dbdata.hxx +++ b/sc/inc/dbdata.hxx @@ -185,7 +185,6 @@ public: const_iterator begin() const; const_iterator end() const; ScDBData* findByIndex(sal_uInt16 nIndex); -ScDBData* findByName(const ::rtl::OUString rName); ScDBData* findByUpperName(const ::rtl::OUString rName); bool insert(ScDBData* p); void erase(iterator itr); diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 10db9ae..89e5d0b 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -948,11 +948,11 @@ void ScFiltersTest::testBugFixesODS() { // fdo#40426 -ScDBData* pDBData = pDoc-GetDBCollection()-getNamedDBs().findByName(DBRange1); +ScDBData* pDBData = pDoc-GetDBCollection()-getNamedDBs().findByUpperName(DBRANGE1); CPPUNIT_ASSERT(pDBData); CPPUNIT_ASSERT(pDBData-HasHeader()); // no header -pDBData = pDoc-GetDBCollection()-getNamedDBs().findByName(DBRange2); +pDBData = pDoc-GetDBCollection()-getNamedDBs().findByUpperName(DBRANGE2); CPPUNIT_ASSERT(pDBData); CPPUNIT_ASSERT(!pDBData-HasHeader()); } diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx index e27339e..4c0bd4b 100644 --- a/sc/source/core/data/cell.cxx +++ b/sc/source/core/data/cell.cxx @@ -203,7 +203,7 @@ void adjustDBRange(ScToken* pToken, ScDocument rNewDoc, const ScDocument* pOldD ScDBData* pDBData = aOldNamedDBs.findByIndex(pToken-GetIndex()); if (!pDBData) return; //invalid index -rtl::OUString aDBName = pDBData-GetName(); +rtl::OUString aDBName = pDBData-GetUpperName(); //search in new document ScDBCollection* pNewDBCollection = rNewDoc.GetDBCollection(); @@ -212,7 +212,7 @@ void adjustDBRange(ScToken* pToken, ScDocument rNewDoc, const ScDocument* pOldD pNewDBCollection = new ScDBCollection(rNewDoc); } ScDBCollection::NamedDBs aNewNamedDBs = pNewDBCollection-getNamedDBs(); -ScDBData* pNewDBData = aNewNamedDBs.findByName(aDBName); +ScDBData* pNewDBData = aNewNamedDBs.findByUpperName(aDBName); if (!pNewDBData) { pNewDBData = new ScDBData(*pDBData); diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index 54ce14f..7ed637c 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -250,7 +250,7 @@ void ScDocument::SetDBCollection( ScDBCollection* pNewDBCollection, bool bRemove bool bFound = false; if (pNewDBCollection) { -ScDBData* pNewData = pNewDBCollection-getNamedDBs().findByName(rOldData.GetName()); +ScDBData* pNewData = pNewDBCollection-getNamedDBs().findByUpperName(rOldData.GetUpperName()); if (pNewData) { if (pNewData-HasAutoFilter()) diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx index 7b142cc..3290f18 100644 --- a/sc/source/core/tool/dbdata.cxx +++ b/sc/source/core/tool/dbdata.cxx @@ -53,7 +53,7 @@ using ::std::pair; bool ScDBData::less::operator() (const ScDBData left, const ScDBData right) const { -return ScGlobal::GetpTransliteration()-compareString(left.GetName(), right.GetName()) 0; +return ScGlobal::GetpTransliteration()-compareString(left.GetUpperName(), right.GetUpperName()) 0; } ScDBData::ScDBData( const ::rtl::OUString rName, @@ -643,17 +643,6 @@ public: } }; -class FindByName : public unary_functionScDBData, bool -{ -const ::rtl::OUString mrName; -public: -FindByName(const ::rtl::OUString rName) : mrName(rName) {} -bool operator() (const ScDBData r) const -{ -return r.GetName() == mrName; -} -}; - class FindByUpperName : public unary_functionScDBData, bool { const ::rtl::OUString mrName; @@ -700,13 +689,6 @@ ScDBData*