[Bug 39440] cppcheck cleanliness

2015-01-18 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=39440

--- Comment #57 from Commit Notification 
 ---
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=ec9c7ebb575b592e188c5f6b545570b11744d063

fdo#39440 vcl: reduce scope of local variables

It will be available in 4.5.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: vcl/generic vcl/quartz vcl/source

2015-01-18 Thread Michael Weghorn
 vcl/generic/fontmanager/parseAFM.cxx |   18 ++
 vcl/generic/print/bitmap_gfx.cxx |3 +--
 vcl/generic/print/text_gfx.cxx   |3 ++-
 vcl/quartz/salgdicommon.cxx  |3 +--
 vcl/source/control/field2.cxx|3 ++-
 vcl/source/control/ilstbox.cxx   |7 ---
 vcl/source/filter/graphicfilter2.cxx |6 --
 vcl/source/filter/sgfbram.cxx|3 +--
 vcl/source/filter/sgvspln.cxx|   11 ---
 vcl/source/filter/sgvtext.cxx|9 +++--
 vcl/source/filter/wmf/enhwmf.cxx |4 ++--
 vcl/source/filter/wmf/winwmf.cxx |3 +--
 vcl/source/filter/wmf/wmfwr.cxx  |4 +---
 13 files changed, 32 insertions(+), 45 deletions(-)

New commits:
commit ec9c7ebb575b592e188c5f6b545570b11744d063
Author: Michael Weghorn 
Date:   Sat Jan 17 00:59:10 2015 +0100

fdo#39440 vcl: reduce scope of local variables

This addresses some cppcheck warnings.

Change-Id: Ib6b9651b828287665f7248052855f0da2779806e
Reviewed-on: https://gerrit.libreoffice.org/13968
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/vcl/generic/fontmanager/parseAFM.cxx 
b/vcl/generic/fontmanager/parseAFM.cxx
index b3a7f7a..6d341ba 100644
--- a/vcl/generic/fontmanager/parseAFM.cxx
+++ b/vcl/generic/fontmanager/parseAFM.cxx
@@ -360,13 +360,12 @@ static int parseGlobals( FileInputStream* fp, 
GlobalFontInfo* gfi )
 {
 bool cont = true, save = (gfi != NULL);
 int error = ok;
-char *keyword;
 int direction = -1;
 int tokenlen;
 
 while (cont)
 {
-keyword = token(fp, tokenlen);
+char *keyword = token(fp, tokenlen);
 
 if (keyword == NULL)
 /* Have reached an early and unexpected EOF. */
@@ -564,11 +563,10 @@ static int parseCharWidths( FileInputStream* fp, int* cwi)
 {
 bool cont = true, save = (cwi != NULL);
 int pos = 0, error = ok, tokenlen;
-char *keyword;
 
 while (cont)
 {
-keyword = token(fp,tokenlen);
+char *keyword = token(fp,tokenlen);
 /* Have reached an early and unexpected EOF. */
 /* Set flag and stop parsing */
 if (keyword == NULL)
@@ -717,11 +715,10 @@ static int parseCharMetrics( FileInputStream* fp, 
FontInfo* fi)
 bool cont = true, firstTime = true;
 int error = ok, count = 0, tokenlen;
 CharMetricInfo *temp = fi->cmi;
-char *keyword;
 
 while (cont)
 {
-keyword = token(fp,tokenlen);
+char *keyword = token(fp,tokenlen);
 if (keyword == NULL)
 {
 error = earlyEOF;
@@ -873,11 +870,10 @@ static int parseTrackKernData( FileInputStream* fp, 
FontInfo* fi)
 {
 bool cont = true, save = (fi->tkd != NULL);
 int pos = 0, error = ok, tcount = 0, tokenlen;
-char *keyword;
 
 while (cont)
 {
-keyword = token(fp,tokenlen);
+char *keyword = token(fp,tokenlen);
 
 if (keyword == NULL)
 {
@@ -980,11 +976,10 @@ static int parsePairKernData( FileInputStream* fp, 
FontInfo* fi)
 {
 bool cont = true, save = (fi->pkd != NULL);
 int pos = 0, error = ok, pcount = 0, tokenlen;
-char *keyword;
 
 while (cont)
 {
-keyword = token(fp,tokenlen);
+char *keyword = token(fp,tokenlen);
 
 if (keyword == NULL)
 {
@@ -1109,11 +1104,10 @@ static int parseCompCharData( FileInputStream* fp, 
FontInfo* fi)
 {
 bool cont = true, firstTime = true, save = (fi->ccd != NULL);
 int pos = 0, j = 0, error = ok, ccount = 0, pcount = 0, tokenlen;
-char *keyword;
 
 while (cont)
 {
-keyword = token(fp,tokenlen);
+char *keyword = token(fp,tokenlen);
 if (keyword == NULL)
 /* Have reached an early and unexpected EOF. */
 /* Set flag and stop parsing */
diff --git a/vcl/generic/print/bitmap_gfx.cxx b/vcl/generic/print/bitmap_gfx.cxx
index 9a6d7e8..dc6997d 100644
--- a/vcl/generic/print/bitmap_gfx.cxx
+++ b/vcl/generic/print/bitmap_gfx.cxx
@@ -625,12 +625,11 @@ PrinterGfx::DrawPS2MonoImage (const PrinterBmp& rBitmap, 
const Rectangle& rArea)
 for (long nRow = rArea.Top(); nRow <= rArea.Bottom(); nRow++)
 {
 long  nBitPos = 0;
-unsigned char nBit= 0;
 unsigned char nByte   = 0;
 
 for (long nColumn = rArea.Left(); nColumn <= rArea.Right(); nColumn++)
 {
-nBit   = rBitmap.GetPixelIdx (nRow, nColumn);
+unsigned char nBit   = rBitmap.GetPixelIdx (nRow, nColumn);
 nByte |= nBit << (7 - nBitPos);
 
 if (++nBitPos == 8)
diff --git a/vcl/generic/print/text_gfx.cxx b/vcl/generic/print/text_gfx.cxx
index a262b82..eeaa029 100644
--- a/vcl/generic/print/text_gfx.cxx
+++ b/vcl/generic/print/text_gfx.cxx
@@ -442,7 +442,7 @@ bool PrinterGfx::drawVerticalizedText(
 
 int nTextScale   = maVirtualStatus.mnTextWidth ? 
maVirtualStatus.mnTextWidth : maVirtualStatus.mnTextHeight;
 int nNormalAngle = mnText

[Bug 39440] cppcheck cleanliness

2015-01-18 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=39440

--- Comment #56 from Commit Notification 
 ---
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=54defd1bd3359c95e45891c7294847d0cebca753

fdo#39440 sw: reduce scope of local variables

It will be available in 4.5.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2015-01-18 Thread Michael Weghorn
 sw/source/ui/config/optload.cxx |3 +--
 sw/source/ui/fldui/changedb.cxx |3 +--
 sw/source/ui/fldui/flddok.cxx   |4 ++--
 sw/source/ui/fldui/fldref.cxx   |6 ++
 sw/source/ui/frmdlg/column.cxx  |3 +--
 sw/source/ui/frmdlg/cption.cxx  |3 +--
 sw/source/ui/index/cnttab.cxx   |   12 
 sw/source/ui/misc/glossary.cxx  |3 +--
 sw/source/uibase/app/appenv.cxx |6 --
 sw/source/uibase/app/docsh2.cxx |   10 ++
 sw/source/uibase/config/uinums.cxx  |6 --
 sw/source/uibase/dochdl/swdtflvr.cxx|8 
 sw/source/uibase/docvw/PostItMgr.cxx|3 +--
 sw/source/uibase/frmdlg/colex.cxx   |3 +--
 sw/source/uibase/misc/redlndlg.cxx  |3 +--
 sw/source/uibase/shells/tabsh.cxx   |3 +--
 sw/source/uibase/uiview/formatclipboard.cxx |2 +-
 sw/source/uibase/uiview/pview.cxx   |6 ++
 sw/source/uibase/uiview/view.cxx|3 +--
 sw/source/uibase/uiview/viewtab.cxx |3 +--
 sw/source/uibase/uno/unotxdoc.cxx   |2 +-
 sw/source/uibase/wrtsh/wrtsh1.cxx   |9 ++---
 22 files changed, 51 insertions(+), 53 deletions(-)

New commits:
commit 54defd1bd3359c95e45891c7294847d0cebca753
Author: Michael Weghorn 
Date:   Fri Jan 16 22:59:20 2015 +0100

fdo#39440 sw: reduce scope of local variables

This addresses some cppcheck warnings.

Change-Id: I0de4e6278fb564c299722a9e23eb67d0999c4e31
Reviewed-on: https://gerrit.libreoffice.org/13966
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx
index b9cb029..e7dd53b 100644
--- a/sw/source/ui/config/optload.cxx
+++ b/sw/source/ui/config/optload.cxx
@@ -456,10 +456,9 @@ SwCaptionOptPage::SwCaptionOptPage( vcl::Window* pParent, 
const SfxItemSet& rSet
 sal_uInt16 nSelFmt = SVX_NUM_ARABIC;
 if (pSh)
 {
-SwFieldType* pFldType;
 for ( sal_uInt16 i = pMgr->GetFldTypeCount(); i; )
 {
-pFldType = pMgr->GetFldType(USHRT_MAX, --i);
+SwFieldType* pFldType = pMgr->GetFldType(USHRT_MAX, --i);
 if (pFldType->GetName().equals(m_pCategoryBox->GetText()))
 {
 nSelFmt = 
(sal_uInt16)static_cast(pFldType)->GetSeqFormat();
diff --git a/sw/source/ui/fldui/changedb.cxx b/sw/source/ui/fldui/changedb.cxx
index c76c889..9e917d4 100644
--- a/sw/source/ui/fldui/changedb.cxx
+++ b/sw/source/ui/fldui/changedb.cxx
@@ -219,12 +219,11 @@ IMPL_LINK_NOARG(SwChangeDBDlg, ButtonHdl)
 
 IMPL_LINK_NOARG(SwChangeDBDlg, TreeSelectHdl)
 {
-bool bEnable = false;
-
 SvTreeListEntry* pEntry = m_pAvailDBTLB->GetCurEntry();
 
 if (pEntry)
 {
+bool bEnable = false;
 if (m_pAvailDBTLB->GetParent(pEntry))
 bEnable = true;
 m_pDefineBT->Enable( bEnable );
diff --git a/sw/source/ui/fldui/flddok.cxx b/sw/source/ui/fldui/flddok.cxx
index b69efd9..db9632e 100644
--- a/sw/source/ui/fldui/flddok.cxx
+++ b/sw/source/ui/fldui/flddok.cxx
@@ -198,10 +198,10 @@ IMPL_LINK_NOARG(SwFldDokPage, TypeHdl)
 m_pTypeLB->SelectEntryPos(0);
 }
 
-size_t nCount;
-
 if (nOld != GetTypeSel())
 {
+size_t nCount;
+
 m_pDateFT->Hide();
 m_pTimeFT->Hide();
 
diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx
index 4be5ad3..605e2a3 100644
--- a/sw/source/ui/fldui/fldref.cxx
+++ b/sw/source/ui/fldui/fldref.cxx
@@ -522,10 +522,9 @@ void SwFldRefPage::UpdateSubType()
 const IDocumentOutlineNodes* pIDoc( 
pSh->getIDocumentOutlineNodesAccess() );
 pIDoc->getOutlineNodes( maOutlineNodes );
 bool bCertainTxtNodeSelected( false );
-SvTreeListEntry* pEntry = 0;
 for ( size_t nOutlIdx = 0; nOutlIdx < maOutlineNodes.size(); 
++nOutlIdx )
 {
-pEntry = m_pSelectionToolTipLB->InsertEntry(
+SvTreeListEntry* pEntry = m_pSelectionToolTipLB->InsertEntry(
 pIDoc->getOutlineText( nOutlIdx, true, true, 
false ) );
 pEntry->SetUserData( reinterpret_cast(nOutlIdx) );
 if ( ( IsFldEdit() &&
@@ -550,10 +549,9 @@ void SwFldRefPage::UpdateSubType()
 const IDocumentListItems* pIDoc( 
pSh->getIDocumentListItemsAccess() );
 pIDoc->getNumItems( maNumItems );
 bool bCertainTxtNodeSelected( false );
-SvTreeListEntry* pEntry = 0;
 for ( size_t nNumItemIdx = 0; nNumItemIdx < maNumItems.size(); 
++nNumItemIdx )
 {
-pEntry = m_pSelectionToolTipLB->InsertEntry(
+SvTreeListEntry* pEntry = m_pSelectionToolTipLB->InsertEntry(
 pIDoc->getListItemText( *maNumItems[nNumItemIdx], 
true, true

[Libreoffice-commits] core.git: vcl/source vcl/unx vcl/win

2015-01-18 Thread Michael Weghorn
 vcl/source/window/menufloatingwindow.cxx |6 ++
 vcl/source/window/splitwin.cxx   |6 ++
 vcl/source/window/status.cxx |4 +---
 vcl/source/window/taskpanelist.cxx   |5 +++--
 vcl/source/window/toolbox.cxx|6 +++---
 vcl/unx/generic/app/salinst.cxx  |3 +--
 vcl/unx/generic/printer/ppdparser.cxx|8 +++-
 vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx |3 +--
 vcl/win/source/app/saldata.cxx   |3 +--
 vcl/win/source/gdi/gdiimpl.cxx   |3 +--
 10 files changed, 18 insertions(+), 29 deletions(-)

New commits:
commit f5f7a69628ad316298febe7b51234428a7896ff9
Author: Michael Weghorn 
Date:   Sat Jan 17 01:36:45 2015 +0100

fdo#39440 vcl: reduce scope of local variables

This addresses some cppcheck warnings.

Change-Id: Ia3910e7f1b33d16866b7e606fd648f152f9fe67a
Reviewed-on: https://gerrit.libreoffice.org/13971
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/vcl/source/window/menufloatingwindow.cxx 
b/vcl/source/window/menufloatingwindow.cxx
index 3647960..e4b1124 100644
--- a/vcl/source/window/menufloatingwindow.cxx
+++ b/vcl/source/window/menufloatingwindow.cxx
@@ -70,11 +70,10 @@ void MenuFloatingWindow::doShutdown()
 if (!bKeyInput && pMenu && pMenu->pStartedFrom && 
!pMenu->pStartedFrom->IsMenuBar())
 {
 // #102461# remove highlight in parent
-MenuItemData* pData;
 size_t i, nCount = pMenu->pStartedFrom->pItemList->size();
 for(i = 0; i < nCount; i++)
 {
-pData = pMenu->pStartedFrom->pItemList->GetDataFromPos( i );
+MenuItemData* pData = 
pMenu->pStartedFrom->pItemList->GetDataFromPos( i );
 if( pData && ( pData->pSubMenu == pMenu ) )
 break;
 }
@@ -672,11 +671,10 @@ void MenuFloatingWindow::ChangeHighlightItem( sal_uInt16 
n, bool bStartPopupTime
 if (pMenu->pStartedFrom && !pMenu->pStartedFrom->IsMenuBar())
 {
 // #102461# make sure parent entry is highlighted as well
-MenuItemData* pData;
 size_t i, nCount = pMenu->pStartedFrom->pItemList->size();
 for(i = 0; i < nCount; i++)
 {
-pData = pMenu->pStartedFrom->pItemList->GetDataFromPos( i );
+MenuItemData* pData = 
pMenu->pStartedFrom->pItemList->GetDataFromPos( i );
 if( pData && ( pData->pSubMenu == pMenu ) )
 break;
 }
diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx
index ab313f9..3dd3e8c 100644
--- a/vcl/source/window/splitwin.cxx
+++ b/vcl/source/window/splitwin.cxx
@@ -416,7 +416,6 @@ static void ImplCalcSet( ImplSplitSet* pSet,
 sal_uInt16  nAbsItems;
 longnCalcSize;
 longnSizeDelta;
-longnCurSize;
 longnSizeWinSize;
 longnNewSizeWinSize;
 longnTemp;
@@ -443,7 +442,7 @@ static void ImplCalcSet( ImplSplitSet* pSet,
 else
 nCalcSize = nSetWidth;
 nCalcSize -= (nVisItems-1)*pSet->mnSplitSize;
-nCurSize   = 0;
+long nCurSize   = 0;
 if ( pSet->mbCalcPix || (pSet->mnLastSize != nCalcSize) )
 {
 long nPercentFactor = 10;
@@ -2003,7 +2002,6 @@ void SplitWindow::ImplStartSplit( const MouseEvent& rMEvt 
)
 ImplSplitItem*  pSplitItem;
 longnCurMaxSize;
 sal_uInt16  nTemp;
-boolbDown;
 boolbPropSmaller;
 
 mnMouseModifier = rMEvt.GetModifier();
@@ -2028,7 +2026,7 @@ void SplitWindow::ImplStartSplit( const MouseEvent& rMEvt 
)
 
 if ( mpSplitSet->mpItems )
 {
-bDown = true;
+bool bDown = true;
 if ( (mpSplitSet == mpMainSet) && mbBottomRight )
 bDown = false;
 
diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index 5751c92..bca642e23 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -315,11 +315,9 @@ Rectangle StatusBar::ImplGetItemRectPos( sal_uInt16 nPos ) 
const
 
 sal_uInt16 StatusBar::ImplGetFirstVisiblePos() const
 {
-ImplStatusItem* pItem;
-
 for( size_t nPos = 0; nPos < mpItemList->size(); nPos++ )
 {
-pItem = (*mpItemList)[ nPos ];
+ImplStatusItem* pItem = (*mpItemList)[ nPos ];
 if ( pItem )
 {
 if ( pItem->mbVisible )
diff --git a/vcl/source/window/taskpanelist.cxx 
b/vcl/source/window/taskpanelist.cxx
index cc13f15..23b9648 100644
--- a/vcl/source/window/taskpanelist.cxx
+++ b/vcl/source/window/taskpanelist.cxx
@@ -162,12 +162,13 @@ bool TaskPaneList::HandleKeyEvent( KeyEvent aKeyEvent )
 
 // Since the design of Ctrl-Tab looks to be inconsistent ( non-modal 
dialogs are not reachable
 // and the shortcut conflicts with tab-co

[Bug 39440] cppcheck cleanliness

2015-01-18 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=39440

--- Comment #55 from Commit Notification 
 ---
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=f5f7a69628ad316298febe7b51234428a7896ff9

fdo#39440 vcl: reduce scope of local variables

It will be available in 4.5.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Bug 39440] cppcheck cleanliness

2015-01-18 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=39440

--- Comment #54 from Commit Notification 
 ---
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5f01eb5d7a3927d31b7dd268562a59e3dacdd8e8

fdo#39440 vcl: reduce scope of local variables

It will be available in 4.5.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2015-01-18 Thread Michael Weghorn
 vcl/source/font/PhysicalFontCollection.cxx |3 +--
 vcl/source/fontsubset/sft.cxx  |   15 ---
 vcl/source/fontsubset/ttcr.cxx |   13 -
 vcl/source/gdi/animate.cxx |4 +---
 vcl/source/gdi/impvect.cxx |6 ++
 vcl/source/gdi/octree.cxx  |   20 
 vcl/source/glyphs/graphite_layout.cxx  |3 +--
 vcl/source/outdev/gradient.cxx |   12 
 vcl/source/window/builder.cxx  |3 +--
 vcl/source/window/floatwin.cxx |3 +--
 10 files changed, 31 insertions(+), 51 deletions(-)

New commits:
commit 5f01eb5d7a3927d31b7dd268562a59e3dacdd8e8
Author: Michael Weghorn 
Date:   Sat Jan 17 01:18:38 2015 +0100

fdo#39440 vcl: reduce scope of local variables

This addresses some cppcheck warnings.

Change-Id: Ibebfe89ad1874f5fa9e20fb76a534d9c2da01e3f
Reviewed-on: https://gerrit.libreoffice.org/13969
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/vcl/source/font/PhysicalFontCollection.cxx 
b/vcl/source/font/PhysicalFontCollection.cxx
index 6754e1b..5f51a3f 100644
--- a/vcl/source/font/PhysicalFontCollection.cxx
+++ b/vcl/source/font/PhysicalFontCollection.cxx
@@ -490,7 +490,6 @@ PhysicalFontFamily* 
PhysicalFontCollection::ImplFindByAttributes( sal_uLong nSea
 InitMatchData();
 PhysicalFontFamily* pFoundData = NULL;
 
-longnTestMatch;
 longnBestMatch = 4;
 sal_uLong   nBestType = 0;
 
@@ -517,7 +516,7 @@ PhysicalFontFamily* 
PhysicalFontCollection::ImplFindByAttributes( sal_uLong nSea
 //  Otherstyle, +Special, +Decorative,
 //   1000   Typewriter, Rounded, Gothic, Schollbook
 //100
-nTestMatch = 0;
+long nTestMatch = 0;
 
 // test CJK script attributes
 if ( nSearchType & IMPL_FONT_ATTR_CJK )
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 1adaf79..737a7a7 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -904,7 +904,7 @@ static int findname( const sal_uInt8 *name, sal_uInt16 n, 
sal_uInt16 platformID,
 {
 if (n == 0) return -1;
 
-int l = 0, r = n-1, i;
+int l = 0, r = n-1;
 sal_uInt32 t1, t2;
 sal_uInt32 m1, m2;
 
@@ -912,7 +912,7 @@ static int findname( const sal_uInt8 *name, sal_uInt16 n, 
sal_uInt16 platformID,
 m2 = (languageID << 16) | nameID;
 
 do {
-i = (l + r) >> 1;
+const int i = (l + r) >> 1;
 t1 = GetUInt32(name + 6, i * 12 + 0, 1);
 t2 = GetUInt32(name + 6, i * 12 + 4, 1);
 
@@ -1044,10 +1044,11 @@ static void GetNames(TrueTypeFont *t)
 bPSNameOK = false;
 if( !bPSNameOK )
 {
-bool bReplace = true;
 /* check if family is a suitable replacement */
 if( t->ufamily && t->family )
 {
+bool bReplace = true;
+
 for( i = 0; t->ufamily[ i ] != 0 && bReplace; i++ )
 if( t->ufamily[ i ] < 33 || t->ufamily[ i ] > 127 )
 bReplace = false;
@@ -1167,7 +1168,7 @@ static sal_uInt32 getGlyph6(const sal_uInt8 *cmap, 
sal_uInt32, sal_uInt32 c) {
 }
 
 static sal_uInt16 GEbinsearch(sal_uInt16 *ar, sal_uInt16 length, sal_uInt16 
toSearch) {
-signed int low, mid, high, lastfound = 0x;
+signed int low, high, lastfound = 0x;
 sal_uInt16 res;
 if(length == (sal_uInt16)0 || length == (sal_uInt16)0x) {
 return (sal_uInt16)0x;
@@ -1175,7 +1176,7 @@ static sal_uInt16 GEbinsearch(sal_uInt16 *ar, sal_uInt16 
length, sal_uInt16 toSe
 low = 0;
 high = length - 1;
 while(high >= low) {
-mid = (high + low)/2;
+int mid = (high + low)/2;
 res = Int16FromMOTA(*(ar+mid));
 if(res >= toSearch) {
 lastfound = mid;
@@ -1820,7 +1821,7 @@ int  CreateT3FromTTGlyphs(TrueTypeFont *ttf, FILE *outf, 
const char *fname,
 {
 ControlPoint *pa;
 PSPathElement *path;
-int i, j, r, n;
+int i, j, n;
 const sal_uInt8* table = getTable(ttf, O_head);
 TTGlyphMetrics metrics;
 int UPEm = ttf->unitsPerEm;
@@ -1909,7 +1910,7 @@ int  CreateT3FromTTGlyphs(TrueTypeFont *ttf, FILE *outf, 
const char *fname,
 
 for (i = 0; i < nGlyphs; i++) {
 fprintf(outf, h33, i);
-r = GetTTGlyphOutline(ttf, glyphArray[i] < ttf->nglyphs ? 
glyphArray[i] : 0, &pa, &metrics, 0);
+int r = GetTTGlyphOutline(ttf, glyphArray[i] < ttf->nglyphs ? 
glyphArray[i] : 0, &pa, &metrics, 0);
 
 if (r > 0) {
 n =  BSplineToPSPath(pa, r, &path);
diff --git a/vcl/source/fontsubset/ttcr.cxx b/vcl/source/fontsubset/ttcr.cxx
index 1f019cf..e65c7cc 100644
--- a/vcl/source/fontsubset/ttcr.cxx
+++ b/vcl/source/fontsubset/ttcr.cxx
@@ -482,16 +482,12 @@ static void TrueTypeTableDispose_glyf(TrueTypeTable 
*_this)
 
 static void TrueTypeTableDispose_cmap(TrueTypeTable *_this)
 {
-   

[Bug 39440] cppcheck cleanliness

2015-01-18 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=39440

--- Comment #53 from Commit Notification 
 ---
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5901827bd44dc3600bf66c83882e6847439d59d6

fdo#39440 reduce scope of local variables

It will be available in 4.5.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2015-01-18 Thread Michael Weghorn
 sw/source/core/view/vnew.cxx|4 ++--
 sw/source/core/view/vprint.cxx  |6 --
 sw/source/filter/html/htmlflywriter.cxx |6 --
 sw/source/filter/html/htmlforw.cxx  |3 ++-
 sw/source/filter/html/htmlgrin.cxx  |9 +
 sw/source/filter/ww8/rtfexport.cxx  |8 +---
 sw/source/filter/ww8/ww8atr.cxx |8 
 sw/source/filter/ww8/ww8par2.cxx|6 ++
 sw/source/filter/ww8/ww8par3.cxx|3 +--
 9 files changed, 29 insertions(+), 24 deletions(-)

New commits:
commit a1fb4ac1991a8da2e527b64a0a01a88a8f2959e3
Author: Michael Weghorn 
Date:   Fri Jan 16 13:50:00 2015 +

fdo#39440 sw: reduce scope of local variables

This addresses some cppcheck warnings.

Change-Id: I7cbc1908d0e3c84f5864db34984d0740db891aef
Reviewed-on: https://gerrit.libreoffice.org/13962
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx
index 6fef158..31d0de4 100644
--- a/sw/source/core/view/vnew.cxx
+++ b/sw/source/core/view/vnew.cxx
@@ -309,14 +309,14 @@ SwViewShell::~SwViewShell()
 if( mpDoc && GetWin() )
 {
 SwNodes& rNds = mpDoc->GetNodes();
-SwGrfNode *pGNd;
 
 SwStartNode *pStNd;
 SwNodeIndex aIdx( *rNds.GetEndOfAutotext().StartOfSectionNode(), 1 
);
 while ( 0 != (pStNd = aIdx.GetNode().GetStartNode()) )
 {
 ++aIdx;
-if ( 0 != ( pGNd = aIdx.GetNode().GetGrfNode() ) )
+SwGrfNode *pGNd = aIdx.GetNode().GetGrfNode();
+if ( 0 != pGNd )
 {
 if( pGNd->IsAnimated() )
 {
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
index 70eb9c3..ef1d456 100644
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -333,11 +333,13 @@ SwDoc * SwViewShell::FillPrtDoc( SwDoc *pPrtDoc, const 
SfxPrinter* pPrt)
 if (pPrt)
 pPrtDoc->getIDocumentDeviceAccess().setPrinter( new SfxPrinter(*pPrt), 
true, true );
 
-const SfxPoolItem* pCpyItem;
 const SfxItemPool& rPool = GetAttrPool();
 for( sal_uInt16 nWh = POOLATTR_BEGIN; nWh < POOLATTR_END; ++nWh )
-if( 0 != ( pCpyItem = rPool.GetPoolDefaultItem( nWh ) ) )
+{
+const SfxPoolItem* pCpyItem = rPool.GetPoolDefaultItem( nWh );
+if( 0 != pCpyItem )
 pPrtDoc->GetAttrPool().SetPoolDefaultItem( *pCpyItem );
+}
 
 // JP 29.07.99 - Bug 67951 - set all Styles from the SourceDoc into
 //  the PrintDoc - will be replaced!
diff --git a/sw/source/filter/html/htmlflywriter.cxx 
b/sw/source/filter/html/htmlflywriter.cxx
index 34c3f2d..dfbb5d0 100644
--- a/sw/source/filter/html/htmlflywriter.cxx
+++ b/sw/source/filter/html/htmlflywriter.cxx
@@ -1000,12 +1000,13 @@ void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& 
aHtml, const SwFrmFmt& rF
 // Umlauf fuer absatzgeb. Grafiken als  in den String
 // schreiben
 
-const sal_Char* pSurroundString = 0;
 if( (nFrameOptions & HTML_FRMOPT_BRCLEAR) &&
 ((FLY_AT_PARA == rFrmFmt.GetAnchor().GetAnchorId()) ||
  (FLY_AT_CHAR == rFrmFmt.GetAnchor().GetAnchorId())) &&
 SfxItemState::SET == rItemSet.GetItemState( RES_SURROUND, true, &pItem 
))
 {
+const sal_Char* pSurroundString = 0;
+
 const SwFmtSurround* pSurround = static_cast(pItem);
 sal_Int16 eHoriOri = rFrmFmt.GetHoriOrient().GetHoriOrient();
 SwSurround eSurround = pSurround->GetSurround();
@@ -1911,11 +1912,12 @@ void SwHTMLWriter::CollectLinkTargets()
 {
 const SwFmtINetFmt* pINetFmt;
 const SwTxtINetFmt* pTxtAttr;
-const SwTxtNode* pTxtNd;
 
 sal_uInt32 n, nMaxItems = pDoc->GetAttrPool().GetItemCount2( 
RES_TXTATR_INETFMT );
 for( n = 0; n < nMaxItems; ++n )
 {
+const SwTxtNode* pTxtNd;
+
 if( 0 != (pINetFmt = static_cast(pDoc->GetAttrPool().GetItem2(
 RES_TXTATR_INETFMT, n ) ) ) &&
 0 != ( pTxtAttr = pINetFmt->GetTxtINetFmt()) &&
diff --git a/sw/source/filter/html/htmlforw.cxx 
b/sw/source/filter/html/htmlforw.cxx
index ea90350..2e95323 100644
--- a/sw/source/filter/html/htmlforw.cxx
+++ b/sw/source/filter/html/htmlforw.cxx
@@ -548,9 +548,10 @@ void SwHTMLWriter::OutHiddenControls(
 {
 sal_Int32 nCount = rFormComps->getCount();
 sal_Int32 nPos = 0;
-bool bDone = false;
 if( rPropSet.is() )
 {
+bool bDone = false;
+
 uno::Reference< form::XFormComponent > xFC( rPropSet, uno::UNO_QUERY );
 for( nPos=0; !bDone && nPos < nCount; nPos++ )
 {
diff --git a/sw/source/filter/html/htmlgrin.cxx 
b/sw/source/filter/html/htmlgrin.cxx
index 808e0ea..7da8891 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -759,7 +759,6 @@ IMAGE_SETEVENT:
 pFlyFmt->Se

[Bug 39440] cppcheck cleanliness

2015-01-18 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=39440

--- Comment #52 from Commit Notification 
 ---
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=a1fb4ac1991a8da2e527b64a0a01a88a8f2959e3

fdo#39440 sw: reduce scope of local variables

It will be available in 4.5.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2015-01-18 Thread Michael Weghorn
 tools/source/generic/bigint.cxx |6 ++
 tools/source/generic/poly.cxx   |5 ++---
 ucb/source/sorter/sortresult.cxx|6 ++
 ucb/source/ucp/ftp/test_ftpurl.cxx  |4 ++--
 unoxml/source/xpath/xpathapi.cxx|5 ++---
 vbahelper/source/vbahelper/vbapagesetupbase.cxx |   20 
 6 files changed, 22 insertions(+), 24 deletions(-)

New commits:
commit 5901827bd44dc3600bf66c83882e6847439d59d6
Author: Michael Weghorn 
Date:   Sat Jan 17 00:37:31 2015 +0100

fdo#39440 reduce scope of local variables

This addresses some cppcheck warnings.

Change-Id: I1cd8b118e2598b8b18fb445851a3bb41e554267b
Reviewed-on: https://gerrit.libreoffice.org/13967
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/tools/source/generic/bigint.cxx b/tools/source/generic/bigint.cxx
index 7804597..cf0df72 100644
--- a/tools/source/generic/bigint.cxx
+++ b/tools/source/generic/bigint.cxx
@@ -310,7 +310,6 @@ void BigInt::MultLong( const BigInt& rB, BigInt& rErg ) 
const
 void BigInt::DivLong( const BigInt& rB, BigInt& rErg ) const
 {
 inti, j;
-long   nTmp;
 sal_uInt16 nK, nQ, nMult;
 short  nLenB  = rB.nLen;
 short  nLenB1 = rB.nLen - 1;
@@ -329,7 +328,7 @@ void BigInt::DivLong( const BigInt& rB, BigInt& rErg ) const
 
 for (j = aTmpA.nLen - 1; j >= nLenB; j--)
 { // guess divisor
-nTmp = ( (long)aTmpA.nNum[j] << 16 ) + aTmpA.nNum[j - 1];
+long nTmp = ( (long)aTmpA.nNum[j] << 16 ) + aTmpA.nNum[j - 1];
 if (aTmpA.nNum[j] == aTmpB.nNum[nLenB1])
 nQ = 0x;
 else
@@ -379,7 +378,6 @@ void BigInt::DivLong( const BigInt& rB, BigInt& rErg ) const
 void BigInt::ModLong( const BigInt& rB, BigInt& rErg ) const
 {
 short  i, j;
-long   nTmp;
 sal_uInt16 nK, nQ, nMult;
 short  nLenB  = rB.nLen;
 short  nLenB1 = rB.nLen - 1;
@@ -398,7 +396,7 @@ void BigInt::ModLong( const BigInt& rB, BigInt& rErg ) const
 
 for (j = aTmpA.nLen - 1; j >= nLenB; j--)
 { // Guess divisor
-nTmp = ( (long)aTmpA.nNum[j] << 16 ) + aTmpA.nNum[j - 1];
+long nTmp = ( (long)aTmpA.nNum[j] << 16 ) + aTmpA.nNum[j - 1];
 if (aTmpA.nNum[j] == aTmpB.nNum[nLenB1])
 nQ = 0x;
 else
diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx
index e949835..5df7ef3 100644
--- a/tools/source/generic/poly.cxx
+++ b/tools/source/generic/poly.cxx
@@ -1069,7 +1069,6 @@ void Polygon::Rotate( const Point& rCenter, double fSin, 
double fCos )
 {
 ImplMakeUnique();
 
-long nX, nY;
 long nCenterX = rCenter.X();
 long nCenterY = rCenter.Y();
 
@@ -1077,8 +1076,8 @@ void Polygon::Rotate( const Point& rCenter, double fSin, 
double fCos )
 {
 Point& rPt = mpImplPolygon->mpPointAry[ i ];
 
-nX = rPt.X() - nCenterX;
-nY = rPt.Y() - nCenterY;
+const long nX = rPt.X() - nCenterX;
+const long nY = rPt.Y() - nCenterY;
 rPt.X() = (long) FRound( fCos * nX + fSin * nY ) + nCenterX;
 rPt.Y() = -(long) FRound( fSin * nX - fCos * nY ) + nCenterY;
 }
diff --git a/ucb/source/sorter/sortresult.cxx b/ucb/source/sorter/sortresult.cxx
index 7e1dde0..d5fcabf 100644
--- a/ucb/source/sorter/sortresult.cxx
+++ b/ucb/source/sorter/sortresult.cxx
@@ -1278,12 +1278,11 @@ sal_IntPtr SortedResultSet::FindPos( SortListData 
*pEntry,
 sal_IntPtr nEnd   = _nEnd;
 sal_IntPtr nMid = 0, nCompare = 0;
 
-SortListData*pMid;
 
 while ( nStart <= nEnd )
 {
 nMid = ( nEnd - nStart ) / 2 + nStart;
-pMid = maS2O.GetData( nMid );
+SortListData *pMid = maS2O.GetData( nMid );
 nCompare = Compare( pEntry, pMid );
 
 if ( !nCompare )
@@ -1771,12 +1770,11 @@ void SortedResultSet::ResortModified( EventList* pList )
 void SortedResultSet::ResortNew( EventList* pList )
 {
 sal_IntPtri, j, nNewPos, nVal;
-SortListData*pData;
 
 try {
 for ( i = mnLastSort; i<(sal_IntPtr)maS2O.Count(); i++ )
 {
-pData = (SortListData*) maModList.GetObject( i );
+SortListData *pData = (SortListData*) maModList.GetObject( i );
 nNewPos = FindPos( pData, 1, mnLastSort );
 if ( nNewPos != i )
 {
diff --git a/ucb/source/ucp/ftp/test_ftpurl.cxx 
b/ucb/source/ucp/ftp/test_ftpurl.cxx
index bbc99ca..b93d2b0 100644
--- a/ucb/source/ucp/ftp/test_ftpurl.cxx
+++ b/ucb/source/ucp/ftp/test_ftpurl.cxx
@@ -245,7 +245,7 @@ int test_ftpopen(void)
 
 FILE* file = url.open();
 if(file) {
-int nbuf,ndest;
+int nbuf;
 const int bffsz = 256;
 char buff[bffsz];
 char *dest = (char*) malloc(sizeof(char));
@@ -254,7 +254,7 @@ int test_ftpopen(void)
 memset((void*)buff, 0, bffsz);
 fread(buff,bffsz-1,1,file);
 nbuf = strlen(buff);
-ndest = strlen(

[Bug 39440] cppcheck cleanliness

2015-01-18 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=39440

--- Comment #51 from Commit Notification 
 ---
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=d1aecd4353bd6ac3961a30df67de78f4b8f0a66b

fdo#39440 sw: reduce scope of local variables

It will be available in 4.5.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2015-01-18 Thread Michael Weghorn
 sw/source/core/docnode/nodes.cxx|6 ++
 sw/source/core/docnode/section.cxx  |3 ++-
 sw/source/core/edit/acorrect.cxx|2 +-
 sw/source/core/edit/autofmt.cxx |3 +--
 sw/source/core/edit/edfld.cxx   |8 ++--
 sw/source/core/fields/docufld.cxx   |4 +++-
 sw/source/core/fields/expfld.cxx|   10 --
 sw/source/core/frmedt/fecopy.cxx|4 +++-
 sw/source/core/frmedt/fefly1.cxx|3 +--
 sw/source/core/frmedt/tblsel.cxx|   10 --
 sw/source/core/graphic/ndgrf.cxx|3 ++-
 sw/source/core/layout/pagechg.cxx   |3 +--
 sw/source/core/layout/tabfrm.cxx|   10 --
 sw/source/core/layout/trvlfrm.cxx   |4 ++--
 sw/source/core/layout/wsfrm.cxx |7 +++
 sw/source/core/swg/SwXMLTextBlocks1.cxx |3 ++-
 sw/source/core/table/swnewtable.cxx |9 +++--
 sw/source/core/table/swtable.cxx|3 +--
 18 files changed, 49 insertions(+), 46 deletions(-)

New commits:
commit d1aecd4353bd6ac3961a30df67de78f4b8f0a66b
Author: Michael Weghorn 
Date:   Fri Jan 16 13:00:37 2015 +

fdo#39440 sw: reduce scope of local variables

This addresses some cppcheck warnings.

Change-Id: Iccdd4bebd46f274697597b13746c820aaadc99a4
Reviewed-on: https://gerrit.libreoffice.org/13960
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index b9c91ad..0530e2c 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -96,11 +96,10 @@ SwNodes::~SwNodes()
 delete pOutlineNds;
 
 {
-SwNode *pNode;
 SwNodeIndex aNdIdx( *this );
 while( true )
 {
-pNode = &aNdIdx.GetNode();
+SwNode *pNode = &aNdIdx.GetNode();
 if( pNode == pEndOfContent )
 break;
 
@@ -1023,7 +1022,6 @@ void SwNodes::SectionUp(SwNodeRange *pRange)
  */
 void SwNodes::SectionUpDown( const SwNodeIndex & aStart, const SwNodeIndex & 
aEnd )
 {
-SwNode * pAktNode;
 SwNodeIndex aTmpIdx( aStart, +1 );
 // array forms a stack, holding all StartOfSelections
 SwSttNdPtrs aSttNdStack;
@@ -1034,7 +1032,7 @@ void SwNodes::SectionUpDown( const SwNodeIndex & aStart, 
const SwNodeIndex & aEn
 // (the indices are updated from the end node backwards to the start)
 for( ;; ++aTmpIdx )
 {
-pAktNode = &aTmpIdx.GetNode();
+SwNode * pAktNode = &aTmpIdx.GetNode();
 pAktNode->pStartOfSection = aSttNdStack[ aSttNdStack.size()-1 ];
 
 if( pAktNode->GetStartNode() )
diff --git a/sw/source/core/docnode/section.cxx 
b/sw/source/core/docnode/section.cxx
index 7e8953e..909edf4 100644
--- a/sw/source/core/docnode/section.cxx
+++ b/sw/source/core/docnode/section.cxx
@@ -1129,7 +1129,6 @@ static void lcl_UpdateLinksInSect( SwBaseLink& rUpdLnk, 
SwSectionNode& rSectNd )
 return ;
 
 const OUString sName( pDShell->GetMedium()->GetName() );
-SwBaseLink* pBLink;
 const OUString sMimeType( SotExchange::GetFormatMimeType( FORMAT_FILE ));
 uno::Any aValue;
 aValue <<= sName; // Arbitrary name
@@ -1137,6 +1136,8 @@ static void lcl_UpdateLinksInSect( SwBaseLink& rUpdLnk, 
SwSectionNode& rSectNd )
 const ::sfx2::SvBaseLinks& rLnks = 
pDoc->getIDocumentLinksAdministration().GetLinkManager().GetLinks();
 for( sal_uInt16 n = rLnks.size(); n; )
 {
+SwBaseLink* pBLink;
+
 ::sfx2::SvBaseLink* pLnk = &(*rLnks[ --n ]);
 if( pLnk && pLnk != &rUpdLnk &&
 OBJECT_CLIENT_FILE == pLnk->GetObjType() &&
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx
index 216a033..ff480c7 100644
--- a/sw/source/core/edit/acorrect.cxx
+++ b/sw/source/core/edit/acorrect.cxx
@@ -487,7 +487,6 @@ void SwDontExpandItem::RestoreDontExpandItems( const 
SwPosition& rPos )
 {
 const size_t nSize = pTxtNd->GetpSwpHints()->Count();
 sal_Int32 nAttrStart;
-const sal_Int32* pAttrEnd;
 
 for( size_t n = 0; n < nSize; ++n )
 {
@@ -496,6 +495,7 @@ void SwDontExpandItem::RestoreDontExpandItems( const 
SwPosition& rPos )
 if( nAttrStart > nStart )   // beyond the area
 break;
 
+const sal_Int32* pAttrEnd;
 if( 0 != ( pAttrEnd = pHt->End() ) &&
 ( ( nAttrStart < nStart &&
 ( pHt->DontExpand() ? nStart < *pAttrEnd
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index 4b81d4c..9fd46c1 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -1192,9 +1192,8 @@ void SwAutoFormat::DelMoreLinesBlanks( bool 
bWithLineBreaks )
 SwTxtFrmInfo aFInfo( m_pCurTxtFrm );
 aFInfo.GetSpaces( m_aDelPam, !m_aFlags.bAFmtByInput || bWithLineBreaks 
);
 
-SwPaM* pNxt;

[Libreoffice-commits] core.git: basic/qa opencl/source vbahelper/source wizards/com xmlsecurity/source

2015-01-18 Thread Andrea Gelmini
 basic/qa/cppunit/basictest.hxx  |2 +-
 opencl/source/openclwrapper.cxx |2 +-
 vbahelper/source/msforms/vbacontrol.hxx |6 +++---
 wizards/com/sun/star/wizards/table/TableWizard.java |2 +-
 xmlsecurity/source/helper/xsecctl.cxx   |2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 07e84cae983c08afdba03018413a19d01abb3006
Author: Andrea Gelmini 
Date:   Sun Jan 18 23:31:37 2015 +0100

Fix typo comments Resouce->Resource

Change-Id: Ia3195a21ad46b4c9830ee6293135dfe5945986a2
Reviewed-on: https://gerrit.libreoffice.org/13985
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/basic/qa/cppunit/basictest.hxx b/basic/qa/cppunit/basictest.hxx
index 6b1d516..ceff6de 100644
--- a/basic/qa/cppunit/basictest.hxx
+++ b/basic/qa/cppunit/basictest.hxx
@@ -25,7 +25,7 @@ class MacroSnippet
 {
 private:
 bool mbError;
-BasicDLL maDll; // we need a dll instance for resouce manager etc.
+BasicDLL maDll; // we need a dll instance for resource manager etc.
 SbModuleRef mpMod;
 StarBASICRef mpBasic;
 
diff --git a/opencl/source/openclwrapper.cxx b/opencl/source/openclwrapper.cxx
index 613e503..64a84cd 100644
--- a/opencl/source/openclwrapper.cxx
+++ b/opencl/source/openclwrapper.cxx
@@ -245,7 +245,7 @@ bool generatBinFromKernelSource( cl_program program, const 
char * clFileName )
 }
 }
 
-// Release all resouces and memory
+// Release all resources and memory
 for ( size_t i = 0; i < numDevices; i++ )
 {
 delete[] binaries[i];
diff --git a/vbahelper/source/msforms/vbacontrol.hxx 
b/vbahelper/source/msforms/vbacontrol.hxx
index 4317f37..34b1c02 100644
--- a/vbahelper/source/msforms/vbacontrol.hxx
+++ b/vbahelper/source/msforms/vbacontrol.hxx
@@ -100,15 +100,15 @@ public:
 virtual void SAL_CALL setTabIndex( sal_Int32 nTabIndex ) throw 
(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
 virtual ::sal_Int32 SAL_CALL getMousePointer() throw 
(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
 virtual void SAL_CALL setMousePointer( ::sal_Int32 _mousepointer ) throw 
(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
-//remove resouce because ooo.vba.excel.XControl is a wrapper of 
com.sun.star.drawing.XControlShape
+//remove resource because ooo.vba.excel.XControl is a wrapper of 
com.sun.star.drawing.XControlShape
 virtual void removeResouce() throw( css::uno::RuntimeException );
 virtual ::sal_Int32 SAL_CALL getForeColor() throw 
(::com::sun::star::uno::RuntimeException);
 virtual void SAL_CALL setForeColor( ::sal_Int32 _forecolor ) throw 
(::com::sun::star::uno::RuntimeException);
 //XHelperInterface
 virtual OUString getServiceImplName() SAL_OVERRIDE;
 virtual css::uno::Sequence getServiceNames() SAL_OVERRIDE;
-//General helper methods for properties ( may or maynot be relevant for all
-//controls
+//General helper methods for properties (may or maynot be relevant for all
+//controls)
 sal_Int32 getBackColor() throw (css::uno::RuntimeException);
 void setBackColor( sal_Int32 nBackColor ) throw 
(css::uno::RuntimeException);
 bool getAutoSize() throw (css::uno::RuntimeException);
diff --git a/wizards/com/sun/star/wizards/table/TableWizard.java 
b/wizards/com/sun/star/wizards/table/TableWizard.java
index cf41446..ce64033 100644
--- a/wizards/com/sun/star/wizards/table/TableWizard.java
+++ b/wizards/com/sun/star/wizards/table/TableWizard.java
@@ -75,7 +75,7 @@ public class TableWizard extends DatabaseObjectWizard 
implements XTextListener
 });
 drawNaviBar();
 fielditems = new HashMap();
-//TODO if reportResouces cannot be gotten dispose officedocument
+//TODO if reportResources cannot be gotten dispose officedocument
 if (getTableResources())
 {
 setRightPaneHeaders(m_oResource, UIConsts.RID_TABLE + 8, 4);
diff --git a/xmlsecurity/source/helper/xsecctl.cxx 
b/xmlsecurity/source/helper/xsecctl.cxx
index 9c65d88..66edb6a 100644
--- a/xmlsecurity/source/helper/xsecctl.cxx
+++ b/xmlsecurity/source/helper/xsecctl.cxx
@@ -655,7 +655,7 @@ void XSecController::endMission()
 
 /*
  * askes the SignatureCreator/SignatureVerifier to release
- * all resouces it uses.
+ * all resources it uses.
  */
 xMissionTaker->endMission();
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


LibreOffice Gerrit News for core on 2015-01-19

2015-01-18 Thread gerrit
Moin!

* Open changes on master for project core changed in the last 25 hours:

 First time contributors doing great things! 
+ Fix typo comments Resouce->Resource
  in https://gerrit.libreoffice.org/13985 from Andrea Gelmini
  about module basic, opencl, vbahelper, wizards, xmlsecurity
+ Ruler ticks spacing consistent with lowDPI monitors.  Draw ticks with wid
  in https://gerrit.libreoffice.org/13987 from Darcy Beurle
  about module svtools
+ Fix typo code Resouce->Resource
  in https://gerrit.libreoffice.org/13986 from Andrea Gelmini
  about module svx, vbahelper
+ Maintain the sorting in sorted_vector after modifying the elements.
  in https://gerrit.libreoffice.org/13984 from Ashod Nakashian
  about module sw
+ fdo#88241 Floating sidebar second call to same item should dismiss it
  in https://gerrit.libreoffice.org/13980 from Trent MacAlpine
  about module sfx2
+ fdo#87217 Inconsistent floating sidebar close behavior
  in https://gerrit.libreoffice.org/13979 from Trent MacAlpine
  about module sfx2
 End of freshness 

+ Mistake in choice of FM_PROP
  in https://gerrit.libreoffice.org/13982 from Julien Nabet
  about module svx
+ fdo#39468 Translate German comments - sw/source/core/text
  in https://gerrit.libreoffice.org/13981 from Philipp Weissenbacher
  about module sw
+ fdo#76870 Add support for Excel2013 function ENCODEURL
  in https://gerrit.libreoffice.org/13478 from Winfried Donkers
  about module formula, include, sc


* Merged changes on master for project core changed in the last 25 hours:

None

* Abandoned changes on master for project core changed in the last 25 hours:

+ Added rectangles to draw with larger width
  in https://gerrit.libreoffice.org/13983 from Darcy Beurle


* Open changes needing tweaks, but being untouched for more than a week:

+ fdo#30541: Default icon set on Windows should be Galaxy, not Tango.
  in https://gerrit.libreoffice.org/13859 from Rimas Kudelis
+ fdo#63905: fix regression by using paper size set in printer properties
  in https://gerrit.libreoffice.org/13763 from Clément Lassieur
+ fdo#75825-"Send Document as E-Mail" not working
  in https://gerrit.libreoffice.org/13786 from Charu Tyagi
+ solenv-filelists.pm: fix "can't call method `mode' on an undefined value"
  in https://gerrit.libreoffice.org/13669 from Douglas Mencken
+ gbuild-to-ide fixes
  in https://gerrit.libreoffice.org/11754 from Peter Foley
+ fdo#82335.
  in https://gerrit.libreoffice.org/11555 from Sudarshan Rao
+ fdo#39625 Make existing CppUnittests work
  in https://gerrit.libreoffice.org/11605 from Tobias Madl
+ fdo#86606 removal of direct formatting options from the context menu
  in https://gerrit.libreoffice.org/13196 from Yousuf Philips
+ fdo#86784 make soffice commandline in juh Bootstrap.bootstrap() configura
  in https://gerrit.libreoffice.org/13290 from Christoph Lutz
+ Replace image-sort.pl with image-sort.py
  in https://gerrit.libreoffice.org/13124 from Marcos Paulo de Souza
+ start detection of kf5 stuff in configure.ac
  in https://gerrit.libreoffice.org/13079 from Jonathan Riddell
+ Move more places to boost::signal2 in math
  in https://gerrit.libreoffice.org/13065 from Marcos Paulo de Souza
+ more breeze icons
  in https://gerrit.libreoffice.org/13058 from Jonathan Riddell
+ vcl: change Timer and Idle to use boost's Signal2
  in https://gerrit.libreoffice.org/12528 from Chris Sherlock
+ Perftest for loading autocorrect dictionaries, related fdo#79761
  in https://gerrit.libreoffice.org/11296 from Matúš Kukan


Best,

Your friendly LibreOffice Gerrit Digest Mailer

Note: The bot generating this message can be found and improved here:
   
https://gerrit.libreoffice.org/gitweb?p=dev-tools.git;a=blob;f=gerritbot/send-daily-digest
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Backport Requests: Example of regression that only affects older branch

2015-01-18 Thread Robinson Tryon
Hi all,

I just ran across a texbook example of a regression that only affected
an older (but still active) release branch:
https://bugs.freedesktop.org/show_bug.cgi?id=88566

Both QA and Developers run into bugs like this all the time, so I
figured it would be a good idea to share my workflow of triaging bug
88566:


INITIAL TRIAGE

In this particular case, Draw could be induced to crash with a 4.3
build, however it did not crash with a 4.2, 4.4, or 4.5 build. As a
result, I
- RESOLVED the bug as WORKSFORME (it's fixed in the latest build)
- Tagged it as a mab4.3 (it's a crasher)
- Keywords: regression
- Asked for a backport once the commit is found: Whiteboard ->
backportRequest:4.3
- Asked for a bibisect: Whiteboard -> bibisectRequest


FIXED IN 4.3

While I was testing with the builds on my local system, I downloaded
the latest 4.3 build: 4.3.6.1.

As it turns out, LO 4.3.6.1 rc did *not* have this crash, which meant
that it was fixed in all of our active branches, and I could then
- Remove mab4.3
- Remove bibisectRequest and backportRequest:4.3

I also left a note telling the bug reporter that this fix would be
available in the upcoming 4.3.6 release, just in case the reporter (or
someone else reading the bug report) isn't familiar with our release
process.


BACKPORT REQUESTS

It's important for us to keep track of open backport requests. You can
find queries linked from the 'Useful Queries' page here:
https://wiki.documentfoundation.org/QA/Bugzilla/Useful_Queries#Backport_Requests

For QA, we'll want to focus on backport requests that need to be
bibisected. For the Devs, you'll want to focus on backport requests
that do not.

As a quick reminder, if there's a good reason not to backport a fix,
change backportRequest:4.3 into backportDenied:4.3 and please leave a
short. explicative comment on the bug.
https://wiki.documentfoundation.org/QA/Bugzilla/Fields/Status/RESOLVED#Fixed_in_a_newer_version


Questions/Comments? Let me know!

Best,
--R

-- 
Robinson Tryon
QA Engineer - The Document Foundation
LibreOffice Community Outreach Herald
qu...@libreoffice.org
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Bug 75025] LibreOffice 4.3 most annoying bugs

2015-01-18 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=75025

Robinson Tryon (qubit)  changed:

   What|Removed |Added

 Depends on|88566   |

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Bug 75025] LibreOffice 4.3 most annoying bugs

2015-01-18 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=75025
Bug 75025 depends on bug 88566, which changed state.

Bug 88566 Summary: Crash on copy
https://bugs.freedesktop.org/show_bug.cgi?id=88566

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |WORKSFORME

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Bug 75025] LibreOffice 4.3 most annoying bugs

2015-01-18 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=75025

Robinson Tryon (qubit)  changed:

   What|Removed |Added

 Depends on||88566

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: 4.4.0.1 build error on sal/types.h on solaris/illumos

2015-01-18 Thread Gabriele Bulfon
Thanks so much!
Here's what I get:
[build LNK] Executable/concat-deps
gmake[1]: Entering directory 
`/sources/sonicle/xstream-desktop-gate/components/libreoffice/libreoffice/libreoffice-4.4.0.2'
S=/sources/sonicle/xstream-desktop-gate/components/libreoffice/libreoffice/libreoffice-4.4.0.2
 & I=$S/instdir & W=$S/workdir &  /usr/gcc/4.7/bin/gcc-Wl,-z,origin 
'-Wl,-rpath,$ORIGIN/../Library' -L$I/ure/lib -L$I/program -L/lib -L/usr/lib 
-Wl,-z,combreloc  -L$W/LinkTarget/StaticLibrary -L$I/sdk/lib  -L$I/ure/lib  
-L$I/program  -L$W/LinkTarget/Library -Wl,-O1  
$W/CObject/solenv/bin/concat-deps.o  -Wl,--start-group   -lm -lnsl -lsocket 
 -Wl,--end-group -Wl,-zrecord  -o $W/LinkTarget/Executable/concat-deps
ld: fatal: unrecognized option '-O'
ld: fatal: unrecognized option '-1'
ld: fatal: use the -z help option for usage information
collect2: error: ld returned 1 exit status
looks like -Wl,-O1 is coming in from somewhere...
--
Da: Norbert Thiebaud
A: gbul...@sonicle.com
Cc: Michael Stahl
libreoffice
Richard PALO
Data: 18 gennaio 2015 20.15.22 CET
Oggetto: Re: 4.4.0.1 build error on sal/types.h on solaris/illumos
On Sun, Jan 18, 2015 at 12:18 PM, Gabriele Bulfon
wrote:
Ok, I checked and it looks fine, so solaris.mk should be taken.
Also config.log shows correct variables for OS, CPU and COM.
What actually happens is during make, after it has downloaded and extracted
various stuff.
The last one is translations file.
Then it goes on building concat-deps, and linking fails:
[build C ] solenv/bin/concat-deps.c
[build LNK] Executable/concat-deps
ld: fatal: unrecognized option '-O'
ld: fatal: unrecognized option '-1'
ld: fatal: use the -z help option for usage information
collect2: error: ld returned 1 exit status
Maybe just concat-deps have problems linking with wrong options on Solaris?
Yes it is quite possible... concat-deps is a small utility I wrote to
speed up the original perl-based one... and I'm quite sure I never
tried to link it on Solaris.
Otoh concat-deps is built using the standard gbuild mechanism for that:
see solenv/Executable_concat-deps.mk
so it is more likely that the problem is generic and that concat-deps
just happen to be the first one to be linked.
BTW, is there any way to issue gmake and let it show what command "LNK" is
doing?
It tried forcing a "-n" but I did not get the command debugged
verbose=t make
Norbert
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: 4.4.0.1 build error on sal/types.h on solaris/illumos

2015-01-18 Thread Richard PALO
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Le 18/01/15 21:33, Gabriele Bulfon a écrit :
> Ok, I commented out these on Solaris.mk:
> #ifneq ($(gb_DEBUGLEVEL),0)
> #gb_LINKEROPTFLAGS :=
> #else
> #gb_LINKEROPTFLAGS := -Wl,-O1
> #endif
> will let you know :)
> --
> Da: Norbert Thiebaud
> A: gbul...@sonicle.com
> Cc: Michael Stahl
> libreoffice
> Richard PALO
> Data: 18 gennaio 2015 20.15.22 CET
> Oggetto: Re: 4.4.0.1 build error on sal/types.h on solaris/illumos
> On Sun, Jan 18, 2015 at 12:18 PM, Gabriele Bulfon
> wrote:
> Ok, I checked and it looks fine, so solaris.mk should be taken.
> Also config.log shows correct variables for OS, CPU and COM.
> What actually happens is during make, after it has downloaded and extracted
> various stuff.
> The last one is translations file.
> Then it goes on building concat-deps, and linking fails:
> [build C ] solenv/bin/concat-deps.c
> [build LNK] Executable/concat-deps
> ld: fatal: unrecognized option '-O'
> ld: fatal: unrecognized option '-1'
> ld: fatal: use the -z help option for usage information
> collect2: error: ld returned 1 exit status
> Maybe just concat-deps have problems linking with wrong options on Solaris?
> Yes it is quite possible... concat-deps is a small utility I wrote to
> speed up the original perl-based one... and I'm quite sure I never
> tried to link it on Solaris.
> Otoh concat-deps is built using the standard gbuild mechanism for that:
> see solenv/Executable_concat-deps.mk
> so it is more likely that the problem is generic and that concat-deps
> just happen to be the first one to be linked.
> BTW, is there any way to issue gmake and let it show what command "LNK" is
> doing?
> It tried forcing a "-n" but I did not get the command debugged
> verbose=t make
> Norbert
> 
Yeah, this should go as not valid for solaris ld.

Apparently comes from here:
> commit 3c4cd1deaf71d0d800957b3580d426c721bf7844
> Author: Jonathan Adams 
> Date:   Fri Mar 16 21:50:37 2012 +0100
> 
> gbuild: switch solaris.mk to GCC

-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJUvCwiAAoJECAB22fHtp27MBMH/2IYZRT44q8six0NjeXYkG6B
vDe0AJund3FTcN/t9zT0bpFx9mPCCdVxWbqqdv0CFKYQrfSLhPRaksuWrAnK1mOI
Nl5vcDxI8D0ls6N1c40ZIAcpI3mOeY1Xye6rpKwYJSjWxqOZHxgWEMMvIrzd9Jxb
wnChiTHrDj4ljX1QCPWLxJQB0+e3gXrFmcLvQSEhIPslGPou4i14ur3tf2vVwk0a
FZzCoiYfCnUil7vQJHA8vUtbVASMxX4sJ6iYOfD0K/Z+11c4PwF4xZZtZCtG6Rek
qLd/Yz/OhqIg2POqJeaDL8S9fYOfrWUgfKuwcFhqBgqDQMknQH8DSeJt6IPAea0=
=ZdNh
-END PGP SIGNATURE-
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: 4.4.0.1 build error on sal/types.h on solaris/illumos

2015-01-18 Thread Gabriele Bulfon
Here's something interesting :) "grepping" on the root of sources:
sonicle@xstreamdev$ grep "Wl,-O1" *
ChangeLog:no local -Wl,-O1 linker flag
ChangeLog:no local -Wl,-O1 linker flag
ChangeLog:add -Wl,-O1 as linker optimization flags when debug is disabled
--
Da: Norbert Thiebaud
A: gbul...@sonicle.com
Cc: Michael Stahl
libreoffice
Richard PALO
Data: 18 gennaio 2015 20.15.22 CET
Oggetto: Re: 4.4.0.1 build error on sal/types.h on solaris/illumos
On Sun, Jan 18, 2015 at 12:18 PM, Gabriele Bulfon
wrote:
Ok, I checked and it looks fine, so solaris.mk should be taken.
Also config.log shows correct variables for OS, CPU and COM.
What actually happens is during make, after it has downloaded and extracted
various stuff.
The last one is translations file.
Then it goes on building concat-deps, and linking fails:
[build C ] solenv/bin/concat-deps.c
[build LNK] Executable/concat-deps
ld: fatal: unrecognized option '-O'
ld: fatal: unrecognized option '-1'
ld: fatal: use the -z help option for usage information
collect2: error: ld returned 1 exit status
Maybe just concat-deps have problems linking with wrong options on Solaris?
Yes it is quite possible... concat-deps is a small utility I wrote to
speed up the original perl-based one... and I'm quite sure I never
tried to link it on Solaris.
Otoh concat-deps is built using the standard gbuild mechanism for that:
see solenv/Executable_concat-deps.mk
so it is more likely that the problem is generic and that concat-deps
just happen to be the first one to be linked.
BTW, is there any way to issue gmake and let it show what command "LNK" is
doing?
It tried forcing a "-n" but I did not get the command debugged
verbose=t make
Norbert
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2015-01-18 Thread Julien Nabet
 svx/source/fmcomp/fmgridcl.cxx |   18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

New commits:
commit f9bea19eeab49cb9e6fcdd3ae5e777da9dc882ca
Author: Julien Nabet 
Date:   Sun Jan 18 21:35:09 2015 +0100

Typo: sDatasouce->sDatasource

Change-Id: I4ffaf4195ae17ecf86dffc9c44e4672c4b2835d7

diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx
index a611b54..4418a47 100644
--- a/svx/source/fmcomp/fmgridcl.cxx
+++ b/svx/source/fmcomp/fmgridcl.cxx
@@ -237,7 +237,7 @@ sal_Int8 FmGridHeader::ExecuteDrop( const ExecuteDropEvent& 
_rEvt )
 }
 
 // extract the descriptor
-OUString sDatasouce, sCommand, 
sFieldName,sDatabaseLocation,sConnnectionResource;
+OUString sDatasource, sCommand, 
sFieldName,sDatabaseLocation,sConnnectionResource;
 sal_Int32   nCommandType = CommandType::COMMAND;
 Reference< XPreparedStatement > xStatement;
 Reference< XResultSet > xResultSet;
@@ -245,7 +245,7 @@ sal_Int8 FmGridHeader::ExecuteDrop( const ExecuteDropEvent& 
_rEvt )
 Reference< XConnection >xConnection;
 
 ODataAccessDescriptor aColumn = 
OColumnTransferable::extractColumnDescriptor(aDroppedData);
-if (aColumn.has(daDataSource))  aColumn[daDataSource]   >>= sDatasouce;
+if (aColumn.has(daDataSource))  aColumn[daDataSource]   >>= sDatasource;
 if (aColumn.has(daDatabaseLocation))aColumn[daDatabaseLocation] >>= 
sDatabaseLocation;
 if (aColumn.has(daConnectionResource))  aColumn[daConnectionResource] >>= 
sConnnectionResource;
 if (aColumn.has(daCommand)) aColumn[daCommand]  >>= sCommand;
@@ -256,7 +256,7 @@ sal_Int8 FmGridHeader::ExecuteDrop( const ExecuteDropEvent& 
_rEvt )
 
 if  (   sFieldName.isEmpty()
 ||  sCommand.isEmpty()
-||  (   sDatasouce.isEmpty()
+||  (   sDatasource.isEmpty()
 &&  sDatabaseLocation.isEmpty()
 &&  !xConnection.is()
 )
@@ -273,12 +273,12 @@ sal_Int8 FmGridHeader::ExecuteDrop( const 
ExecuteDropEvent& _rEvt )
 {   // the transferable did not contain the connection -> build an own 
one
 try
 {
-OUString sSignificantSource( sDatasouce.isEmpty() ? 
sDatabaseLocation : sDatasouce );
+OUString sSignificantSource( sDatasource.isEmpty() ? 
sDatabaseLocation : sDatasource );
 xConnection = 
OStaticDataAccessTools().getConnection_withFeedback(sSignificantSource, 
OUString(), OUString(),
   
static_cast(GetParent())->getContext() );
 }
 catch(NoSuchElementException&)
-{   // allowed, means sDatasouce isn't a valid data source name 

+{   // allowed, means sDatasource isn't a valid data source name 

 }
 catch(Exception&)
 {
@@ -374,8 +374,8 @@ IMPL_LINK( FmGridHeader, OnAsyncExecuteDrop, void*, 
/*NOTINTERESTEDIN*/ )
 Reference< XPropertySet >   xField;
 Reference< XConnection >xConnection;
 
-OUString sDatasouce = m_pImpl->aDropData.getDataSource();
-if ( sDatasouce.isEmpty() && m_pImpl->aDropData.has(daConnectionResource) )
+OUString sDatasource = m_pImpl->aDropData.getDataSource();
+if ( sDatasource.isEmpty() && m_pImpl->aDropData.has(daConnectionResource) 
)
 m_pImpl->aDropData[daConnectionResource]>>= sURL;
 m_pImpl->aDropData[daCommand]   >>= sCommand;
 m_pImpl->aDropData[daCommandType]   >>= nCommandType;
@@ -585,8 +585,8 @@ IMPL_LINK( FmGridHeader, OnAsyncExecuteDrop, void*, 
/*NOTINTERESTEDIN*/ )
 {
 if 
(::comphelper::getString(xForm->getPropertyValue(FM_PROP_DATASOURCE)).isEmpty())
 {
-if ( !sDatasouce.isEmpty() )
-xForm->setPropertyValue(FM_PROP_DATASOURCE, 
makeAny(sDatasouce));
+if ( !sDatasource.isEmpty() )
+xForm->setPropertyValue(FM_PROP_DATASOURCE, 
makeAny(sDatasource));
 else
 xForm->setPropertyValue(FM_PROP_URL, makeAny(sURL));
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: 4.4.0.1 build error on sal/types.h on solaris/illumos

2015-01-18 Thread Gabriele Bulfon
Ok, I commented out these on Solaris.mk:
#ifneq ($(gb_DEBUGLEVEL),0)
#gb_LINKEROPTFLAGS :=
#else
#gb_LINKEROPTFLAGS := -Wl,-O1
#endif
will let you know :)
--
Da: Norbert Thiebaud
A: gbul...@sonicle.com
Cc: Michael Stahl
libreoffice
Richard PALO
Data: 18 gennaio 2015 20.15.22 CET
Oggetto: Re: 4.4.0.1 build error on sal/types.h on solaris/illumos
On Sun, Jan 18, 2015 at 12:18 PM, Gabriele Bulfon
wrote:
Ok, I checked and it looks fine, so solaris.mk should be taken.
Also config.log shows correct variables for OS, CPU and COM.
What actually happens is during make, after it has downloaded and extracted
various stuff.
The last one is translations file.
Then it goes on building concat-deps, and linking fails:
[build C ] solenv/bin/concat-deps.c
[build LNK] Executable/concat-deps
ld: fatal: unrecognized option '-O'
ld: fatal: unrecognized option '-1'
ld: fatal: use the -z help option for usage information
collect2: error: ld returned 1 exit status
Maybe just concat-deps have problems linking with wrong options on Solaris?
Yes it is quite possible... concat-deps is a small utility I wrote to
speed up the original perl-based one... and I'm quite sure I never
tried to link it on Solaris.
Otoh concat-deps is built using the standard gbuild mechanism for that:
see solenv/Executable_concat-deps.mk
so it is more likely that the problem is generic and that concat-deps
just happen to be the first one to be linked.
BTW, is there any way to issue gmake and let it show what command "LNK" is
doing?
It tried forcing a "-n" but I did not get the command debugged
verbose=t make
Norbert
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2015-01-18 Thread Miklos Vajna
 sw/qa/extras/odfexport/data/gerrit13858.odt |binary
 sw/qa/extras/odfexport/odfexport.cxx|5 
 sw/source/core/doc/textboxhelper.cxx|   31 +++-
 sw/source/filter/xml/xmltble.cxx|4 +--
 4 files changed, 33 insertions(+), 7 deletions(-)

New commits:
commit 8d758d0764beb78a49f3035c254eb085b112c2b1
Author: Miklos Vajna 
Date:   Sun Jan 18 21:17:03 2015 +0100

SwTextBoxHelper::findTextBoxes: optimize unnecessary O(n^2)

Change-Id: Ib127b6cf44a69709673465db99cc79417b18c266

diff --git a/sw/source/core/doc/textboxhelper.cxx 
b/sw/source/core/doc/textboxhelper.cxx
index d447b5b..f5096a0 100644
--- a/sw/source/core/doc/textboxhelper.cxx
+++ b/sw/source/core/doc/textboxhelper.cxx
@@ -114,17 +114,38 @@ void SwTextBoxHelper::destroy(SwFrmFmt* pShape)
 
 std::set SwTextBoxHelper::findTextBoxes(const SwDoc* pDoc)
 {
-std::set aRet;
+std::set aTextBoxes;
+std::map aFlyFormats, aDrawFormats;
 
 const SwFrmFmts& rSpzFrmFmts = *pDoc->GetSpzFrmFmts();
 for (SwFrmFmts::const_iterator it = rSpzFrmFmts.begin(); it != 
rSpzFrmFmts.end(); ++it)
 {
-SwFrmFmt* pTextBox = findTextBox(*it);
-if (pTextBox)
-aRet.insert(pTextBox);
+const SwFrmFmt* pFormat = *it;
+
+// A TextBox in the context of this class is a fly frame that has a
+// matching (same RES_CNTNT) draw frame.
+if (!pFormat->GetAttrSet().HasItem(RES_CNTNT) || 
!pFormat->GetCntnt().GetCntntIdx())
+continue;
+
+const SwNodeIndex& rIndex = *pFormat->GetCntnt().GetCntntIdx();
+
+if (pFormat->Which() == RES_FLYFRMFMT)
+{
+if (aDrawFormats.find(rIndex) != aDrawFormats.end())
+aTextBoxes.insert(pFormat);
+else
+aFlyFormats[rIndex] = pFormat;
+}
+else if (pFormat->Which() == RES_DRAWFRMFMT)
+{
+if (aFlyFormats.find(rIndex) != aFlyFormats.end())
+aTextBoxes.insert(aFlyFormats[rIndex]);
+else
+aDrawFormats[rIndex] = pFormat;
+}
 }
 
-return aRet;
+return aTextBoxes;
 }
 
 std::set SwTextBoxHelper::findTextBoxes(const SwNode& rNode)
commit 80eb001e6a861c68f2915d4eebded5e36e1875f6
Author: Miklos Vajna 
Date:   Sun Jan 18 21:16:55 2015 +0100

ODT export: fix namespace of  inside shapes

Change-Id: If96b46bac7f8212cfb83dc8b4528986137f1eaea

diff --git a/sw/qa/extras/odfexport/data/gerrit13858.odt 
b/sw/qa/extras/odfexport/data/gerrit13858.odt
new file mode 100644
index 000..9b3dd37
Binary files /dev/null and b/sw/qa/extras/odfexport/data/gerrit13858.odt differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx 
b/sw/qa/extras/odfexport/odfexport.cxx
index 77ae4ec..f23c2a3 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -432,6 +432,11 @@ DECLARE_ODFEXPORT_TEST(testFdo86963, "fdo86963.odt")
 CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDrawPage->getCount());
 }
 
+DECLARE_ODFEXPORT_TEST(testGerrit13858, "gerrit13858.odt")
+{
+// Just make sure the output is valid.
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx
index de682f2..b1db68f 100644
--- a/sw/source/filter/xml/xmltble.cxx
+++ b/sw/source/filter/xml/xmltble.cxx
@@ -897,7 +897,7 @@ void SwXMLExport::ExportTableLine( const SwTableLine& rLine,
 const long nRowSpan = pBox->getRowSpan();
 if( nRowSpan < 1 )
 {
-SvXMLElementExport aElem2( *this, XML_NAMESPACE_TABLE,
+SvXMLElementExport aElem2( *this, rTblInfo.GetPrefix(),
   XML_COVERED_TABLE_CELL, true,
   false );
 }
@@ -930,7 +930,7 @@ void SwXMLExport::ExportTableLine( const SwTableLine& rLine,
 
 for( size_t i=nOldCol; ihttp://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: 4.4.0.1 build error on sal/types.h on solaris/illumos

2015-01-18 Thread Norbert Thiebaud
On Sun, Jan 18, 2015 at 12:18 PM, Gabriele Bulfon  wrote:
> Ok, I checked and it looks fine, so solaris.mk should be taken.
> Also config.log shows correct variables for OS, CPU and COM.
>
> What actually happens is during make, after it has downloaded and extracted
> various stuff.
> The last one is translations file.
>
> Then it goes on building concat-deps, and linking fails:
>
> [build C ] solenv/bin/concat-deps.c
> [build LNK] Executable/concat-deps
> ld: fatal: unrecognized option '-O'
> ld: fatal: unrecognized option '-1'
> ld: fatal: use the -z help option for usage information
> collect2: error: ld returned 1 exit status
>
> Maybe just concat-deps have problems linking with wrong options on Solaris?

Yes it is quite possible... concat-deps is a small utility I wrote to
speed up the original perl-based one... and I'm quite sure I never
tried to link it on Solaris.
Otoh concat-deps is built using the standard gbuild mechanism for that:
see solenv/Executable_concat-deps.mk

so it is more likely that the problem is generic and that concat-deps
just happen to be the first one to be linked.

> BTW, is there any way to issue gmake and let it show what command "LNK" is
> doing?
> It tried forcing a "-n" but I did not get the command debugged

verbose=t make

Norbert
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


QA Meeting Minutes - 2015-01-14

2015-01-18 Thread Robinson Tryon
Hello, hello!

Thanks to everyone for the lovely QA Meeting. Minutes are here:
https://wiki.documentfoundation.org/QA/Meetings/2015/January_14

Our next meeting will be in 2 weeks:
https://wiki.documentfoundation.org/QA/Meetings/2015/January_28

REMEMBER: Our Bugzilla Migration is coming up in about a week, so
please sign up for a few shifts of watching the QA IRC channel and
Mailing list. The work is easy -- just help out anyone who has
problems finding the new site or resetting a password:
https://wiki.documentfoundation.org/QA/Meetings/2015/January_14#New_topics

Thanks!
--R

-- 
Robinson Tryon
QA Engineer - The Document Foundation
LibreOffice Community Outreach Herald
qu...@libreoffice.org
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Help for getting started with open source

2015-01-18 Thread Robinson Tryon
On Sat, Jan 17, 2015 at 1:36 PM,   wrote:
> Hello,
>
> I am an undergraduate student and I have relevant skills of C, C++ and Java.
> I have developed various projects on Windows Platform. But now I want to
> contribute to the open source world.

Sounds great!

> Can anyone please help me for getting started with open source. I want to
> contribute to the Libre.

Contributors to the project are generally around during the work week,
so that's usually the best time to correspond with people on IRC.
(Mailing lists are, of course, more flexible :-)

Is there anything in particular that you're hoping to work on within
LibreOffice? Often the best way to get started on the development side
is to
- Build LibreOffice
https://wiki.documentfoundation.org/Development/GeneralProgrammingGuidelines
- Find and fix an Easy Hack
https://wiki.documentfoundation.org/Development/Easy_Hacks

Of course there are many different teams in the project, including QA,
Language/Localization, Design, Documentation, etc..., several of which
can benefit from someone with development experience!
https://wiki.documentfoundation.org/Teams

> Looking forward for positive response.
>

Well welcome to the project! We're always happy to have eager, skilled
contributors join us :-)

Cheers,
--R


-- 
Robinson Tryon
QA Engineer - The Document Foundation
LibreOffice Community Outreach Herald
qu...@libreoffice.org
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Reminder: LibreOffice Bugzilla Migration will happen next Saturday (Jan 24th)

2015-01-18 Thread Robinson Tryon
Hi all,

I hope that winter has been treating you well!

This is just a quick reminder that we'll be migrating all of the
LibreOffice bugs from Freedesktop.org to
https://bugs.documentfoundation.org/ this coming Saturday.

REMEMBER: You *WILL* have to reset your password after the migration
is complete.


KEY DETAILS:

- Migration Date: January 24th, 2015 at 15:00 UTC

- Migration Duration: Approximately 4-6 hours

- New URL: https://bugs.documentfoundation.org/

- Information about the migration:
https://wiki.documentfoundation.org/QA/Bugzilla/TDF_Bugzilla_Proposal/Migration_Userguide#Guide


As always, if you have any questions about the migration, feel free to email me
or the QA mailing list:
https://wiki.documentfoundation.org/QA/Mailing_List


Cheers,
--R

-- 
Robinson Tryon
QA Engineer - The Document Foundation
LibreOffice Community Outreach Herald
qu...@libreoffice.org
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: 4.4.0.1 build error on sal/types.h on solaris/illumos

2015-01-18 Thread Gabriele Bulfon
Ok, I checked and it looks fine, so solaris.mk should be taken.
Also config.log shows correct variables for OS, CPU and COM.
What actually happens is during make, after it has downloaded and extracted 
various stuff.
The last one is translations file.
Then it goes on building concat-deps, and linking fails:
[build C  ] solenv/bin/concat-deps.c
[build LNK] Executable/concat-deps
ld: fatal: unrecognized option '-O'
ld: fatal: unrecognized option '-1'
ld: fatal: use the -z help option for usage information
collect2: error: ld returned 1 exit status
Maybe just concat-deps have problems linking with wrong options on Solaris?
Also, strange, but build goes on anyway, like:
[build YAC] unoidl/source/sourceprovider-parser
[build LEX] unoidl/source/sourceprovider-scanner
[build CAT] officecfg_qa_allheaders.hxx
[build XSL] CustomTarget/officecfg/registry/officecfg/FirstStartWizard.hxx
..
..
...[long list of build stuff, until it reaches 
here].
[build CMP] scripting/java/ScriptProviderForBeanShell
[build CMP] scripting/java/ScriptProviderForJavaScript
make[2]: *** No rule to make target 
`/sources/sonicle/xstream-desktop-gate/components/libreoffice/libreoffice/libreoffice-4.4.0.2/workdir/LinkTarget/Executable/concat-deps',
 needed by 
`/sources/sonicle/xstream-desktop-gate/components/libreoffice/libreoffice/libreoffice-4.4.0.2/workdir/Module/nonl10n/solenv'.
  Stop.
make[2]: *** Waiting for unfinished jobs
make[2]: Leaving directory 
`/sources/sonicle/xstream-desktop-gate/components/libreoffice/libreoffice/libreoffice-4.4.0.2'
make[1]: *** [build] Error 2
make[1]: Leaving directory 
`/sources/sonicle/xstream-desktop-gate/components/libreoffice/libreoffice/libreoffice-4.4.0.2'
gmake: *** 
[/sources/sonicle/xstream-desktop-gate/components/libreoffice/libreoffice/build/i86/.built]
 Error 2
Obviously the last error is because we have no concat-deps binary :)
I tried to look at the place where it builds concat-deps, but it's not easy to 
figure it out
BTW, is there any way to issue gmake and let it show what command "LNK" is 
doing?
It tried forcing a "-n" but I did not get the command debugged
Thanks again!
Gabriele.
--
Da: Norbert Thiebaud
A: gbul...@sonicle.com
Cc: Michael Stahl
libreoffice
Richard PALO
Data: 17 gennaio 2015 14.56.18 CET
Oggetto: Re: 4.4.0.1 build error on sal/types.h on solaris/illumos
On Sat, Jan 17, 2015 at 5:07 AM, Gabriele Bulfon
wrote:
Looks like 4.4.0.2 has this solaris ld patch already applied.
I strongly believe gmake is not using the solaris.mk file.
How can I verify if configure/make is really taking the solaris.mk platform?
In gbuild.mk we include
platform/$(OS)_$(CPUNAME)_$(COM).mk
verify in your config_host.mk tht these resolve to
SOLARIS,INTEL and GCC respectively
SOLARIS_INTEL_GCC.mk just include platform/solaris.mk
Norbert
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: 4 commits - basegfx/CppunitTest_basegfx.mk basegfx/test sc/inc sc/qa sc/source

2015-01-18 Thread Markus Mohrhard
 basegfx/CppunitTest_basegfx.mk|1 
 basegfx/test/basegfx1d.cxx|   63 --
 basegfx/test/basegfx2d.cxx|5 --
 sc/inc/conditio.hxx   |2 
 sc/qa/unit/ucalc.cxx  |   24 +--
 sc/source/core/data/conditio.cxx  |   14 +-
 sc/source/core/data/table2.cxx|2 
 sc/source/core/data/table4.cxx|   10 ++--
 sc/source/filter/excel/xicontent.cxx  |2 
 sc/source/filter/oox/condformatbuffer.cxx |2 
 sc/source/filter/xml/xmlcondformat.cxx|2 
 sc/source/filter/xml/xmlstyli.cxx |2 
 sc/source/ui/condformat/condformatdlg.cxx |4 -
 sc/source/ui/unoobj/cellsuno.cxx  |2 
 14 files changed, 32 insertions(+), 103 deletions(-)

New commits:
commit dcd291330b95e6493e341ae40ef1afe1482fcd24
Author: Markus Mohrhard 
Date:   Sun Jan 18 16:35:42 2015 +0100

rename AddRange to SetRange

Change-Id: I696fcbd2896aefda38314457b6838874262ad111

diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx
index 743c950..341e032 100644
--- a/sc/inc/conditio.hxx
+++ b/sc/inc/conditio.hxx
@@ -393,7 +393,7 @@ public:
 ScConditionalFormat* Clone(ScDocument* pNewDoc = NULL) const;
 
 voidAddEntry( ScFormatEntry* pNew );
-voidAddRange( const ScRangeList& rRanges );
+voidSetRange( const ScRangeList& rRanges );
 const ScRangeList&  GetRange() const  { return maRanges; }
 // don't use the same name as for the const version
 ScRangeList& GetRangeList() { return maRanges; }
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index fe01944..eb4454f 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -3660,7 +3660,7 @@ void Test::testCopyPasteSkipEmptyConditionalFormatting()
 m_pDoc->SetCondFormList(pCondFormatList, 0);
 
 ScConditionalFormat* pFormat = new ScConditionalFormat(1, m_pDoc);
-pFormat->AddRange(aDestRange);
+pFormat->SetRange(aDestRange);
 sal_uLong nCondFormatKey = m_pDoc->AddCondFormat(pFormat, 0);
 
 // Prepare a clipboard content interleaved with empty cells.
@@ -3675,7 +3675,7 @@ void Test::testCopyPasteSkipEmptyConditionalFormatting()
 aClipDoc.SetValue(4,5,0,2);
 
 ScConditionalFormat* pClipFormat = new ScConditionalFormat(2, &aClipDoc);
-pClipFormat->AddRange(aSrcRange);
+pClipFormat->SetRange(aSrcRange);
 aClipDoc.AddCondFormat(pClipFormat, 0);
 
 // Create undo document.
@@ -5466,7 +5466,7 @@ void Test::testCondFormatINSDEL()
 
 ScConditionalFormat* pFormat = new ScConditionalFormat(1, m_pDoc);
 ScRangeList aRangeList(ScRange(0,0,0,0,3,0));
-pFormat->AddRange(aRangeList);
+pFormat->SetRange(aRangeList);
 ScCondFormatEntry* pEntry = new 
ScCondFormatEntry(SC_COND_DIRECT,"=B2","",m_pDoc,ScAddress(0,0,0),ScGlobal::GetRscString(STR_STYLENAME_RESULT));
 pFormat->AddEntry(pEntry);
 
@@ -5490,7 +5490,7 @@ void Test::testCondFormatInsertCol()
 
 ScConditionalFormat* pFormat = new ScConditionalFormat(1, m_pDoc);
 ScRangeList aRangeList(ScRange(0,0,0,3,3,0));
-pFormat->AddRange(aRangeList);
+pFormat->SetRange(aRangeList);
 
 ScCondFormatEntry* pEntry = new 
ScCondFormatEntry(SC_COND_DIRECT,"=B2","",m_pDoc,ScAddress(0,0,0),ScGlobal::GetRscString(STR_STYLENAME_RESULT));
 pFormat->AddEntry(pEntry);
@@ -5512,7 +5512,7 @@ void Test::testCondFormatInsertRow()
 
 ScConditionalFormat* pFormat = new ScConditionalFormat(1, m_pDoc);
 ScRangeList aRangeList(ScRange(0,0,0,3,3,0));
-pFormat->AddRange(aRangeList);
+pFormat->SetRange(aRangeList);
 
 ScCondFormatEntry* pEntry = new 
ScCondFormatEntry(SC_COND_DIRECT,"=B2","",m_pDoc,ScAddress(0,0,0),ScGlobal::GetRscString(STR_STYLENAME_RESULT));
 pFormat->AddEntry(pEntry);
@@ -5533,7 +5533,7 @@ void Test::testCondFormatInsertDeleteSheets()
 
 // Add a conditional format to B2:B4.
 ScConditionalFormat* pFormat = new ScConditionalFormat(1, m_pDoc);
-pFormat->AddRange(ScRange(1,1,0,1,3,0));
+pFormat->SetRange(ScRange(1,1,0,1,3,0));
 
 sal_uLong nKey = m_pDoc->AddCondFormat(pFormat, 0);
 
@@ -5640,7 +5640,7 @@ void Test::testCondCopyPaste()
 ScConditionalFormat* pFormat = new ScConditionalFormat(1, m_pDoc);
 ScRange aCondFormatRange(0,0,0,3,3,0);
 ScRangeList aRangeList(aCondFormatRange);
-pFormat->AddRange(aRangeList);
+pFormat->SetRange(aRangeList);
 
 ScCondFormatEntry* pEntry = new 
ScCondFormatEntry(SC_COND_DIRECT,"=B2","",m_pDoc,ScAddress(0,0,0),ScGlobal::GetRscString(STR_STYLENAME_RESULT));
 pFormat->AddEntry(pEntry);
@@ -5674,7 +5674,7 @@ void Test::testCondCopyPasteSingleCell()
 ScConditionalFormat* pFormat = new ScConditionalFormat(1, m_pDoc);
 ScRange aCondFormatRange(0,0,0,3,3,0);
 ScRangeList aRangeList(aCondFormatRange);
-pFormat->AddRange(aRangeList);
+pFormat->SetRange(aRangeList);
 
 ScCondFormatEntry* pEntry = new 
Sc

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

2015-01-18 Thread Tomaž Vajngerl
 include/vcl/outdev.hxx   |6 
 vcl/source/outdev/bitmap.cxx |  438 +++
 2 files changed, 289 insertions(+), 155 deletions(-)

New commits:
commit d53103dd83bf20ac63485e229069f145e35b3009
Author: Tomaž Vajngerl 
Date:   Sun Jan 18 23:51:14 2015 +0900

fdo#74124 bilinear scaling with blending for some formats

The DrawDeviceAlphaBitmapSlowPath used fast/ugly scaling with
blending. With this a bilinear scaling is used which should
improve quality for downscaling (less than 50% should start to
degrade in quality as only 2 samples are always used) and
upscaling.

Change-Id: I56cdf2b5761687be891387343a773b6fefac03e2

diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx
index 50877be..1ee1eef 100644
--- a/vcl/source/outdev/bitmap.cxx
+++ b/vcl/source/outdev/bitmap.cxx
@@ -673,6 +673,179 @@ void OutputDevice::DrawDeviceAlphaBitmap( const Bitmap& 
rBmp, const AlphaMask& r
 }
 }
 
+namespace
+{
+
+struct ScaleContext
+{
+boost::scoped_array mpMapX;
+boost::scoped_array mpMapY;
+
+boost::scoped_array mpMapXOffset;
+boost::scoped_array mpMapYOffset;
+
+ScaleContext(Rectangle& aDstRect, Rectangle& aBitmapRect,
+ Size& aOutSize, long nOffX, long nOffY)
+
+: mpMapX(new long[aDstRect.GetWidth()])
+, mpMapY(new long[aDstRect.GetHeight()])
+, mpMapXOffset(new long[aDstRect.GetWidth()])
+, mpMapYOffset(new long[aDstRect.GetHeight()])
+{
+const long nSrcWidth = aBitmapRect.GetWidth();
+const long nSrcHeight = aBitmapRect.GetHeight();
+
+const bool bHMirr = aOutSize.Width() < 0;
+const bool bVMirr = aOutSize.Height() < 0;
+
+generateSimpleMap(
+nSrcWidth,  aDstRect.GetWidth(), aBitmapRect.Left(),
+aOutSize.Width(),  nOffX, bHMirr, mpMapX.get(), 
mpMapXOffset.get());
+
+generateSimpleMap(
+nSrcHeight, aDstRect.GetHeight(), aBitmapRect.Top(),
+aOutSize.Height(), nOffY, bVMirr, mpMapY.get(), 
mpMapYOffset.get());
+}
+
+private:
+
+static void generateSimpleMap(long nSrcDimension, long nDstDimension, long 
nDstLocation,
+  long nOutDimention, long nOffset, bool 
bMirror, long* pMap, long* pMapOffset)
+{
+long nMirrorOffset = 0;
+
+if (bMirror)
+nMirrorOffset = (nDstLocation << 1) + nSrcDimension - 1L;
+
+double fReverseScale = (nSrcDimension - 1L) / double(nOutDimention - 
1L);
+
+for (long i = 0L; i < nDstDimension; i++)
+{
+double fTemp = ((nOffset + i) * fReverseScale);
+if (bMirror)
+fTemp = nMirrorOffset - fTemp - 1L;
+
+pMap[i] = MinMax(nDstLocation + long(fTemp), 0, nSrcDimension - 
2L);
+pMapOffset[i] = (long) ((fTemp - pMap[i]) * 128.0);
+}
+}
+
+public:
+void blendBitmap(
+const BitmapWriteAccess* pDestination,
+const BitmapReadAccess*  pSource,
+const BitmapReadAccess*  pSourceAlpha,
+const long nDstWidth,
+const long nDstHeight)
+{
+if (pSource && pSourceAlpha && pDestination)
+{
+unsigned long nSourceFormat = pSource->GetScanlineFormat();
+unsigned long nDestinationFormat = 
pDestination->GetScanlineFormat();
+
+switch (nSourceFormat)
+{
+case BMP_FORMAT_24BIT_TC_RGB:
+case BMP_FORMAT_24BIT_TC_BGR:
+{
+if ( (nSourceFormat == BMP_FORMAT_24BIT_TC_BGR && 
nDestinationFormat == BMP_FORMAT_32BIT_TC_BGRA)
+  || (nSourceFormat == BMP_FORMAT_24BIT_TC_RGB && 
nDestinationFormat == BMP_FORMAT_32BIT_TC_RGBA))
+{
+blendBitmap24(pDestination, pSource, pSourceAlpha, 
nDstWidth, nDstHeight);
+}
+}
+}
+}
+}
+
+void blendBitmap24(
+const BitmapWriteAccess*  pDestination,
+const BitmapReadAccess*   pSource,
+const BitmapReadAccess*   pSourceAlpha,
+const long nDstWidth,
+const long nDstHeight)
+{
+Scanline pLine0, pLine1;
+Scanline pLineAlpha0, pLineAlpha1;
+Scanline pColorSample1, pColorSample2;
+Scanline pDestScanline;
+
+long nColor1Line1, nColor2Line1, nColor3Line1;
+long nColor1Line2, nColor2Line2, nColor3Line2;
+long nAlphaLine1, nAlphaLine2;
+
+sal_uInt8 nColor1, nColor2, nColor3, nAlpha;
+
+for (long nY = 0L; nY < nDstHeight; nY++)
+{
+const long nMapY  = mpMapY[nY];
+const long nMapFY = mpMapYOffset[nY];
+
+pLine0 = pSource->GetScanline(nMapY);
+pLine1 = pSource->GetScanline(nMapY + 1);
+
+pLineAlpha0 = pSourceAlpha->GetScanline(nMapY);
+pLineAlpha1 = p