[Libreoffice-commits] core.git: Changes to 'refs/changes/41/3541/4'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/80/5180/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/56/7656/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/94/5394/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/33/5733/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/83/5183/3'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/09/4209/3'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/88/288/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/07/5607/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/26/1026/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/40/1640/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/23/5623/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/82/5182/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/30/6030/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/40/5340/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/13/5413/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/63/5463/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/41/3541/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/62/5962/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/79/979/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/82/5482/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/31/5731/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/09/4209/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/88/288/3'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/26/5626/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/39/1639/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/58/7658/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/72/5372/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/58/5458/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/05/5405/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/80/4280/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/63/5463/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/64/5964/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/23/5623/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/30/6030/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/82/5182/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/58/7658/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/36/1636/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/57/5457/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/29/6029/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/38/5738/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 9 commits - sw/source vcl/source vcl/unx
sw/source/ui/vba/vbaselection.cxx| 10 sw/source/uibase/dochdl/swdtflvr.cxx | 36 ++- vcl/source/edit/texteng.cxx |2 - vcl/source/filter/FilterConfigItem.cxx |3 +- vcl/source/filter/graphicfilter.cxx |7 +++--- vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx | 33 ++-- 6 files changed, 45 insertions(+), 46 deletions(-) New commits: commit 565340d457f41197474a75ba1b036bdc3d569041 Author: Matteo Casalin Date: Sat Jun 2 23:55:42 2018 +0200 Fix tdf#100937: LO Freezed when I insert a very long text in... ... the Description box The issue was triggered by ImpVclMEdit::Resize initially calling TextEngine::SetMaxTextWidth() with a negative width (due to an initial empty area, further "reduced" to take into account a vertical scroll bar) and then with positive values in following iterations. I preferred to consider such negative widths a no-op instead of extending them to the "maximum" possible width. Change-Id: I756652a30c23ebe6674e481e7d8d6e0d8ba45e75 diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx index 3beff673c1be..90f40a0f939d 100644 --- a/vcl/source/edit/texteng.cxx +++ b/vcl/source/edit/texteng.cxx @@ -219,7 +219,7 @@ void TextEngine::SetMaxTextLen( sal_Int32 nLen ) void TextEngine::SetMaxTextWidth( long nMaxWidth ) { -if ( nMaxWidth != mnMaxTextWidth ) +if ( nMaxWidth>=0 && nMaxWidth != mnMaxTextWidth ) { mnMaxTextWidth = nMaxWidth; FormatFullDoc(); commit 91b5e86d5ef1318bd894b1fc3b537fb4615673da Author: Matteo Casalin Date: Wed May 30 20:49:22 2018 +0200 Improve 1a2ee0ecd5b0cff52922c1d261f7d03a57a52ca0 Change-Id: I50f369f28c3b97ba7fed494cb238b7756920abc6 diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 9f5d6caeb0eb..1ba3d1d776ec 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -2439,8 +2439,9 @@ ErrCode GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString& r } else { -sal_Int32 nIdx{0}; -do { +sal_Int32 nIdx {aFilterPath.isEmpty() ? -1 : 0}; +while (nIdx>=0) +{ #ifndef DISABLE_DYNLOADING OUString aPhysicalName( ImpCreateFullFilterPath( aFilterPath.getToken(0, ';', nIdx), aFilterName ) ); osl::Module aLibrary( aPhysicalName ); @@ -2471,7 +2472,7 @@ ErrCode GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString& r } else nStatus = ERRCODE_GRFILTER_FILTERERROR; -} while (nIdx>=0); +} } } if( nStatus != ERRCODE_NONE ) commit 3c78a19ed66b44ebb2db7b160fa92a010a3c42aa Author: Matteo Casalin Date: Wed May 30 20:37:20 2018 +0200 Try harder to find a matching file extension Potential regression from 2a39163aef4211c9d19cb1faee7f55d3718355b6 Change-Id: I67f1f11bd52a1dbf0f77a35df7ad556437ccd39b diff --git a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx index a222d603270c..e4f5ac395b8d 100644 --- a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx +++ b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx @@ -705,23 +705,32 @@ namespace bool lcl_matchFilter( const rtl::OUString& rFilter, const rtl::OUString& rExt ) { -const sal_Int32 nBegin = rFilter.indexOf(rExt); +const sal_Unicode cSep {';'}; +sal_Int32 nIdx {0}; -if (nBegin<0) // not found -return false; +for (;;) +{ +const sal_Int32 nBegin = rFilter.indexOf(rExt, nIdx); -const sal_Unicode cSep{';'}; +if (nBegin<0) // not found +break; -// Check if the found occurrence is an exact match: left side -if (nBegin>0 && rFilter[nBegin-1]!=cSep) -return false; +// Let nIdx point to end of matched string, useful in order to +// check string boundaries and also for a possible next iteration +nIdx = nBegin + rExt.getLength(); -// Check if the found occurrence is an exact match: right side -const sal_Int32 nEnd = nBegin + rExt.getLength(); -if (nEnd0 && rFilter[nBegin-1]!=cSep) +continue; + + return true; +} + +return false; } } commit 85613aa81a885488f99ed038f2254ddb0c8a1037 Author: Matteo Casalin Date: Wed May 16 23:26:44 2018 +0200 Fix tdf#117410 - UI: Settings in PDF Options not remembered... for next export Change-Id: I6f066c81d96595a4560f5bb9e148001b004b38f0 diff --git a/vcl/source/filter/FilterConfigItem.cxx b/vcl/source/filter/FilterConfigItem.cxx index 170e4b956046..0eedb63b408d 100644 --- a/vcl/source/filter/FilterConfigItem.cxx +++ b/vcl/source/fi
Can someone kindly backport a patch to 6.1?
Dear all, I recently pushed to master a patch [1] for an issue I introduced in LO 6.1.0.0.alpha0+ [2]. This patch will be integrated in 6.2, can someone kindly backport it to 6.1? It seems that I have no push rights to such branch. Kind regards Matteo [1] https://cgit.freedesktop.org/libreoffice/core/commit/?id=85613aa81a885488f99ed038f2254ddb0c8a1037 [2] https://bugs.documentfoundation.org/show_bug.cgi?id=117410 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - vcl/source
vcl/source/filter/FilterConfigItem.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 43df64affb71e9cd17cfaf936d142dad95b280f7 Author: Matteo Casalin Date: Wed May 16 23:26:44 2018 +0200 Fix tdf#117410 - UI: Settings in PDF Options not remembered... for next export Change-Id: I6f066c81d96595a4560f5bb9e148001b004b38f0 (cherry picked from commit 85613aa81a885488f99ed038f2254ddb0c8a1037) Reviewed-on: https://gerrit.libreoffice.org/55647 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos diff --git a/vcl/source/filter/FilterConfigItem.cxx b/vcl/source/filter/FilterConfigItem.cxx index 170e4b956046..0eedb63b408d 100644 --- a/vcl/source/filter/FilterConfigItem.cxx +++ b/vcl/source/filter/FilterConfigItem.cxx @@ -68,7 +68,8 @@ static bool ImpIsTreeAvailable( Reference< XMultiServiceFactory > const & rXCfgP } if ( xReadAccess.is() ) { -while (bAvailable && nIdx>=0 ) +const sal_Int32 nEnd {rTree.getLength()}; +while (bAvailable && nIdx>=0 && nIdx xHierarchicalNameAccess ( xReadAccess, UNO_QUERY ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - 2 commits - vcl/source vcl/unx
vcl/source/filter/graphicfilter.cxx |7 +++--- vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx | 33 +++ 2 files changed, 25 insertions(+), 15 deletions(-) New commits: commit b44167edcbdb94b471da5d6ef390edfa1bf4fe36 Author: Matteo Casalin Date: Wed May 30 20:37:20 2018 +0200 Try harder to find a matching file extension Potential regression from 2a39163aef4211c9d19cb1faee7f55d3718355b6 Change-Id: I67f1f11bd52a1dbf0f77a35df7ad556437ccd39b (cherry picked from commit 3c78a19ed66b44ebb2db7b160fa92a010a3c42aa) Reviewed-on: https://gerrit.libreoffice.org/55889 Tested-by: Jenkins Reviewed-by: Matteo Casalin diff --git a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx index a222d603270c..e4f5ac395b8d 100644 --- a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx +++ b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx @@ -705,23 +705,32 @@ namespace bool lcl_matchFilter( const rtl::OUString& rFilter, const rtl::OUString& rExt ) { -const sal_Int32 nBegin = rFilter.indexOf(rExt); +const sal_Unicode cSep {';'}; +sal_Int32 nIdx {0}; -if (nBegin<0) // not found -return false; +for (;;) +{ +const sal_Int32 nBegin = rFilter.indexOf(rExt, nIdx); -const sal_Unicode cSep{';'}; +if (nBegin<0) // not found +break; -// Check if the found occurrence is an exact match: left side -if (nBegin>0 && rFilter[nBegin-1]!=cSep) -return false; +// Let nIdx point to end of matched string, useful in order to +// check string boundaries and also for a possible next iteration +nIdx = nBegin + rExt.getLength(); -// Check if the found occurrence is an exact match: right side -const sal_Int32 nEnd = nBegin + rExt.getLength(); -if (nEnd0 && rFilter[nBegin-1]!=cSep) +continue; + +return true; +} + +return false; } } commit 133a56d75d77275fd9a0dcc08e759be14adc523f Author: Matteo Casalin Date: Wed May 30 20:49:22 2018 +0200 Improve 1a2ee0ecd5b0cff52922c1d261f7d03a57a52ca0 Change-Id: I50f369f28c3b97ba7fed494cb238b7756920abc6 (cherry picked from commit 91b5e86d5ef1318bd894b1fc3b537fb4615673da) Reviewed-on: https://gerrit.libreoffice.org/55890 Tested-by: Jenkins Reviewed-by: Matteo Casalin diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 6e37dd6d3ff1..870c5586ea82 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -2439,8 +2439,9 @@ ErrCode GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString& r } else { -sal_Int32 nIdx{0}; -do { +sal_Int32 nIdx {aFilterPath.isEmpty() ? -1 : 0}; +while (nIdx>=0) +{ #ifndef DISABLE_DYNLOADING OUString aPhysicalName( ImpCreateFullFilterPath( aFilterPath.getToken(0, ';', nIdx), aFilterName ) ); osl::Module aLibrary( aPhysicalName ); @@ -2471,7 +2472,7 @@ ErrCode GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString& r } else nStatus = ERRCODE_GRFILTER_FILTERERROR; -} while (nIdx>=0); +} } } if( nStatus != ERRCODE_NONE ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - include/svx sc/source sd/source svx/source
include/svx/svddrgv.hxx | 16 +--- include/svx/svdmrkv.hxx |4 ++-- sc/source/ui/drawfunc/fudraw.cxx |2 +- sd/source/ui/func/fudraw.cxx |2 +- svx/source/svdraw/svddrgv.cxx| 18 ++ svx/source/svdraw/svdmrkv.cxx| 26 -- 6 files changed, 31 insertions(+), 37 deletions(-) New commits: commit 8f4c5a34b9e8704035c6ec770fc2947eb9964502 Author: Matteo Casalin Date: Sun Nov 26 21:51:26 2017 +0100 GetMarkableObjCount() is only compared against 1 Change-Id: I390b260fe481c7db73a065dd271c78a5df188ccc diff --git a/include/svx/svdmrkv.hxx b/include/svx/svdmrkv.hxx index 21b6df1583ab..3fba52b0453e 100644 --- a/include/svx/svdmrkv.hxx +++ b/include/svx/svdmrkv.hxx @@ -199,7 +199,8 @@ public: void SetFrameHandles(bool bOn); bool IsFrameHandles() const { return mbForceFrameHandles; } -sal_uIntPtr GetMarkableObjCount() const; +// returns true if number of markable objects is greater than 1 +bool HasMultipleMarkableObjects() const; void SetEditMode(SdrViewEditMode eMode); SdrViewEditMode GetEditMode() const { return meEditMode; } diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx index 5fbd8d9ab608..630d3abc4818 100644 --- a/sc/source/ui/drawfunc/fudraw.cxx +++ b/sc/source/ui/drawfunc/fudraw.cxx @@ -271,7 +271,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt) if(!pView->MarkNextObj( !aCode.IsShift() )) { //If there is only one object, don't do the UnmarkAllObj() & MarkNextObj(). -if ( pView->GetMarkableObjCount() > 1 && pView->HasMarkableObj() ) +if ( pView->HasMultipleMarkableObjects() && pView->HasMarkableObj() ) { // No next object: go over open end and // get first from the other side diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx index bf1d2ba36699..008321e0b0ee 100644 --- a/sd/source/ui/func/fudraw.cxx +++ b/sd/source/ui/func/fudraw.cxx @@ -372,7 +372,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt) if(!mpView->MarkNextObj( !aCode.IsShift() )) { //If there is only one object, don't do the UnmarkAllObj() & MarkNextObj(). -if ( mpView->GetMarkableObjCount() > 1 && mpView->AreObjectsMarked() ) +if ( mpView->HasMultipleMarkableObjects() && mpView->AreObjectsMarked() ) { // No next object: go over open end and get first from // the other side diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index 9fc9f3a0bf0c..d02758a6eee8 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -522,23 +522,22 @@ void SdrMarkView::BrkMarkGluePoints() } } -sal_uIntPtr SdrMarkView::GetMarkableObjCount() const +bool SdrMarkView::HasMultipleMarkableObjects() const { -sal_uIntPtr nCount=0; SdrPageView* pPV = GetSdrPageView(); +if (!pPV) +return false; -if(pPV) -{ -SdrObjList* pOL=pPV->GetObjList(); -const size_t nObjCount = pOL->GetObjCount(); -for (size_t nObjNum=0; nObjNumGetObj(nObjNum); -if (IsObjMarkable(pObj,pPV)) { -nCount++; -} -} +int nCount=0; +SdrObjList* pOL=pPV->GetObjList(); +const size_t nObjCount = pOL->GetObjCount(); +for (size_t nObjNum=0; nObjNumGetObj(nObjNum); +if (IsObjMarkable(pObj,pPV) && ++nCount>1) +return true; } -return nCount; + +return false; } bool SdrMarkView::HasMarkableObj() const commit d67eaa235db15853b3b454f2ef45c9a72529a3dc Author: Matteo Casalin Date: Sun Nov 26 17:02:32 2017 +0100 Remove unneeded data member Change-Id: I9d007f67e5f6024b1eaea10669a915ffd33d7c29 diff --git a/include/svx/svdmrkv.hxx b/include/svx/svdmrkv.hxx index acea4c514145..21b6df1583ab 100644 --- a/include/svx/svdmrkv.hxx +++ b/include/svx/svdmrkv.hxx @@ -114,7 +114,6 @@ protected: tools::RectanglemaMarkedGluePointsRect; sal_uInt16 mnFrameHandlesLimit; -sal_uIntPtr mnInsPointNum; // Number of the InsPoint SdrDragMode meDragMode; // Persistent SdrViewEditMode meEditMode; // Persistent diff --git a/svx/source/svdraw/svddrgv.cxx b/svx/source/svdraw/svddrgv.cxx index 2716bf42ea49..252dfd456b9b 100644 --- a/svx/source/svdraw/svddrgv.cxx +++ b/svx/source/svdraw/svddrgv.cxx @@ -642,14 +642,10 @@ bool SdrDragView::ImpBegInsObjPoint(bool bIdxZwang, const Point& rPnt, bool bNew bool bClosed0 =
[Libreoffice-commits] core.git: sw/source
sw/source/core/layout/calcmove.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 60fc08111d6453ca79603b4c5c85be05e45c35e7 Author: Matteo Casalin Date: Wed Nov 1 11:16:42 2017 +0100 Fix a likely copypasta All dimensions set to 0 seems to be a correct setting for an empty page. Change-Id: Idf8a587ab405ecd07b44a7c80d5d2eaf98e1c146 diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx index 3a770bcb6a2b..de694019e1bd 100644 --- a/sw/source/core/layout/calcmove.cxx +++ b/sw/source/core/layout/calcmove.cxx @@ -777,10 +777,10 @@ void SwPageFrame::MakeAll(vcl::RenderContext* pRenderContext) { SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*this); aFrm.Width( 0 ); -aFrm.Width( 0 ); +aFrm.Height( 0 ); SwFrameAreaDefinition::FramePrintAreaWriteAccess aPrt(*this); -aPrt.Height( 0 ); +aPrt.Width( 0 ); aPrt.Height( 0 ); aPrt.Left( 0 ); aPrt.Top( 0 ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 17 commits - sfx2/source svtools/source svx/source sw/source
sfx2/source/appl/newhelp.cxx | 28 ++-- svtools/source/config/printoptions.cxx|6 - svtools/source/misc/imap2.cxx |6 + svx/source/form/fmshimp.cxx |5 +--- svx/source/gallery2/galbrws2.cxx |3 -- svx/source/gallery2/gallery1.cxx | 20 ++--- svx/source/gallery2/galmisc.cxx |2 - svx/source/xml/xmlgrhlp.cxx | 30 ++ sw/source/core/unocore/unochart.cxx | 17 +- sw/source/core/unocore/unofield.cxx |3 -- sw/source/filter/html/htmlforw.cxx| 19 +--- sw/source/filter/ww8/docxattributeoutput.cxx |9 +++ sw/source/ui/dbui/createaddresslistdialog.cxx | 13 --- 13 files changed, 79 insertions(+), 82 deletions(-) New commits: commit 6050f9cf7b39e4d7073e1e54109e436b43dfa519 Author: Matteo Casalin Date: Sat Jun 30 17:03:25 2018 +0200 Reduce number of operations on OUString Change-Id: I5d65dd36981e6d75f0e3c0e3f00e1964d1249887 diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 0ac8ef38b41b..2d3c73a8d493 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -954,24 +954,19 @@ SearchTabPage_Impl::~SearchTabPage_Impl() void SearchTabPage_Impl::dispose() { SvtViewOptions aViewOpt( EViewType::TabPage, CONFIGNAME_SEARCHPAGE ); -sal_Int32 nChecked = m_pFullWordsCB->IsChecked() ? 1 : 0; -OUString aUserData = OUString::number( nChecked ); -aUserData += ";"; -nChecked = m_pScopeCB->IsChecked() ? 1 : 0; -aUserData += OUString::number( nChecked ); -aUserData += ";"; +OUString aUserData = +OUString::number( m_pFullWordsCB->IsChecked() ? 1 : 0 ) + ";" + +OUString::number( m_pScopeCB->IsChecked() ? 1 : 0 ); sal_Int32 nCount = std::min( m_pSearchED->GetEntryCount(), sal_Int32(10) ); // save only 10 entries for ( sal_Int32 i = 0; i < nCount; ++i ) { -OUString aText = m_pSearchED->GetEntry(i); -aUserData += INetURLObject::encode( -aText, INetURLObject::PART_UNO_PARAM_VALUE, +aUserData += ";" + INetURLObject::encode( +m_pSearchED->GetEntry(i), +INetURLObject::PART_UNO_PARAM_VALUE, INetURLObject::EncodeMechanism::All ); -aUserData += ";"; } -aUserData = comphelper::string::stripEnd(aUserData, ';'); Any aUserItem = makeAny( aUserData ); aViewOpt.SetUserItem( USERITEM_NAME, aUserItem ); commit fbd787dc9bf048bfc1be8eebf5920a69e34b6b75 Author: Matteo Casalin Date: Sat Jun 30 16:39:46 2018 +0200 Use indexed getToken() and avoid getTokenCount() Change-Id: I8807f8e7fd0fb76723bc4d46fa35cc346777051e diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index a8234eaa99bf..0ac8ef38b41b 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -928,16 +928,17 @@ SearchTabPage_Impl::SearchTabPage_Impl(vcl::Window* pParent, SfxHelpIndexWindow_ Any aUserItem = aViewOpt.GetUserItem( USERITEM_NAME ); if ( aUserItem >>= aUserData ) { -bool bChecked = aUserData.getToken(0, ';').toInt32() == 1; +sal_Int32 nIdx {0}; +bool bChecked = aUserData.getToken(0, ';', nIdx).toInt32() == 1; m_pFullWordsCB->Check( bChecked ); -bChecked = aUserData.getToken(1, ';').toInt32() == 1; +bChecked = aUserData.getToken(0, ';', nIdx).toInt32() == 1; m_pScopeCB->Check( bChecked ); -for ( sal_Int32 i = 2; i < comphelper::string::getTokenCount(aUserData, ';'); ++i ) +while ( nIdx > 0 ) { -OUString aToken = aUserData.getToken(i, ';'); m_pSearchED->InsertEntry( INetURLObject::decode( -aToken, INetURLObject::DecodeMechanism::WithCharset ) ); +aUserData.getToken(0, ';', nIdx), +INetURLObject::DecodeMechanism::WithCharset ) ); } } } commit d253ee7c8b04d19e415a4fdeefdc450bdee824e2 Author: Matteo Casalin Date: Sat Jun 30 12:21:22 2018 +0200 Avoid using getTokenCount() to get last token in a string Change-Id: I8e26d07c67fe10a55717a238563dd036b94fd381 diff --git a/svtools/source/config/printoptions.cxx b/svtools/source/config/printoptions.cxx index f5d3c178f471..af1101acd8cd 100644 --- a/svtools/source/config/printoptions.cxx +++ b/svtools/source/config/printoptions.cxx @@ -30,7 +30,6 @@ #include #include -#include #include "itemholder2.hxx" @@ -129,10 +128,7 @@ SvtPrintOptions_Impl::SvtPrintOptions_Impl(
[Libreoffice-commits] core.git: 16 commits - basic/source cui/source dbaccess/source sw/source vcl/source vcl/unx
basic/source/basmgr/basmgr.cxx | 36 --- cui/source/dialogs/cuifmsearch.cxx | 23 +-- cui/source/options/optjava.cxx |4 +-- cui/source/tabpages/numpages.cxx |9 +-- dbaccess/source/core/misc/dsntypes.cxx | 23 +++ dbaccess/source/ui/misc/TokenWriter.cxx | 18 --- sw/source/core/unocore/unoidx.cxx| 28 +--- sw/source/ui/index/cntex.cxx |5 ++-- sw/source/ui/index/cnttab.cxx| 15 ++-- sw/source/uibase/envelp/envimg.cxx | 12 +- sw/source/uibase/envelp/labelcfg.cxx | 10 vcl/source/control/combobox.cxx | 13 ++- vcl/source/filter/FilterConfigItem.cxx | 17 -- vcl/source/filter/graphicfilter.cxx | 27 --- vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx | 24 15 files changed, 140 insertions(+), 124 deletions(-) New commits: commit 3922602fc3aff254ba1df3e2f193a7f569b8963f Author: Matteo Casalin Date: Sun Apr 29 22:42:33 2018 +0200 Avoid getTokenCount Change-Id: Iad8a623a219b1e6158a1ec447bdc7853817d2086 diff --git a/sw/source/uibase/envelp/envimg.cxx b/sw/source/uibase/envelp/envimg.cxx index c09159802628..199b8fcda74a 100644 --- a/sw/source/uibase/envelp/envimg.cxx +++ b/sw/source/uibase/envelp/envimg.cxx @@ -18,7 +18,6 @@ */ #include -#include #include #include #include @@ -50,13 +49,14 @@ OUString MakeSender() { SvtUserOptions& rUserOpt = SW_MOD()->GetUserOptions(); +const OUString sSenderToken(SwResId(STR_SENDER_TOKENS)); +if (sSenderToken.isEmpty()) +return OUString(); + OUString sRet; -OUString sSenderToken(SwResId(STR_SENDER_TOKENS)); -sal_Int32 nTokenCount = comphelper::string::getTokenCount(sSenderToken, ';'); sal_Int32 nSttPos = 0; bool bLastLength = true; -for( sal_Int32 i = 0; i < nTokenCount; i++ ) -{ +do { OUString sToken = sSenderToken.getToken( 0, ';', nSttPos ); if (sToken == "COMPANY") { @@ -86,7 +86,7 @@ OUString MakeSender() sRet += rUserOpt.GetState(); else if (!sToken.isEmpty()) //spaces sRet += sToken; -} +} while (nSttPos>=0); return sRet; } commit 5f07b58b0904f2d00ea4c1b49296ec0abfbe397c Author: Matteo Casalin Date: Sun Apr 29 22:24:45 2018 +0200 Avoid getTokenCount Change-Id: Idf94fa126580623c879023b04a2d9cbe54679b21 diff --git a/sw/source/uibase/envelp/labelcfg.cxx b/sw/source/uibase/envelp/labelcfg.cxx index 808b250a3470..6c6ec6127efc 100644 --- a/sw/source/uibase/envelp/labelcfg.cxx +++ b/sw/source/uibase/envelp/labelcfg.cxx @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -183,12 +182,13 @@ static std::unique_ptr lcl_CreateSwLabRec(const OUString& rType, const pNewRec->m_aType = rType; //all values are contained as colon-separated 1/100 mm values //except for the continuous flag ('C'/'S') and nCols, nRows (sal_Int32) -sal_uInt16 nTokenCount = comphelper::string::getTokenCount(rMeasure, ';'); -for(sal_uInt16 i = 0; i < nTokenCount; i++) +sal_Int32 nTok{0}; +sal_Int32 nIdx{rMeasure.isEmpty() ? -1 : 0}; +while (nIdx>=0) { -OUString sToken(rMeasure.getToken(i, ';' )); +const OUString sToken(rMeasure.getToken(0, ';', nIdx)); int nVal = sToken.toInt32(); -switch(i) +switch(nTok++) { case 0 : pNewRec->m_bCont = sToken[0] == 'C'; break; case 1 : pNewRec->m_nHDist= convertMm100ToTwip(nVal); break; commit e7747a338bb3951448a0be2cda1e9ae5eb6cc117 Author: Matteo Casalin Date: Sun Apr 29 21:34:26 2018 +0200 Avoid getTokenCount Previous implementation looped backward from last token, but just a match seems to be required in order to insert the associated ComboBox position in a std::set (which does not care for insertion order). Change-Id: If92b28a9364e59fca46e728164be41e0755d0977 diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index 9f8bd524e0e1..d54c628df8a3 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -89,14 +89,15 @@ struct ComboBox::Impl static void lcl_GetSelectedEntries( ::std::set< sal_Int32 >& rSelectedPos, const OUString& rText, sal_Unicode cTokenSep, const ImplEntryList* pEntryList ) { -for (sal_Int32 n = comphelper::string::getTokenCount(rText, cTokenSep); n;) -{ -OUString aToken = rText.getToken( --n, cTokenSep ); -aToken = comphelper::string::strip(aToken, ' '); -sal_Int32 nPos = pEntryList->FindEntry( aToken ); +if (r
[Libreoffice-commits] core.git: vcl/source
vcl/source/filter/graphicfilter.cxx | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) New commits: commit b3c43f257404f1b9037898825e86806b5b0b0fc7 Author: Matteo Casalin Date: Mon Apr 30 09:33:10 2018 +0200 Avoid getTokenCount (fix 1a2ee0ecd5b0cff52922c1d261f7d03a57a52ca0) Change-Id: I2def3a427585fd281fb0b25e90060b2a2037212b diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 0a95499c84c9..6c10f95e7094 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -75,8 +74,6 @@ #define PMGCHUNG_msOG 0x6d734f47 // Microsoft Office Animated GIF -using comphelper::string::getTokenCount; - typedef ::std::vector< GraphicFilter* > FilterList_impl; static FilterList_impl* pFilterHdlList = nullptr; @@ -2011,11 +2008,16 @@ ErrCode GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPath, { ImpFilterLibCacheEntry* pFilter = nullptr; -// find first filter in filter paths -sal_Int32 i, nTokenCount = getTokenCount(aFilterPath, ';'); -ImpFilterLibCache &rCache = Cache::get(); -for( i = 0; ( i < nTokenCount ) && ( pFilter == nullptr ); i++ ) -pFilter = rCache.GetFilter(aFilterPath.getToken(i, ';'), aFilterName, aExternalFilterName); +if (!aFilterPath.isEmpty()) +{ +// find first filter in filter paths +ImpFilterLibCache &rCache = Cache::get(); +sal_Int32 nIdx{0}; +do { +pFilter = rCache.GetFilter(aFilterPath.getToken(0, ';', nIdx), aFilterName, aExternalFilterName); +} while (nIdx>=0 && pFilter==nullptr); +} + if( !pFilter ) nStatus = ERRCODE_GRFILTER_FILTERERROR; else ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 7 commits - sw/source
sw/source/core/inc/SwXMLTextBlocks.hxx |1 sw/source/core/layout/pagechg.cxx | 15 +- sw/source/core/layout/pagedesc.cxx |2 sw/source/core/layout/paintfrm.cxx | 40 +++ sw/source/core/layout/ssfrm.cxx| 10 + sw/source/core/layout/tabfrm.cxx | 22 ++-- sw/source/core/layout/trvlfrm.cxx | 12 +- sw/source/core/swg/SwXMLTextBlocks.cxx | 23 +--- sw/source/core/swg/swblocks.cxx| 33 +++--- sw/source/core/table/swnewtable.cxx| 169 - 10 files changed, 159 insertions(+), 168 deletions(-) New commits: commit 47647601c1b5c22d0d3881e47b1f3a46a304 Author: Matteo Casalin Date: Sun Oct 26 10:31:10 2014 +0100 Simplify and optimize booleans expressions Change-Id: Ic5d736cdd48565c62958de72b08714922f1c56e5 diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index 811fb36..45a3252 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -1176,7 +1176,7 @@ SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, bool bFtn ) if ( rDesc.GetNumOffset() ) { ::boost::optional oNumOffset = rDesc.GetNumOffset(); -bWishedOdd = ((oNumOffset ? oNumOffset.get() : 0) % 2) ? true : false; +bWishedOdd = oNumOffset && (oNumOffset.get() % 2) != 0; // use the opportunity to set the flag at root pRoot->SetVirtPageNum( true ); } @@ -1421,7 +1421,7 @@ void SwRootFrm::AssertFlyPages() if ( nMaxPg > pPage->GetPhyPageNum() ) { // Continue pages based on the rules of the PageDesc after the last page. -bool bOdd = (pPage->GetPhyPageNum() % 2) ? sal_True : sal_False; +bool bOdd = (pPage->GetPhyPageNum() % 2) != 0; SwPageDesc *pDesc = pPage->GetPageDesc(); SwFrm *pSibling = pPage->GetNext(); for ( sal_uInt16 i = pPage->GetPhyPageNum(); i < nMaxPg; ++i ) @@ -1432,7 +1432,7 @@ void SwRootFrm::AssertFlyPages() pPage = new SwPageFrm( pDoc->GetEmptyPageFmt(), this, pDesc ); pPage->Paste( this, pSibling ); pPage->PreparePage( false ); -bOdd = bOdd ? sal_False : sal_True; +bOdd = !bOdd; ++i; } pPage = new @@ -1440,7 +1440,7 @@ void SwRootFrm::AssertFlyPages() pDesc->GetLeftFmt()), this, pDesc ); pPage->Paste( this, pSibling ); pPage->PreparePage( false ); -bOdd = bOdd ? sal_False : sal_True; +bOdd = !bOdd; pDesc = pDesc->GetFollow(); } // If the endnote pages are now corrupt, destroy them. diff --git a/sw/source/core/layout/pagedesc.cxx b/sw/source/core/layout/pagedesc.cxx index d041840..f26f4cd 100644 --- a/sw/source/core/layout/pagedesc.cxx +++ b/sw/source/core/layout/pagedesc.cxx @@ -319,7 +319,7 @@ SwFrmFmt *SwPageDesc::GetRightFmt(bool const bFirst) bool SwPageDesc::IsFirstShared() const { -return eUse & nsUseOnPage::PD_FIRSTSHARE ? sal_True : sal_False; +return (eUse & nsUseOnPage::PD_FIRSTSHARE) != 0; } void SwPageDesc::ChgFirstShare( bool bNew ) diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 75bc9cb..a382659 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -262,7 +262,7 @@ static double aEdgeScale = 0.5; // The help lines will be collected and merged in pSubsLines. These will // be compared with pLines before the work in order to avoid help lines // to hide borders. -// bTablines is sal_True during the Paint of a table. +// bTablines is true during the Paint of a table. static BorderLines *g_pBorderLines = 0; static SwLineRects *pLines = 0; static SwSubsRects *pSubsLines = 0; @@ -3212,7 +3212,7 @@ void SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) c SwLayAction aAction( (SwRootFrm*)this, pSh->Imp() ); aAction.SetPaint( false ); aAction.SetComplete( false ); -aAction.SetReschedule( pProgress ? sal_True : sal_False ); +aAction.SetReschedule( pProgress != nullptr ); aAction.Action(); ((SwRootFrm*)this)->ResetTurboFlag(); if ( !pSh->ActionPend() ) @@ -4161,7 +4161,7 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const tools::PolyPolygon aPoly; if ( bContour ) { -// OD 16.04.2003 #i13147# - add 2nd parameter with value +// OD 16.04.2003 #i13147# - add 2nd parameter with value // to indicate that method is called for paint in order to avoid // load of the intrinsic graphic. bContour = GetContour( aPoly, true ); @@ -6503,7 +6503,7 @@ void SwFrm::PaintBackground( const SwRe
[Libreoffice-commits] core.git: sw/source
sw/source/core/fields/authfld.cxx | 10 - sw/source/core/fields/dbfld.cxx | 19 --- sw/source/core/fields/ddefld.cxx|5 sw/source/core/fields/docufld.cxx | 40 +-- sw/source/core/fields/expfld.cxx| 20 --- sw/source/core/fields/fldbas.cxx|5 sw/source/core/fields/flddat.cxx| 10 - sw/source/core/fields/scrptfld.cxx |2 sw/source/core/fields/tblcalc.cxx |5 sw/source/core/fields/usrfld.cxx| 15 -- sw/source/core/graphic/grfatr.cxx |4 sw/source/core/layout/atrfrm.cxx| 77 +++-- sw/source/core/para/paratr.cxx |2 sw/source/core/txtnode/fmtatr2.cxx |2 sw/source/core/unocore/unocrsrhelper.cxx|6 - sw/source/core/unocore/unodraw.cxx |5 sw/source/core/unocore/unofield.cxx | 16 +- sw/source/core/unocore/unoframe.cxx |6 - sw/source/core/unocore/unoidx.cxx |3 sw/source/core/unocore/unoobj.cxx |2 sw/source/core/unocore/unoport.cxx |4 sw/source/core/unocore/unoredline.cxx | 15 -- sw/source/core/unocore/unosect.cxx | 10 - sw/source/core/unocore/unosett.cxx | 41 +-- sw/source/core/unocore/unosrch.cxx |4 sw/source/core/unocore/unostyle.cxx | 27 +--- sw/source/core/unocore/unotbl.cxx | 27 +--- sw/source/filter/html/htmlform.cxx | 23 +--- sw/source/filter/xml/XMLRedlineImportHelper.cxx |9 - sw/source/filter/xml/swxml.cxx | 33 + sw/source/filter/xml/wrtxml.cxx | 18 --- sw/source/filter/xml/xmlexp.cxx |7 - sw/source/filter/xml/xmlimp.cxx | 10 - sw/source/filter/xml/xmltexte.cxx |6 - sw/source/ui/dbui/dbinsdlg.cxx | 23 +--- sw/source/ui/frmdlg/frmpage.cxx |4 sw/source/ui/index/cntex.cxx| 11 - sw/source/uibase/config/modcfg.cxx | 54 +++-- sw/source/uibase/config/prtopt.cxx | 34 ++ sw/source/uibase/config/usrpref.cxx | 20 +-- sw/source/uibase/envelp/envimg.cxx |5 sw/source/uibase/envelp/labimg.cxx |9 - sw/source/uibase/uiview/view.cxx|6 - sw/source/uibase/uiview/view0.cxx |5 sw/source/uibase/uiview/view2.cxx |4 sw/source/uibase/uno/SwXDocumentSettings.cxx| 136 +++- sw/source/uibase/uno/unomod.cxx |4 sw/source/uibase/uno/unotxdoc.cxx | 10 - sw/source/uibase/utlui/navicfg.cxx |5 sw/source/uibase/utlui/unotools.cxx |9 - 50 files changed, 260 insertions(+), 567 deletions(-) New commits: commit 8aac6ecc58fa2c475f34817e607efb6a31317898 Author: Matteo Casalin Date: Sun Nov 30 18:33:21 2014 +0100 Use Any specializations for bool, instead of SetValue Change-Id: I7a5babe494bdb09a71164ea74d7be3f6bf985ff6 Reviewed-on: https://gerrit.libreoffice.org/13215 Tested-by: LibreOffice gerrit bot Reviewed-by: Michael Stahl diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx index b001b84..56060cd 100644 --- a/sw/source/core/fields/authfld.cxx +++ b/sw/source/core/fields/authfld.cxx @@ -379,11 +379,11 @@ bool SwAuthorityFieldType::QueryValue( Any& rVal, sal_uInt16 nWhichId ) const break; case FIELD_PROP_BOOL1: +rVal <<= m_bIsSequence; +break; + case FIELD_PROP_BOOL2: -{ -sal_Bool bVal = FIELD_PROP_BOOL1 == nWhichId ? m_bIsSequence: m_bSortByDocument; -rVal.setValue(&bVal, ::getBooleanCppuType()); -} +rVal <<= m_bSortByDocument; break; case FIELD_PROP_LOCALE: @@ -402,7 +402,7 @@ bool SwAuthorityFieldType::QueryValue( Any& rVal, sal_uInt16 nWhichId ) const pValue[0].Name = UNO_NAME_SORT_KEY; pValue[0].Value <<= sal_Int16(pKey->eField); pValue[1].Name = UNO_NAME_IS_SORT_ASCENDING; -pValue[1].Value.setValue(&pKey->bSortAscending, ::getBooleanCppuType()); +pValue[1].Value <<= pKey->bSortAscending; } rVal <<= aRet; } diff --git a/sw/source/core/fields/dbfld.cxx b/sw/source/core/fields/dbfld.cxx index edc94d0..eca0e53 100644 --- a/sw/source/core/fields/dbfld.cxx +++ b/sw/source/core/fields/dbfld.cxx @@ -366,17 +366,11 @@ bool SwDBField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const switch( nWhichId ) { case FIELD_PROP_BOOL1: -{ -sal_Bool b
[Libreoffice-commits] core.git: 23 commits - sw/inc sw/source
/inputwin.cxx|2 sw/source/uibase/shells/basesh.cxx |7 - sw/source/uibase/shells/textfld.cxx |6 sw/source/uibase/shells/textglos.cxx|2 sw/source/uibase/shells/textsh.cxx |2 sw/source/uibase/shells/textsh1.cxx |6 sw/source/uibase/uiview/view.cxx|7 - sw/source/uibase/uiview/view2.cxx |4 sw/source/uibase/uiview/viewling.cxx|4 sw/source/uibase/uiview/viewprt.cxx |4 sw/source/uibase/uiview/viewstat.cxx|7 - sw/source/uibase/uiview/viewtab.cxx |6 sw/source/uibase/uno/unoatxt.cxx|2 sw/source/uibase/uno/unomailmerge.cxx |4 sw/source/uibase/uno/unomod.cxx |3 sw/source/uibase/uno/unotxdoc.cxx |4 sw/source/uibase/uno/unotxvw.cxx|6 sw/source/uibase/utlui/content.cxx |4 sw/source/uibase/utlui/unotools.cxx |4 sw/source/uibase/wrtsh/wrtsh1.cxx | 22 +-- 172 files changed, 550 insertions(+), 619 deletions(-) New commits: commit 1e0c847a6049e923e40954fcc4339e6989d80a69 Author: Matteo Casalin Date: Sun Nov 16 14:49:16 2014 +0100 sal_True/sal_False to true/false in calls to getWordBoundary Change-Id: I6116b4c2b8e03e819a430cbdcb7874af6508fb62 diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx index e5c9073..c9a8b5d 100644 --- a/sw/source/core/crsr/swcrsr.cxx +++ b/sw/source/core/crsr/swcrsr.cxx @@ -1200,7 +1200,7 @@ bool SwCursor::IsInWordWT( sal_Int16 nWordType ) const pTxtNd->GetTxt(), nPtPos, g_pBreakIt->GetLocale( pTxtNd->GetLang( nPtPos ) ), nWordType, -sal_True ); +true ); bRet = aBoundary.startPos != aBoundary.endPos && aBoundary.startPos <= nPtPos && @@ -1242,7 +1242,7 @@ bool SwCursor::GoStartWordWT( sal_Int16 nWordType ) pTxtNd->GetTxt(), nPtPos, g_pBreakIt->GetLocale( pTxtNd->GetLang( nPtPos ) ), nWordType, -sal_False ).startPos; +false ).startPos; if (nPtPos < pTxtNd->GetTxt().getLength() && nPtPos >= 0) { @@ -1266,7 +1266,7 @@ bool SwCursor::GoEndWordWT( sal_Int16 nWordType ) pTxtNd->GetTxt(), nPtPos, g_pBreakIt->GetLocale( pTxtNd->GetLang( nPtPos ) ), nWordType, -sal_True ).endPos; +true ).endPos; if (nPtPos <= pTxtNd->GetTxt().getLength() && nPtPos >= 0 && GetPoint()->nContent.GetIndex() != nPtPos ) diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index 7e99c27..a39b961 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -1315,7 +1315,7 @@ namespace //local functions originally from docfmt.cxx pTxtNd->GetTxt(), nPtPos, g_pBreakIt->GetLocale( pTxtNd->GetLang( nPtPos ) ), WordType::ANY_WORD /*ANYWORD_IGNOREWHITESPACES*/, -sal_True ); +true ); if( aBndry.startPos < nPtPos && nPtPos < aBndry.endPos ) { @@ -2513,7 +2513,7 @@ void DocumentContentOperationsManager::TransliterateText( pTNd->GetTxt(), nSttCnt, g_pBreakIt->GetLocale( pTNd->GetLang( nSttCnt ) ), WordType::ANY_WORD /*ANYWORD_IGNOREWHITESPACES*/, -sal_True ); +true ); if( aBndry.startPos < nSttCnt && nSttCnt < aBndry.endPos ) { diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index db36809..dbe7168 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -267,7 +267,7 @@ void SwDoc::ResetAttrs( const SwPaM &rRg, pTxtNd->GetTxt(), nPtPos, g_pBreakIt->GetLocale( pTxtNd->GetLang( nPtPos ) ), WordType::ANY_WORD /*ANYWORD_IGNOREWHITESPACES*/, -sal_True ); +
SfxFilterMatcher::GuessFilter called with sal_False instead of SfxFilterFlags
Hi all, I found some call sites [1] to SfxFilterMatcher::GuessFilter which pass a sal_False value instead of a SfxFilterFlags, and among the defined flags I just see SFX_FILTER_VERSION_NONE (which is never used in the code, anyway) with a 0 value. These calls seems to be like this from the beginning and I really haven't got a clue if sal_False should be changed to 0 (or SFX_FILTER_VERSION_NONE), to something else, just deleted, or whatever. Any idea? Thanks Matteo [1] http://opengrok.libreoffice.org/xref/core/sw/source/uibase/dochdl/gloshdl.cxx#732 http://opengrok.libreoffice.org/xref/core/sw/source/core/unocore/unocrsrhelper.cxx#1020 http://opengrok.libreoffice.org/xref/core/sw/source/uibase/uiview/view2.cxx#2135 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
SfxFilterMatcher::GuessFilter called with sal_False instead of SfxFilterGlags
Hi all, I found some call sites [1] for SfxFilterMatcher::GuessFilter which pass a sal_False value instead of a SfxFilterFlags, and among the defined flags I just see SFX_FILTER_VERSION_NONE (which is never used in the code, anyway) with a 0 value. These calls seems to be like this from the beginning and I really haven't got a clue if sal_False should be changed to 0 (or SFX_FILTER_VERSION_NONE), to something else, just deleted, or whatever. Any idea? Thanks Matteo [1] http://opengrok.libreoffice.org/xref/core/sw/source/uibase/dochdl/gloshdl.cxx#732 http://opengrok.libreoffice.org/xref/core/sw/source/core/unocore/unocrsrhelper.cxx#1020 http://opengrok.libreoffice.org/xref/core/sw/source/uibase/uiview/view2.cxx#2135 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: SfxFilterMatcher::GuessFilter called with sal_False instead of SfxFilterGlags
Great! Thanks Caolán. Matteo On Mon, 17 Nov 2014 10:42:03 + Caolán McNamara wrote: > On Sun, 2014-11-16 at 19:59 +0100, Matteo Casalin wrote: > > Hi all, > > I found some call sites [1] for SfxFilterMatcher::GuessFilter which > > pass a sal_False value instead of a SfxFilterFlags, and among the > > defined flags I just see SFX_FILTER_VERSION_NONE (which is never used in > > the code, anyway) with a 0 value. These calls seems to be like this from > > the beginning and I really haven't got a clue if sal_False should be > > changed to 0 (or SFX_FILTER_VERSION_NONE), to something else, just > > deleted, or whatever. > > The safest and easiest thing IMO is to just change from from sal_False > to SFX_FILTER_VERSION_NONE so I've done that change now. > > C. > > ___ > LibreOffice mailing list > LibreOffice@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/libreoffice ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Questions about bool or sal_Bool in Any::setValue, makeAny
Hi all, I was converting all sw call-places to Any::setValue that pass sal_Bool to use bool instead. I wonder if this is a good choice or not, is there any guideline? Also some of these call places look like: sal_Bool bTrue = sal_True; uno::Any aVal(&bTrue, ::getBooleanCppuType()); some_function_call( aVal ); or uno::Any aAny; sal_Bool bFalse = sal_False; aTmp.setValue(&bFalse, ::getBooleanCppuType() ); some_function_call( aTmp ); could these be changed to use makeAny(bool)? Does this hold also if the same Any object is used multiple times (each time calling setValue on it)? Thanks Matteo ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: Questions about bool or sal_Bool in Any::setValue, makeAny
On 11/17/2014 10:39 PM, Michael Stahl wrote: On 16.11.2014 19:57, Matteo Casalin wrote: Hi all, I was converting all sw call-places to Any::setValue that pass sal_Bool to use bool instead. I wonder if this is a good choice or not, is there any guideline? it looks like the Any has specific support for C++ bool so it should work fine. I confirm that the code compiles fine (on Linux x86_64), so I'll proceed with these changes. Also some of these call places look like: sal_Bool bTrue = sal_True; uno::Any aVal(&bTrue, ::getBooleanCppuType()); some_function_call( aVal ); or uno::Any aAny; sal_Bool bFalse = sal_False; aTmp.setValue(&bFalse, ::getBooleanCppuType() ); some_function_call( aTmp ); could these be changed to use makeAny(bool)? Does this hold also if the same Any object is used multiple times (each time calling setValue on it)? it's much better to use a type-safe method like makeAny() or operator<<= and not the Any::setValue()/getValue() methods that operate on unsafe void*. Thank you Michael for the hints. I will work on a patch that does both bool and makeAny (or <<=) and submit it to gerrit for a final review. Matteo ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice-commits] core.git: 3 commits - sw/source
sw/source/core/table/swtable.cxx | 246 +++ 1 file changed, 126 insertions(+), 120 deletions(-) New commits: commit eff06c85b1263a761657bb3689f7b850db1f0341 Author: Matteo Casalin Date: Sat Oct 4 09:08:48 2014 +0200 Use more proper integer types Change-Id: I4d87647d0a001ef24f9dde91cef85c72b44bcdd2 diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx index 196abd9..99ebf86 100644 --- a/sw/source/core/table/swtable.cxx +++ b/sw/source/core/table/swtable.cxx @@ -316,11 +316,11 @@ static void lcl_ModifyBoxes( SwTableBoxes &rBoxes, const long nOld, static void lcl_ModifyLines( SwTableLines &rLines, const long nOld, const long nNew, std::vector& rFmtArr, const bool bCheckSum ) { -for ( sal_uInt16 i = 0; i < rLines.size(); ++i ) +for ( size_t i = 0; i < rLines.size(); ++i ) ::lcl_ModifyBoxes( rLines[i]->GetTabBoxes(), nOld, nNew, rFmtArr ); if( bCheckSum ) { -for( sal_uInt16 i = 0; i < rFmtArr.size(); ++i ) +for( size_t i = 0; i < rFmtArr.size(); ++i ) { SwFmt* pFmt = rFmtArr[i]; sal_uInt64 nBox = pFmt->GetFrmSize().GetWidth(); @@ -339,7 +339,7 @@ static void lcl_ModifyBoxes( SwTableBoxes &rBoxes, const long nOld, { sal_uInt64 nSum = 0; // To avoid rounding errors we summarize all box widths sal_uInt64 nOriginalSum = 0; // Sum of original widths -for ( sal_uInt16 i = 0; i < rBoxes.size(); ++i ) +for ( size_t i = 0; i < rBoxes.size(); ++i ) { SwTableBox &rBox = *rBoxes[i]; if ( !rBox.GetTabLines().empty() ) @@ -381,7 +381,7 @@ static void lcl_ModifyBoxes( SwTableBoxes &rBoxes, const long nOld, void SwTable::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ) { // catch SSize changes, to adjust the lines/boxes -sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0 ; +const sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0 ; const SwFmtFrmSize* pNewSize = 0, *pOldSize = 0; if( RES_ATTRSET_CHG == nWhich ) @@ -432,12 +432,12 @@ static void lcl_SortedTabColInsert( SwTabCols &rToFill, const SwTableBox *pBox, // The value for the left edge of the box is calculated from the // widths of the previous boxes. -sal_uInt16 nPos = 0; -sal_uInt16 nLeftMin = 0; -sal_uInt16 nRightMax = 0; +long nPos = 0; +long nLeftMin = 0; +long nRightMax = 0; if (nWish != 0) //fdo#33012 0 width frmfmt { -sal_uInt16 nSum = 0; +SwTwips nSum = 0; const SwTableBox *pCur = pBox; const SwTableLine *pLine = pBox->GetUpper(); const long nAct = rToFill.GetRight() - rToFill.GetLeft(); // +1 why? @@ -445,10 +445,10 @@ static void lcl_SortedTabColInsert( SwTabCols &rToFill, const SwTableBox *pBox, while ( pLine ) { const SwTableBoxes &rBoxes = pLine->GetTabBoxes(); -for ( sal_uInt16 i = 0; i < rBoxes.size(); ++i ) +for ( size_t i = 0; i < rBoxes.size(); ++i ) { SwTwips nWidth = rBoxes[i]->GetFrmFmt()->GetFrmSize().GetWidth(); -nSum = (sal_uInt16)(nSum + nWidth); +nSum += nWidth; sal_uInt64 nTmp = nSum; nTmp *= nAct; nTmp /= nWish; @@ -456,14 +456,14 @@ static void lcl_SortedTabColInsert( SwTabCols &rToFill, const SwTableBox *pBox, if (rBoxes[i] != pCur) { if ( pLine == pBox->GetUpper() || 0 == nLeftMin ) -nLeftMin = (sal_uInt16)(nTmp - nPos); -nPos = (sal_uInt16)nTmp; +nLeftMin = static_cast(nTmp - nPos); +nPos = static_cast(nTmp); } else { -nSum = (sal_uInt16)(nSum - nWidth); +nSum -= nWidth; if ( 0 == nRightMax ) -nRightMax = (sal_uInt16)(nTmp - nPos); +nRightMax = static_cast(nTmp - nPos); break; } } @@ -540,10 +540,10 @@ static void lcl_ProcessBoxGet( const SwTableBox *pBox, SwTabCols &rToFill, if ( !pBox->GetTabLines().empty() ) { const SwTableLines &rLines = pBox->GetTabLines(); -for ( sal_uInt16 i = 0; i < rLines.size(); ++i ) +for ( size_t i = 0; i < rLines.size(); ++i ) { const SwTableBoxes &rBoxes = rLines[i]->GetTabBoxes(); -for ( sal_uInt16 j = 0; j < rBoxes.size(); ++j ) +for ( size_t j = 0; j < rBoxes.size(); ++j ) ::lcl_ProcessBoxGet( rBoxes[j], rToFill, pTabFmt, bRefreshHidden); } } @@ -55
[Libreoffice-commits] core.git: 3 commits - sw/source xmloff/source
sw/source/core/uibase/uno/unomailmerge.cxx |5 ++--- sw/source/ui/dbui/mmpreparemergepage.cxx |1 - xmloff/source/draw/shapeexport.cxx | 17 +++-- 3 files changed, 5 insertions(+), 18 deletions(-) New commits: commit 05c1c60a8258caa7b088bc52e85c4b3d8e70f68a Author: Matteo Casalin Date: Tue Mar 25 08:04:41 2014 +0100 Remove stray fprintf Change-Id: I9d85108b8c2659f1b167299840772f51f80b2e29 diff --git a/sw/source/ui/dbui/mmpreparemergepage.cxx b/sw/source/ui/dbui/mmpreparemergepage.cxx index 60f800f..af42dd3 100644 --- a/sw/source/ui/dbui/mmpreparemergepage.cxx +++ b/sw/source/ui/dbui/mmpreparemergepage.cxx @@ -67,7 +67,6 @@ IMPL_LINK_NOARG(SwMailMergePrepareMergePage, EditDocumentHdl_Impl) IMPL_LINK( SwMailMergePrepareMergePage, MoveHdl_Impl, void*, pCtrl) { -fprintf(stderr, "move\n"); SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem(); sal_Int32 nPos = rConfigItem.GetResultSetPosition(); if (pCtrl == m_pFirstPB) commit cd8c774030f9a8d3abbaf0eb43a5cdd228e643cf Author: Matteo Casalin Date: Mon Mar 24 23:57:38 2014 +0100 Simplify by choosing shape kind in SvXMLElementExport constructor Change-Id: I6d8e1e3c78675b6096f354cace3ff060801cad9e diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 9f119ac..f2f7c1b 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -2096,21 +2096,10 @@ void XMLShapeExport::ImpExportEllipseShape( sal_Bool bCreateNewline( (nFeatures & SEF_EXPORT_NO_WS) == 0 ); // #86116#/#92210# -// prepare name (with most used) -enum ::xmloff::token::XMLTokenEnum eName(XML_CIRCLE); - -if(bCircle) -{ -// name already set -} -else -{ -// set name -eName = XML_ELLIPSE; -} - // write ellipse or circle -SvXMLElementExport aOBJ(mrExport, XML_NAMESPACE_DRAW, eName, bCreateNewline, sal_True); +SvXMLElementExport aOBJ(mrExport, XML_NAMESPACE_DRAW, +bCircle ? XML_CIRCLE : XML_ELLIPSE, +bCreateNewline, sal_True); ImpExportDescription( xShape ); // #i68101# ImpExportEvents( xShape ); commit 794d71c4e990a24539a8dad3d960169538a4b0d4 Author: Matteo Casalin Date: Mon Mar 24 23:40:25 2014 +0100 Use isEmpty and endsWith The isEmpty could be redundant, since the first test for length in the old code seemed to be just a pre-condition for evaluating the expressions in the second one. Change-Id: I0d1838d5eb143196a0d7be0cbadf9f0a59cff71b diff --git a/sw/source/core/uibase/uno/unomailmerge.cxx b/sw/source/core/uibase/uno/unomailmerge.cxx index 63d8199..e72c80a 100644 --- a/sw/source/core/uibase/uno/unomailmerge.cxx +++ b/sw/source/core/uibase/uno/unomailmerge.cxx @@ -723,9 +723,8 @@ uno::Any SAL_CALL SwXMailMerge::execute( aURLObj.SetSmartURL( aCurOutputURL ); OUString aPath = aURLObj.GetMainURL( INetURLObject::DECODE_TO_IURI ); -OUString aDelim = OUString(INET_PATH_TOKEN); -if (aPath.getLength() >= aDelim.getLength() && -aPath.copy( aPath.getLength() - aDelim.getLength() ) != aDelim) +const OUString aDelim = OUString(INET_PATH_TOKEN); +if (!aPath.isEmpty() && !aPath.endsWith(aDelim)) aPath += aDelim; if (bCurFileNameFromColumn) pMgr->SetEMailColumn( aCurFileNamePrefix ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 9 commits - sw/source
sw/source/core/uibase/inc/mailmrge.hxx |2 sw/source/ui/envelp/labelexp.cxx |4 - sw/source/ui/envelp/labfmt.cxx | 81 +++-- sw/source/ui/envelp/labprt.cxx |4 - sw/source/ui/envelp/mailmrge.cxx | 40 +++- 5 files changed, 61 insertions(+), 70 deletions(-) New commits: commit 4e9565b24b3a1d393cc7093b363709c233de9d43 Author: Matteo Casalin Date: Sun Mar 30 23:35:07 2014 +0200 sal_uInt16 to sal_Int32 Change-Id: I7c658f74c70daeece6343e69bd89313d22620a60 diff --git a/sw/source/ui/envelp/labelexp.cxx b/sw/source/ui/envelp/labelexp.cxx index 669d513..649323c 100644 --- a/sw/source/ui/envelp/labelexp.cxx +++ b/sw/source/ui/envelp/labelexp.cxx @@ -52,7 +52,7 @@ void SwVisitingCardPage::InitFrameControl() uno::Sequence aNames = m_xAutoText->getElementNames(); const OUString* pGroups = aNames.getConstArray(); -for(sal_uInt16 i = 0; i < aNames.getLength(); i++) +for(sal_Int32 i = 0; i < aNames.getLength(); ++i) { uno::Any aGroup = m_xAutoText->getByName(pGroups[i]); uno::Reference< text::XAutoTextGroup > xGroup; @@ -66,7 +66,7 @@ void SwVisitingCardPage::InitFrameControl() uno::Any aTitle = xPrSet->getPropertyValue( UNO_NAME_TITLE ); OUString uTitle; aTitle >>= uTitle; -sal_uInt16 nEntry = m_pAutoTextGroupLB->InsertEntry(uTitle); +const sal_Int32 nEntry = m_pAutoTextGroupLB->InsertEntry(uTitle); m_pAutoTextGroupLB->SetEntryData(nEntry, new OUString(pGroups[i])); } } commit fa8f89cf46da59c4362537103f4cae39c7e4362d Author: Matteo Casalin Date: Sun Mar 30 23:30:06 2014 +0200 sal_uInt16 to sal_Int32/size_t Change-Id: I1c6a0aff1515e8e4fe86f2027f405a9a7c7aa579 diff --git a/sw/source/ui/envelp/labfmt.cxx b/sw/source/ui/envelp/labfmt.cxx index 1e06a910..c763b0e 100644 --- a/sw/source/ui/envelp/labfmt.cxx +++ b/sw/source/ui/envelp/labfmt.cxx @@ -157,8 +157,10 @@ void SwLabPreview::Paint(const Rectangle &) // Labels SetClipRegion(Region(Rectangle(Point(lX0, lY0), Size(lOutlineW, lOutlineH; SetFillColor( COL_LIGHTGRAYBLUE ); -for (sal_uInt16 nRow = 0; nRow < std::min((sal_uInt16) 2, (sal_uInt16) aItem.nRows); nRow++) -for (sal_uInt16 nCol = 0; nCol < std::min((sal_uInt16) 2, (sal_uInt16) aItem.nCols); nCol++) +const sal_Int32 nRows = std::min(2, aItem.nRows); +const sal_Int32 nCols = std::min(2, aItem.nCols); +for (sal_Int32 nRow = 0; nRow < nRows; ++nRow) +for (sal_Int32 nCol = 0; nCol < nCols; ++nCol) DrawRect(Rectangle( Point(lX0 + ROUND(f * (aItem.lLeft + nCol * aItem.lHDist)), lY0 + ROUND(f * (aItem.lUpper + nRow * aItem.lVDist))), @@ -495,8 +497,8 @@ void SwLabFmtPage::FillItem(SwLabItem& rItem) rItem.lHeight = rRec.lHeight = static_cast< long >(GETFLDVAL(*m_pHeightField)); rItem.lLeft = rRec.lLeft = static_cast< long >(GETFLDVAL(*m_pLeftField )); rItem.lUpper = rRec.lUpper = static_cast< long >(GETFLDVAL(*m_pUpperField )); -rItem.nCols = rRec.nCols = (sal_uInt16) m_pColsField->GetValue(); -rItem.nRows = rRec.nRows = (sal_uInt16) m_pRowsField->GetValue(); +rItem.nCols = rRec.nCols = static_cast< sal_Int32 >(m_pColsField->GetValue()); +rItem.nRows = rRec.nRows = static_cast< sal_Int32 >(m_pRowsField->GetValue()); rItem.lPWidth = rRec.lPWidth = static_cast< long >(GETFLDVAL(*m_pPWidthField )); rItem.lPHeight = rRec.lPHeight = static_cast< long >(GETFLDVAL(*m_pPHeightField)); } @@ -552,8 +554,8 @@ IMPL_LINK_NOARG(SwLabFmtPage, SaveHdl) aRec.lHeight = static_cast< long >(GETFLDVAL(*m_pHeightField)); aRec.lLeft = static_cast< long >(GETFLDVAL(*m_pLeftField )); aRec.lUpper = static_cast< long >(GETFLDVAL(*m_pUpperField )); -aRec.nCols = (sal_uInt16) m_pColsField->GetValue(); -aRec.nRows = (sal_uInt16) m_pRowsField->GetValue(); +aRec.nCols = static_cast< sal_Int32 >(m_pColsField->GetValue()); +aRec.nRows = static_cast< sal_Int32 >(m_pRowsField->GetValue()); aRec.lPWidth = static_cast< long >(GETFLDVAL(*m_pPWidthField )); aRec.lPHeight = static_cast< long >(GETFLDVAL(*m_pPHeightField)); aRec.bCont = aItem.bCont; @@ -594,7 +596,7 @@ SwSaveLabelDlg::SwSaveLabelDlg(SwLabFmtPage* pParent, SwLabRec& rRec) SwLabelConfig& rCfg = pLabPage->GetParentSwLabDlg()->GetLabelsConfig(); const std::vector& rMan = rCfg.GetManufacturers(); -for (sal_uInt16 i = 0; i < rMan.size(); i++) +for (size_t i = 0; i < rMan.size(); ++i) { m_pMakeCB->InsertEntry(rMan[i])
[Libreoffice-commits] core.git: 20 commits - sw/source
sw/source/ui/dbui/mmlayoutpage.cxx | 116 ++--- sw/source/ui/dialog/ascfldlg.cxx | 27 sw/source/ui/dialog/uiregionsw.cxx | 105 - sw/source/ui/envelp/envfmt.cxx | 30 - sw/source/ui/envelp/envlop1.cxx| 48 +++ sw/source/ui/envelp/envprt.cxx |6 - sw/source/ui/envelp/envprt.hxx |2 sw/source/ui/envelp/label1.cxx | 39 ++-- 8 files changed, 171 insertions(+), 202 deletions(-) New commits: commit dab78653430200bab325db6348734e570a34fe12 Author: Matteo Casalin Date: Sat Apr 5 23:21:44 2014 +0200 OUString: constify and avoid concatenated appends Change-Id: I1bef9af92107d4cb4ac869dd0f6cbd2853302330 diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx index 86192c6..4cbcadf 100644 --- a/sw/source/ui/dbui/mmlayoutpage.cxx +++ b/sw/source/ui/dbui/mmlayoutpage.cxx @@ -114,7 +114,7 @@ SwMailMergeLayoutPage::SwMailMergeLayoutPage( SwMailMergeWizard* _pParent) : uno::Sequence< beans::PropertyValue > aValues(1); beans::PropertyValue* pValues = aValues.getArray(); pValues[0].Name = "FilterName"; -pValues[0].Value <<= OUString(pSfxFlt->GetFilterName()); +pValues[0].Value <<= pSfxFlt->GetFilterName(); uno::Reference< frame::XStorable > xStore( pView->GetDocShell()->GetModel(), uno::UNO_QUERY); xStore->storeToURL( m_sExampleURL, aValues ); @@ -302,14 +302,10 @@ SwFrmFmt* SwMailMergeLayoutPage::InsertAddressFrame( SwFldMgr aFldMgr(&rShell); //create a database string source.command.commandtype.column const SwDBData& rData = rConfigItem.GetCurrentDBData(); -OUString sDBName(rData.sDataSource); -sDBName += OUString(DB_DELIM); -sDBName += rData.sCommand; -sDBName += OUString(DB_DELIM); -OUString sDatabaseConditionPrefix(sDBName); -sDatabaseConditionPrefix = sDatabaseConditionPrefix.replace(DB_DELIM, '.'); -sDBName += OUString::number(rData.nCommandType); -sDBName += OUString(DB_DELIM); +OUString sDBName(rData.sDataSource + OUString(DB_DELIM) ++ rData.sCommand + OUString(DB_DELIM)); +const OUString sDatabaseConditionPrefix(sDBName.replace(DB_DELIM, '.')); +sDBName += OUString::number(rData.nCommandType) + OUString(DB_DELIM); // if only the country is in an address line the // paragraph has to be hidden depending on the @@ -321,12 +317,13 @@ SwFrmFmt* SwMailMergeLayoutPage::InsertAddressFrame( bool bSpecialReplacementForCountry = (!bIncludeCountry || !rExcludeCountry.isEmpty()); const ResStringArray& rHeaders = rConfigItem.GetDefaultAddressHeaders(); -OUString sCountryColumn = rHeaders.GetString(MM_PART_COUNTRY); Sequence< OUString> aAssignment = rConfigItem.GetColumnAssignment( rConfigItem.GetCurrentDBData() ); const OUString* pAssignment = aAssignment.getConstArray(); -if(aAssignment.getLength() > MM_PART_COUNTRY && !aAssignment[MM_PART_COUNTRY].isEmpty()) -sCountryColumn = aAssignment[MM_PART_COUNTRY]; +const OUString sCountryColumn( +(aAssignment.getLength() > MM_PART_COUNTRY && !aAssignment[MM_PART_COUNTRY].isEmpty()) +? aAssignment[MM_PART_COUNTRY] +: rHeaders.GetString(MM_PART_COUNTRY)); OUString sHideParagraphsExpression; SwAddressIterator aIter(aBlocks[0]); @@ -348,8 +345,7 @@ SwFrmFmt* SwMailMergeLayoutPage::InsertAddressFrame( break; } } -OUString sDB(sDBName); -sDB += sConvertedColumn; +const OUString sDB(sDBName + sConvertedColumn); if(!sHideParagraphsExpression.isEmpty()) sHideParagraphsExpression += " AND "; @@ -358,19 +354,18 @@ SwFrmFmt* SwMailMergeLayoutPage::InsertAddressFrame( if( bSpecialReplacementForCountry && sCountryColumn == sConvertedColumn ) { // now insert a hidden paragraph field -OUString sExpression; if( !rExcludeCountry.isEmpty() ) { -sExpression = "[" + sDatabaseConditionPrefix + sCountryColumn + "]"; - -OUString sCondition = sExpression + " != \"" + rExcludeCountry + "\""; - -SwInsertFld_Data aData(TYP_CONDTXTFLD, 0, sCondition, sExpression, 0, &rShell ); +const OUString sExpression("[" + sDatabaseConditionPrefix + sCountryColumn + "]"); +
[Libreoffice-commits] core.git: 2 commits - sw/source
sw/source/core/doc/DocumentLinksAdministrationManager.cxx |2 sw/source/core/doc/DocumentOutlineNodesManager.cxx| 10 +- sw/source/core/doc/DocumentSettingManager.cxx |2 sw/source/core/doc/doc.cxx| 49 ++ 4 files changed, 31 insertions(+), 32 deletions(-) New commits: commit af76cc04722386f2635e0fe2ce196974f356deaf Author: Matteo Casalin Date: Sat Jan 24 09:39:44 2015 +0100 Use more proper integer types Change-Id: I43116c77b05d6c695c6f38c373f9d48e67ab8f20 diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index 034c122..1a470e0 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -525,7 +525,7 @@ sal_uInt16 _PostItFld::GetPageNo( //Probably only once. For the page number we don't select a random one, //but the PostIt's first occurrence in the selected area. rVirtPgNo = 0; -sal_uInt16 nPos = GetCntnt(); +const sal_Int32 nPos = GetCntnt(); SwIterator aIter( GetTxtFld()->GetTxtNode() ); for( SwTxtFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() ) { @@ -738,7 +738,8 @@ void SwDoc::UpdatePagesForPrintingWithPostItData( sal_Int16 nPostItMode = (sal_Int16) rOptions.getIntValue( "PrintAnnotationMode", 0 ); OSL_ENSURE(nPostItMode == POSTITS_NONE || rData.HasPostItData(), "print post-its without post-it data?" ); -const sal_uInt16 nPostItCount = rData.HasPostItData() ? rData.m_pPostItFields->size() : 0; +const _SetGetExpFlds::size_type nPostItCount = +rData.HasPostItData() ? rData.m_pPostItFields->size() : 0; if (nPostItMode != POSTITS_NONE && nPostItCount > 0) { SET_CURR_SHELL( rData.m_pPostItShell.get() ); @@ -765,7 +766,7 @@ void SwDoc::UpdatePagesForPrintingWithPostItData( // already get them in the correct order sal_uInt16 nVirtPg = 0, nLineNo = 0, nLastPageNum = 0, nPhyPageNum = 0; bool bIsFirstPostIt = true; -for (sal_uInt16 i = 0; i < nPostItCount; ++i) +for (_SetGetExpFlds::size_type i = 0; i < nPostItCount; ++i) { _PostItFld& rPostIt = static_cast<_PostItFld&>(*(*rData.m_pPostItFields)[ i ]); nLastPageNum = nPhyPageNum; @@ -895,8 +896,7 @@ void SwDoc::CalculatePagePairsForProspectPrinting( return; const SwPageFrm *pStPage = dynamic_cast( rLayout.Lower() ); -sal_Int32 i = 0; -for ( i = 1; pStPage && i < nDocPageCount; ++i ) +for ( sal_Int32 i = 1; pStPage && i < nDocPageCount; ++i ) pStPage = static_cast(pStPage->GetNext()); if ( !pStPage ) // Then it was that return; @@ -936,7 +936,7 @@ void SwDoc::CalculatePagePairsForProspectPrinting( // now fill the vector for calculating the page pairs with the start frames // from the above obtained vector std::vector< const SwPageFrm * > aVec; -for ( i = 0; i < sal_Int32(aPagesToPrint.size()); ++i) +for ( std::vector< sal_Int32 >::size_type i = 0; i < aPagesToPrint.size(); ++i) { const sal_Int32 nPage = aPagesToPrint[i]; const SwPageFrm *pFrm = validStartFrms[ nPage ]; @@ -956,9 +956,9 @@ void SwDoc::CalculatePagePairsForProspectPrinting( } // make sure that all pages are in correct order -sal_uInt16 nSPg = 0; -sal_uInt32 nEPg = aVec.size(); -sal_uInt16 nStep = 1; +std::vector< const SwPageFrm * >::size_type nSPg = 0; +std::vector< const SwPageFrm * >::size_type nEPg = aVec.size(); +sal_Int32 nStep = 1; if ( 0 == (nEPg & 1 )) // there are no uneven ones! --nEPg; @@ -973,7 +973,7 @@ void SwDoc::CalculatePagePairsForProspectPrinting( // the number of 'virtual' pages to be printed sal_Int32 nCntPage = (( nEPg - nSPg ) / ( 2 * nStep )) + 1; -for ( sal_uInt16 nPrintCount = 0; nSPg < nEPg && +for ( sal_Int32 nPrintCount = 0; nSPg < nEPg && nPrintCount < nCntPage; ++nPrintCount ) { pStPage = aVec[ nSPg ]; @@ -1196,20 +1196,19 @@ void SwDoc::Summary( SwDoc* pExtDoc, sal_uInt8 nLevel, sal_uInt8 nPara, bool bIm const SwOutlineNodes& rOutNds = GetNodes().GetOutLineNds(); if( pExtDoc && !rOutNds.empty() ) { -sal_uInt16 i; ::StartProgress( STR_STATSTR_SUMMARY, 0, rOutNds.size(), GetDocShell() ); SwNodeIndex aEndOfDoc( pExtDoc->GetNodes().GetEndOfContent(), -1 ); -for( i = 0; i < rOutNds.size(); ++i ) +for( SwOutlineNodes::size_type i = 0; i < rOutNds.size(); ++i ) { -::SetProgressState( i, GetDocShell() ); +::SetProgressState( static_cast(i), GetDocShell() ); const sal_uLong nIndex = rOutNds[ i ]->GetIndex(); const int nLvl = GetNodes()[ nIndex ]-&g
[Libreoffice-commits] core.git: 2 commits - sw/source
sw/source/core/table/swtable.cxx | 95 ++- 1 file changed, 45 insertions(+), 50 deletions(-) New commits: commit ac33cafa2e20a26f5af3d4030ae7dd152b2744e7 Author: Matteo Casalin Date: Sat Jan 24 11:13:14 2015 +0100 long should be fine here Change-Id: Ieeceab68104bf4a9185bdd2317972f4f867edd1d diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx index b392238..2f275d2 100644 --- a/sw/source/core/table/swtable.cxx +++ b/sw/source/core/table/swtable.cxx @@ -1228,8 +1228,8 @@ void SwTable::NewSetTabCols( Parm &rParm, const SwTabCols &rNew, return; for( size_t i = 0; i <= rOld.Count(); ++i ) { -sal_uInt64 nNewPos; -sal_uInt64 nOldPos; +long nNewPos; +long nOldPos; if( i == rOld.Count() ) { nOldPos = rParm.rOld.GetRight() - rParm.rOld.GetLeft(); @@ -1240,8 +1240,8 @@ void SwTable::NewSetTabCols( Parm &rParm, const SwTabCols &rNew, nOldPos = rOld[i] - rParm.rOld.GetLeft(); nNewPos = rNew[i] - rParm.rNew.GetLeft(); } -nNewPos = lcl_MulDiv64(nNewPos, rParm.nNewWish, nNewWidth); -nOldPos = lcl_MulDiv64(nOldPos, rParm.nOldWish, nOldWidth); +nNewPos = lcl_MulDiv64(nNewPos, rParm.nNewWish, nNewWidth); +nOldPos = lcl_MulDiv64(nOldPos, rParm.nOldWish, nOldWidth); if( nOldPos != nNewPos && nNewPos > 0 && nOldPos > 0 ) { ColChange aChg( (sal_uInt16)nOldPos, (sal_uInt16)nNewPos ); commit 7ef1ff6696536857a00ddf136471aceebf5e9772 Author: Matteo Casalin Date: Sat Jan 24 11:02:36 2015 +0100 Group common code (multiplication/division/type conversion) Change-Id: Ib220dcb0e714b9ab4389997d3466ef7240882e23 diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx index ff129a2..b392238 100644 --- a/sw/source/core/table/swtable.cxx +++ b/sw/source/core/table/swtable.cxx @@ -303,6 +303,17 @@ SwTable::~SwTable() delete pHTMLLayout; } +namespace +{ + +template +inline T lcl_MulDiv64(sal_uInt64 nA, sal_uInt64 nM, sal_uInt64 nD) +{ +return static_cast((nA*nM)/nD); +} + +} + static void FmtInArr( std::vector& rFmtArr, SwFmt* pBoxFmt ) { std::vector::const_iterator it = std::find( rFmtArr.begin(), rFmtArr.end(), pBoxFmt ); @@ -323,10 +334,8 @@ static void lcl_ModifyLines( SwTableLines &rLines, const long nOld, for( size_t i = 0; i < rFmtArr.size(); ++i ) { SwFmt* pFmt = rFmtArr[i]; -sal_uInt64 nBox = pFmt->GetFrmSize().GetWidth(); -nBox *= nNew; -nBox /= nOld; -SwFmtFrmSize aNewBox( ATT_VAR_SIZE, SwTwips(nBox), 0 ); +const SwTwips nBox = lcl_MulDiv64(pFmt->GetFrmSize().GetWidth(), nNew, nOld); +SwFmtFrmSize aNewBox( ATT_VAR_SIZE, nBox, 0 ); pFmt->LockModify(); pFmt->SetFmtAttr( aNewBox ); pFmt->UnlockModify(); @@ -353,10 +362,7 @@ static void lcl_ModifyBoxes( SwTableBoxes &rBoxes, const long nOld, nOriginalSum += nBox; nBox *= nNew; nBox /= nOld; -sal_uInt64 nWishedSum = nOriginalSum; -nWishedSum *= nNew; -nWishedSum /= nOld; -nWishedSum -= nSum; +const sal_uInt64 nWishedSum = lcl_MulDiv64(nOriginalSum, nNew, nOld) - nSum; if( nWishedSum > 0 ) { if( nBox == nWishedSum ) @@ -447,23 +453,21 @@ static void lcl_SortedTabColInsert( SwTabCols &rToFill, const SwTableBox *pBox, const SwTableBoxes &rBoxes = pLine->GetTabBoxes(); for ( size_t i = 0; i < rBoxes.size(); ++i ) { -SwTwips nWidth = rBoxes[i]->GetFrmFmt()->GetFrmSize().GetWidth(); +const SwTwips nWidth = rBoxes[i]->GetFrmFmt()->GetFrmSize().GetWidth(); nSum += nWidth; -sal_uInt64 nTmp = nSum; -nTmp *= nAct; -nTmp /= nWish; +const long nTmp = lcl_MulDiv64(nSum, nAct, nWish); if (rBoxes[i] != pCur) { if ( pLine == pBox->GetUpper() || 0 == nLeftMin ) -nLeftMin = static_cast(nTmp - nPos); -nPos = static_cast(nTmp); +nLeftMin = nTmp - nPos; +nPos = nTmp; } else { nSum -= nWidth; if ( 0 == nRightMax ) -nRightMax = static_cast(nTmp - nPos); +nRightMax = nTmp - nPos; break; } } @@ -707,11 +711,9 @@ static void lcl_ProcessBoxSet( SwTableBox *pBox, Parm &rParm ) const SwTableBoxes &rBoxes = pLine->GetTabBoxes(); for (
[Libreoffice-commits] core.git: dtrans/source
dtrans/source/win32/dtobj/FmtFilter.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 3da925eb807d8ccab9a3b928ba7c4c898c2b8d66 Author: Matteo Casalin Date: Sat Jan 24 19:15:39 2015 +0100 Fix warning C4101: ´ex´ : unreferenced local variable Change-Id: I0c8d488047fc7a28a3fa5a47de5da947bb911136 diff --git a/dtrans/source/win32/dtobj/FmtFilter.cxx b/dtrans/source/win32/dtobj/FmtFilter.cxx index 019d840..4063762 100644 --- a/dtrans/source/win32/dtobj/FmtFilter.cxx +++ b/dtrans/source/win32/dtobj/FmtFilter.cxx @@ -448,6 +448,7 @@ std::wstring getShellLinkTarget(const std::wstring& aLnkFile) catch(sal::systools::ComError& ex) { OSL_FAIL(ex.what()); +(void)ex; } return target; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 4 commits - sw/inc sw/source
sw/inc/docary.hxx |1 + sw/source/core/doc/docbasic.cxx |4 ++-- sw/source/core/doc/docbm.cxx|2 +- sw/source/core/doc/docchart.cxx | 16 sw/source/core/doc/doccomp.cxx | 11 +-- sw/source/core/doc/docglos.cxx |4 ++-- 6 files changed, 19 insertions(+), 19 deletions(-) New commits: commit 802b80fcd378d5788adff1c7c98af526651a30c2 Author: Matteo Casalin Date: Sun Jan 25 01:31:20 2015 +0100 Retrieve sub-OUStrings without unnecessary copying Change-Id: I1aaaef4bf81f5b56fe71ca0aae59b59dbd0dee59 diff --git a/sw/source/core/doc/docchart.cxx b/sw/source/core/doc/docchart.cxx index bbe92a0..426fd56 100644 --- a/sw/source/core/doc/docchart.cxx +++ b/sw/source/core/doc/docchart.cxx @@ -51,16 +51,16 @@ bool SwTable::IsTblComplexForChart( const OUString& rSelection ) const const SwTableBox* pSttBox, *pEndBox; if( 2 < rSelection.getLength() ) { -// Remove brackets at the beginning and from the end -OUString sBox( rSelection ); -if( '<' == sBox[0] ) sBox = sBox.copy( 1 ); -if( '>' == sBox[ sBox.getLength()-1 ] ) sBox = sBox.copy( 0, sBox.getLength()-1 ); - -sal_Int32 nSeparator = sBox.indexOf( ':' ); +const sal_Int32 nSeparator {rSelection.indexOf( ':' )}; OSL_ENSURE( -1 != nSeparator, "no valid selection" ); -pSttBox = GetTblBox( sBox.copy( 0, nSeparator )); -pEndBox = GetTblBox( sBox.copy( nSeparator+1 )); +// Remove brackets at the beginning and from the end +const sal_Int32 nOffset {'<' == rSelection[0] ? 1 : 0}; +const sal_Int32 nLength {'>' == rSelection[ rSelection.getLength()-1 ] +? rSelection.getLength()-1 : rSelection.getLength()}; + +pSttBox = GetTblBox(rSelection.copy( nOffset, nSeparator - nOffset )); +pEndBox = GetTblBox(rSelection.copy( nSeparator+1, nLength - (nSeparator+1) )); } else { commit 834f711841f0d7a29b23eac47267c6ad852f395e Author: Matteo Casalin Date: Sun Jan 25 01:03:12 2015 +0100 Fix selection handling in SwTable::IsTblComplexForChart Change-Id: I5f35a705316db164474c64ea99ee4e4eada57d49 diff --git a/sw/source/core/doc/docchart.cxx b/sw/source/core/doc/docchart.cxx index 669fa78..bbe92a0 100644 --- a/sw/source/core/doc/docchart.cxx +++ b/sw/source/core/doc/docchart.cxx @@ -53,7 +53,7 @@ bool SwTable::IsTblComplexForChart( const OUString& rSelection ) const { // Remove brackets at the beginning and from the end OUString sBox( rSelection ); -if( '<' == sBox[0] ) sBox = sBox.copy( 0, 1 ); +if( '<' == sBox[0] ) sBox = sBox.copy( 1 ); if( '>' == sBox[ sBox.getLength()-1 ] ) sBox = sBox.copy( 0, sBox.getLength()-1 ); sal_Int32 nSeparator = sBox.indexOf( ':' ); commit 0019a535f27e666fba98bc37d8d672544d40c526 Author: Matteo Casalin Date: Sun Jan 25 00:56:38 2015 +0100 Use more proper integer types Change-Id: I0c0eceb46738af44e527cbda48e62f4ca75e069d diff --git a/sw/inc/docary.hxx b/sw/inc/docary.hxx index 4f40a22..fba92fb 100644 --- a/sw/inc/docary.hxx +++ b/sw/inc/docary.hxx @@ -229,6 +229,7 @@ public: using _SwRedlineTbl::begin; using _SwRedlineTbl::end; using _SwRedlineTbl::size; +using _SwRedlineTbl::size_type; using _SwRedlineTbl::operator[]; using _SwRedlineTbl::empty; }; diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index fd3f601..b3272a5 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -1369,7 +1369,7 @@ void _DelBookmarks( // which holds all position information as offset. // Assignement happens after moving. SwRedlineTbl& rTbl = pDoc->getIDocumentRedlineAccess().GetRedlineTbl(); -for(sal_uInt16 nCnt = 0; nCnt < rTbl.size(); ++nCnt ) +for(SwRedlineTbl::size_type nCnt = 0; nCnt < rTbl.size(); ++nCnt ) { // Is at position? SwRangeRedline* pRedl = rTbl[ nCnt ]; diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx index 91ab8d0..61f207f 100644 --- a/sw/source/core/doc/doccomp.cxx +++ b/sw/source/core/doc/doccomp.cxx @@ -624,16 +624,15 @@ void Compare::CountDifference( const CompareData& rData, sal_uLong* pCounts ) void Compare::SetDiscard( const CompareData& rData, sal_Char* pDiscard, sal_uLong* pCounts ) { -sal_uLong nLen = rData.GetLineCount(); +const sal_uLong nLen = rData.GetLineCount(); // calculate Max with respect to the line count -sal_uInt16 nMax = 5; -sal_uLong n; +sal_uLong nMax = 5; -for( n = nLen / 64; ( n = n >> 2 ) > 0; ) +for( sal_uLong n = nLen / 64; ( n = n >> 2 ) > 0; ) nMax <<= 1; -for( n = 0; n < nLen; ++n ) +
[Libreoffice-commits] core.git: 19 commits - basctl/source chart2/source cui/source include/svx reportdesign/inc reportdesign/source sc/qa sc/source sd/inc sd/qa sd/source svx/source sw/inc sw/qa sw/s
| 152 +++--- svx/source/svdraw/svdmrkv1.cxx| 84 +-- svx/source/svdraw/svdobj.cxx |6 svx/source/svdraw/svdoedge.cxx|2 svx/source/svdraw/svdograf.cxx|3 svx/source/svdraw/svdogrp.cxx | 92 +--- svx/source/svdraw/svdopath.cxx|8 svx/source/svdraw/svdovirt.cxx|6 svx/source/svdraw/svdpage.cxx | 94 ++-- svx/source/svdraw/svdpagv.cxx |4 svx/source/svdraw/svdpntv.cxx |4 svx/source/svdraw/svdpoev.cxx | 48 +- svx/source/svdraw/svdundo.cxx | 12 svx/source/svdraw/svdview.cxx | 16 svx/source/svdraw/svdxcgv.cxx | 21 svx/source/table/svdotable.cxx|8 svx/source/table/tablecontroller.cxx |2 svx/source/tbxctrls/grafctrl.cxx |2 svx/source/toolbars/extrusionbar.cxx | 36 - svx/source/toolbars/fontworkbar.cxx | 28 - svx/source/unodraw/unopage.cxx|8 svx/source/unodraw/unoshap2.cxx | 14 svx/source/unodraw/unoshap3.cxx |6 svx/source/unodraw/unoshape.cxx |6 sw/inc/dpage.hxx |2 sw/qa/extras/uiwriter/uiwriter.cxx|6 sw/source/core/access/accdoc.cxx |2 sw/source/core/doc/docdraw.cxx| 17 sw/source/core/doc/docfly.cxx |2 sw/source/core/docnode/nodedump.cxx |4 sw/source/core/draw/dcontact.cxx |4 sw/source/core/draw/dpage.cxx |2 sw/source/core/draw/dview.cxx | 34 - sw/source/core/edit/edundo.cxx|2 sw/source/core/frmedt/fecopy.cxx | 17 sw/source/core/frmedt/fefly1.cxx |2 sw/source/core/frmedt/feshview.cxx| 52 +- sw/source/core/frmedt/fews.cxx|2 sw/source/core/layout/fly.cxx |2 sw/source/core/layout/newfrm.cxx |2 sw/source/core/undo/undraw.cxx|6 sw/source/core/unocore/unodraw.cxx|2 sw/source/core/view/vdraw.cxx |4 sw/source/filter/ww8/ww8graf.cxx |2 sw/source/uibase/inc/tabsh.hxx|1 sw/source/uibase/shells/drwbassh.cxx |4 sw/source/uibase/shells/langhelper.cxx| 23 - sw/source/uibase/shells/listsh.cxx| 10 sw/source/uibase/shells/mediash.cxx |3 sw/source/uibase/shells/navsh.cxx | 64 +- sw/source/uibase/shells/tabsh.cxx | 196 sw/source/uibase/shells/textfld.cxx | 48 +- sw/source/uibase/uiview/viewdraw.cxx | 12 sw/source/uibase/uno/unotxvw.cxx |2 sw/source/uibase/utlui/content.cxx| 28 - 187 files changed, 1361 insertions(+), 1476 deletions(-) New commits: commit bc69fc451c0c60b5054c2bfd1f79778b056778c2 Author: Matteo Casalin Date: Sat Aug 16 16:55:36 2014 +0200 Reserve vector capacity in advance Change-Id: I2ee5913a274eecf86ad6bbf19b99e1fe61f0ade7 diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx index 7496eab..175b2a0 100644 --- a/svx/source/customshapes/EnhancedCustomShape2d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx @@ -2248,6 +2248,7 @@ SdrObject* EnhancedCustomShape2d::CreatePathObj( bool bLineGeometryNeededOnly ) if ( bSortFilledObjectsToBack ) { std::vector< SdrPathObj* > vTempList; +vTempList.reserve(vObjectList.size()); for ( size_t i = 0; i < vObjectList.si
[Libreoffice-commits] core.git: include/svx
include/svx/svdedtv.hxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit ce9a327c507aaed816cf85401187020d4846cc21 Author: Matteo Casalin Date: Sat Aug 16 22:15:56 2014 +0200 Fix member function prototype (sal_uIntPtr& to size_t&) Change-Id: I063549d510d80450ab502fc511c79de41b591c4e diff --git a/include/svx/svdedtv.hxx b/include/svx/svdedtv.hxx index f0a9883..1782820 100644 --- a/include/svx/svdedtv.hxx +++ b/include/svx/svdedtv.hxx @@ -144,7 +144,7 @@ protected: // fuer DismantleMarkedObjects bool ImpCanDismantle(const basegfx::B2DPolyPolygon& rPpolyPpolygon, bool bMakeLines) const; bool ImpCanDismantle(const SdrObject* pObj, bool bMakeLines) const; -void ImpDismantleOneObject(const SdrObject* pObj, SdrObjList& rOL, sal_uIntPtr& rPos, SdrPageView* pPV, bool bMakeLines); +void ImpDismantleOneObject(const SdrObject* pObj, SdrObjList& rOL, size_t& rPos, SdrPageView* pPV, bool bMakeLines); void ImpCrookObj(SdrObject* pO, const Point& rRef, const Point& rRad, SdrCrookMode eMode, bool bVertical, bool bNoContortion, bool bRotate, const Rectangle& rMarkRect); void ImpDistortObj(SdrObject* pO, const Rectangle& rRef, const XPolygon& rDistortedRect, bool bNoContortion); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/shells/tabsh.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit f53878770a3e3f82659df3d74fd8fd2d408476b3 Author: Matteo Casalin Date: Sat Aug 16 22:18:55 2014 +0200 Missing ; (unsuccessful merge) Change-Id: I3a1ab8936021e0b310afa799b1c257040bf78be3 diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx index 3fe1367..da67f6f 100644 --- a/sw/source/uibase/shells/tabsh.cxx +++ b/sw/source/uibase/shells/tabsh.cxx @@ -741,7 +741,7 @@ void SwTableShell::Execute(SfxRequest &rReq) } default: OSL_ENSURE( false, "unknown return value MergeTab."); -break +break; } break; case FN_TABLE_ADJUST_CELLS: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
Suspicious loop: any idea?
Hi all, function lcl_NotifyNeighbours in sw/source/core/frmedt/feshview.cxx has the following loop: for( size_t j = 0; j < pLst->GetMarkCount(); ++j ) { [...] SdrObject *pO = pLst->GetMark( 0 )->GetMarkedSdrObj(); [...] } I can't see any use of j inside the loop itself, and repeatedly calling "GetMark( 0 )" seems a little strange to me since I do not see any removal of the obtained Mark (which could explain the loop). I'm not familiar with this code, though: does anybody have an idea of whether the loop is correct or not, and in case of how to fix it? Thanks! Matteo ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice-commits] core.git: dbaccess/source
dbaccess/source/ui/inc/WTypeSelect.hxx |1 + 1 file changed, 1 insertion(+) New commits: commit 97cb7cd16c809e8311eada4200c748984e3f148f Author: Matteo Casalin Date: Sat Aug 16 22:56:18 2014 +0200 CID 1231678: Uninitialized pointer field Change-Id: I1c691b2c9c66b99957b07df4197c0a67c2598273 diff --git a/dbaccess/source/ui/inc/WTypeSelect.hxx b/dbaccess/source/ui/inc/WTypeSelect.hxx index 5e498d1..0967c5c 100644 --- a/dbaccess/source/ui/inc/WTypeSelect.hxx +++ b/dbaccess/source/ui/inc/WTypeSelect.hxx @@ -74,6 +74,7 @@ namespace dbaui OWizTypeSelectList( Window* pParent, WinBits nStyle = WB_BORDER ) : MultiListBox(pParent,nStyle) , m_bPKey(false) +, m_pParentTabPage(NULL) {} voidSetPKey(bool bPKey) { m_bPKey = bPKey; } voidSetParentTabPage(Window* pParentTabPage) { m_pParentTabPage = pParentTabPage; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 2 commits - include/test test/source
include/test/primitive2dxmldump.hxx |2 +- test/source/primitive2dxmldump.cxx | 10 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) New commits: commit ed8c68726508112e30f178f1ce31f421cddb4d87 Author: Matteo Casalin Date: Sun Aug 17 00:31:19 2014 +0200 Fix: reference to 'Primitive2DSequence' is ambiguous Change-Id: Ic6cf4bc6dab4b9e2610aebdc42e3df7b56eda59d diff --git a/test/source/primitive2dxmldump.cxx b/test/source/primitive2dxmldump.cxx index da6f4e2..afa26fe 100644 --- a/test/source/primitive2dxmldump.cxx +++ b/test/source/primitive2dxmldump.cxx @@ -59,7 +59,9 @@ void Primitive2dXmlDump::filterAllActionTypes() maFilter.assign(constMaxActionType, true); } -xmlDocPtr Primitive2dXmlDump::dumpAndParse(const Primitive2DSequence& rPrimitive2DSequence, const OUString& rTempStreamName) +xmlDocPtr Primitive2dXmlDump::dumpAndParse( +const drawinglayer::primitive2d::Primitive2DSequence& rPrimitive2DSequence, +const OUString& rTempStreamName) { boost::scoped_ptr pStream; @@ -84,7 +86,9 @@ xmlDocPtr Primitive2dXmlDump::dumpAndParse(const Primitive2DSequence& rPrimitive return pDoc; } -void Primitive2dXmlDump::decomposeAndWrite(const Primitive2DSequence& rPrimitive2DSequence, XmlWriter& rWriter) +void Primitive2dXmlDump::decomposeAndWrite( +const drawinglayer::primitive2d::Primitive2DSequence& rPrimitive2DSequence, +XmlWriter& rWriter) { for (int i = 0; i < rPrimitive2DSequence.getLength(); i++) { commit fb1f710d3f58337e8a05e476326453b584e87fa2 Author: Matteo Casalin Date: Sun Aug 17 00:27:24 2014 +0200 loplugin:passstuffbyref (Primitive2DSequence) Change-Id: I3d9c6daa09d71ca872021fe13405b08050e191d9 diff --git a/include/test/primitive2dxmldump.hxx b/include/test/primitive2dxmldump.hxx index 6a94960..a578e60 100644 --- a/include/test/primitive2dxmldump.hxx +++ b/include/test/primitive2dxmldump.hxx @@ -39,7 +39,7 @@ public: pTempStreamName - this is useful when creating the test, to dump the file for examination. */ -xmlDocPtr dumpAndParse(drawinglayer::primitive2d::Primitive2DSequence aPrimitive2DSequence, const OUString& rTempStreamName = OUString()); +xmlDocPtr dumpAndParse(const drawinglayer::primitive2d::Primitive2DSequence& aPrimitive2DSequence, const OUString& rTempStreamName = OUString()); }; #endif // INCLUDED_TEST_PRIMITIVE2DXMLDUMP_HXX diff --git a/test/source/primitive2dxmldump.cxx b/test/source/primitive2dxmldump.cxx index ea12562..da6f4e2 100644 --- a/test/source/primitive2dxmldump.cxx +++ b/test/source/primitive2dxmldump.cxx @@ -59,7 +59,7 @@ void Primitive2dXmlDump::filterAllActionTypes() maFilter.assign(constMaxActionType, true); } -xmlDocPtr Primitive2dXmlDump::dumpAndParse(Primitive2DSequence aPrimitive2DSequence, const OUString& rTempStreamName) +xmlDocPtr Primitive2dXmlDump::dumpAndParse(const Primitive2DSequence& rPrimitive2DSequence, const OUString& rTempStreamName) { boost::scoped_ptr pStream; @@ -72,7 +72,7 @@ xmlDocPtr Primitive2dXmlDump::dumpAndParse(Primitive2DSequence aPrimitive2DSeque aWriter.startDocument(); aWriter.startElement("primitive2D"); -decomposeAndWrite(aPrimitive2DSequence, aWriter); +decomposeAndWrite(rPrimitive2DSequence, aWriter); aWriter.endElement(); aWriter.endDocument(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: test/source
test/source/primitive2dxmldump.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 613cc91bb5c169ad5294f04567df526d2181a6f9 Author: Matteo Casalin Date: Sun Aug 17 00:54:21 2014 +0200 Fix another: reference to 'Primitive2DSequence' is ambiguous Change-Id: I8b78126cab64f023ffcb35c080576148b1eb15f5 diff --git a/test/source/primitive2dxmldump.cxx b/test/source/primitive2dxmldump.cxx index afa26fe..9d3ad11 100644 --- a/test/source/primitive2dxmldump.cxx +++ b/test/source/primitive2dxmldump.cxx @@ -92,7 +92,7 @@ void Primitive2dXmlDump::decomposeAndWrite( { for (int i = 0; i < rPrimitive2DSequence.getLength(); i++) { -Primitive2DReference xPrimitive2DReference = rPrimitive2DSequence[i]; +drawinglayer::primitive2d::Primitive2DReference xPrimitive2DReference = rPrimitive2DSequence[i]; const BasePrimitive2D* pBasePrimitive = dynamic_cast(xPrimitive2DReference.get()); sal_uInt32 nId = pBasePrimitive->getPrimitive2DID(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/source
sw/source/core/frmedt/feshview.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 5d5c102e36bcc7eac6ae89d44a635e5d9b680e40 Author: Matteo Casalin Date: Mon Aug 18 20:18:40 2014 +0200 Typo: loop on all Marks instead of processing Mark(0) over and over See: http://nabble.documentfoundation.org/Suspicious-loop-any-idea-td4119239.html Since the code was like this since initial import (2000), if this patch proves to be wrong then the other option could be to just don't loop and process Mark(0) just once. Change-Id: I41ac18604e916740dcc68bf69af37529842f774d diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index 49dd779..97c064c 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -731,7 +731,7 @@ static void lcl_NotifyNeighbours( const SdrMarkList *pLst ) bool bCheckNeighbours = false; sal_Int16 aHori = text::HoriOrientation::NONE; SwRect aRect; -SdrObject *pO = pLst->GetMark( 0 )->GetMarkedSdrObj(); +SdrObject *pO = pLst->GetMark( j )->GetMarkedSdrObj(); if ( pO->ISA(SwVirtFlyDrawObj) ) { SwFlyFrm *pFly = ((SwVirtFlyDrawObj*)pO)->GetFlyFrm(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
Re: Suspicious loop: any idea?
Hi Michael, all On 08/18/2014 12:37 PM, Michael Stahl wrote: On 16/08/14 22:42, Matteo Casalin wrote: Hi all, function lcl_NotifyNeighbours in sw/source/core/frmedt/feshview.cxx has the following loop: for( size_t j = 0; j < pLst->GetMarkCount(); ++j ) { [...] SdrObject *pO = pLst->GetMark( 0 )->GetMarkedSdrObj(); [...] } I can't see any use of j inside the loop itself, and repeatedly calling "GetMark( 0 )" seems a little strange to me since I do not see any removal of the obtained Mark (which could explain the loop). I'm not familiar with this code, though: does anybody have an idea of whether the loop is correct or not, and in case of how to fix it? i think you're right, it's very suspicious and the 0 should be replaced by j. probably the feature is obscure enough that it doesn't cause easily noticeable problems; you have to select more than 1 fly and then invoke some send-to-top or send-to-bottom feature. Pushed replacement of 0 with j as http://cgit.freedesktop.org/libreoffice/core/commit/?id=5d5c102e36bcc7eac6ae89d44a635e5d9b680e40 Thanks everybody for your comments Matteo ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: Suspicious loop: any idea?
Thanks Julien for providing much more accessible and clear context! Cheers Matteo On 08/17/2014 09:02 AM, julien2412 wrote: Just to check more quickly, here's the link: http://opengrok.libreoffice.org/xref/core/sw/source/core/frmedt/feshview.cxx#720 I agree with you, this part is strange: SdrObject *pO = pLst->GetMark( 0 )->GetMarkedSdrObj(); Shouldn't it be this? SdrObject *pO = pLst->GetMark( j )->GetMarkedSdrObj(); Julien -- View this message in context: http://nabble.documentfoundation.org/Suspicious-loop-any-idea-tp4119239p4119258.html Sent from the Dev mailing list archive at Nabble.com. ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice-commits] core.git: 5 commits - sw/inc sw/source
sw/inc/doc.hxx |8 sw/inc/editsh.hxx |4 ++-- sw/inc/fesh.hxx |4 ++-- sw/source/core/doc/docchart.cxx |4 ++-- sw/source/core/doc/docfly.cxx | 16 sw/source/core/doc/docfmt.cxx | 12 ++-- sw/source/core/doc/notxtfrm.cxx |5 - sw/source/core/doc/sortopt.cxx |2 +- sw/source/core/doc/swserv.cxx |2 +- sw/source/core/docnode/ndcopy.cxx |2 +- sw/source/core/edit/edfmt.cxx |4 ++-- sw/source/core/fields/ddetbl.cxx| 10 ++ sw/source/core/frmedt/fefly1.cxx|4 ++-- sw/source/core/frmedt/feshview.cxx |4 ++-- sw/source/core/graphic/ndgrf.cxx|2 +- sw/source/core/inc/notxtfrm.hxx |5 - sw/source/core/layout/laycache.cxx |4 ++-- sw/source/core/layout/layhelp.hxx |6 +++--- sw/source/core/unocore/unochart.cxx |4 ++-- sw/source/core/unocore/unocoll.cxx | 24 sw/source/core/unocore/unoframe.cxx |4 ++-- sw/source/uibase/shells/frmsh.cxx |4 ++-- sw/source/uibase/utlui/content.cxx |8 sw/source/uibase/wrtsh/wrtsh1.cxx |2 +- 24 files changed, 68 insertions(+), 76 deletions(-) New commits: commit 93e97e83d8db7641d32391af7203806d2d26370b Author: Matteo Casalin Date: Thu Dec 25 17:38:13 2014 +0100 sal_uInt16 to size_t Change-Id: Ide8913930f9f951039cefecf71609c5a2bcc5e82 diff --git a/sw/source/core/doc/docchart.cxx b/sw/source/core/doc/docchart.cxx index 1b48a92..02fdf91 100644 --- a/sw/source/core/doc/docchart.cxx +++ b/sw/source/core/doc/docchart.cxx @@ -91,7 +91,7 @@ void SwDoc::DoUpdateAllCharts() if( pVSh ) { const SwFrmFmts& rTblFmts = *GetTblFrmFmts(); -for( sal_uInt16 n = 0; n < rTblFmts.size(); ++n ) +for( size_t n = 0; n < rTblFmts.size(); ++n ) { SwTable* pTmpTbl; const SwTableNode* pTblNd; @@ -151,7 +151,7 @@ void SwDoc::SetTableName( SwFrmFmt& rTblFmt, const OUString &rNewName ) { const SwFrmFmt* pFmt; const SwFrmFmts& rTbl = *GetTblFrmFmts(); -for( sal_uInt16 i = rTbl.size(); i; ) +for( size_t i = rTbl.size(); i; ) if( !( pFmt = rTbl[ --i ] )->IsDefault() && pFmt->GetName() == rNewName && IsUsed( *pFmt ) ) { diff --git a/sw/source/core/doc/sortopt.cxx b/sw/source/core/doc/sortopt.cxx index 9aba7fe..555e444 100644 --- a/sw/source/core/doc/sortopt.cxx +++ b/sw/source/core/doc/sortopt.cxx @@ -60,7 +60,7 @@ SwSortOptions::SwSortOptions(const SwSortOptions& rOpt) : bTable( rOpt.bTable ), bIgnoreCase( rOpt.bIgnoreCase ) { -for( sal_uInt16 i=0; i < rOpt.aKeys.size(); ++i ) +for( size_t i=0; i < rOpt.aKeys.size(); ++i ) { SwSortKey* pNew = new SwSortKey(*rOpt.aKeys[i]); aKeys.push_back( pNew ); diff --git a/sw/source/core/doc/swserv.cxx b/sw/source/core/doc/swserv.cxx index ce473a6..4487b25 100644 --- a/sw/source/core/doc/swserv.cxx +++ b/sw/source/core/doc/swserv.cxx @@ -234,7 +234,7 @@ bool SwServerObject::IsLinkInServer( const SwBaseLink* pChkLnk ) const SwServerObject::ServerModes eSave = eType; if( !pChkLnk ) const_cast(this)->eType = NONE_SERVER; -for( sal_uInt16 n = rLnks.size(); n; ) +for( size_t n = rLnks.size(); n; ) { const ::sfx2::SvBaseLink* pLnk = &(*rLnks[ --n ]); if( pLnk && OBJECT_CLIENT_GRF != pLnk->GetObjType() && diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx index 47d5f62..b26299c 100644 --- a/sw/source/core/docnode/ndcopy.cxx +++ b/sw/source/core/docnode/ndcopy.cxx @@ -244,7 +244,7 @@ SwTableNode* SwTableNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const if( !pDoc->IsCopyIsMove() ) { const SwFrmFmts& rTblFmts = *pDoc->GetTblFrmFmts(); -for( sal_uInt16 n = rTblFmts.size(); n; ) +for( size_t n = rTblFmts.size(); n; ) if( rTblFmts[ --n ]->GetName() == sTblName ) { sTblName = pDoc->GetUniqueTblName(); diff --git a/sw/source/core/fields/ddetbl.cxx b/sw/source/core/fields/ddetbl.cxx index a135603..be1212d 100644 --- a/sw/source/core/fields/ddetbl.cxx +++ b/sw/source/core/fields/ddetbl.cxx @@ -111,12 +111,12 @@ void SwDDETable::ChangeContent() OUString aExpand = comphelper::string::remove(pDDEType->GetExpansion(), '\r'); sal_Int32 nExpandTokenPos = 0; -for( sal_uInt16 n = 0; n < aLines.size(); ++n ) +for( size_t n = 0; n < aLines.size(); ++n ) { OUString aLine = aExpand.getToken( 0, '\n', nExpandTokenPos ); sal_Int32 nLineTokenPos = 0; SwTableLine* pLine = aLines[ n ]; -for( sal_uInt16 i = 0; i < pLin
[Libreoffice-commits] core.git: 4 commits - sw/inc sw/source
sw/inc/shellio.hxx |2 +- sw/source/core/unocore/unocoll.cxx |2 +- sw/source/filter/html/htmlforw.cxx | 22 ++ sw/source/filter/html/htmlplug.cxx |2 +- sw/source/filter/html/parcss1.cxx |6 +++--- sw/source/filter/writer/writer.cxx |4 ++-- 6 files changed, 18 insertions(+), 20 deletions(-) New commits: commit b739e6aeef8329e7e4a7ec525a650a4c74cf4699 Author: Matteo Casalin Date: Sat Jan 3 15:23:59 2015 +0100 Writer::GetBookmarks can return bool Change-Id: I4210fd4bc086c5cfdfe7dc01cd9387993b4916ca diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx index a1d024f..6b97b2f 100644 --- a/sw/inc/shellio.hxx +++ b/sw/inc/shellio.hxx @@ -438,7 +438,7 @@ public: // OtherPos of the bookmarks also inserted. void CreateBookmarkTbl(); // Search alle Bookmarks in the range and return it in the Array. -sal_uInt16 GetBookmarks( const SwCntntNode& rNd, +bool GetBookmarks( const SwCntntNode& rNd, sal_Int32 nStt, sal_Int32 nEnd, std::vector< const ::sw::mark::IMark* >& rArr ); diff --git a/sw/source/filter/writer/writer.cxx b/sw/source/filter/writer/writer.cxx index 0f4788f..c928b9a 100644 --- a/sw/source/filter/writer/writer.cxx +++ b/sw/source/filter/writer/writer.cxx @@ -398,7 +398,7 @@ void Writer::CreateBookmarkTbl() } // search alle Bookmarks in the range and return it in the Array -sal_uInt16 Writer::GetBookmarks(const SwCntntNode& rNd, sal_Int32 nStt, +bool Writer::GetBookmarks(const SwCntntNode& rNd, sal_Int32 nStt, sal_Int32 nEnd, std::vector< const ::sw::mark::IMark* >& rArr) { OSL_ENSURE( rArr.empty(), "there are still entries available" ); @@ -435,7 +435,7 @@ sal_uInt16 Writer::GetBookmarks(const SwCntntNode& rNd, sal_Int32 nStt, } } } -return rArr.size(); +return !rArr.empty(); } // Storage-specific commit 63cb016bc31a2d51d445b335454b9de99c77e413 Author: Matteo Casalin Date: Wed Dec 31 00:41:54 2014 +0100 sal_uInt16 to more proper types Change-Id: I0e226787206e0429149fccc99677529d52d7825a diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx index 8e73371..f6890bf 100644 --- a/sw/source/filter/html/htmlplug.cxx +++ b/sw/source/filter/html/htmlplug.cxx @@ -1183,7 +1183,7 @@ Writer& OutHTML_FrmFmtOLENode( Writer& rWrt, const SwFrmFmt& rFrmFmt, rHTMLWrt.IncIndentLevel(); // Inhalt von Applet einruecken -sal_uInt16 ii = aParams.size(); +size_t ii = aParams.size(); while( ii > 0 ) { const SvCommand& rCommand = aCommands[ aParams[--ii] ]; diff --git a/sw/source/filter/html/parcss1.cxx b/sw/source/filter/html/parcss1.cxx index b901b5f..637362d 100644 --- a/sw/source/filter/html/parcss1.cxx +++ b/sw/source/filter/html/parcss1.cxx @@ -177,7 +177,7 @@ CSS1Token CSS1Parser::GetNextToken() if( CSS1_NULL==nRet ) { aToken.clear(); -sal_uInt16 nBlockLvl = 0; +int nBlockLvl = 0; sal_Unicode cQuoteCh = 0; bool bDone = false, bEscape = false; while( !bDone && !IsEOF() ) @@ -620,7 +620,7 @@ CSS1Token CSS1Parser::GetNextToken() (('r'==aToken[0] || 'R'==aToken[0]) && aToken.equalsIgnoreAsciiCase( "rgb" )) ) ) { -sal_uInt16 nNestCnt = 0; +int nNestCnt = 0; OUStringBuffer sTmpBuffer2( 64L ); do { sTmpBuffer2.append( cNextCh ); @@ -1279,7 +1279,7 @@ bool CSS1Expression::GetColor( Color &rColor ) const OUString aColorStr(aValue.copy(4, aValue.getLength() - 5)); sal_Int32 nPos = 0; -sal_uInt16 nCol = 0; +int nCol = 0; while( nCol < 3 && nPos < aColorStr.getLength() ) { commit 351dee6b5343a910ee6fb6372bd0b2d9435517bd Author: Matteo Casalin Date: Fri Dec 26 10:48:27 2014 +0100 sal_uInt16 to more proper types, use while instead of for in simple cases Change-Id: I5f3cc2771ccde44e1ea45b1ff3e7f8a3fedfb94a diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx index 2ada383..ea90350 100644 --- a/sw/source/filter/html/htmlforw.cxx +++ b/sw/source/filter/html/htmlforw.cxx @@ -153,7 +153,7 @@ static void lcl_html_outEvents( SvStream& rStrm, OUString sMethod( pDescs[i].EventMethod ); const sal_Char *pOpt = 0; -for( sal_uInt16 j=0; aEventListenerTable[j]; j++ ) +for( int j=0; aEventListenerTable[j]; j++ ) { if( sListener.equalsAscii( aEventListenerTable[j
[Libreoffice-commits] core.git: 20 commits - sw/inc sw/source
sw/inc/calc.hxx |2 sw/inc/fesh.hxx |2 sw/source/core/access/accdoc.cxx |9 - sw/source/core/access/accmap.cxx | 184 -- sw/source/core/access/accnotexthyperlink.cxx |5 sw/source/core/access/accnotexthyperlink.hxx |3 sw/source/core/access/accpara.cxx | 47 ++ sw/source/core/access/accportions.cxx | 128 -- sw/source/core/access/accportions.hxx |4 sw/source/core/access/accselectionhelper.cxx |8 - sw/source/core/access/textmarkuphelper.cxx|3 sw/source/core/bastyp/bparr.cxx |2 sw/source/core/bastyp/calc.cxx| 17 +- sw/source/core/bastyp/init.cxx|2 sw/source/core/bastyp/swcache.cxx |4 sw/source/core/crsr/crstrvl.cxx |8 - sw/source/core/crsr/findtxt.cxx |6 sw/source/core/crsr/pam.cxx |2 sw/source/core/crsr/swcrsr.cxx|2 sw/source/core/crsr/trvlreg.cxx |2 sw/source/core/crsr/viscrs.cxx|6 sw/source/core/frmedt/feshview.cxx| 10 - sw/source/filter/writer/writer.cxx|2 sw/source/filter/ww8/WW8TableInfo.cxx | 25 +-- sw/source/filter/ww8/attributeoutputbase.hxx |2 sw/source/filter/ww8/docxattributeoutput.cxx | 15 -- sw/source/filter/ww8/docxtablestyleexport.cxx | 10 - sw/source/filter/ww8/docxtablestyleexport.hxx |2 sw/source/filter/ww8/rtfattributeoutput.cxx |7 sw/source/filter/ww8/wrtww8.cxx |4 30 files changed, 245 insertions(+), 278 deletions(-) New commits: commit 6304f5e8e23cd9c9afbeab87f20100498175d4e6 Author: Matteo Casalin Date: Wed Jan 7 19:24:03 2015 +0100 sal_uInt16 to size_type Change-Id: I89b35680d8df0efca814cec3d21cb2f78a64793b diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx index 599d9ba..68cbcff 100644 --- a/sw/source/core/crsr/pam.cxx +++ b/sw/source/core/crsr/pam.cxx @@ -665,7 +665,7 @@ bool SwPaM::HasReadonlySel( bool bFormView, bool bAnnotationMode ) const if( nSttIdx + 3 < nEndIdx ) { const SwSectionFmts& rFmts = GetDoc()->GetSections(); -for( sal_uInt16 n = rFmts.size(); n; ) +for( SwSectionFmts::size_type n = rFmts.size(); n; ) { const SwSectionFmt* pFmt = rFmts[ --n ]; if( pFmt->GetProtect().IsCntntProtected() ) diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx index ce67b7e..898e04a 100644 --- a/sw/source/core/crsr/swcrsr.cxx +++ b/sw/source/core/crsr/swcrsr.cxx @@ -297,7 +297,7 @@ bool SwCursor::IsSelOvr( int eFlags ) } const SwSectionFmts& rFmts = pDoc->GetSections(); -for( sal_uInt16 n = 0; n < rFmts.size(); ++n ) +for( SwSectionFmts::size_type n = 0; n < rFmts.size(); ++n ) { const SwSectionFmt* pFmt = rFmts[n]; const SvxProtectItem& rProtect = pFmt->GetProtect(); diff --git a/sw/source/core/crsr/trvlreg.cxx b/sw/source/core/crsr/trvlreg.cxx index 92f37ab..231d7ca 100644 --- a/sw/source/core/crsr/trvlreg.cxx +++ b/sw/source/core/crsr/trvlreg.cxx @@ -233,7 +233,7 @@ bool SwCursor::GotoRegion( const OUString& rName ) { bool bRet = false; const SwSectionFmts& rFmts = GetDoc()->GetSections(); -for( sal_uInt16 n = rFmts.size(); n; ) +for( SwSectionFmts::size_type n = rFmts.size(); n; ) { const SwSectionFmt* pFmt = rFmts[ --n ]; const SwNodeIndex* pIdx = 0; diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx index 13bbd29..5873e93 100644 --- a/sw/source/core/crsr/viscrs.cxx +++ b/sw/source/core/crsr/viscrs.cxx @@ -261,7 +261,7 @@ void SwSelPaintRects::Show() // get new rects std::vector< basegfx::B2DRange > aNewRanges; -for(sal_uInt16 a(0); a < size(); a++) +for(size_type a = 0; a < size(); ++a) { const SwRect aNextRect((*this)[a]); const Rectangle aPntRect(aNextRect.SVRect()); @@ -419,7 +419,7 @@ void SwSelPaintRects::HighlightInputFld() void SwSelPaintRects::Invalidate( const SwRect& rRect ) { -sal_uInt16 nSz = size(); +size_type nSz = size(); if( !nSz ) return; @@ -598,7 +598,7 @@ short SwShellCrsr::MaxReplaceArived() "modules/swriter/ui/asksearchdialog.ui").Execute(); } -for( sal_uInt16 n = 0; n < aArr.size(); ++n ) +for( std::vector::size_type n = 0; n < aArr.size(); ++n ) { for( nActCnt = aArr[n]; nActCnt--; ) pSh->StartAction(); commit dd9972f5f370
[Libreoffice-commits] core.git: 2 commits - basic/source editeng/source sc/qa sc/source svl/source svtools/source svx/source sw/source
basic/source/sbx/sbxdate.cxx|4 --- basic/source/sbx/sbxscan.cxx|3 -- editeng/source/items/flditem.cxx|2 - sc/qa/unit/ucalc.cxx|4 +-- sc/source/core/data/table4.cxx |8 +- sc/source/core/data/validat.cxx |4 --- sc/source/core/tool/cellform.cxx|8 +++--- sc/source/filter/rtf/eeimpars.cxx |4 --- sc/source/ui/formdlg/formula.cxx| 12 ++--- sc/source/ui/unoobj/chart2uno.cxx |4 --- svl/source/numbers/numfmuno.cxx |6 +--- svtools/source/control/fmtfield.cxx | 15 --- svx/source/items/numfmtsh.cxx | 31 +--- sw/source/core/fields/fldbas.cxx|4 +-- sw/source/core/table/swtable.cxx|9 ++ sw/source/core/text/EnhancedPDFExportHelper.cxx |5 --- sw/source/ui/utlui/numfmtlb.cxx |8 +++--- 17 files changed, 42 insertions(+), 89 deletions(-) New commits: commit 83aa6d8180f289e5ae4034560dbd95ab160b1ac2 Author: Matteo Casalin Date: Mon Feb 24 09:05:50 2014 +0100 Remove some temporaries around calls to SvNumberFormatter methods Change-Id: Ib03c97a52df120bac1ac9b2b9d2e52431ead1027 diff --git a/basic/source/sbx/sbxdate.cxx b/basic/source/sbx/sbxdate.cxx index 65d4940..0ed08e7 100644 --- a/basic/source/sbx/sbxdate.cxx +++ b/basic/source/sbx/sbxdate.cxx @@ -313,9 +313,7 @@ start: nIndex, LANGUAGE_GERMAN, eLangType ); -OUString aTmpString; -pFormatter->GetOutputString( n, nIndex, aTmpString, &pColor ); -*p->pOUString = aTmpString; +pFormatter->GetOutputString( n, nIndex, *p->pOUString, &pColor ); delete pFormatter; break; } diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx index c3b52f0..7ec18a7 100644 --- a/basic/source/sbx/sbxscan.cxx +++ b/basic/source/sbx/sbxscan.cxx @@ -799,8 +799,7 @@ void SbxValue::Format( OUString& rRes, const OUString* pFmt ) const aFormatter.PutandConvertEntry( aFmtStr, nCheckPos, nType, nIndex, LANGUAGE_ENGLISH, eLangType ); OUString aTime; aFormatter.GetOutputString( nNumber, nIndex, aTime, &pCol ); -rRes += " "; -rRes += aTime; +rRes += " " + aTime; } } else diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx index 99f0575..03fc0da 100644 --- a/editeng/source/items/flditem.cxx +++ b/editeng/source/items/flditem.cxx @@ -502,7 +502,7 @@ OUString SvxDateField::GetFormatted( Date& aDate, SvxDateFormat eFormat, SvNumbe double fDiffDate = aDate - *(rFormatter.GetNullDate()); OUString aStr; - Color* pColor = NULL; +Color* pColor = NULL; rFormatter.GetOutputString( fDiffDate, nFormatKey, aStr, &pColor ); return aStr; } diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index d37620a..e44d3f2 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -911,9 +911,7 @@ OUString ScTable::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW Color* pColor; sal_uLong nNumFmt = GetNumberFormat( nSrcX, nSrcY ); -OUString sTmp(aValue); -pDocument->GetFormatTable()->GetOutputString( nVal, nNumFmt, sTmp, &pColor ); -aValue = sTmp; +pDocument->GetFormatTable()->GetOutputString( nVal, nNumFmt, aValue, &pColor ); } break; // not for formulas @@ -997,9 +995,7 @@ OUString ScTable::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW //! Zahlformat je nach Index holen? Color* pColor; sal_uLong nNumFmt = GetNumberFormat( nCol1, nRow1 ); -OUString sTmp(aValue); -pDocument->GetFormatTable()->GetOutputString( nStart, nNumFmt, sTmp, &pColor ); -aValue = sTmp; +pDocument->GetFormatTable()->GetOutputString( nStart, nNumFmt, aValue, &pColor ); } } } diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx index 67de694e..5e684d2 100644 --- a/sc/source/core/data/validat.cxx +++ b/sc/source/core/data/validat.cxx @@ -764,9 +7
[Libreoffice-commits] core.git: 5 commits - svtools/source sw/inc sw/source
svtools/source/svhtml/parhtml.cxx |7 - sw/inc/index.hxx | 52 ++ sw/source/core/bastyp/index.cxx | 28 3 files changed, 48 insertions(+), 39 deletions(-) New commits: commit d2622ba4f3eb53296df21ec14ec91fda42eebeeb Author: Matteo Casalin Date: Tue Mar 4 08:58:06 2014 +0100 'explicit' makes no sense for a default constructor Change-Id: Ib70c75e43ecf020fcb39696bddea414b0de9bbf7 diff --git a/sw/inc/index.hxx b/sw/inc/index.hxx index 9fa4e63..9f9c600 100644 --- a/sw/inc/index.hxx +++ b/sw/inc/index.hxx @@ -111,7 +111,7 @@ protected: bool HasAnyIndex() const { return 0 != m_pFirst; } public: -explicit SwIndexReg(); +SwIndexReg(); virtual ~SwIndexReg(); /// rtti, derived classes might do the same. If so, one can cast typesavely commit 574086f4cfbd8f85b47f310e5637d224acc05056 Author: Matteo Casalin Date: Tue Mar 4 08:51:48 2014 +0100 Remove '#define INLINE', inline in method definition is enough Change-Id: I9c7ae289492e3ec8ada111a8dddfb5426ef22d30 diff --git a/sw/inc/index.hxx b/sw/inc/index.hxx index 568da1a..9fa4e63 100644 --- a/sw/inc/index.hxx +++ b/sw/inc/index.hxx @@ -26,12 +26,6 @@ class SwIndexReg; struct SwPosition; -#ifdef DBG_UTIL -#define INLINE -#else -#define INLINE inline -#endif - /// Marks a character position inside a document model node. class SW_DLLPUBLIC SwIndex { @@ -54,23 +48,23 @@ public: SwIndex( const SwIndex &, short nDiff ); ~SwIndex() { Remove(); } -INLINE SwIndex& operator=( sal_Int32 const ); +SwIndex& operator=( sal_Int32 const ); SwIndex& operator=( const SwIndex & ); -INLINE sal_Int32 operator++(); -INLINE sal_Int32 operator--(); -INLINE sal_Int32 operator++(int); -INLINE sal_Int32 operator--(int); +sal_Int32 operator++(); +sal_Int32 operator--(); +sal_Int32 operator++(int); +sal_Int32 operator--(int); -INLINE sal_Int32 operator+=( sal_Int32 const ); -INLINE sal_Int32 operator-=( sal_Int32 const ); -INLINE sal_Int32 operator+=( const SwIndex& ); -INLINE sal_Int32 operator-=( const SwIndex& ); +sal_Int32 operator+=( sal_Int32 const ); +sal_Int32 operator-=( sal_Int32 const ); +sal_Int32 operator+=( const SwIndex& ); +sal_Int32 operator-=( const SwIndex& ); -INLINE bool operator< ( const SwIndex& ) const; -INLINE bool operator<=( const SwIndex& ) const; -INLINE bool operator> ( const SwIndex& ) const; -INLINE bool operator>=( const SwIndex& ) const; +bool operator< ( const SwIndex& ) const; +bool operator<=( const SwIndex& ) const; +bool operator> ( const SwIndex& ) const; +bool operator>=( const SwIndex& ) const; bool operator< ( sal_Int32 const nVal ) const { return m_nIndex < nVal; } bool operator<=( sal_Int32 const nVal ) const { return m_nIndex <= nVal; } @@ -100,8 +94,6 @@ public: const SwIndexReg* GetIdxReg() const { return m_pIndexReg; } }; -#undef INLINE - class SwIndexReg { friend class SwIndex; commit b49e047472e37cda9e7f7c0ee6e4606862054f57 Author: Matteo Casalin Date: Tue Mar 4 00:23:14 2014 +0100 Remove unused headers and forward declarations Change-Id: I8e8406dab1bca2a3349043eecaca168ff9ac00fb diff --git a/sw/inc/index.hxx b/sw/inc/index.hxx index 2d1394e..568da1a 100644 --- a/sw/inc/index.hxx +++ b/sw/inc/index.hxx @@ -19,14 +19,10 @@ #ifndef INCLUDED_SW_INC_INDEX_HXX #define INCLUDED_SW_INC_INDEX_HXX -#include - -#include "rtl/instance.hxx" -#include +#include #include #include -class SwIndex; class SwIndexReg; struct SwPosition; @@ -139,16 +135,19 @@ inline sal_Int32 SwIndex::operator++() { return ChgValue( *this, m_nIndex+1 ).m_nIndex; } + inline sal_Int32 SwIndex::operator--() { return ChgValue( *this, m_nIndex-1 ).m_nIndex; } + inline sal_Int32 SwIndex::operator++(int) { sal_Int32 const nOldIndex = m_nIndex; ChgValue( *this, m_nIndex+1 ); return nOldIndex; } + inline sal_Int32 SwIndex::operator--(int) { sal_Int32 const nOldIndex = m_nIndex; @@ -160,14 +159,17 @@ inline sal_Int32 SwIndex::operator+=( sal_Int32 const nVal ) { return ChgValue( *this, m_nIndex + nVal ).m_nIndex; } + inline sal_Int32 SwIndex::operator-=( sal_Int32 const nVal ) { return ChgValue( *this, m_nIndex - nVal ).m_nIndex; } + inline sal_Int32 SwIndex::operator+=( const SwIndex& rIndex ) { return ChgValue( *this, m_nIndex + rIndex.m_nIndex ).m_nIndex; } + inline sal_Int32 SwIndex::operator-=( const SwIndex& rIndex ) { return ChgValue( *this, m_nIndex - rIndex.m_nIndex ).m_nIndex; @@ -177,18 +179,22 @@ inline bool SwIndex::operator< ( const SwIndex& rIndex ) const { return m_nIndex < rIndex.m_nIndex; } + inline
[Libreoffice-commits] core.git: oox/source
oox/source/drawingml/shapepropertymap.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit f3199b9ac677a93ee65a1f2df039458560efc020 Author: Matteo Casalin Date: Sun Mar 9 00:14:11 2014 +0100 Fix signed/unsigned comparison Change-Id: Iedc3b5c20b5f47117f29dcbeaf84efacbd4ce497 diff --git a/oox/source/drawingml/shapepropertymap.cxx b/oox/source/drawingml/shapepropertymap.cxx index 5a90875..21281cdd 100644 --- a/oox/source/drawingml/shapepropertymap.cxx +++ b/oox/source/drawingml/shapepropertymap.cxx @@ -64,7 +64,8 @@ ShapePropertyInfo::ShapePropertyInfo( const sal_Int32* pnPropertyIds, mbNamedFillBitmapUrl( bNamedFillBitmapUrl ) { assert(pnPropertyIds); -for(size_t i = 0; i < PROP_COUNT; ++i) // normally we should not reach PROP_COUNT but it prevents infinite loops if we hit a bug +// normally we should not reach PROP_COUNT but it prevents infinite loops if we hit a bug +for(size_t i = 0; i < static_cast(PROP_COUNT); ++i) { if(pnPropertyIds[i] == PROP_END_LIST) break; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 4 commits - sw/source
sw/source/core/text/porlay.cxx | 142 + 1 file changed, 61 insertions(+), 81 deletions(-) New commits: commit 59239c29269d69a7dec9b093b7832dd032dec1e8 Author: Matteo Casalin Date: Sun Jan 26 19:17:41 2014 +0100 Use += when possible Change-Id: I6dad55d3a397becab18f1159f3e8d84cffd7517b diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx index d19515e..29861eb 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -352,7 +352,7 @@ void SwLineLayout::CalcLine( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf ) } const sal_Int32 nPorSttIdx = rInf.GetLineStart() + nLineLength; -nLineLength = nLineLength + pPos->GetLen(); +nLineLength += pPos->GetLen(); AddPrtWidth( pPos->Width() ); // #i3952# @@ -1629,7 +1629,7 @@ long SwScriptInfo::Compress( sal_Int32* pKernArray, sal_Int32 nIdx, sal_Int32 nL sal_Int32 nChg = GetCompStart( nCompIdx ); sal_Int32 nCompLen = GetCompLen( nCompIdx ); sal_uInt16 nI = 0; -nLen = nLen + nIdx; +nLen += nIdx; if( nChg > nIdx ) { @@ -1650,7 +1650,7 @@ long SwScriptInfo::Compress( sal_Int32* pKernArray, sal_Int32 nIdx, sal_Int32 nL #ifdef DBG_UTIL SAL_WARN_IF( nType != CompType( nIdx ), "sw.core", "Gimme the right type!" ); #endif -nCompLen = nCompLen + nIdx; +nCompLen += nIdx; if( nCompLen > nLen ) nCompLen = nLen; @@ -2093,7 +2093,7 @@ sal_Int32 SwParaPortion::GetParLen() const const SwLineLayout *pLay = this; while( pLay ) { -nLen = nLen + pLay->GetLen(); +nLen += pLay->GetLen(); pLay = pLay->GetNext(); } return nLen; commit 6a9b0aac0362f98a11e9a1f33809b43a30b2c7c7 Author: Matteo Casalin Date: Sun Jan 26 18:32:50 2014 +0100 Bail out early Change-Id: Id2a77996cfe9a9ec755766295141123870b4eaf2 diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx index 09445be..d19515e 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -750,20 +750,18 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL ) { while( nCntComp < CountCompChg() ) { -if ( nChg > GetCompStart( nCntComp ) ) -nCntComp++; -else +if ( nChg <= GetCompStart( nCntComp ) ) break; +nCntComp++; } } if ( bAdjustBlock ) { while( nCntKash < CountKashida() ) { -if ( nChg > GetKashida( nCntKash ) ) -nCntKash++; -else +if ( nChg <= GetKashida( nCntKash ) ) break; +nCntKash++; } } } @@ -888,10 +886,9 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL ) while( com::sun::star::i18n::CTLScriptType::CTL_UNKNOWN == nCurrentScriptType || nScriptType == nCurrentScriptType ) { nNextCTLScriptStart = ScriptTypeDetector::endOfCTLScriptType( rTxt, nNextCTLScriptStart ); -if( nNextCTLScriptStart < rTxt.getLength() && nNextCTLScriptStart < nChg ) -nCurrentScriptType = ScriptTypeDetector::getCTLScriptType( rTxt, nNextCTLScriptStart ); -else +if( nNextCTLScriptStart >= rTxt.getLength() || nNextCTLScriptStart >= nChg ) break; +nCurrentScriptType = ScriptTypeDetector::getCTLScriptType( rTxt, nNextCTLScriptStart ); } nChg = std::min( nChg, nNextCTLScriptStart ); } @@ -1698,27 +1695,24 @@ long SwScriptInfo::Compress( sal_Int32* pKernArray, sal_Int32 nIdx, sal_Int32 nL } } -if( nIdx < nLen ) +if( nIdx >= nLen ) +break; + +sal_Int32 nTmpChg = nLen; +if( ++nCompIdx < nCompCount ) { -sal_Int32 nTmpChg; -if( ++nCompIdx < nCompCount ) -{ -nTmpChg = GetCompStart( nCompIdx ); -if( nTmpChg > nLen ) -nTmpChg = nLen; -nCompLen = GetCompLen( nCompIdx ); -} -else +nTmpChg = GetCompStart( nCompIdx ); +if( nTmpChg > nLen ) nTmpChg = nLen; -while( nIdx < nTmpChg ) -{ -nLast = pKernArray[ nI ]; -pKernArray[ nI++ ] -= nSub; -++nIdx; -} +nCompLen = GetCompLen( nCompIdx ); +} + +while( nIdx < nTmpChg ) +{ +
[Libreoffice-commits] core.git: 2 commits - include/tools tools/source
include/tools/inetstrm.hxx |2 -- tools/source/inet/inetmsg.cxx |1 - tools/source/inet/inetstrm.cxx | 12 +--- 3 files changed, 9 insertions(+), 6 deletions(-) New commits: commit 7b2966dbf283b168fa0cc1eadf989387ab6e25b9 Author: Matteo Casalin Date: Sat Jun 4 16:19:23 2016 +0200 nBufSiz can be a non-class local constant Change-Id: I2a7d32eabd01622261a1163781ac2a8b64bdee3f diff --git a/include/tools/inetstrm.hxx b/include/tools/inetstrm.hxx index e7a0a99..8d6353b 100644 --- a/include/tools/inetstrm.hxx +++ b/include/tools/inetstrm.hxx @@ -31,7 +31,6 @@ class TOOLS_DLLPUBLIC INetMIMEMessageStream INetMIMEMessage *pSourceMsg; boolbHeaderGenerated; -sal_uIntPtr nBufSiz; sal_Char *pBuffer; sal_Char *pRead; sal_Char *pWrite; diff --git a/tools/source/inet/inetstrm.cxx b/tools/source/inet/inetstrm.cxx index f1082a1f..99716a1 100644 --- a/tools/source/inet/inetstrm.cxx +++ b/tools/source/inet/inetstrm.cxx @@ -222,11 +222,17 @@ int INetMIMEMessageStream::GetMsgLine(sal_Char* pData, sal_uIntPtr nSize) } } +namespace +{ + +const int BUFFER_SIZE = 2048; + +} + INetMIMEMessageStream::INetMIMEMessageStream( INetMIMEMessage *pMsg, bool headerGenerated): pSourceMsg(pMsg), bHeaderGenerated(headerGenerated), -nBufSiz(2048), pMsgStrm(nullptr), pMsgBuffer(new SvMemoryStream), pMsgRead(nullptr), @@ -237,7 +243,7 @@ INetMIMEMessageStream::INetMIMEMessageStream( { assert(pMsg != nullptr); pMsgBuffer->SetStreamCharSet(RTL_TEXTENCODING_ASCII_US); -pBuffer = new sal_Char[nBufSiz]; +pBuffer = new sal_Char[BUFFER_SIZE]; pRead = pWrite = pBuffer; } @@ -271,7 +277,7 @@ int INetMIMEMessageStream::Read(sal_Char* pData, sal_uIntPtr nSize) pRead = pWrite = pBuffer; // Read next message line. -int nRead = GetMsgLine(pBuffer, nBufSiz); +int nRead = GetMsgLine(pBuffer, BUFFER_SIZE); if (nRead > 0) { // Set read pointer. commit 30d722a8f91b667cf56cab2ab6e2f5b2ed18408c Author: Matteo Casalin Date: Sat Jun 4 13:23:31 2016 +0200 Reduce #include dependencies Change-Id: I5c6c379717869028102ab2a1ae7929dfbc447904 diff --git a/include/tools/inetstrm.hxx b/include/tools/inetstrm.hxx index 834df85..e7a0a99 100644 --- a/include/tools/inetstrm.hxx +++ b/include/tools/inetstrm.hxx @@ -21,7 +21,6 @@ #include #include -#include class INetMIMEMessage; class SvMemoryStream; diff --git a/tools/source/inet/inetmsg.cxx b/tools/source/inet/inetmsg.cxx index 19eed71..b488ff9 100644 --- a/tools/source/inet/inetmsg.cxx +++ b/tools/source/inet/inetmsg.cxx @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 5 commits - include/vcl vcl/inc vcl/osx vcl/source vcl/unx vcl/win
include/vcl/print.hxx |2 - vcl/inc/osx/salprn.h|4 +- vcl/inc/salprn.hxx |8 +++- vcl/inc/salptype.hxx| 33 +--- vcl/inc/unx/genprn.h| 14 vcl/inc/unx/gtk/gtkprn.hxx |2 - vcl/inc/win/salprn.h|4 +- vcl/osx/salprn.cxx | 12 +++ vcl/source/gdi/print.cxx| 12 +++ vcl/source/gdi/print3.cxx | 11 ++ vcl/unx/generic/print/genprnpsp.cxx | 30 +- vcl/unx/gtk/salprn-gtk.cxx |2 - vcl/win/gdi/salprn.cxx | 58 +--- 13 files changed, 99 insertions(+), 93 deletions(-) New commits: commit bddca7fbcc64814860f331b464b61727f5569709 Author: Matteo Casalin Date: Sun Jan 10 16:09:41 2016 +0100 sal_uLong to DWORD/sal_Size in vcl/win/gdi/salprn.cxx Change-Id: I11c5547966a3b97562ecbbc91f32724fc190e5a7 diff --git a/vcl/win/gdi/salprn.cxx b/vcl/win/gdi/salprn.cxx index ef624c2..dbe8533 100644 --- a/vcl/win/gdi/salprn.cxx +++ b/vcl/win/gdi/salprn.cxx @@ -370,7 +370,6 @@ static bool ImplUpdateSalJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS LONGnRet; HWNDhWnd = 0; DWORD nMode = DM_OUT_BUFFER; -sal_uLong nDriverDataLen = 0; SalDriverData* pOutBuffer = NULL; BYTE* pInBuffer = NULL; @@ -384,7 +383,7 @@ static bool ImplUpdateSalJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS } // make Outputbuffer -nDriverDataLen = sizeof(SalDriverData) + nSysJobSize-1; +const sal_Size nDriverDataLen = sizeof(SalDriverData) + nSysJobSize-1; pOutBuffer = (SalDriverData*)rtl_allocateZeroMemory( nDriverDataLen ); pOutBuffer->mnSysSignature = SAL_DRIVERDATA_SYSSIGN; // calculate driver data offset including structure padding @@ -476,7 +475,7 @@ static void ImplDevModeToJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS // PaperBin if ( nFlags & JobSetFlags::PAPERBIN ) { -sal_uLong nCount = ImplDeviceCaps( pPrinter, DC_BINS, NULL, pSetupData ); +const DWORD nCount = ImplDeviceCaps( pPrinter, DC_BINS, NULL, pSetupData ); if ( nCount && (nCount != GDI_ERROR) ) { @@ -485,7 +484,7 @@ static void ImplDevModeToJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS pSetupData->mnPaperBin = 0; // search the right bin and assign index to mnPaperBin -for( sal_uLong i = 0; i < nCount; i++ ) +for( DWORD i = 0; i < nCount; ++i ) { if( CHOOSE_DEVMODE(dmDefaultSource) == pBins[ i ] ) { @@ -508,9 +507,9 @@ static void ImplDevModeToJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS } else { -sal_uLong nPaperCount = ImplDeviceCaps( pPrinter, DC_PAPERS, NULL, pSetupData ); +const DWORD nPaperCount = ImplDeviceCaps( pPrinter, DC_PAPERS, NULL, pSetupData ); WORD* pPapers = NULL; -sal_uLong nPaperSizeCount = ImplDeviceCaps( pPrinter, DC_PAPERSIZE, NULL, pSetupData ); +const DWORD nPaperSizeCount = ImplDeviceCaps( pPrinter, DC_PAPERSIZE, NULL, pSetupData ); POINT* pPaperSizes = NULL; if ( nPaperCount && (nPaperCount != GDI_ERROR) ) { @@ -524,7 +523,7 @@ static void ImplDevModeToJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS } if( nPaperSizeCount == nPaperCount && pPaperSizes && pPapers ) { -for( sal_uLong i = 0; i < nPaperCount; i++ ) +for( DWORD i = 0; i < nPaperCount; ++i ) { if( pPapers[ i ] == CHOOSE_DEVMODE(dmPaperSize) ) { @@ -743,7 +742,7 @@ static void ImplJobSetupToDevMode( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS // PaperBin if ( nFlags & JobSetFlags::PAPERBIN ) { -sal_uLong nCount = ImplDeviceCaps( pPrinter, DC_BINS, NULL, pSetupData ); +const DWORD nCount = ImplDeviceCaps( pPrinter, DC_BINS, NULL, pSetupData ); if ( nCount && (nCount != GDI_ERROR) ) { @@ -921,9 +920,9 @@ static void ImplJobSetupToDevMode( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS default: { short nPaper = 0; -sal_uLong nPaperCount = ImplDeviceCaps( pPrinter, DC_PAPERS, NULL, pSetupData ); +const DWORD nPaperCount = ImplDeviceCaps( pPrinter, DC_PAPERS, NULL, pSetupData ); WORD* pPapers = NULL; -sal_uLong nPaperSizeCount = ImplDeviceCaps( pPrinter, DC_PAPERSIZE, NULL, pSetupData ); +const DWORD nPaperSizeCount = ImplDeviceCaps( p
[Libreoffice-commits] core.git: vcl/inc vcl/osx
vcl/inc/osx/salprn.h |2 +- vcl/osx/salprn.cxx |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) New commits: commit fc388c1ff4ba005bbf784a083825f2070e66325e Author: Matteo Casalin Date: Tue Jan 26 22:13:40 2016 +0100 Blind fix for OSX Change-Id: Ieafe8df5d67299615e279151b29744ddd180 diff --git a/vcl/inc/osx/salprn.h b/vcl/inc/osx/salprn.h index afb0cb7..94340f3 100644 --- a/vcl/inc/osx/salprn.h +++ b/vcl/inc/osx/salprn.h @@ -125,7 +125,7 @@ class AquaSalPrinter : public SalPrinter virtual boolStartJob( const OUString* i_pFileName, const OUString& i_rJobName, const OUString& i_rAppName, - sal_uLong i_nCopies, + sal_uInt32 i_nCopies, bool i_bCollate, bool i_bDirect, ImplJobSetup* i_pSetupData ) override; diff --git a/vcl/osx/salprn.cxx b/vcl/osx/salprn.cxx index ca9bec2..54e3e8f 100644 --- a/vcl/osx/salprn.cxx +++ b/vcl/osx/salprn.cxx @@ -590,7 +590,7 @@ bool AquaSalPrinter::StartJob( const OUString* i_pFileName, bool AquaSalPrinter::StartJob( const OUString* /*i_pFileName*/, const OUString& /*i_rJobName*/, const OUString& /*i_rAppName*/, - sal_uLong /*i_nCopies*/, + sal_uInt32 /*i_nCopies*/, bool /*i_bCollate*/, bool /*i_bDirect*/, ImplJobSetup* ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: vcl/win
vcl/win/gdi/salprn.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit ccd681dabd75b14feaf410640cddc20862316cb3 Author: Matteo Casalin Date: Tue Jan 26 22:23:51 2016 +0100 Blind fix for Windows Change-Id: Icd28c3126eb764187788f3726bfa3a5db54ba7e6 diff --git a/vcl/win/gdi/salprn.cxx b/vcl/win/gdi/salprn.cxx index dbe8533..ae2d923 100644 --- a/vcl/win/gdi/salprn.cxx +++ b/vcl/win/gdi/salprn.cxx @@ -722,7 +722,7 @@ static void ImplDevModeToJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS } } -static void ImplJobSetupToDevMode( WinSalInfoPrinter* pPrinter, ImplJobSetup* pSetupData, sal_uLong nFlags ) +static void ImplJobSetupToDevMode( WinSalInfoPrinter* pPrinter, ImplJobSetup* pSetupData, JobSetFlags nFlags ) { if ( !pSetupData || !pSetupData->mpDriverData ) return; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - include/tools rsc/inc rsc/source tools/source
include/tools/pstm.hxx | 16 +++- include/tools/unqidx.hxx | 49 +-- rsc/inc/rscdb.hxx|6 ++-- rsc/inc/rscdef.hxx | 27 +++-- rsc/source/parser/rscdb.cxx | 24 +-- rsc/source/parser/rsclex.cxx |2 - rsc/source/parser/rscyacc.y |1 rsc/source/rsc/rsc.cxx | 26 ++-- rsc/source/tools/rscdef.cxx | 49 ++- tools/source/memtools/unqidx.cxx | 36 ++-- tools/source/ref/pstm.cxx| 14 +-- 11 files changed, 130 insertions(+), 120 deletions(-) New commits: commit 0d34f4ac9b17348d7956285c6cefb28bea2537b6 Author: Matteo Casalin Date: Tue Mar 1 23:37:07 2016 +0100 Data member nStartIndex can be const Change-Id: I94a3bdd01186061fbd95b62494c24a50f0c4866d diff --git a/include/tools/unqidx.hxx b/include/tools/unqidx.hxx index c783151..dd66c300 100644 --- a/include/tools/unqidx.hxx +++ b/include/tools/unqidx.hxx @@ -33,7 +33,7 @@ public: private: std::map maMap; -Index nStartIndex; +const Index nStartIndex; Index nUniqIndex; Index nCount; commit f00967cf38ed0c2c197284391fc521825bb3c2ac Author: Matteo Casalin Date: Tue Mar 1 23:21:02 2016 +0100 sal_uIntPtr/sal_uLong to Index (aka sal_uInt32) in UniqueIndex Change-Id: I212cb3bb9d920741629fc4564bbd28b393e8fe00 diff --git a/include/tools/pstm.hxx b/include/tools/pstm.hxx index 92b5349..ab75416 100644 --- a/include/tools/pstm.hxx +++ b/include/tools/pstm.hxx @@ -91,8 +91,6 @@ public: SvPersistBase *& rpObj ); }; -typedef std::map PersistBaseMap; - class SvStream; /** Persistent Stream @@ -130,12 +128,18 @@ class SvStream; */ class TOOLS_DLLPUBLIC SvPersistStream : public SvStream { +public: +typedef UniqueIndex::Index Index; + +private: +typedef std::map PersistBaseMap; + SvClassManager &rClassMgr; SvStream * pStm; PersistBaseMap aPTable; // reversed pointer and key UniqueIndex aPUIdx; -sal_uIntPtr nStartIdx; +Index nStartIdx; const SvPersistStream * pRefStm; virtual sal_uIntPtr GetData( void* pData, sal_uIntPtr nSize ) override; @@ -151,13 +155,13 @@ public: virtual voidResetError() override; SvPersistStream( SvClassManager &, SvStream * pStream, - sal_uInt32 nStartIdx = 1 ); + Index nStartIdx = 1 ); virtual ~SvPersistStream(); voidSetStream( SvStream * pStream ); -SvPersistBase * GetObject( sal_uIntPtr nIdx ) const; -sal_uIntPtr GetIndex( SvPersistBase * ) const; +SvPersistBase * GetObject( Index nIdx ) const; +Index GetIndex( SvPersistBase * ) const; static void WriteCompressed( SvStream & rStm, sal_uInt32 nVal ); static sal_uInt32 ReadCompressed( SvStream & rStm ); diff --git a/include/tools/unqidx.hxx b/include/tools/unqidx.hxx index 03a30c6..c783151 100644 --- a/include/tools/unqidx.hxx +++ b/include/tools/unqidx.hxx @@ -20,45 +20,52 @@ #define INCLUDED_TOOLS_UNQIDX_HXX #include -#include +#include #include -#define UNIQUEINDEX_ENTRY_NOTFOUND CONTAINER_ENTRY_NOTFOUND - class SAL_WARN_UNUSED TOOLS_DLLPUBLIC UniqueIndexImpl { +public: +typedef sal_uInt32 Index; +enum { +IndexNotFound = std::numeric_limits::max() +}; + private: -std::map maMap; -sal_uIntPtr nStartIndex; -sal_uIntPtr nUniqIndex; -sal_uIntPtr nCount; +std::map maMap; +Index nStartIndex; +Index nUniqIndex; +Index nCount; public: -UniqueIndexImpl( sal_uIntPtr _nStartIndex = 0 ) +UniqueIndexImpl( Index _nStartIndex = 0 ) : maMap(), nStartIndex(_nStartIndex), nUniqIndex(_nStartIndex), nCount(0) {} -sal_uIntPtr Insert( void* p ); +Index Insert( void* p ); // insert value with key, replacing existing entry if necessary -void* Remove( sal_uIntPtr aIndex ); -void* Get( sal_uIntPtr aIndex ) const; +void* Remove( Index aIndex ); +void* Get( Index aIndex ) const; -sal_uIntPtr GetIndexOf( void* p ) const; -sal_uIntPtr FirstIndex() const; -sal_uIntPtr LastIndex() const; -sal_uIntPtr NextIndex( sal_uIntPtr aCurrIndex ) const; +Index GetIndexOf( void* p ) const; +Index FirstIndex() const; +Index LastIndex() const; +Index NextIndex( Index aCurrIndex ) const; }; template class UniqueIndex : private UniqueIndexImpl { public: -UniqueIndex( sal_uIntPtr _nStartIndex = 0 ) : UniqueIndexImpl(_nStartIndex) {} +using UniqueIndexImpl::Index; +using UniqueInde
[Libreoffice-commits] core.git: include/tools
include/tools/unqidx.hxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit ad0aec407d09711f58acbacbf6296ca53b760725 Author: Matteo Casalin Date: Wed Mar 2 08:30:10 2016 +0100 Fix error C2057: expected constant expression Change-Id: Ie345ede60c1204c38a1c157c6335e3ded81fc26f diff --git a/include/tools/unqidx.hxx b/include/tools/unqidx.hxx index dd66c300..8e979bf 100644 --- a/include/tools/unqidx.hxx +++ b/include/tools/unqidx.hxx @@ -19,8 +19,8 @@ #ifndef INCLUDED_TOOLS_UNQIDX_HXX #define INCLUDED_TOOLS_UNQIDX_HXX +#include #include -#include #include class SAL_WARN_UNUSED TOOLS_DLLPUBLIC UniqueIndexImpl @@ -28,7 +28,7 @@ class SAL_WARN_UNUSED TOOLS_DLLPUBLIC UniqueIndexImpl public: typedef sal_uInt32 Index; enum { -IndexNotFound = std::numeric_limits::max() +IndexNotFound = SAL_MAX_UINT32 }; private: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 4 commits - include/tools tools/source
include/tools/unqidx.hxx |3 +-- tools/source/memtools/unqidx.cxx | 20 +--- 2 files changed, 6 insertions(+), 17 deletions(-) New commits: commit f04999cc84152ef9fc216d339da4b5fc2c52e256 Author: Matteo Casalin Date: Sat Mar 5 10:05:50 2016 +0100 Delete obsolete/unuseful comments Change-Id: Iadec409743e144a97c4468052dc0a04b91ca9619 diff --git a/tools/source/memtools/unqidx.cxx b/tools/source/memtools/unqidx.cxx index 7d7ac85..ecc6232 100644 --- a/tools/source/memtools/unqidx.cxx +++ b/tools/source/memtools/unqidx.cxx @@ -25,7 +25,6 @@ UniqueIndexImpl::Index UniqueIndexImpl::Insert( void* p ) if ( !p ) return IndexNotFound; - // Expend array if full const Index nTmp = static_cast(maMap.size()) + 1; // Avoid overflow of UniqIndex upon deletion @@ -35,7 +34,6 @@ UniqueIndexImpl::Index UniqueIndexImpl::Insert( void* p ) while ( maMap.find( nUniqIndex ) != maMap.end() ) nUniqIndex = (nUniqIndex+1) % nTmp; -// Insert object to array maMap[ nUniqIndex ] = p; nUniqIndex++; @@ -47,8 +45,6 @@ void* UniqueIndexImpl::Remove( Index nIndex ) // Check for valid index if ( nIndex >= nStartIndex ) { -// insert index as empty entry, and reduce indexcount, -// if this entry was used std::map::iterator it = maMap.find( nIndex - nStartIndex ); if( it != maMap.end() ) { commit ae35981823114d51376bf86bf1db665db62482c3 Author: Matteo Casalin Date: Sat Mar 5 09:48:11 2016 +0100 Do not duplicate count of items Change-Id: I373b39f36fee7c37f2c10cc748f309412d68b688 diff --git a/include/tools/unqidx.hxx b/include/tools/unqidx.hxx index 190b8e1..b6d65b4 100644 --- a/include/tools/unqidx.hxx +++ b/include/tools/unqidx.hxx @@ -33,12 +33,11 @@ private: std::map maMap; const Index nStartIndex; Index nUniqIndex; -Index nCount; public: UniqueIndexImpl( Index _nStartIndex = 0 ) : maMap(), - nStartIndex(_nStartIndex), nUniqIndex(_nStartIndex), nCount(0) {} + nStartIndex(_nStartIndex), nUniqIndex(_nStartIndex) {} Index Insert( void* p ); // insert value with key, replacing existing entry if necessary diff --git a/tools/source/memtools/unqidx.cxx b/tools/source/memtools/unqidx.cxx index ea3b773..7d7ac85 100644 --- a/tools/source/memtools/unqidx.cxx +++ b/tools/source/memtools/unqidx.cxx @@ -26,9 +26,7 @@ UniqueIndexImpl::Index UniqueIndexImpl::Insert( void* p ) return IndexNotFound; // Expend array if full -Index nTmp = static_cast(maMap.size()); -if( nTmp == nCount ) -nTmp++; +const Index nTmp = static_cast(maMap.size()) + 1; // Avoid overflow of UniqIndex upon deletion nUniqIndex = nUniqIndex % nTmp; @@ -40,7 +38,6 @@ UniqueIndexImpl::Index UniqueIndexImpl::Insert( void* p ) // Insert object to array maMap[ nUniqIndex ] = p; -nCount++; nUniqIndex++; return ( nUniqIndex + nStartIndex - 1 ); } @@ -57,7 +54,6 @@ void* UniqueIndexImpl::Remove( Index nIndex ) { void* p = it->second; maMap.erase( it ); -nCount--; return p; } } commit 9f7f577df3bc056c77d63aafa26e4d21c53af0aa Author: Matteo Casalin Date: Fri Mar 4 23:19:09 2016 +0100 Let find fail, instead of using a dubious upper bound check Change-Id: I874ef402d241aa4de02057ca9dc747ae0497b1e0 diff --git a/tools/source/memtools/unqidx.cxx b/tools/source/memtools/unqidx.cxx index 3d60fb8..ea3b773 100644 --- a/tools/source/memtools/unqidx.cxx +++ b/tools/source/memtools/unqidx.cxx @@ -48,8 +48,7 @@ UniqueIndexImpl::Index UniqueIndexImpl::Insert( void* p ) void* UniqueIndexImpl::Remove( Index nIndex ) { // Check for valid index -if ( (nIndex >= nStartIndex) && - (nIndex < (maMap.size() + nStartIndex)) ) +if ( nIndex >= nStartIndex ) { // insert index as empty entry, and reduce indexcount, // if this entry was used @@ -68,8 +67,7 @@ void* UniqueIndexImpl::Remove( Index nIndex ) void* UniqueIndexImpl::Get( Index nIndex ) const { // check for valid index -if ( (nIndex >= nStartIndex) && - (nIndex < (maMap.size() + nStartIndex)) ) +if ( nIndex >= nStartIndex ) { std::map::const_iterator it = maMap.find( nIndex - nStartIndex ); if( it != maMap.end() ) commit 1d4914e9e5cad4f443a742a34862620143176dbc Author: Matteo Casalin Date: Fri Mar 4 23:10:50 2016 +0100 Use Index consistently Change-Id: I20b7c1bd2e21967c4edab37a94c971aa8a8d diff --git a/tools/source/memtools/unqidx.cxx b/tools/source/memtools/unqidx.cxx index 4bd05bb..3d60fb8 100644 --- a/tools/source/memtools/unqidx.cxx +++ b/tools/source/memtools/unqidx.cxx @@ -96,7 +96,7 @@ UniqueIndexImpl::Index UniqueIndexImpl::LastIndex() const UniqueIndexImpl::Index UniqueIndexImpl::NextIn
[Libreoffice-commits] core.git: tools/source
tools/source/memtools/unqidx.cxx | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) New commits: commit bc2e74f3c3093819c499921cf62615e9a8d7301c Author: Matteo Casalin Date: Sat Mar 5 14:35:25 2016 +0100 Simplify recycling/search of freed UniqueIndex-es Change-Id: Icb8b375a95718a72abdd6650dda49fb9f43026a4 Reviewed-on: https://gerrit.libreoffice.org/22934 Reviewed-by: Noel Grandin Tested-by: Noel Grandin diff --git a/tools/source/memtools/unqidx.cxx b/tools/source/memtools/unqidx.cxx index ecc6232..56a9f0a 100644 --- a/tools/source/memtools/unqidx.cxx +++ b/tools/source/memtools/unqidx.cxx @@ -25,14 +25,10 @@ UniqueIndexImpl::Index UniqueIndexImpl::Insert( void* p ) if ( !p ) return IndexNotFound; -const Index nTmp = static_cast(maMap.size()) + 1; - -// Avoid overflow of UniqIndex upon deletion -nUniqIndex = nUniqIndex % nTmp; - -// Search next empty index +// Search next unused index, may be needed after +// a removal followed by multiple insertions while ( maMap.find( nUniqIndex ) != maMap.end() ) -nUniqIndex = (nUniqIndex+1) % nTmp; +++nUniqIndex; maMap[ nUniqIndex ] = p; @@ -48,6 +44,13 @@ void* UniqueIndexImpl::Remove( Index nIndex ) std::map::iterator it = maMap.find( nIndex - nStartIndex ); if( it != maMap.end() ) { +// Allow to recycle freed indexes, as was done by +// original implementation based on a vector +// This is not really needed when using a map, and +// really unique indexes might be better/safer? +if ( nIndex < nUniqIndex ) +nUniqIndex = nIndex; + void* p = it->second; maMap.erase( it ); return p; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/tools tools/source
include/tools/unqidx.hxx |6 ++ tools/source/memtools/unqidx.cxx | 39 +++ 2 files changed, 17 insertions(+), 28 deletions(-) New commits: commit 078188793b2753bf607bb629464935ccefd28136 Author: Matteo Casalin Date: Sat Mar 5 14:59:11 2016 +0100 Remove unuseful nStartIndex data member (and fix indexing) The methods that modify nUinqIndex already maintain class invariants: * Insert() never decrease its value * Remove() can replace its value with that of the removed item, which was no lower than the one specified in constructor call. Besides, boundary checks against nStartIndex are not really needed since the various methods rely on map::find. Finally, FirstIndex/NextIndex/LastIndex/GetIndexOf did not adjust with nStartIndex the index value retrieved from tha map, thus provifing wrong values. Since the map now stores the real indexes, consistency is granted. Change-Id: I5e47cd2672677805304d4c4860826fe272812abf Reviewed-on: https://gerrit.libreoffice.org/22935 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/tools/unqidx.hxx b/include/tools/unqidx.hxx index b6d65b4..99c5655 100644 --- a/include/tools/unqidx.hxx +++ b/include/tools/unqidx.hxx @@ -31,13 +31,11 @@ public: private: std::map maMap; -const Index nStartIndex; Index nUniqIndex; public: -UniqueIndexImpl( Index _nStartIndex = 0 ) -: maMap(), - nStartIndex(_nStartIndex), nUniqIndex(_nStartIndex) {} +UniqueIndexImpl( Index nStartIndex = 0 ) +: maMap(), nUniqIndex(nStartIndex) {} Index Insert( void* p ); // insert value with key, replacing existing entry if necessary diff --git a/tools/source/memtools/unqidx.cxx b/tools/source/memtools/unqidx.cxx index 56a9f0a..b53895f 100644 --- a/tools/source/memtools/unqidx.cxx +++ b/tools/source/memtools/unqidx.cxx @@ -32,42 +32,33 @@ UniqueIndexImpl::Index UniqueIndexImpl::Insert( void* p ) maMap[ nUniqIndex ] = p; -nUniqIndex++; -return ( nUniqIndex + nStartIndex - 1 ); +return nUniqIndex++; } void* UniqueIndexImpl::Remove( Index nIndex ) { -// Check for valid index -if ( nIndex >= nStartIndex ) +std::map::iterator it = maMap.find( nIndex ); +if ( it != maMap.end() ) { -std::map::iterator it = maMap.find( nIndex - nStartIndex ); -if( it != maMap.end() ) -{ -// Allow to recycle freed indexes, as was done by -// original implementation based on a vector -// This is not really needed when using a map, and -// really unique indexes might be better/safer? -if ( nIndex < nUniqIndex ) -nUniqIndex = nIndex; +// Allow to recycle freed indexes, as was done by +// original implementation based on a vector +// This is not really needed when using a map, and +// really unique indexes might be better/safer? +if ( nIndex < nUniqIndex ) +nUniqIndex = nIndex; -void* p = it->second; -maMap.erase( it ); -return p; -} +void* p = it->second; +maMap.erase( it ); +return p; } return nullptr; } void* UniqueIndexImpl::Get( Index nIndex ) const { -// check for valid index -if ( nIndex >= nStartIndex ) -{ -std::map::const_iterator it = maMap.find( nIndex - nStartIndex ); -if( it != maMap.end() ) -return it->second; -} +std::map::const_iterator it = maMap.find( nIndex ); +if ( it != maMap.end() ) +return it->second; return nullptr; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: tools/source
tools/source/memtools/unqidx.cxx | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) New commits: commit 96be131c5ef00bfae3c0c83231989fdfe9f7f5bb Author: Matteo Casalin Date: Sat Mar 5 18:58:30 2016 +0100 Minor optimization, and improved comments Change-Id: I6732725ef48d69f4c01762a117a60447e313aea0 Reviewed-on: https://gerrit.libreoffice.org/22936 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/tools/source/memtools/unqidx.cxx b/tools/source/memtools/unqidx.cxx index b53895f..7c57c1b 100644 --- a/tools/source/memtools/unqidx.cxx +++ b/tools/source/memtools/unqidx.cxx @@ -25,13 +25,13 @@ UniqueIndexImpl::Index UniqueIndexImpl::Insert( void* p ) if ( !p ) return IndexNotFound; -// Search next unused index, may be needed after -// a removal followed by multiple insertions -while ( maMap.find( nUniqIndex ) != maMap.end() ) +// Insert the pointer, starting from the current nUniqIndex "hint" +// and increasing it until a free one is found (this may happen +// after removals followed by multiple insertions). +while ( !maMap.emplace(nUniqIndex, p).second ) ++nUniqIndex; -maMap[ nUniqIndex ] = p; - +// Take care of updating hint key for next insertion return nUniqIndex++; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 24 commits - accessibility/source basctl/source cui/source desktop/source include/svtools include/vcl sfx2/source svtools/source sw/source vcl/source
accessibility/source/extended/textwindowaccessibility.cxx | 40 - basctl/source/basicide/baside2.cxx| 33 - basctl/source/basicide/baside2b.cxx | 24 basctl/source/basicide/linenumberwindow.cxx | 10 cui/source/dialogs/SpellDialog.cxx|4 desktop/source/deployment/gui/license_dialog.cxx |4 include/svtools/svmedit2.hxx |2 include/vcl/textdata.hxx | 15 include/vcl/texteng.hxx | 106 ++-- include/vcl/throbber.hxx |1 sfx2/source/control/thumbnailviewitem.cxx |4 svtools/source/edit/editsyntaxhighlighter.cxx | 11 svtools/source/edit/svmedit2.cxx |2 sw/source/ui/dbui/mmaddressblockpage.cxx | 18 sw/source/uibase/docvw/srcedtw.cxx|2 sw/source/uibase/uiview/srcview.cxx |8 vcl/source/control/combobox.cxx |6 vcl/source/control/field2.cxx | 12 vcl/source/control/ilstbox.cxx| 30 - vcl/source/control/longcurr.cxx |4 vcl/source/control/throbber.cxx | 10 vcl/source/edit/textdat2.hxx | 125 ++-- vcl/source/edit/textdata.cxx | 33 - vcl/source/edit/textdoc.cxx | 44 - vcl/source/edit/textdoc.hxx | 14 vcl/source/edit/texteng.cxx | 369 ++ vcl/source/edit/textund2.hxx | 16 vcl/source/edit/textundo.cxx | 10 vcl/source/edit/textview.cxx | 55 -- vcl/source/edit/vclmedit.cxx | 31 - vcl/source/edit/xtextedt.cxx | 16 31 files changed, 517 insertions(+), 542 deletions(-) New commits: commit 98244c3cb47824babc746ebc14a199977e9768d1 Author: Matteo Casalin Date: Sat Aug 15 19:35:32 2015 +0200 sal_uLong to sal_Int32/long Change-Id: Ia4ae190da37351b8c2b7ee9fc953508c5b1ab062 diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx index 65b6bf4..1aa1aa6 100644 --- a/basctl/source/basicide/baside2.cxx +++ b/basctl/source/basicide/baside2.cxx @@ -743,11 +743,11 @@ void ModulWindow::EditMacro( const OUString& rMacroName ) TextView * pView = GetEditView(); // scroll if applicable so that first line is at the top long nVisHeight = GetOutputSizePixel().Height(); -if ( (long)pView->GetTextEngine()->GetTextHeight() > nVisHeight ) +if ( pView->GetTextEngine()->GetTextHeight() > nVisHeight ) { -long nMaxY = (long)pView->GetTextEngine()->GetTextHeight() - nVisHeight; +long nMaxY = pView->GetTextEngine()->GetTextHeight() - nVisHeight; long nOldStartY = pView->GetStartDocPos().Y(); -long nNewStartY = (long)nStart * (long)pView->GetTextEngine()->GetCharHeight(); +long nNewStartY = (long)nStart * pView->GetTextEngine()->GetCharHeight(); nNewStartY = std::min( nNewStartY, nMaxY ); pView->Scroll( 0, -(nNewStartY-nOldStartY) ); pView->ShowCursor( false ); diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index 106e923..d1a29ae 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -1107,11 +1107,11 @@ void EditorWindow::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) { if ( rModulWindow.GetHScrollBar() ) { -sal_uLong nWidth = pEditEngine->CalcTextWidth(); -if ( (long)nWidth != nCurTextWidth ) +const long nWidth = pEditEngine->CalcTextWidth(); +if ( nWidth != nCurTextWidth ) { nCurTextWidth = nWidth; -rModulWindow.GetHScrollBar()->SetRange( Range( 0, (long)nCurTextWidth-1) ); +rModulWindow.GetHScrollBar()->SetRange( Range( 0, nCurTextWidth-1) ); rModulWindow.GetHScrollBar()->SetThumbPos( pEditView->GetStartDocPos().X() ); } } diff --git a/desktop/source/deployment/gui/license_dialog.cxx b/desktop/source/deployment/gui/license_dialog.cxx index f37082e..cc1621a 100644 --- a/desktop/source/deployment/gui/license_dialog.cxx +++ b/desktop/source/deployment/gui/license_dialog.cx
[Libreoffice-commits] core.git: 9 commits - filter/source include/vcl registry/source store/source unoidl/source vcl/inc vcl/source
filter/source/msfilter/util.cxx|4 include/vcl/salbtype.hxx | 160 +++-- registry/source/reflcnst.hxx | 76 - store/source/lockbyte.cxx |4 store/source/storbase.hxx |8 - store/source/storbios.cxx |8 - store/source/storcach.cxx |2 store/source/stordata.hxx | 22 ++--- store/source/stordir.cxx |2 store/source/stortree.hxx |4 unoidl/source/legacyprovider.cxx |8 - vcl/inc/canvasbitmap.hxx |2 vcl/source/helper/canvasbitmap.cxx | 20 ++-- 13 files changed, 163 insertions(+), 157 deletions(-) New commits: commit 6257ea7d925080c930748b5c1120971f3aabc44d Author: Matteo Casalin Date: Fri Aug 21 22:14:03 2015 +0200 sal_uLong to size_t Change-Id: Ie1774045329f543c05316ba2acfa332e3b323c7c diff --git a/include/vcl/salbtype.hxx b/include/vcl/salbtype.hxx index ee3b0f2..2ad04bc 100644 --- a/include/vcl/salbtype.hxx +++ b/include/vcl/salbtype.hxx @@ -419,7 +419,7 @@ inline BitmapPalette::BitmapPalette( const BitmapPalette& rBitmapPalette ) : { if( mnCount ) { -const sal_uLong nSize = mnCount * sizeof( BitmapColor ); +const size_t nSize = mnCount * sizeof( BitmapColor ); mpBitmapColor = reinterpret_cast(new sal_uInt8[ nSize ]); memcpy( mpBitmapColor, rBitmapPalette.mpBitmapColor, nSize ); } @@ -432,7 +432,7 @@ inline BitmapPalette::BitmapPalette( sal_uInt16 nCount ) : { if( mnCount ) { -const sal_uLong nSize = mnCount * sizeof( BitmapColor ); +const size_t nSize = mnCount * sizeof( BitmapColor ); mpBitmapColor = reinterpret_cast(new sal_uInt8[ nSize ]); memset( mpBitmapColor, 0, nSize ); } @@ -452,7 +452,7 @@ inline BitmapPalette& BitmapPalette::operator=( const BitmapPalette& rBitmapPale if( mnCount ) { -const sal_uLong nSize = mnCount * sizeof( BitmapColor ); +const size_t nSize = mnCount * sizeof( BitmapColor ); mpBitmapColor = reinterpret_cast(new sal_uInt8[ nSize ]); memcpy( mpBitmapColor, rBitmapPalette.mpBitmapColor, nSize ); } @@ -508,8 +508,8 @@ inline void BitmapPalette::SetEntryCount( sal_uInt16 nCount ) } else if( nCount != mnCount ) { -const sal_uLong nNewSize = nCount * sizeof( BitmapColor ); -const sal_uLong nMinSize = std::min( mnCount, nCount ) * sizeof( BitmapColor ); +const size_t nNewSize = nCount * sizeof( BitmapColor ); +const size_t nMinSize = std::min( mnCount, nCount ) * sizeof( BitmapColor ); sal_uInt8* pNewColor = new sal_uInt8[ nNewSize ]; if ( nMinSize && mpBitmapColor ) commit adc5e7d554fb3ad1afc4fdd15021fb84be297147 Author: Matteo Casalin Date: Wed Aug 19 22:47:51 2015 +0200 ColorMask: sal_uLong to better types, minor code rework Change-Id: I426fa847038e7a6f788761242cb43e38cb355a36 diff --git a/include/vcl/salbtype.hxx b/include/vcl/salbtype.hxx index dfbc59d..ee3b0f2 100644 --- a/include/vcl/salbtype.hxx +++ b/include/vcl/salbtype.hxx @@ -68,9 +68,9 @@ typedef const sal_uInt8* ConstScanline; #define MASK_TO_COLOR( d_nVal, d_RM, d_GM, d_BM, d_RS, d_GS, d_BS, d_Col ) \ -sal_uLong _def_cR = (sal_uInt8) ( d_RS < 0L ? ( (d_nVal) & d_RM ) << -d_RS : ( (d_nVal) & d_RM ) >> d_RS ); \ -sal_uLong _def_cG = (sal_uInt8) ( d_GS < 0L ? ( (d_nVal) & d_GM ) << -d_GS : ( (d_nVal) & d_GM ) >> d_GS ); \ -sal_uLong _def_cB = (sal_uInt8) ( d_BS < 0L ? ( (d_nVal) & d_BM ) << -d_BS : ( (d_nVal) & d_BM ) >> d_BS ); \ +const sal_uInt8 _def_cR = static_cast( d_RS < 0 ? ( (d_nVal) & d_RM ) << -d_RS : ( (d_nVal) & d_RM ) >> d_RS ); \ +const sal_uInt8 _def_cG = static_cast( d_GS < 0 ? ( (d_nVal) & d_GM ) << -d_GS : ( (d_nVal) & d_GM ) >> d_GS ); \ +const sal_uInt8 _def_cB = static_cast( d_BS < 0 ? ( (d_nVal) & d_BM ) << -d_BS : ( (d_nVal) & d_BM ) >> d_BS ); \ d_Col = BitmapColor( (sal_uInt8) ( _def_cR | ( ( _def_cR & mnROr ) >> mnROrShift ) ), \ (sal_uInt8) ( _def_cG | ( ( _def_cG & mnGOr ) >> mnGOrShift ) ), \ (sal_uInt8) ( _def_cB | ( ( _def_cB & mnBOr ) >> mnBOrShift ) ) ); @@ -184,33 +184,33 @@ public: // - ColorMask - class VCL_DLLPUBLIC ColorMask { -sal_uLong mnRMask; -sal_uLong mnGMask; -sal_uLong mnBMask; -longmnRShift; -longmnGShift; -longmnBShift; -sal_uLong mnROrShift; -sal_uLong mnGOrShift; -sal_uLong mnBOrShift; -sal_uLong mnROr; -sal_uLong
Re: [Libreoffice-commits] core.git: Silence some conversion warnings
Hi On Mon, 24 Aug 2015 10:37:38 +0200 Stephan Bergmann wrote: > On 08/21/2015 10:30 PM, Matteo Casalin wrote: > > commit eb4cbea657b9038c488f1b1bcf5107cc226a6681 > > Author: Matteo Casalin > > Date: Sun Aug 16 16:32:13 2015 +0200 > > > > Silence some conversion warnings > > > > Change-Id: I676ed010576f3a24b193ffc6c28a319bcc5ac968 > > > [...] > > diff --git a/store/source/storbase.hxx b/store/source/storbase.hxx > > index 395870f..78a51a1 100644 > > --- a/store/source/storbase.hxx > > +++ b/store/source/storbase.hxx > > @@ -512,9 +512,9 @@ struct PageData > > void guard (sal_uInt32 nAddr) > > { > > sal_uInt32 nCRC32 = 0; > > -nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, > > sizeof(sal_uInt32)); > > +nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, > > static_cast(sizeof(sal_uInt32))); > > What compiler/switch is it that warns there? It does not look like that > particular compiler/switch is very useful. sizeof(sal_uInt32) is a > known, small integer at compile time. It should be apparent to both the > compiler and humans that it fits into the sal_uInt32 argument to > rtl_crc32 without needing the static_cast noise. That's GCC -Wconversion, which I'm using to chase harmful downcasts (e.g. sal_Int32 to sal_uInt16 for OUString length, there are still some of them here and there). The point is that some of these downcasts, although safe in themselves, introduce a lot of noise in the logs and make the real issues difficult to detect. If I remember correctly in this case the warning was probably only in the result of "theSize - sizeof(G)" some lines below, I just casted both call places for simmetry. If that's undesired I'll revert the cast for the "sizeof(sal_uInt32)" calls. Kind regards Matteo ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice-commits] core.git: 7 commits - editeng/source filter/source include/editeng include/svx include/vcl sc/source sot/source store/source svx/source sw/qa sw/source unotools/source vcl/inc vc
editeng/source/uno/unoedhlp.cxx |4 filter/source/flash/swfwriter1.cxx |2 filter/source/svg/svgexport.cxx | 13 filter/source/svg/svgwriter.cxx |8 filter/source/svg/svgwriter.hxx |2 include/editeng/unoedhlp.hxx|4 include/svx/xoutbmp.hxx |2 include/vcl/alpha.hxx |2 include/vcl/animate.hxx |4 include/vcl/bitmap.hxx |2 include/vcl/bitmapex.hxx|2 include/vcl/gdimtf.hxx |2 include/vcl/graph.hxx |2 sc/source/filter/starcalc/scflt.cxx | 779 ++-- sot/source/sdstor/ucbstorage.cxx| 42 - store/source/storbase.hxx |4 store/source/storbios.cxx |4 store/source/stordata.hxx |8 svx/source/xoutdev/_xoutbmp.cxx |6 sw/qa/extras/ooxmlimport/ooxmlimport.cxx|2 sw/source/core/edit/editsh.cxx |3 sw/source/filter/html/css1atr.cxx |3 sw/source/filter/html/htmlflywriter.cxx |6 sw/source/filter/html/wrthtml.cxx |3 unotools/source/config/syslocaleoptions.cxx |4 vcl/inc/impbmp.hxx |6 vcl/inc/impgraph.hxx|2 vcl/source/gdi/animate.cxx |4 vcl/source/gdi/bitmap.cxx |8 vcl/source/gdi/bitmapex.cxx |2 vcl/source/gdi/gdimtf.cxx |4 vcl/source/gdi/graph.cxx|2 vcl/source/gdi/impgraph.cxx |4 33 files changed, 473 insertions(+), 472 deletions(-) New commits: commit d00ca13f880bbfe0fc987ef47184737dc74551d8 Author: Matteo Casalin Date: Sat Aug 29 16:49:46 2015 +0200 XOutBitmap::GraphicToBase64 can return bool instead of a sal_uLong error code, which no call place cares about Change-Id: I0d0dd16859e2f9678f47f484edf933e165b1ca48 diff --git a/include/svx/xoutbmp.hxx b/include/svx/xoutbmp.hxx index 34e03c3..37fe77d 100644 --- a/include/svx/xoutbmp.hxx +++ b/include/svx/xoutbmp.hxx @@ -56,7 +56,7 @@ public: static sal_uInt16 WriteGraphic( const Graphic& rGraphic, OUString& rFileName, const OUString& rFilterName, const sal_uIntPtr nFlags = 0L, const Size* pMtfSize_100TH_MM = NULL ); -static sal_uLongGraphicToBase64(const Graphic& rGraphic,OUString& rOUString); +static bool GraphicToBase64(const Graphic& rGraphic, OUString& rOUString); static sal_uInt16 ExportGraphic( const Graphic& rGraphic, const INetURLObject& rURL, GraphicFilter& rFilter, const sal_uInt16 nFormat, diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx index c6a71ae..3993018 100644 --- a/svx/source/xoutdev/_xoutbmp.cxx +++ b/svx/source/xoutdev/_xoutbmp.cxx @@ -327,7 +327,7 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileNam } } -sal_uLong XOutBitmap::GraphicToBase64(const Graphic& rGraphic, OUString& rOUString) +bool XOutBitmap::GraphicToBase64(const Graphic& rGraphic, OUString& rOUString) { SvMemoryStream aOStm; OUString aMimeType; @@ -357,14 +357,14 @@ sal_uLong XOutBitmap::GraphicToBase64(const Graphic& rGraphic, OUString& rOUStri if ( nErr ) { SAL_WARN("svx", "XOutBitmap::GraphicToBase64() invalid Graphic? error: " << nErr ); -return nErr; +return false; } aOStm.Seek(STREAM_SEEK_TO_END); css::uno::Sequence aOStmSeq( static_cast(aOStm.GetData()),aOStm.Tell() ); OUStringBuffer aStrBuffer; ::sax::Converter::encodeBase64(aStrBuffer,aOStmSeq); rOUString = aMimeType + ";base64," + aStrBuffer.makeStringAndClear(); -return 0; +return true; } sal_uInt16 XOutBitmap::ExportGraphic( const Graphic& rGraphic, const INetURLObject& rURL, diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index 02881ce..c630a76 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -3235,8 +3235,7 @@ static Writer& OutCSS1_SvxBrush( Writer& rWrt, const SfxPoolItem& rHt, const Graphic* pGrf = static_cast(rHt).GetGraphic(); if( pGrf ) { -sal_uLong nErr = XOutBitmap::GraphicToBase64(*pGrf, aGraphicInBase64); -if( nErr ) +if( !XOutBitmap::GraphicToBase64(*pGrf, aGraphicInBase64) ) { rHTMLWrt.nWarn = WARN_SWG_POOR_LOAD | WARN_SW_WRITE_BASE; } diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filte
[Libreoffice-commits] core.git: 15 commits - basctl/source basic/source desktop/source editeng/source include/vcl sc/inc sc/source sd/source sfx2/source svx/source sw/source vcl/generic vcl/headless v
basctl/source/basicide/basidesh.cxx|2 basic/source/classes/sb.cxx|2 basic/source/classes/sbxmod.cxx|6 basic/source/runtime/methods1.cxx |2 basic/source/runtime/stdobj.cxx|2 basic/source/sbx/sbxcoll.cxx |2 basic/source/sbx/sbxobj.cxx|2 desktop/source/deployment/gui/license_dialog.cxx |2 editeng/source/editeng/impedit5.cxx|2 include/vcl/jobdata.hxx|4 sc/inc/brdcst.hxx |2 sc/inc/column.hxx |2 sc/inc/document.hxx|4 sc/inc/global.hxx |3 sc/inc/zforauto.hxx| 20 +- sc/source/core/data/bcaslot.cxx|6 sc/source/core/data/column3.cxx|2 sc/source/core/data/documen7.cxx |4 sc/source/core/data/dputil.cxx |2 sc/source/core/data/formulacell.cxx|8 - sc/source/core/data/global.cxx |8 - sc/source/core/inc/bcaslot.hxx |6 sc/source/core/tool/brdcst.cxx |2 sc/source/core/tool/dbdata.cxx |3 sc/source/core/tool/zforauto.cxx | 36 ++-- sc/source/filter/lotus/tool.cxx|2 sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx |2 sc/source/ui/Accessibility/AccessiblePreviewTable.cxx |4 sc/source/ui/Accessibility/AccessibleText.cxx | 104 - sc/source/ui/app/inputwin.cxx |2 sc/source/ui/app/scmod.cxx | 10 - sc/source/ui/docshell/docsh.cxx|3 sc/source/ui/docshell/servobj.cxx |3 sc/source/ui/miscdlgs/autofmt.cxx |2 sc/source/ui/navipi/navipi.cxx |2 sc/source/ui/unoobj/cellsuno.cxx | 10 - sc/source/ui/unoobj/chart2uno.cxx |2 sc/source/ui/unoobj/datauno.cxx|8 - sc/source/ui/unoobj/docuno.cxx |2 sc/source/ui/unoobj/editsrc.cxx|2 sc/source/ui/unoobj/textuno.cxx|2 sc/source/ui/view/prevwsh2.cxx |3 sc/source/ui/view/tabvwsh5.cxx |2 sd/source/core/stlsheet.cxx|5 sd/source/ui/tools/PreviewRenderer.cxx |5 sd/source/ui/view/DocumentRenderer.cxx |7 sfx2/source/dialog/templdlg.cxx|2 svx/source/svdraw/svdoedge.cxx |2 sw/source/core/layout/frmtool.cxx |2 sw/source/core/unocore/unostyle.cxx|3 sw/source/filter/html/htmlfld.cxx |2 sw/source/filter/ww8/ww8par5.cxx |2 sw/source/uibase/app/apphdl.cxx| 19 +- sw/source/uibase/docvw/srcedtw.cxx | 26 +-- sw/source/uibase/shells/textsh1.cxx|2 sw/source/uibase/utlui/numfmtlb.cxx| 21 +- vcl/generic/print/genprnpsp.cxx|4 vcl/headless/svpprn.cxx|2 vcl/inc/jobset.h |2 vcl/source/edit/vclmedit.cxx | 41 ++--- vcl/source/fontsubset/gsub.cxx | 11 - vcl/unx/generic/printer/jobdata.cxx|9 - 62 files changed, 216 insertions(+), 250 deletions(-) New commits: commit e7d920da4465fd8de8b8a9f87a3589054eac73de Author: Matteo Casalin Date: Tue Dec 22 22:57:02 2015 +0100 sal_uLong to sal_uInt32, ScHint related Change-Id: I84402bf4b8d69ae350f6449cf4d1fd7c5c325f3c diff --git a/sc/inc/brdcst.hxx b/sc/inc/brdcst.hxx index 5dfdb8f..606541b 100644 --- a/sc/inc/brdcst.hxx +++ b/sc/inc/brdcst.hxx @@ -31,7 +31,7 @@ class ScHint : public SfxSimpleHint ScAddress aAddress; public: -ScHint( sal_uLong n, const ScAddress& a ); +ScHint( sal_uInt32 n, const ScAddress& a ); const ScAddress&GetAddress() const { return aAddress; } ScAddress&GetAddress() { return aAdd
[Libreoffice-commits] core.git: 12 commits - connectivity/source dbaccess/source extensions/source filter/source framework/inc idl/inc idl/source include/editeng include/filter include/framework inclu
|1 sot/source/sdstor/stg.cxx | 16 +-- sot/source/sdstor/stgcache.cxx|2 sot/source/sdstor/stgcache.hxx|6 - sot/source/sdstor/stgio.cxx |6 - sot/source/sdstor/stgstrms.hxx|6 - sot/source/sdstor/storage.cxx |2 sot/source/sdstor/ucbstorage.cxx | 16 +-- svl/source/inc/strmadpt.hxx |1 svl/source/items/lckbitem.cxx |1 svtools/source/svhtml/HtmlWriter.cxx |1 svx/source/gallery2/galtheme.cxx |4 svx/source/tbxctrls/Palette.cxx |1 svx/source/xoutdev/xexch.cxx |1 sw/source/core/edit/edglss.cxx|5 - sw/source/core/inc/swfont.hxx |1 sw/source/core/unocore/unoobj.cxx | 22 ++-- sw/source/filter/html/htmlplug.cxx|3 sw/source/filter/html/wrthtml.hxx |1 sw/source/filter/ww8/WW8Sttbf.cxx |1 sw/source/filter/ww8/WW8Sttbf.hxx |3 sw/source/filter/ww8/ww8scan.cxx |2 sw/source/filter/ww8/ww8scan.hxx |3 test/source/xmlwriter.cxx |1 tools/qa/cppunit/test_urlobj.cxx | 12 +- tools/source/stream/stream.cxx|2 vcl/source/filter/graphicfilter.cxx |3 vcl/source/gdi/gfxlink.cxx|1 vcl/source/gdi/graphictools.cxx |1 vcl/source/gdi/pdfwriter_impl.hxx |3 vcl/source/gdi/pdfwriter_impl2.cxx|1 109 files changed, 275 insertions(+), 206 deletions(-) New commits: commit 20635ed90b2f684757c480b3cff70547a0e06363 Author: Matteo Casalin Date: Sun Oct 11 18:21:11 2015 +0200 Reduce scope of #include Change-Id: I0752cbb0cb2e0f89607d81d9eda7ce7091449fd6 diff --git a/connectivity/source/drivers/dbase/dindexnode.cxx b/connectivity/source/drivers/dbase/dindexnode.cxx index edbbf5c..da67032 100644 --- a/connectivity/source/drivers/dbase/dindexnode.cxx +++ b/connectivity/source/drivers/dbase/dindexnode.cxx @@ -22,6 +22,7 @@ #include #include "dbase/DIndex.hxx" #include +#include #include #include diff --git a/connectivity/source/inc/dbase/dindexnode.hxx b/connectivity/source/inc/dbase/dindexnode.hxx index e4bc122..17e713e 100644 --- a/connectivity/source/inc/dbase/dindexnode.hxx +++ b/connectivity/source/inc/dbase/dindexnode.hxx @@ -23,12 +23,13 @@ #include "file/FTable.hxx" #include #include -#include #include #define NODE_NOTFOUND 0x #define DINDEX_PAGE_SIZE 512 +class SvStream; + namespace connectivity { namespace dbase diff --git a/dbaccess/source/ui/inc/HtmlReader.hxx b/dbaccess/source/ui/inc/HtmlReader.hxx index 78368ce..9c5ca32 100644 --- a/dbaccess/source/ui/inc/HtmlReader.hxx +++ b/dbaccess/source/ui/inc/HtmlReader.hxx @@ -22,10 +22,11 @@ #include "DExport.hxx" #include #include -#include #include #include +class SvStream; + namespace dbaui { class OHTMLReader : public HTMLParser, public ODatabaseExport diff --git a/dbaccess/source/ui/inc/RtfReader.hxx b/dbaccess/source/ui/inc/RtfReader.hxx index f0da719..fe8a02e 100644 --- a/dbaccess/source/ui/inc/RtfReader.hxx +++ b/dbaccess/source/ui/inc/RtfReader.hxx @@ -22,7 +22,8 @@ #include #include #include "DExport.hxx" -#include + +class SvStream; namespace dbaui { diff --git a/dbaccess/source/ui/inc/TableRow.hxx b/dbaccess/source/ui/inc/TableRow.hxx index 9d18818..fa57cf0 100644 --- a/dbaccess/source/ui/inc/TableRow.hxx +++ b/dbaccess/source/ui/inc/TableRow.hxx @@ -19,10 +19,10 @@ #ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_TABLEROW_HXX #define INCLUDED_DBACCESS_SOURCE_UI_INC_TABLEROW_HXX -#include #include #include "TypeInfo.hxx" +class SvStream; namespace dbaui { diff --git a/dbaccess/source/ui/inc/TokenWriter.hxx b/dbaccess/source/ui/inc/TokenWriter.hxx index 91fc0c8..da97dfa 100644 --- a/dbaccess/source/ui/inc/TokenWriter.hxx +++ b/dbaccess/source/ui/inc/TokenWriter.hxx @@ -35,7 +35,6 @@ #include #include -#include #include namespace com { namespace sun { namespace star { @@ -44,6 +43,8 @@ namespace com { namespace sun { namespace star { } }}} +class SvStream; + namespace dbaui { // ODatabaseImportExport base class for import/export diff --git a/dbaccess/source/ui/misc/HtmlReader.cxx b/dbaccess/source/ui/misc/HtmlReader.cxx index 4cc93a2..7d11395 100644 --- a/dbaccess/source/ui/misc/HtmlReader.cxx +++ b/dbaccess/source/ui/misc/HtmlReader.cxx @@ -21,6 +21,7 @@ #include #include #i
[Libreoffice-commits] core.git: sot/source
sot/source/sdstor/stgstrms.cxx | 22 ++ sot/source/sdstor/stgstrms.hxx |2 +- 2 files changed, 11 insertions(+), 13 deletions(-) New commits: commit 51bc0594f2d65630cf167a107f3be3f79993e6d9 Author: Matteo Casalin Date: Tue Oct 27 18:25:07 2015 +0100 sal_uLong to sal_uInt64/sal_Size Change-Id: I4032b08225f1b530a43f1a8c09c5fc3515f45ced diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx index f21bc25..4367fc7 100644 --- a/sot/source/sdstor/stgstrms.cxx +++ b/sot/source/sdstor/stgstrms.cxx @@ -,7 +,7 @@ sal_Int32 StgSmallStrm::Write( const void* pBuf, sal_Int32 n ) #define THRESHOLD 32768L -StgTmpStrm::StgTmpStrm( sal_uLong nInitSize ) +StgTmpStrm::StgTmpStrm( sal_uInt64 nInitSize ) : SvMemoryStream( nInitSize > THRESHOLD ? 16 : ( nInitSize ? nInitSize : 16 ), 4096 ) @@ -1125,8 +1125,8 @@ StgTmpStrm::StgTmpStrm( sal_uLong nInitSize ) bool StgTmpStrm::Copy( StgTmpStrm& rSrc ) { -sal_uLong n= rSrc.GetSize(); -sal_uLong nCur = rSrc.Tell(); +sal_uInt64 n = rSrc.GetSize(); +const sal_uInt64 nCur = rSrc.Tell(); SetSize( n ); if( GetError() == SVSTREAM_OK ) { @@ -1135,9 +1135,7 @@ bool StgTmpStrm::Copy( StgTmpStrm& rSrc ) Seek( 0L ); while( n ) { -sal_uLong nn = n; -if( nn > 4096 ) -nn = 4096; +const sal_uInt64 nn = std::min(n, 4096); if( rSrc.Read( p.get(), nn ) != nn ) break; if( Write( p.get(), nn ) != nn ) @@ -1187,15 +1185,15 @@ void StgTmpStrm::SetSize(sal_uInt64 n) { m_aName = utl::TempFile(0, false).GetURL(); SvFileStream* s = new SvFileStream( m_aName, STREAM_READWRITE ); -sal_uLong nCur = Tell(); -sal_uLong i = nEndOfData; +const sal_uInt64 nCur = Tell(); +sal_uInt64 i = nEndOfData; std::unique_ptr p(new sal_uInt8[ 4096 ]); if( i ) { Seek( 0L ); while( i ) { -sal_uLong nb = ( i > 4096 ) ? 4096 : i; +const sal_uInt64 nb = std::min(i, 4096); if( Read( p.get(), nb ) == nb && s->Write( p.get(), nb ) == nb ) i -= nb; @@ -1213,7 +1211,7 @@ void StgTmpStrm::SetSize(sal_uInt64 n) i = n - nEndOfData; while (i) { -sal_uLong const nb = (i > 4096) ? 4096 : i; +const sal_uInt64 nb = std::min(i, 4096); if (s->Write(p.get(), nb) == nb) i -= nb; else @@ -1247,7 +1245,7 @@ void StgTmpStrm::SetSize(sal_uInt64 n) } } -sal_uLong StgTmpStrm::GetData( void* pData, sal_uLong n ) +sal_Size StgTmpStrm::GetData( void* pData, sal_Size n ) { if( m_pStrm ) { @@ -1259,7 +1257,7 @@ sal_uLong StgTmpStrm::GetData( void* pData, sal_uLong n ) return SvMemoryStream::GetData( pData, n ); } -sal_uLong StgTmpStrm::PutData( const void* pData, sal_uLong n ) +sal_Size StgTmpStrm::PutData( const void* pData, sal_Size n ) { sal_uInt32 nCur = Tell(); sal_uInt32 nNew = nCur + n; diff --git a/sot/source/sdstor/stgstrms.hxx b/sot/source/sdstor/stgstrms.hxx index 94f3049..2ce3ff3 100644 --- a/sot/source/sdstor/stgstrms.hxx +++ b/sot/source/sdstor/stgstrms.hxx @@ -151,7 +151,7 @@ class StgTmpStrm : public SvMemoryStream virtual void FlushData() override; public: -explicit StgTmpStrm( sal_uLong=16 ); +explicit StgTmpStrm( sal_uInt64=16 ); virtual ~StgTmpStrm(); bool Copy( StgTmpStrm& ); virtual void SetSize( sal_uInt64 ) override; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits