[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2014-04-17 Thread Michael Stahl
 sw/source/core/fields/reffld.cxx |   73 ++-
 1 file changed, 34 insertions(+), 39 deletions(-)

New commits:
commit 4786291566320aaf21fe4c9a7fb52269ddba4f3c
Author: Michael Stahl mst...@redhat.com
Date:   Thu Apr 17 15:25:23 2014 +0200

fdo#77342: sw: fix copy/paste of footnote cross references

The fix for sequence fields broke the footnote references some more;
simplify it by handling the footnotes in the same way as the sequence
fields, and not remapping GetExp fields for which the corresponding
SetExp field / footnote is missing.

Also, don't do any remapping when the target is a clipboard document, to
prevent modifying the source document.

(regression from bb665affbd8870652ade3951d626d76e99143f67)

(cherry picked from commit cbfcb837fb06a14daf5281ae13fc1886328cee6f)

Conflicts:
sw/source/core/fields/reffld.cxx

Change-Id: If1be1e1d9742182a4085bbbff53e26a8fa8665b8
Reviewed-on: https://gerrit.libreoffice.org/9084
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index ba0e4bb..fee6d0e 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -1014,6 +1014,17 @@ void _RefIdsMap::Init( SwDoc rDoc, SwDoc rDestDoc, 
bool bField )
 {
 GetNoteIdsFromDoc( rDestDoc, aIds );
 GetNoteIdsFromDoc( rDoc, aDstIds );
+
+for (std::setsal_uInt16::iterator pIt = aDstIds.begin(); pIt != 
aDstIds.end(); ++pIt)
+AddId( GetFirstUnusedId(aIds), *pIt );
+
+// Change the footnotes/endnotes in the source doc to the new ID
+for (sal_uInt16 i = 0, nCnt = rDoc.GetFtnIdxs().size(); i  nCnt; ++i)
+{
+SwTxtFtn *const pFtnIdx = rDoc.GetFtnIdxs()[i];
+sal_uInt16 const n = pFtnIdx-GetSeqRefNo();
+pFtnIdx-SetSeqNo(sequencedIds[n]);
+}
 }
 bInit = true;
 }
@@ -1051,54 +1062,38 @@ void _RefIdsMap::Check( SwDoc rDoc, SwDoc rDestDoc, 
SwGetRefField rFld,
 {
 Init( rDoc, rDestDoc, bField);
 
-sal_uInt16 nSeqNo = rFld.GetSeqNo();
+sal_uInt16 const nSeqNo = rFld.GetSeqNo();
 
-// Check if the number is used in both documents
-// Note: For fields, aIds contains both the ids of SetExp from rDestDoc
-// and the targets of the already remapped ones from rDoc.
-// It is possible that aDstIds contains numbers that aIds does not contain!
-// For example, copying a selection to clipboard that does not contain
-// the first SwSetExpField will result in id 0 missing, then pasting that
-// into empty document gives a mapping 1-0 ... N-N-1 (fdo#63553).
-if (aIds.count(nSeqNo) || aDstIds.count(nSeqNo))
+// check if it needs to be remapped
+// if sequencedIds doesn't contain the number, it means there is no
+// SetExp field / footnote in the source document: do not modify
+// the number, which works well for copy from/paste to same document
+// (and if it is not the same document, there's no correct result anyway)
+if (sequencedIds.count(nSeqNo))
 {
-// Number already taken, so need a new one.
-if( sequencedIds.count(nSeqNo) )
-rFld.SetSeqNo( sequencedIds[nSeqNo] );
-else
-{
-assert(!bField || !aDstIds.count(nSeqNo)); // postcond of Init
-
-sal_uInt16 n = GetFirstUnusedId( aIds );
-
-// die neue SeqNo eintragen, damit die belegt ist
-AddId( n, nSeqNo );
-rFld.SetSeqNo( n );
-
-// und noch die Fuss-/EndNote auf die neue Id umsetzen
-if( !bField )
-{
-SwTxtFtn* pFtnIdx;
-for( sal_uInt16 i = 0, nCnt = rDoc.GetFtnIdxs().size(); i  
nCnt; ++i )
-if( nSeqNo == (pFtnIdx = rDoc.GetFtnIdxs()[ i 
])-GetSeqRefNo() )
-{
-pFtnIdx-SetSeqNo( n );
-break;
-}
-}
-}
-}
-else
-{
-AddId( nSeqNo, nSeqNo ); // this requires that nSeqNo is unused in 
both!
+rFld.SetSeqNo( sequencedIds[nSeqNo] );
 }
 }
 
-
+/// 1. if _both_ SetExp + GetExp / Footnote + GetExp field are copied,
+///enusure that both get a new unused matching number
+/// 2. if only SetExp / Footnote is copied, it gets a new unused number
+/// 3. if only GetExp field is copied, for the case of copy from / paste to
+///same document it's desirable to keep the same number;
+///for other cases of copy/paste or master documents it's not obvious
+///what is most desirable since it's going to be wrong anyway
 void SwGetRefFieldType::MergeWithOtherDoc( SwDoc rDestDoc )
 {
 if( rDestDoc != pDoc )
 {
+if (rDestDoc.IsClipBoard())
+{
+// when copying _to_ clipboard, expectation is that no 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2014-04-11 Thread Lennard Wasserthal
 sw/source/ui/docvw/edtwin.cxx |   19 +++
 1 file changed, 11 insertions(+), 8 deletions(-)

New commits:
commit c7cec7bb9ea7ef0aaa18a5c39eca13c446f974c5
Author: Lennard Wasserthal wassert...@nefkom.net
Date:   Sat Apr 5 11:55:24 2014 +0200

fdo#69157 Apply object-in front selection on mouseUp

Before, all selection was recklessly replaced when you clicked something
else than a scaling handle (or the like).
It caused bug 69157.

But now, you can still drag the frame by gripping the interior one.
Btw, that the timer did not correctly start was because of the return
statement in the prior state.

Change-Id: I5e02cfb2d5fe9cdb9fd7f50d0c961dcc418fadd6
Signed-off-by: Lennard Wasserthal wassert...@nefkom.net
Signed-off-by: Michael Stahl mst...@redhat.com
(cherry picked from commit 351ab7b879a1e5bf879600bf47909181029a4d11)
Reviewed-on: https://gerrit.libreoffice.org/8907
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index 3dd87c0..cd838c0 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -2618,8 +2618,6 @@ void SwEditWin::MouseButtonDown(const MouseEvent _rMEvt)
 {
 SwWrtShell rSh = m_rView.GetWrtShell();
 
-SdrObject* pObj;
-SdrPageView* pPV;
 // We have to check if a context menu is shown and we have an UI
 // active inplace client. In that case we have to ignore the mouse
 // button down event. Otherwise we would crash (context menu has been
@@ -2936,12 +2934,6 @@ void SwEditWin::MouseButtonDown(const MouseEvent _rMEvt)
 // only if no position to size was hit.
 if (!bHitHandle)
 {
-if (pSdrView-PickObj(aDocPos, 
pSdrView-getHitTolLog(), pObj, pPV, SDRSEARCH_ALSOONMASTER | 
SDRSEARCH_BEFOREMARK))
-{
-pSdrView-UnmarkAllObj();
-
pSdrView-MarkObj(pObj,pPV,false,false);
-return;
-}
 StartDDTimer();
 SwEditWin::m_nDDStartPosY = aDocPos.Y();
 SwEditWin::m_nDDStartPosX = aDocPos.X();
@@ -4029,6 +4021,8 @@ void SwEditWin::MouseMove(const MouseEvent _rMEvt)
  */
 void SwEditWin::MouseButtonUp(const MouseEvent rMEvt)
 {
+SdrObject* pObj;
+SdrPageView* pPV;
 bool bCallBase = true;
 
 sal_Bool bCallShadowCrsr = m_bWasShdwCrsr;
@@ -4080,6 +4074,15 @@ void SwEditWin::MouseButtonUp(const MouseEvent rMEvt)
 bFrmDrag = false;
 }
 bNoInterrupt = false;
+const Point aDocPos( PixelToLogic( rMEvt.GetPosPixel() ) );
+if ((PixelToLogic(m_aStartPos).Y() == (aDocPos.Y()))  
(PixelToLogic(m_aStartPos).X() == (aDocPos.X(//To make sure it was not moved
+{
+if (pSdrView-PickObj(aDocPos, pSdrView-getHitTolLog(), pObj, 
pPV, SDRSEARCH_ALSOONMASTER ))
+{
+pSdrView-UnmarkAllObj();
+pSdrView-MarkObj(pObj,pPV,false,false);
+}
+}
 ReleaseMouse();
 return;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2014-04-07 Thread Michael Stahl
 sw/source/core/ole/ndole.cxx |   17 +
 1 file changed, 9 insertions(+), 8 deletions(-)

New commits:
commit b7407546a0f3e0464a974f91d1e5ee2a92211d30
Author: Michael Stahl mst...@redhat.com
Date:   Mon Apr 7 10:21:05 2014 +0200

fdo#76298: sw: do not start up every OLE object on deletion

First check if it's actually a Chart embedded object; starting up
external processes on Windows for arbitrary OLEs is likely expensive.

(regression from 1ba29be90f7141077f2d079d40dffc2efd4f1a2c)

(cherry picked from commit 206848294f686a0ccf4c741d7e92a2314a88ea48)

Conflicts:
sw/source/core/ole/ndole.cxx

Conflicts:
sw/source/core/ole/ndole.cxx

Change-Id: I3c6b6cf4d4f791cafc77ec1f9b2b0150ad1b
Reviewed-on: https://gerrit.libreoffice.org/8882
Tested-by: Caolán McNamara caol...@redhat.com
Reviewed-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx
index 1f74ff5..3e21ec0 100644
--- a/sw/source/core/ole/ndole.cxx
+++ b/sw/source/core/ole/ndole.cxx
@@ -340,27 +340,28 @@ sal_Bool SwOLENode::SavePersistentData()
 if ( xChild.is() )
 xChild-setParent( 0 );
 
-  // pCnt-RemoveEmbeddedObject( aOLEObj.aName, sal_False );
/* #i119941: When cut or move the chart, SwUndoFlyBase::DelFly will 
call SaveSection to store the comtent to strorage.
In this step, chart filter functions will be called. And chart 
filter will call chart core functions to create the chart again.
Then chart core function will call the class 
ExplicitCategoryProvider to create data source.
-   In this step, when SW data source provider create the data source, 
it will create a new SwFlyFrm.
+   In this step, when SW
+   source provider create the data source, an UnoActionRemoveContext
+   will mess with the layout and create a new SwFlyFrm.
But later in SwUndoFlyBase::DelFly, it will clear anchor related 
attributes of SwFlyFrm. Then finally null pointer occur.
Resolution:
In pCnt-RemoveEmbeddedObject in SaveSection process of table 
chart, only remove the object from the object container,
without removing it's storage and graphic stream. The chart already 
removed from formatter. */
-   sal_Bool bChartWithInternalProvider = sal_False;
sal_Bool bKeepObjectToTempStorage = sal_True;
uno::Reference  embed::XEmbeddedObject  xIP = 
GetOLEObj().GetOleRef();
-   if ( svt::EmbeddedObjectRef::TryRunningState( xIP ) )
+   if (IsChart()  sChartTblName.Len()
+svt::EmbeddedObjectRef::TryRunningState(xIP))
{
uno::Reference chart2::XChartDocument  xChart( 
xIP-getComponent(), UNO_QUERY );
-   if ( xChart.is()  xChart-hasInternalDataProvider() )
-   bChartWithInternalProvider = sal_True;
+if (xChart.is()  !xChart-hasInternalDataProvider())
+{
+bKeepObjectToTempStorage = sal_False;
+}
}
 
-   if ( IsChart()  sChartTblName.Len()  
!bChartWithInternalProvider )
-   bKeepObjectToTempStorage = sal_False;
pCnt-RemoveEmbeddedObject( aOLEObj.aName, sal_False, 
bKeepObjectToTempStorage );
// modify end
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2014-03-19 Thread Luboš Luňák
 sw/source/core/table/swnewtable.cxx |   16 +---
 1 file changed, 13 insertions(+), 3 deletions(-)

New commits:
commit e8b686149f2a9f21a7a52bb5710a8a6362cd7a35
Author: Luboš Luňák l.lu...@centrum.cz
Date:   Tue Mar 18 18:57:05 2014 +0100

workaround for rounding errors when handling merged cells (fdo#38414)

Change-Id: I4d36e4b86c77a7356a8c221cbfc5735e925392ba
Signed-off-by: Andras Timar andras.ti...@collabora.com

diff --git a/sw/source/core/table/swnewtable.cxx 
b/sw/source/core/table/swnewtable.cxx
index 23edc85..fef95fc 100644
--- a/sw/source/core/table/swnewtable.cxx
+++ b/sw/source/core/table/swnewtable.cxx
@@ -200,10 +200,20 @@ static SwTableBox* lcl_LeftBorder2Box( long nLeft, const 
SwTableLine* pLine )
 {
 SwTableBox* pBox = pLine-GetTabBoxes()[nCurrBox];
 OSL_ENSURE( pBox, Missing table box );
-if( nCurrLeft = nLeft  pBox-GetFrmFmt()-GetFrmSize().GetWidth() )
+if( pBox-GetFrmFmt()-GetFrmSize().GetWidth() )
 {
-OSL_ENSURE( nCurrLeft == nLeft, Wrong box found );
-return pBox;
+if( nCurrLeft == nLeft )
+return pBox;
+// HACK: It appears that rounding errors may result in positions 
not matching
+// exactly, so allow a little tolerance. This happens at least 
with merged cells
+// in the doc from fdo#38414 .
+if( abs( nCurrLeft - nLeft ) = ( nLeft / 1000 ))
+return pBox;
+if( nCurrLeft = nLeft )
+{
+SAL_WARN( sw.core, Possibly wrong box found );
+return pBox;
+}
 }
 nCurrLeft += pBox-GetFrmFmt()-GetFrmSize().GetWidth();
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2014-03-19 Thread Michael Stahl
 sw/source/ui/uiview/viewport.cxx |   15 +--
 1 file changed, 5 insertions(+), 10 deletions(-)

New commits:
commit 715cb73a20bbe9db6406a863201370996c04c1b7
Author: Michael Stahl mst...@redhat.com
Date:   Fri Mar 14 23:08:11 2014 +0100

fdo#75460: sw: fix AutoScroll

This reverts commit 5141201fba2d080841b81e02be92f4b47aae2684. which
fixed a crash but unfortunately also prevents the
m_pEditWin-HandleScrollCommand from being called, thus disabling
AutoScroll.  Fix the crash in the ugly way by another pWData check.

(regression from 8880c773e779710dc0a08760e92afd709a73ca31)

(cherry picked from commit 6795b251e2011cae945c6bb903de8053953b5e30)

Conflicts:
sw/source/ui/uiview/viewport.cxx

Change-Id: I958f1403ad23d0c0631eca5dbbef977a9ca1210d
Reviewed-on: https://gerrit.libreoffice.org/8597
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/source/ui/uiview/viewport.cxx b/sw/source/ui/uiview/viewport.cxx
index e9f5d1a..aabbda9 100644
--- a/sw/source/ui/uiview/viewport.cxx
+++ b/sw/source/ui/uiview/viewport.cxx
@@ -1253,14 +1253,9 @@ void SwView::Move()
 
 sal_Bool SwView::HandleWheelCommands( const CommandEvent rCEvt )
 {
-const CommandWheelData* pWData = rCEvt.GetWheelData();
-if (!pWData)
-{
-return sal_False;
-}
-
 sal_Bool bOk = sal_False;
-if( COMMAND_WHEEL_ZOOM == pWData-GetMode() )
+const CommandWheelData* pWData = rCEvt.GetWheelData();
+if (pWData  COMMAND_WHEEL_ZOOM == pWData-GetMode())
 {
 long nFact = m_pWrtShell-GetViewOptions()-GetZoom();
 if( 0L  pWData-GetDelta() )
@@ -1271,7 +1266,7 @@ sal_Bool SwView::HandleWheelCommands( const CommandEvent 
rCEvt )
 SetZoom( SVX_ZOOM_PERCENT, nFact );
 bOk = sal_True;
 }
-else if( COMMAND_WHEEL_ZOOM_SCALE == pWData-GetMode() )
+else if (pWData  COMMAND_WHEEL_ZOOM_SCALE == pWData-GetMode())
 {
 int newZoom = 100 * (m_pWrtShell-GetViewOptions()-GetZoom() / 100.0) 
* (pWData-GetDelta() / 100.0);
 SetZoom( SVX_ZOOM_PERCENT, std::max( 20, std::min( 600, newZoom ) ) );
@@ -1279,13 +1274,13 @@ sal_Bool SwView::HandleWheelCommands( const 
CommandEvent rCEvt )
 }
 else
 {
-if(pWData-GetMode()==COMMAND_WHEEL_SCROLL)
+if (pWData  pWData-GetMode()==COMMAND_WHEEL_SCROLL)
 {
 // This influences whether quick help is shown
 m_bWheelScrollInProgress=true;
 }
 
-if ((COMMAND_WHEEL_SCROLL==pWData-GetMode())  
(((sal_uLong)0x) == pWData-GetScrollLines()))
+if (pWData  (COMMAND_WHEEL_SCROLL==pWData-GetMode())  
(((sal_uLong)0x) == pWData-GetScrollLines()))
 {
 if (pWData-GetDelta()0)
 PhyPageDown();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2014-02-27 Thread Zolnai Tamás
 sw/source/ui/frmdlg/uiborder.cxx |6 +++---
 sw/source/ui/inc/uiborder.hxx|2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 97197e881d609404288eaa903fa7db2c3b0c70b6
Author: Zolnai Tamás tamas.zol...@collabora.com
Date:   Thu Feb 27 09:57:52 2014 +0100

fdo#73159 Make border dialog work again

It seems converting to SfxSingleTabDialog makes it work.
Similar conversions were made on master branch.

Change-Id: I49985bed56f12460d289c7f0d4e1c1435aa4674e
Reviewed-on: https://gerrit.libreoffice.org/8377
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/sw/source/ui/frmdlg/uiborder.cxx b/sw/source/ui/frmdlg/uiborder.cxx
index 2f4b1ef..8925786 100644
--- a/sw/source/ui/frmdlg/uiborder.cxx
+++ b/sw/source/ui/frmdlg/uiborder.cxx
@@ -34,7 +34,7 @@
 
 SwBorderDlg::SwBorderDlg(Window* pParent, SfxItemSet rSet, sal_uInt16 nType) :
 
-SfxNoLayoutSingleTabDialog(pParent, rSet, 0)
+SfxSingleTabDialog(pParent, rSet)
 
 {
 SetText(SW_RESSTR(STR_FRMUI_BORDER));
@@ -45,13 +45,13 @@ SwBorderDlg::SwBorderDlg(Window* pParent, SfxItemSet rSet, 
sal_uInt16 nType) :
 ::CreateTabPage fnCreatePage = pFact-GetTabPageCreatorFunc( 
RID_SVXPAGE_BORDER );
 if ( fnCreatePage )
 {
-SfxTabPage* pNewPage = (*fnCreatePage)( this, rSet );
+SfxTabPage* pNewPage = (*fnCreatePage)( get_content_area(), rSet );
 SfxAllItemSet aSet(*(rSet.GetPool()));
 aSet.Put (SfxUInt16Item(SID_SWMODE_TYPE,nType));
 if(SW_BORDER_MODE_TABLE == nType)
 aSet.Put (SfxUInt32Item(SID_FLAG_TYPE,SVX_HIDESHADOWCTL));
 pNewPage-PageCreated(aSet);
-SetTabPage(pNewPage);
+setTabPage(pNewPage);
 }
 }
 
diff --git a/sw/source/ui/inc/uiborder.hxx b/sw/source/ui/inc/uiborder.hxx
index 20e5e87..a8890b4 100644
--- a/sw/source/ui/inc/uiborder.hxx
+++ b/sw/source/ui/inc/uiborder.hxx
@@ -24,7 +24,7 @@
 class Window;
 class SfxItemSet;
 
-class SwBorderDlg : public SfxNoLayoutSingleTabDialog
+class SwBorderDlg : public SfxSingleTabDialog
 {
 public:
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2014-02-18 Thread Jan Holesovsky
 sw/source/filter/html/parcss1.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 84de230c6a73afb1c32ee04aa1f70fbcfbf5677e
Author: Jan Holesovsky ke...@collabora.com
Date:   Mon Feb 17 20:49:24 2014 +0100

Fix crash in css rgb color handling.

Crashing since 2000 (or earlier).

Change-Id: I9f91d56f380be2421370b0acbee351461e1f0973
Reviewed-on: https://gerrit.libreoffice.org/8092
Tested-by: David Tardon dtar...@redhat.com
Reviewed-by: David Tardon dtar...@redhat.com

diff --git a/sw/source/filter/html/parcss1.cxx 
b/sw/source/filter/html/parcss1.cxx
index 8455ab1..24c32b9 100644
--- a/sw/source/filter/html/parcss1.cxx
+++ b/sw/source/filter/html/parcss1.cxx
@@ -1281,7 +1281,7 @@ sal_Bool CSS1Expression::GetColor( Color rColor ) const
 ')' == aValue.GetChar( aValue.Len()-1),
 keine gueltiges RGB(...) );
 
-String aColorStr( aValue.Copy( 4, aValue.Len()-1 ) );
+String aColorStr( aValue.Copy( 4, aValue.Len()-5 ) );
 
 xub_StrLen nPos = 0;
 sal_uInt16 nCol = 0;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2014-02-12 Thread Stephan Bergmann
 sw/source/core/unocore/unostyle.cxx |   14 +-
 1 file changed, 1 insertion(+), 13 deletions(-)

New commits:
commit 3e17c731cbe11c79c3283ffefecf4401bd8cb08e
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Feb 11 16:31:47 2014 +0100

nPDescPos is never read

...since b48f4e99e1d2935f84bc2fac1e6670dd83939673 #86296# use page 
descriptor
only if necessary, and this nicely removes the odd

  for(i = 0; i  nPDescCount + 1; i++)

loop that read past the end of the maPageDescs vector.

(cherry picked from commit 7fb6ae28ae7bebd67c2b9bf2cf517f1f7bb2777e)
Conflicts:
sw/source/core/unocore/unostyle.cxx

Change-Id: I9b0f24231774eef7231eff4b053fd56c020c6e69
Reviewed-on: https://gerrit.libreoffice.org/8007
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/source/core/unocore/unostyle.cxx 
b/sw/source/core/unocore/unostyle.cxx
index 0e090be..1631a49 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -1589,14 +1589,12 @@ struct SwStyleBase_Impl
 SfxItemSet* pItemSet;
 
 const String   rStyleName;
-sal_uInt16  nPDescPos;
 
 SwStyleBase_Impl(SwDoc rSwDoc, const String rName) :
 rDoc(rSwDoc),
 pOldPageDesc(0),
 pItemSet(0),
-rStyleName(rName),
-nPDescPos(0x)
+rStyleName(rName)
 {}
 
 ~SwStyleBase_Impl(){ delete pItemSet; }
@@ -1625,7 +1623,6 @@ const SwPageDesc SwStyleBase_Impl::GetOldPageDesc()
 if(rDesc.GetName() == rStyleName)
 {
 pOldPageDesc =  rDesc;
-nPDescPos = i;
 break;
 }
 }
@@ -1640,15 +1637,6 @@ const SwPageDesc SwStyleBase_Impl::GetOldPageDesc()
 break;
 }
 }
-for(i = 0; i  nPDescCount + 1; i++)
-{
-const SwPageDesc rDesc = rDoc.GetPageDesc( i );
-if(rDesc.GetName() == rStyleName)
-{
-nPDescPos = i;
-break;
-}
-}
 }
 }
 return *pOldPageDesc;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2014-02-12 Thread Stephan Bergmann
 sw/source/core/unocore/unostyle.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a682fd572a2056eaaed9443bad70303879c4eec4
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Feb 11 17:28:43 2014 +0100

Do not reference a dangling OUString

(cherry picked from commit 151f3d665581d887cda1e36b817afb124c5c789e)
Conflicts:
sw/source/core/unocore/unostyle.cxx

Change-Id: I0908d1300d0d1acb515345ccbdf6cdc2bf44d6a5
Reviewed-on: https://gerrit.libreoffice.org/8008
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/source/core/unocore/unostyle.cxx 
b/sw/source/core/unocore/unostyle.cxx
index 1631a49..47b1acb 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -1588,7 +1588,7 @@ struct SwStyleBase_Impl
 rtl::Reference SwDocStyleSheet  mxNewBase;
 SfxItemSet* pItemSet;
 
-const String   rStyleName;
+String   rStyleName;
 
 SwStyleBase_Impl(SwDoc rSwDoc, const String rName) :
 rDoc(rSwDoc),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2014-01-30 Thread Michael Stahl
 sw/source/core/fields/reffld.cxx |   18 +-
 1 file changed, 13 insertions(+), 5 deletions(-)

New commits:
commit 139342a9ad5995058081a47a24818b14581735a5
Author: Michael Stahl mst...@redhat.com
Date:   Wed Jan 29 22:38:21 2014 +0100

fdo#63553: sw: fix copy/paste of cross references

If one of aIds or aDestIds contains nSeqNo then adding an identity
mapping for it will actually re-define a previous mapping.  Likely this
can only happen when clipboard document is the source.

(regression from 44f971506c0ed37928c48e55d8007f24b0c43a5f)

(also it looks like 4b0b0a5b3045902d9a6b95510ec30a3027181e29 has subtly
 changed what the else branch does when it is erroneously taken -
 results are differently wrong)

Change-Id: I34e2979e45cffeb62ebf3d7b3e5ac6d2afff0c2b
(cherry picked from commit bb665affbd8870652ade3951d626d76e99143f67)
Reviewed-on: https://gerrit.libreoffice.org/7730
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index 4c668b0..ba0e4bb 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -997,7 +997,7 @@ void _RefIdsMap::Init( SwDoc rDoc, SwDoc rDestDoc, bool 
bField )
 for ( std::setsal_uInt16::iterator pIt = aDstIds.begin(); pIt != 
aDstIds.end(); ++pIt )
 AddId( GetFirstUnusedId(aIds), *pIt );
 
-// Change the Sequence number of all the SetExp fields in the 
destination document
+// Change the Sequence number of all SetExp fields in the source 
document
 SwFieldType* pType = rDoc.GetFldType( RES_SETEXPFLD, aName, false );
 if( pType )
 {
@@ -1051,16 +1051,24 @@ void _RefIdsMap::Check( SwDoc rDoc, SwDoc rDestDoc, 
SwGetRefField rFld,
 {
 Init( rDoc, rDestDoc, bField);
 
-// dann teste mal, ob die Nummer schon vergeben ist
-// oder ob eine neue bestimmt werden muss.
 sal_uInt16 nSeqNo = rFld.GetSeqNo();
-if( aIds.count( nSeqNo )  aDstIds.count( nSeqNo ))
+
+// Check if the number is used in both documents
+// Note: For fields, aIds contains both the ids of SetExp from rDestDoc
+// and the targets of the already remapped ones from rDoc.
+// It is possible that aDstIds contains numbers that aIds does not contain!
+// For example, copying a selection to clipboard that does not contain
+// the first SwSetExpField will result in id 0 missing, then pasting that
+// into empty document gives a mapping 1-0 ... N-N-1 (fdo#63553).
+if (aIds.count(nSeqNo) || aDstIds.count(nSeqNo))
 {
 // Number already taken, so need a new one.
 if( sequencedIds.count(nSeqNo) )
 rFld.SetSeqNo( sequencedIds[nSeqNo] );
 else
 {
+assert(!bField || !aDstIds.count(nSeqNo)); // postcond of Init
+
 sal_uInt16 n = GetFirstUnusedId( aIds );
 
 // die neue SeqNo eintragen, damit die belegt ist
@@ -1082,7 +1090,7 @@ void _RefIdsMap::Check( SwDoc rDoc, SwDoc rDestDoc, 
SwGetRefField rFld,
 }
 else
 {
-AddId( nSeqNo, nSeqNo );
+AddId( nSeqNo, nSeqNo ); // this requires that nSeqNo is unused in 
both!
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2014-01-25 Thread Michael Stahl
 sw/source/core/layout/trvlfrm.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 34afdbfd9689ecfa2ea3e93cd7812d192016baf3
Author: Michael Stahl mst...@redhat.com
Date:   Fri Jan 24 23:04:03 2014 +0100

fdo#68876: sw: layout should never care about IsFirstShared()

With 75084f6c42c27dc95418df9cefed2fddfb26000e the layout should put the
first frame-format on every first-page of a page style; unfortunately
SwFrm::OnFirstPage() was not adapted with this change and that results
in various misbehaviour in the layout.

Change-Id: Ia31add0d72ca581963b7e8e40c3ea932361b7fd6
(cherry picked from commit ecf617ee0cb74526e3989500c122835c32082845)
Reviewed-on: https://gerrit.libreoffice.org/7639
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/sw/source/core/layout/trvlfrm.cxx 
b/sw/source/core/layout/trvlfrm.cxx
index fcaa4af..6d0624e 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -1909,7 +1909,7 @@ bool SwFrm::OnFirstPage() const
 if (pPrevFrm)
 {
 const SwPageDesc* pDesc = pPage-GetPageDesc();
-bRet = pPrevFrm-GetPageDesc() != pDesc  !pDesc-IsFirstShared();
+bRet = pPrevFrm-GetPageDesc() != pDesc;
 }
 else
 bRet = true;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2014-01-25 Thread Michael Stahl
 sw/source/core/docnode/ndtbl.cxx |   17 +
 1 file changed, 9 insertions(+), 8 deletions(-)

New commits:
commit d506760f7797565486c2470abbc269a446fbc3b0
Author: Michael Stahl mst...@redhat.com
Date:   Wed Jan 22 21:11:01 2014 +0100

fdo#67238: sw: fix table cell Unprotect

SwDoc::UnProtectCells() was setting the old box format (from aFmts)
instead of the new one, and actually these 2 vectors are a map.

(regression from 772101649cf16233bbaf0900aa9ebbc915151a95)

Change-Id: I0881a1c499c51b5f3c257e9def1a2e9a00bcb639
(cherry picked from commit b2f9d1b43e4b14cc48327cdce14a03c826096579)
Reviewed-on: https://gerrit.libreoffice.org/7640
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 689ac04..92f17bf 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -4460,22 +4460,23 @@ sal_Bool SwDoc::UnProtectCells( const SwSelBoxes 
rBoxes )
 ? new SwUndoAttrTbl( *rBoxes[0]-GetSttNd()-FindTableNode() )
 : 0;
 
-std::vectorSwFrmFmt* aFmts, aNewFmts;
+std::mapSwFrmFmt*, SwTableBoxFmt* aFmtsMap;
 for (size_t i = rBoxes.size(); i; )
 {
 SwTableBox* pBox = rBoxes[ --i ];
 SwFrmFmt* pBoxFmt = pBox-GetFrmFmt();
 if( pBoxFmt-GetProtect().IsCntntProtected() )
 {
-std::vectorSwFrmFmt*::iterator it = std::find( 
aFmts.begin(), aFmts.end(), pBoxFmt );
-if( aFmts.end() != it )
-pBox-ChgFrmFmt( (SwTableBoxFmt*)*it );
+std::mapSwFrmFmt*, SwTableBoxFmt*::const_iterator const it =
+aFmtsMap.find(pBoxFmt);
+if (aFmtsMap.end() != it)
+pBox-ChgFrmFmt(it-second);
 else
 {
-aFmts.push_back( pBoxFmt );
-pBoxFmt = pBox-ClaimFrmFmt();
-pBoxFmt-ResetFmtAttr( RES_PROTECT );
-aNewFmts.push_back( pBoxFmt );
+SwTableBoxFmt *const pNewBoxFmt(
+dynamic_castSwTableBoxFmt*(pBox-ClaimFrmFmt()));
+pNewBoxFmt-ResetFmtAttr( RES_PROTECT );
+aFmtsMap.insert(std::make_pair(pBoxFmt, pNewBoxFmt));
 }
 bChgd = sal_True;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2014-01-21 Thread Michael Stahl
 sw/source/core/text/txtfly.cxx|6 +++---
 sw/source/core/txtnode/fntcap.cxx |4 ++--
 sw/source/core/txtnode/swfont.cxx |8 
 3 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 7cdf5a6995a017e295e9b1099abc6dcb1987ae9e
Author: Michael Stahl mst...@redhat.com
Date:   Tue Jan 21 11:16:20 2014 +0100

fdo#68959: sw: fix painting of tab fill characters in small caps text

The member SwDrawTextInfo::pPos was changed from a pointer to some
externally provided Point to a real object; unfortunately there were
some functions which hold backups of the current pPos as a
reference/pointer and then restore it, and the restore is a no-op now.
So use real Points as backups.

(regression from f22006dc6ac34a35a060e15466cf6b2d2058617d)

Change-Id: I8470143ec494cb194a88ddcbd12d96867974278f
(cherry picked from commit c445d40da8daa2f6ec0ae9930a06f50ab80cc85d)
Reviewed-on: https://gerrit.libreoffice.org/7568
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index 54635d7..3a140b6 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -568,7 +568,7 @@ sal_Bool SwTxtFly::DrawTextOpaque( SwDrawTextInfo rInf )
 }
 
 Point aPos( rInf.GetPos().X(), rInf.GetPos().Y() + rInf.GetAscent() );
-const Point rOld = rInf.GetPos();
+const Point aOldPos(rInf.GetPos());
 rInf.SetPos( aPos );
 
 if( !bOpaque )
@@ -577,7 +577,7 @@ sal_Bool SwTxtFly::DrawTextOpaque( SwDrawTextInfo rInf )
 rInf.GetFont()-_DrawStretchText( rInf );
 else
 rInf.GetFont()-_DrawText( rInf );
-rInf.SetPos( rOld );
+rInf.SetPos(aOldPos);
 return sal_False;
 }
 else if( !aRegion.empty() )
@@ -595,7 +595,7 @@ sal_Bool SwTxtFly::DrawTextOpaque( SwDrawTextInfo rInf )
 rInf.GetFont()-_DrawText( rInf );
 }
 }
-rInf.SetPos( rOld );
+rInf.SetPos(aOldPos);
 return sal_True;
 }
 
diff --git a/sw/source/core/txtnode/fntcap.cxx 
b/sw/source/core/txtnode/fntcap.cxx
index 9735b2c..3f827f2 100644
--- a/sw/source/core/txtnode/fntcap.cxx
+++ b/sw/source/core/txtnode/fntcap.cxx
@@ -536,9 +536,9 @@ void SwSubFont::DrawStretchCapital( SwDrawTextInfo rInf )
 if( rInf.GetLen() == STRING_LEN )
 rInf.SetLen( rInf.GetText().getLength() );
 
-const Point rOldPos = rInf.GetPos();
+const Point aOldPos = rInf.GetPos();
 const sal_uInt16 nCapWidth = (sal_uInt16)( GetCapitalSize( rInf ).Width() 
);
-rInf.SetPos( rOldPos );
+rInf.SetPos(aOldPos);
 
 rInf.SetDrawSpace( GetUnderline() != UNDERLINE_NONE ||
GetOverline()  != UNDERLINE_NONE ||
diff --git a/sw/source/core/txtnode/swfont.cxx 
b/sw/source/core/txtnode/swfont.cxx
index 977b6d2..8a4ed6d 100644
--- a/sw/source/core/txtnode/swfont.cxx
+++ b/sw/source/core/txtnode/swfont.cxx
@@ -849,12 +849,12 @@ void SwSubFont::_DrawText( SwDrawTextInfo rInf, const 
sal_Bool bGrey )
 
 SwDigitModeModifier aDigitModeModifier( rInf.GetOut(), 
rInf.GetFont()-GetLanguage() );
 
+const Point aOldPos(rInf.GetPos());
 Point aPos( rInf.GetPos() );
 
 if( GetEscapement() )
 CalcEsc( rInf, aPos );
 
-const Point rOld = rInf.GetPos();
 rInf.SetPos( aPos );
 rInf.SetKern( CheckKerning() + rInf.GetSperren() / 
SPACING_PRECISION_FACTOR );
 
@@ -955,7 +955,7 @@ static sal_Char const sDoubleSpace[] =   ;
 rInf.SetLen( nOldLen );
 }
 
-rInf.SetPos( rOld );
+rInf.SetPos(aOldPos);
 }
 
 void SwSubFont::_DrawStretchText( SwDrawTextInfo rInf )
@@ -980,13 +980,13 @@ void SwSubFont::_DrawStretchText( SwDrawTextInfo rInf )
 
 rInf.ApplyAutoColor();
 
+const Point aOldPos(rInf.GetPos());
 Point aPos( rInf.GetPos() );
 
 if( GetEscapement() )
 CalcEsc( rInf, aPos );
 
 rInf.SetKern( CheckKerning() + rInf.GetSperren() / 
SPACING_PRECISION_FACTOR );
-const Point rOld = rInf.GetPos();
 rInf.SetPos( aPos );
 
 if( IsCapital() )
@@ -1038,7 +1038,7 @@ static sal_Char const sDoubleSpace[] =   ;
 rInf.SetLen( nOldLen );
 }
 
-rInf.SetPos( rOld );
+rInf.SetPos(aOldPos);
 }
 
 /*
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2014-01-15 Thread Michael Stahl
 sw/source/core/txtnode/fntcache.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 4b965b031e2196b39f20e28ce9d9fd40552753a5
Author: Michael Stahl mst...@redhat.com
Date:   Tue Jan 14 16:32:20 2014 +0100

fdo#73095: fix invalid access in SwFntObj::DrawText()

aStr may be 1 larger than pKernArray.
Trivial fix by checking the largest index; not sure if it would be a
good idea to allocate pKernArray with the larger size in the first
place, but that would be a bigger change...
(regression from 02ce734450559c9353ca7f42b2519239220dd265)

Change-Id: Ia33feab001c34e85066b7596d8873f41588984e9
(cherry picked from commit 61ec8f086ba314b86c80a02b16072e88774abf6c)
Reviewed-on: https://gerrit.libreoffice.org/7428
Reviewed-by: Michael Meeks michael.me...@collabora.com
Tested-by: Michael Meeks michael.me...@collabora.com

diff --git a/sw/source/core/txtnode/fntcache.cxx 
b/sw/source/core/txtnode/fntcache.cxx
index 0857604..42ca510 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -1535,8 +1535,11 @@ void SwFntObj::DrawText( SwDrawTextInfo rInf )
 /* fdo#72488 Hack: try to see if the space is zero width
  * and don't bother with inserting a bullet in this case.
  */
-if (pKernArray[i + nCopyStart] != pKernArray[ i + 
nCopyStart + 1])
+if ((i + nCopyStart + 1 = rInf.GetLen()) ||
+pKernArray[i + nCopyStart] != pKernArray[ i + 
nCopyStart + 1])
+{
 aStr = aStr.replaceAt(i, 1, OUString(CH_BULLET));
+}
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2014-01-07 Thread Marcos Paulo de Souza
 sw/source/core/layout/pagedesc.cxx |   11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit 63c2990d0e67e90f5445dac10c8c1f7919031482
Author: Marcos Paulo de Souza marcos.souza@gmail.com
Date:   Tue Jan 7 12:42:25 2014 -0200

Fix fdo#70807: Page Style method isInUse() broken

We need to check m_FirstMaster and m_FirstLeft too to verify is a style is 
used

Thanks a lot mst__ for pointing how to fix this!

Change-Id: Ic9c37c552893c17fba4aabcc0fd4beb7fe2550e8
Reviewed-on: https://gerrit.libreoffice.org/7295
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Olivier Hallot olivier.hal...@edx.srv.br
(cherry picked from commit 6131787afbb32e1e12aac4cf4f65625d11d39f08)
Signed-off-by: Michael Stahl mst...@redhat.com

diff --git a/sw/source/core/layout/pagedesc.cxx 
b/sw/source/core/layout/pagedesc.cxx
index 05a24d1..1f7addb 100644
--- a/sw/source/core/layout/pagedesc.cxx
+++ b/sw/source/core/layout/pagedesc.cxx
@@ -156,13 +156,16 @@ void SwPageDesc::ResetAllAttr( sal_Bool bLeft )
 |*
 */
 
-
-// gets information from Modify
+// gets information from Modify
 bool SwPageDesc::GetInfo( SfxPoolItem  rInfo ) const
 {
 if( !aMaster.GetInfo( rInfo ) )
-return false;   // found
-return aLeft.GetInfo( rInfo );
+return false;   // found
+if ( !aLeft.GetInfo( rInfo ) )
+return false ;
+if ( !m_FirstMaster.GetInfo( rInfo ) )
+return false;
+return m_FirstLeft.GetInfo( rInfo );
 }
 
 /*
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-12-28 Thread Zolnai Tamás
 sw/source/ui/misc/redlndlg.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 70f90c08592ef3e50840afda20428078c25c463a
Author: Zolnai Tamás tamas.zol...@collabora.com
Date:   Fri Dec 27 09:45:05 2013 +0100

Fix stepping to the next change

Bug description:
In the Accept or Reject Changes dialog, when select a change
(it should be after the first few ones) and clicking Accept
or Reject button, acception/rejection is made but after it
not the next change is selected for futher work,
but a random one. This bug doesn't appear in all case,
just if changes are complex enough.

Solution:
The nPos means absolute position so we have to get the next entry
with the corresponding GetEntryAtAbsPos() method. It seems simple
position can differ from absolute positions if changes are
complex enough.

Change-Id: I7996f81c2a09c492f9334f071591291d200d533f
(cherry picked from commit dbd8a631bb23c588f52102e5dd2a61c9cd854bc3)
Reviewed-on: https://gerrit.libreoffice.org/7209
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/source/ui/misc/redlndlg.cxx b/sw/source/ui/misc/redlndlg.cxx
index 7885bb4..f1cc96d 100644
--- a/sw/source/ui/misc/redlndlg.cxx
+++ b/sw/source/ui/misc/redlndlg.cxx
@@ -830,9 +830,9 @@ void SwRedlineAcceptDlg::CallAcceptReject( sal_Bool 
bSelect, sal_Bool bAccept )
 {
 if( nPos = pTable-GetEntryCount() )
 nPos = pTable-GetEntryCount() - 1;
-pEntry = pTable-GetEntry( nPos );
+pEntry = pTable-GetEntryAtAbsPos( nPos );
 if( !pEntry  nPos-- )
-pEntry = pTable-GetEntry( nPos );
+pEntry = pTable-GetEntryAtAbsPos( nPos );
 if( pEntry )
 {
 pTable-Select( pEntry );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-12-23 Thread Khaled Hosny
 sw/source/core/text/EnhancedPDFExportHelper.cxx |   11 +--
 sw/source/core/text/txthyph.cxx |   12 ++--
 2 files changed, 11 insertions(+), 12 deletions(-)

New commits:
commit 158027cd7fe1ea2faeb5d2220547b36c9cbfb9d3
Author: Khaled Hosny khaledho...@eglug.org
Date:   Sun Dec 22 01:02:19 2013 +0200

fdo#67370: Hyphens are not visible in tagged PDF

One requirement of tagged PDF is to represent automatically inserted
hyphens using the soft hyphen (U+00AD) character, so we were doing this
by simply passing that character to text layout code when exporting a
tagged PDF (which is the literal suggestion of old PDF specification).

This is wrong, though, since the soft hyphen is a control character and
should not have a visible output by itself (and fonts might not even
have a visible glyph there), but this happened to work because non of
the layout engines we are using treated soft hyphen specially and was
just showing whatever glyph the font had there. This broke with the
switch to HarfBuzz since it will not show any visible glyph for Unicode
control characters (by default), which is the right thing to do.

Latest versions of PDF spec suggest using either ToUnicode mapping or an
ActualText text entry to encode the soft hyphen instead, I found it
easier to use ActualText since we already have code that handles
non-standard hyphenation using it already.

Conflicts:
sw/source/core/text/EnhancedPDFExportHelper.cxx
sw/source/core/text/txthyph.cxx

Change-Id: I88deadf3a806f69775b2e0ccff2f9b2f61a0f2e2
Reviewed-on: https://gerrit.libreoffice.org/7177
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx 
b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index 3933837..9538de6 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -766,7 +766,8 @@ void SwTaggedPDFHelper::SetAttributes( 
vcl::PDFWriter::StructElement eType )
 case vcl::PDFWriter::Span :
 case vcl::PDFWriter::Quote :
 case vcl::PDFWriter::Code :
-if( POR_HYPHSTR == pPor-GetWhichPor() || POR_SOFTHYPHSTR == 
pPor-GetWhichPor() )
+if( POR_HYPHSTR == pPor-GetWhichPor() || POR_SOFTHYPHSTR == 
pPor-GetWhichPor() ||
+POR_HYPH == pPor-GetWhichPor() || POR_SOFTHYPH == 
pPor-GetWhichPor() )
 bActualText = true;
 else
 {
@@ -789,7 +790,11 @@ void SwTaggedPDFHelper::SetAttributes( 
vcl::PDFWriter::StructElement eType )
 
 if ( bActualText )
 {
-const String aActualTxt( rInf.GetTxt(), rInf.GetIdx(), 
pPor-GetLen() );
+String aActualTxt;
+if (pPor-GetWhichPor() == POR_SOFTHYPH || pPor-GetWhichPor() == 
POR_HYPH)
+aActualTxt = (sal_Unicode)0xad; // soft hyphen
+else
+aActualTxt = String(rInf.GetTxt(), rInf.GetIdx(), 
pPor-GetLen());
 mpPDFExtOutDevData-SetActualText( aActualTxt );
 }
 
@@ -1373,6 +1378,8 @@ void SwTaggedPDFHelper::BeginInlineStructureElements()
 
 switch ( pPor-GetWhichPor() )
 {
+case POR_HYPH :
+case POR_SOFTHYPH :
 // Check for alternative spelling:
 case POR_HYPHSTR :
 case POR_SOFTHYPHSTR :
diff --git a/sw/source/core/text/txthyph.cxx b/sw/source/core/text/txthyph.cxx
index 62b3ad4..6b32a9f 100644
--- a/sw/source/core/text/txthyph.cxx
+++ b/sw/source/core/text/txthyph.cxx
@@ -20,7 +20,6 @@
 #include hintids.hxx
 #include editeng/unolingu.hxx
 #include com/sun/star/i18n/WordType.hpp
-#include EnhancedPDFExportHelper.hxx
 #include viewopt.hxx  // SwViewOptions
 #include viewsh.hxx
 #include SwPortionHandler.hxx
@@ -370,16 +369,9 @@ sal_Bool SwTxtPortion::CreateHyphen( SwTxtFormatInfo 
rInf, SwTxtGuess rGuess )
  *  virtual SwHyphPortion::GetExpTxt()
  */
 
-sal_Bool SwHyphPortion::GetExpTxt( const SwTxtSizeInfo rInf, OUString rTxt ) 
const
+sal_Bool SwHyphPortion::GetExpTxt( const SwTxtSizeInfo /*rInf*/, OUString 
rTxt ) const
 {
-// #i16816# tagged pdf support
-const sal_Unicode cChar = rInf.GetVsh() 
-  rInf.GetVsh()-GetViewOptions()-IsPDFExport() 
-  SwTaggedPDFHelper::IsExportTaggedPDF( 
*rInf.GetOut() ) ?
-  0xad :
-  '-';
-
-rTxt = OUString(cChar);
+rTxt = -;
 return sal_True;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-12-21 Thread Michael Stahl
 sw/source/core/doc/docdesc.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e839c779a1a6b5a80d5e7368c457ba9620ecd6bb
Author: Michael Stahl mst...@redhat.com
Date:   Fri Dec 20 11:24:48 2013 +0100

fdo#70232: sw: brown paper-bag fix for header sharing mangling footers

Stupid copy/paste error in SwDoc::CopyMasterFooter() checks
IsHeaderShared().

(regression from e1a9a348a519a69f898c9c1e6d87a5837b8267f9)

Change-Id: I0c0bc16a8c581cd05ed206a0de79c7983204165b
(cherry picked from commit 94c772adc2e8d8af468f3996527c84bf7704103f)
Reviewed-on: https://gerrit.libreoffice.org/7154
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index bb1d78f..7bbecfa 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -259,7 +259,7 @@ void SwDoc::CopyMasterFooter(const SwPageDesc rChged, 
const SwFmtFooter rFoot,
 // The CntntIdx is _always_ different when called from
 // SwDocStyleSheet::SetItemSet, because it deep-copies the
 // PageDesc.  So check if it was previously shared.
- ((bLeft) ? pDesc-IsHeaderShared() : pDesc-IsFirstShared()))
+ ((bLeft) ? pDesc-IsFooterShared() : pDesc-IsFirstShared()))
 {
 SwFrmFmt *pFmt = new SwFrmFmt( GetAttrPool(), (bLeft ? Left 
footer : First footer),
 GetDfltFrmFmt() );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-12-21 Thread Michael Stahl
 sw/source/core/undo/SwUndoPageDesc.cxx |   42 +
 1 file changed, 42 insertions(+)

New commits:
commit e94ab5aad124b888d524033abeaf212696779067
Author: Michael Stahl mst...@redhat.com
Date:   Fri Dec 20 21:24:37 2013 +0100

fdo#71429: sw: fix crashes when changing header first sharing

Copy some nutso code in SwUndoPageDesc::ExchangeContentNodes() to
work on the un-shared First header/footer too, which apparently avoids
the crash.  It's not like Undo of header/footer isn't already a
house of cards anyway.

Change-Id: Ie6593c4784ce9d368a5098ffb3aa4dec536d250e
(cherry picked from commit 899538a155b0d58f3a864dbc26d0dc7c37386807)
Reviewed-on: https://gerrit.libreoffice.org/7159
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/sw/source/core/undo/SwUndoPageDesc.cxx 
b/sw/source/core/undo/SwUndoPageDesc.cxx
index b60c18b..5246c6f 100644
--- a/sw/source/core/undo/SwUndoPageDesc.cxx
+++ b/sw/source/core/undo/SwUndoPageDesc.cxx
@@ -248,6 +248,27 @@ void SwUndoPageDesc::ExchangeContentNodes( SwPageDesc 
rSource, SwPageDesc rDes
 pNewFmt-SetFmtAttr( SwFmtCntnt() );
 delete pNewItem;
 }
+if (!rDest.IsFirstShared())
+{
+// Same procedure for unshared header..
+const SwFmtHeader rSourceFirstMasterHead = 
rSource.GetFirstMaster().GetHeader();
+rDest.GetFirstMaster().GetAttrSet().GetItemState( RES_HEADER, 
sal_False, pItem );
+pNewItem = pItem-Clone();
+pNewFmt = ((SwFmtHeader*)pNewItem)-GetHeaderFmt();
+#if OSL_DEBUG_LEVEL  1
+const SwFmtCntnt rSourceCntnt1 = 
rSourceFirstMasterHead.GetHeaderFmt()-GetCntnt();
+(void)rSourceCntnt1;
+const SwFmtCntnt rDestCntnt1 = 
rDest.GetFirstMaster().GetHeader().GetHeaderFmt()-GetCntnt();
+(void)rDestCntnt1;
+#endif
+pNewFmt-SetFmtAttr( 
rSourceFirstMasterHead.GetHeaderFmt()-GetCntnt() );
+delete pNewItem;
+rSource.GetFirstMaster().GetAttrSet().GetItemState( RES_HEADER, 
sal_False, pItem );
+pNewItem = pItem-Clone();
+pNewFmt = ((SwFmtHeader*)pNewItem)-GetHeaderFmt();
+pNewFmt-SetFmtAttr( SwFmtCntnt() );
+delete pNewItem;
+}
 }
 // Same procedure for footers...
 const SwFmtFooter rDestFoot = rDest.GetMaster().GetFooter();
@@ -294,6 +315,27 @@ void SwUndoPageDesc::ExchangeContentNodes( SwPageDesc 
rSource, SwPageDesc rDes
 pNewFmt-SetFmtAttr( SwFmtCntnt() );
 delete pNewItem;
 }
+if (!rDest.IsFirstShared())
+{
+const SwFmtFooter rSourceFirstMasterFoot = 
rSource.GetFirstMaster().GetFooter();
+#if OSL_DEBUG_LEVEL  1
+const SwFmtCntnt rFooterSourceCntnt2 = 
rSourceFirstMasterFoot.GetFooterFmt()-GetCntnt();
+const SwFmtCntnt rFooterDestCntnt2 =
+rDest.GetFirstMaster().GetFooter().GetFooterFmt()-GetCntnt();
+(void)rFooterSourceCntnt2;
+(void)rFooterDestCntnt2;
+#endif
+rDest.GetFirstMaster().GetAttrSet().GetItemState( RES_FOOTER, 
sal_False, pItem );
+pNewItem = pItem-Clone();
+pNewFmt = ((SwFmtFooter*)pNewItem)-GetFooterFmt();
+pNewFmt-SetFmtAttr( 
rSourceFirstMasterFoot.GetFooterFmt()-GetCntnt() );
+delete pNewItem;
+rSource.GetFirstMaster().GetAttrSet().GetItemState( RES_FOOTER, 
sal_False, pItem );
+pNewItem = pItem-Clone();
+pNewFmt = ((SwFmtFooter*)pNewItem)-GetFooterFmt();
+pNewFmt-SetFmtAttr( SwFmtCntnt() );
+delete pNewItem;
+}
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-12-10 Thread Michael Stahl
 sw/source/core/doc/docfld.cxx |3 ++-
 sw/source/filter/html/htmlfld.cxx |5 +++--
 2 files changed, 5 insertions(+), 3 deletions(-)

New commits:
commit f0d031c19c45d680b3d468c58a912da2a3ce4c78
Author: Michael Stahl mst...@redhat.com
Date:   Mon Dec 9 21:45:16 2013 +0100

fdo#70198: sw: don't truncate Time values on 32bit platforms

SwDoc::SetFixFields() uses sal_uLong to store Time.GetTime() which needs
64 bits.

Also fix same problem on Time fields in HTML import.

(regression from 9830fd36dbdb72c79703b0c61efc027fba793c5a)

(cherry picked from commit 17dab5bf8efb3fd676e6854474b199b681d0dc28)

Conflicts:
sw/source/filter/html/htmlfld.cxx

Change-Id: I5d0388cbc364e1f9dfb60ff9e83c7d2f101c69d8
Reviewed-on: https://gerrit.libreoffice.org/7020
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index a78a592..941e79b 100644
--- a/sw/source/core/doc/docfld.cxx
+++ b/sw/source/core/doc/docfld.cxx
@@ -1982,7 +1982,8 @@ void SwDoc::SetFixFields( bool bOnlyTimeDate, const 
DateTime* pNewDateTime )
 {
 sal_Bool bIsModified = IsModified();
 
-sal_uLong nDate, nTime;
+sal_Int32 nDate;
+sal_Int64 nTime;
 if( pNewDateTime )
 {
 nDate = pNewDateTime-GetDate();
diff --git a/sw/source/filter/html/htmlfld.cxx 
b/sw/source/filter/html/htmlfld.cxx
index 3213bfc..bcf06da 100644
--- a/sw/source/filter/html/htmlfld.cxx
+++ b/sw/source/filter/html/htmlfld.cxx
@@ -327,7 +327,8 @@ void SwHTMLParser::NewField()
 case RES_TIMEFLD:
 {
 sal_uLong nNumFmt = 0;
-sal_uLong nTime = Time( Time::SYSTEM ).GetTime(), nDate = Date( 
Date::SYSTEM ).GetDate();
+sal_Int64 nTime = Time( Time::SYSTEM ).GetTime();
+sal_Int32 nDate = Date( Date::SYSTEM ).GetDate();
 sal_uInt16 nSub = 0;
 sal_Bool bValidFmt = sal_False;
 HTMLNumFmtTblEntry * pFmtTbl;
@@ -337,7 +338,7 @@ void SwHTMLParser::NewField()
 nSub = DATEFLD;
 pFmtTbl = aHTMLDateFldFmtTable;
 if( aValue.Len() )
-nDate = (sal_uLong)aValue.ToInt32();
+nDate = aValue.ToInt32();
 }
 else
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-12-09 Thread Khaled Hosny
 sw/source/core/txtnode/fntcache.cxx |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit b79b4b88c5eb6b0fe4092b5eb98f3088f316f7b2
Author: Khaled Hosny khaledho...@eglug.org
Date:   Sun Dec 8 22:30:28 2013 +0200

fdo#72488: Broken text when showing visible space

Turning on showing nonprinting characters replaces the space with bullet
character, but still draws the text with the original kern array, this
works fine until there are ligatures involving the space character as
the number of glyphs after replacing the space with the bullet will be
different and the kern array will be completely off.

This is a hack that gives up on replacing the space with a bullet when
its width is zero, not sure if it would interfere with other legitimate
uses.

Change-Id: I3803a2097b7c9dab1fb53b24404e8550c5bf537e
Reviewed-on: https://gerrit.libreoffice.org/7005
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/source/core/txtnode/fntcache.cxx 
b/sw/source/core/txtnode/fntcache.cxx
index 80b2ea8..0857604 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -1531,7 +1531,13 @@ void SwFntObj::DrawText( SwDrawTextInfo rInf )
 
 for( sal_Int32 i = 0; i  aStr.getLength(); ++i )
 if( CH_BLANK == aStr[ i ] )
-aStr = aStr.replaceAt(i, 1, OUString(CH_BULLET));
+{
+/* fdo#72488 Hack: try to see if the space is zero width
+ * and don't bother with inserting a bullet in this case.
+ */
+if (pKernArray[i + nCopyStart] != pKernArray[ i + 
nCopyStart + 1])
+aStr = aStr.replaceAt(i, 1, OUString(CH_BULLET));
+}
 }
 
 xub_StrLen nCnt = rInf.GetText().getLength();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-12-06 Thread Michael Stahl
 sw/source/core/frmedt/fecopy.cxx |   23 ++-
 1 file changed, 10 insertions(+), 13 deletions(-)

New commits:
commit 640e8abbff03f7f242c0c0b9d73ffd2eda3c4e35
Author: Michael Stahl mst...@redhat.com
Date:   Thu Dec 5 21:58:11 2013 +0100

fdo#71892: sw: fix crash when pasting table in footnote

The code that updates RSIDs assumes that the number of nodes copied is
the same as the number of nodes inserted, which is not true when pasting
a table into a footnote because Writer can't do that, hence all table
nodes are missing.  Count inserted nodes instead.

(regression from 062eaeffe7cb986255063bb9b0a5f3fb3fc8e34c)

(cherry picked from commit 4580094d2d9d5b952c4526ee23204f75a5bb2f1b)

Conflicts:
sw/source/core/frmedt/fecopy.cxx

(cherry picked from commit 2171fff4c1a57ede8f9693d7c0d95c1171a49a70)

Change-Id: I77b5b7751d1036a6401f708532537d874969502e
Reviewed-on: https://gerrit.libreoffice.org/6951
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index 3fa4a73..6c503dc 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -1039,25 +1039,22 @@ sal_Bool SwFEShell::Paste( SwDoc* pClpDoc, sal_Bool 
bIncludingPageFrames )
 aIndexBefore--;
 
 pClpDoc-CopyRange( aCpyPam, rInsPos, false );
+// Note: aCpyPam is invalid now
 
-{
-++aIndexBefore;
-SwPaM aPaM(SwPosition(aIndexBefore),
-   SwPosition(rInsPos.nNode));
+++aIndexBefore;
+SwPaM aPaM(SwPosition(aIndexBefore),
+   SwPosition(rInsPos.nNode));
 
-aPaM.GetDoc()-MakeUniqueNumRules(aPaM);
-}
-}
+aPaM.GetDoc()-MakeUniqueNumRules(aPaM);
 
-// Update the rsid of each pasted text node.
-{
-xub_StrLen nNodesCnt = aCpyPam.End()-nNode.GetIndex() - 
aCpyPam.Start()-nNode.GetIndex();
+// Update the rsid of each pasted text node.
 SwNodes rDestNodes = GetDoc()-GetNodes();
-xub_StrLen nDestStart = PCURCRSR-GetPoint()-nNode.GetIndex() 
- nNodesCnt;
+sal_uLong const nEndIdx = aPaM.End()-nNode.GetIndex();
 
-for ( sal_uInt64 nIdx = 0; nIdx = nNodesCnt; nIdx++ )
+for (sal_uLong nIdx = aPaM.Start()-nNode.GetIndex();
+nIdx = nEndIdx; ++nIdx)
 {
-SwTxtNode *pTxtNode = rDestNodes[ nDestStart + nIdx 
]-GetTxtNode();
+SwTxtNode *const pTxtNode = rDestNodes[nIdx]-GetTxtNode();
 if ( pTxtNode )
 {
 GetDoc()-UpdateParRsid( pTxtNode );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-12-05 Thread Caolán McNamara
 sw/source/core/access/accmap.cxx |   14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

New commits:
commit 1405c123157406e601adbea2c5f13e62c70f0ede
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Dec 4 13:10:16 2013 +

Relater: rhbz#903281 NULL follow frames on drag/drop

Change-Id: I50319fb218518edd23ff8c859c355265595050d6
(cherry picked from commit f141505929c95c97ae4765d7c7221f07e41ef8e7)
Reviewed-on: https://gerrit.libreoffice.org/6926
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com

diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index 5435961..5b81a26 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -747,12 +747,18 @@ static bool AreInSameTable( const uno::Reference 
XAccessible  rAcc,
 if( pAccImpl-GetFrm()-IsCellFrm() )
 {
 const SwTabFrm *pTabFrm1 = pAccImpl-GetFrm()-FindTabFrm();
-while( pTabFrm1-GetFollow() )
-   pTabFrm1 = pTabFrm1-GetFollow();
+if (pTabFrm1)
+{
+while (pTabFrm1-GetFollow())
+pTabFrm1 = pTabFrm1-GetFollow();
+}
 
 const SwTabFrm *pTabFrm2 = pFrm-FindTabFrm();
-while( pTabFrm2-GetFollow() )
-   pTabFrm2 = pTabFrm2-GetFollow();
+if (pTabFrm2)
+{
+while (pTabFrm2-GetFollow())
+pTabFrm2 = pTabFrm2-GetFollow();
+}
 
 bRet = (pTabFrm1 == pTabFrm2);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-12-03 Thread Michael Stahl
 sw/source/filter/ww8/ww8par.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6dfc6b717b5e625cbc48c856b73573719c511c8a
Author: Michael Stahl mst...@redhat.com
Date:   Mon Dec 2 22:20:25 2013 +0100

fdo#71749: sw: WW8: don't loop on tables in footnotes

(regression from ee1db992b98378b5e2f5e9aa8af0e36c375e582f)

Change-Id: Id10b6fb8e9e3697b10a1df605cb48d94a55ad207
(cherry picked from commit 790896d9a557d34ea91d6e5926471de66503be7a)
Reviewed-on: https://gerrit.libreoffice.org/6905
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index bf5bea0..223de68 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2383,7 +2383,7 @@ bool SwWW8ImplReader::ProcessSpecial(bool rbReSync, 
WW8_CP nStartCp)
 pPlcxMan-GetPap()-Restore( aSave );
 }
 }
-} while (nInTable  nCellLevel);
+} while (!bFtnEdn  (nInTable  nCellLevel));
 return bTableRowEnd;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-11-25 Thread Julien Nabet
 sw/source/core/text/itrcrsr.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 509f1f456d6a7d3ec3aca6620a8a3c1302045c6b
Author: Julien Nabet serval2...@yahoo.fr
Date:   Sun Nov 17 17:48:31 2013 +0100

Resolves: fdo#67263 CRASH when deleting applied bulleted paragraph style

Change-Id: I70dc18363480e6c07577a93279ddd083631f6cc3
Reviewed-on: https://gerrit.libreoffice.org/6702
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com
(cherry picked from commit 899c5ea9dc3c34892edfde642510514779132910)
Reviewed-on: https://gerrit.libreoffice.org/6755
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com

diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index 3befea2..3891390 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -139,7 +139,7 @@ namespace {
 {
 bool bRet( false );
 
-if ( rTxtNode.AreListLevelIndentsApplicable() )
+if ( rTxtNode.GetNumRule()  rTxtNode.AreListLevelIndentsApplicable() 
)
 {
 const SwNumFmt rNumFmt =
 rTxtNode.GetNumRule()-Get( 
static_castsal_uInt16(rTxtNode.GetActualListLevel()) );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-11-20 Thread Arnaud Versini
 sw/source/core/layout/anchoredobject.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 394a1ee9a0f5438bda41cbf4ecf065b9b278b4c4
Author: Arnaud Versini arnaud.vers...@libreoffice.org
Date:   Tue Nov 19 12:36:33 2013 +0100

Writer : Fix fdo#71694 by clearing old anchor frame before setting new

Needed as otherwise AnchoredObjects can be in more than one SwLayoutFrm.
See also 7eae50f9ff5877ef880be9a85d3f7e52b1fec49f ( Access by 
AnchoredObject of a deleted SwLayoutFrm ).

Change-Id: I54582d6f9fb8b6f853352af27706faabe610874b
Reviewed-on: https://gerrit.libreoffice.org/6720
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com
(cherry picked from commit 7726339a648ac94bb7c365950f23dabec5aa52e7)
Reviewed-on: https://gerrit.libreoffice.org/6732
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com

diff --git a/sw/source/core/layout/anchoredobject.cxx 
b/sw/source/core/layout/anchoredobject.cxx
index 77cf548..9e6dc5e 100644
--- a/sw/source/core/layout/anchoredobject.cxx
+++ b/sw/source/core/layout/anchoredobject.cxx
@@ -246,8 +246,9 @@ void SwAnchoredObject::ResetLastCharRectHeight()
 // 
=
 void SwAnchoredObject::SetVertPosOrientFrm( const SwLayoutFrm 
_rVertPosOrientFrm )
 {
-mpVertPosOrientFrm = _rVertPosOrientFrm;
+ClearVertPosOrientFrm();
 
+mpVertPosOrientFrm = _rVertPosOrientFrm;
 const_castSwLayoutFrm*(mpVertPosOrientFrm)-SetVertPosOrientFrmFor(this);
 
 // #i28701# - take over functionality of deleted method
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-11-02 Thread Caolán McNamara
 sw/source/core/layout/wsfrm.cxx |   11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

New commits:
commit c5112b0ab7c97a092981fe0d1a6c8bf37931b53e
Author: Caolán McNamara caol...@redhat.com
Date:   Thu Oct 31 10:08:46 2013 +

Resolves: fdo#70358 crash when deleting tables

Change-Id: I87282e363425a1bb6d9ab92e07717f66ee56a6c5
(cherry picked from commit e8e12b32ae23ee9b1613ef7794b83adbde27e9f8)
Reviewed-on: https://gerrit.libreoffice.org/6509
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com

diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index de45f50..007de68 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -2650,8 +2650,15 @@ SwTwips SwLayoutFrm::ShrinkFrm( SwTwips nDist, sal_Bool 
bTst, sal_Bool bInfo )
 {
 _InvalidateAll();
 InvalidatePage( pPage );
-const SvxGraphicPosition ePos = 
GetFmt()-GetBackground().GetGraphicPos();
-if ( GPOS_NONE != ePos  GPOS_TILED != ePos )
+bool bCompletePaint = true;
+const SwFrmFmt* pFmt = GetFmt();
+if (pFmt)
+{
+const SvxGraphicPosition ePos = 
pFmt-GetBackground().GetGraphicPos();
+if ( GPOS_NONE == ePos || GPOS_TILED == ePos )
+bCompletePaint = false;
+}
+if (bCompletePaint)
 SetCompletePaint();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-10-29 Thread Caolán McNamara
 sw/source/core/text/portxt.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 66edf3c164176180c15dc768ce2b4518a9178183
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Oct 29 10:58:18 2013 +

Resolves: fdo#69510 don't access beyond end of string

Change-Id: Ib5d60159ad75791371a7805ef8e211a4010d7608
(cherry picked from commit 47690627565bec866ea2de74b5504160479cff74)
Reviewed-on: https://gerrit.libreoffice.org/6472
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com

diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index 7dff0bd..fd04016 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -160,7 +160,8 @@ static sal_Int32 lcl_AddSpace( const SwTxtSizeInfo rInf, 
const OUString* pStr,
 if ( bDoNotAddSpace )
 return nCnt;
 
-for ( ; nPos  nEnd; ++nPos )
+sal_Int32 nTxtEnd = std::min(nEnd, pStr-getLength());
+for ( ; nPos  nTxtEnd; ++nPos )
 {
 if( CH_BLANK == (*pStr)[ nPos ] )
 ++nCnt;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-10-29 Thread Caolán McNamara
 sw/source/ui/docvw/edtwin.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 46d4789bdf14208d927d58e7a871cb14c8c7f917
Author: Caolán McNamara caol...@redhat.com
Date:   Thu Oct 24 10:19:36 2013 +0100

Resolves: fdo#70571 don't crash when clicking link in toc

when link is in a toc, and Cursor in protected areas is
disabled, causing the cursor to leap before the toc
before trying to see what's under the cursor in order
to jump to it

Change-Id: Iaf348e3621df02628b4d2ac8c1165df7082237ed
(cherry picked from commit e9ce405103036b2fa0ae26d331a6cfc3465de10b)
Reviewed-on: https://gerrit.libreoffice.org/6416
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com

diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index 6e208f0..3dd87c0 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -4368,7 +4368,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent rMEvt)
 }
 else
 {
-if ( bExecHyperlinks )
+if ( bExecHyperlinks  aCntntAtPos.aFnd.pAttr 
)
 rSh.ClickToINetAttr( 
*(SwFmtINetFmt*)aCntntAtPos.aFnd.pAttr, nFilter );
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-10-14 Thread Michael Stahl
 sw/source/ui/shells/textsh1.cxx |   16 +++-
 1 file changed, 11 insertions(+), 5 deletions(-)

New commits:
commit 02a4d733ef24f4350f65179f46d144de7b948799
Author: Michael Stahl mst...@redhat.com
Date:   Fri Oct 11 18:36:47 2013 +0200

fdo#67796: sw: fix table cursor when setting language in status bar

Unfortunately it turns out that the neat hack in commit
b227a8e4d65e4bbfe991aed9342fe3e30eca8639 does not work unless something
actually _deletes_ the current m_pTblCrsr between Push() and Pop(),
e.g. by calling SwCrsrShell::ClearMark() or KillPams().

It would be possible to do some invalidation of m_pTblCrsr in
SwCrsrShell::ClearUpCrsrs() or UpdateCrsr(), to set it's bChg flag
or perhaps call ParkTblCrsr(); not sure if doing that is an improvement;
certainly it shouldn't be tried in a 4.0.6 backport.

So work around the problem locally in SwTextShell::Execute().

Conflicts:
sw/source/ui/shells/textsh1.cxx

(cherry picked from commit 9533e01713c0170bdae030429de38756d9c5ca74)

Change-Id: I2981506b3065e824532deda28d21dad4a5734a8c
Reviewed-on: https://gerrit.libreoffice.org/6212
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx
index 25976e9..b019604 100644
--- a/sw/source/ui/shells/textsh1.cxx
+++ b/sw/source/ui/shells/textsh1.cxx
@@ -328,8 +328,6 @@ void SwTextShell::Execute(SfxRequest rReq)
 rWrtSh.StartAction();
 // prevent view from jumping because of (temporary) selection 
changes
 rWrtSh.LockView( sal_True );
-// save selection for later restoration
-rWrtSh.Push();
 
 // setting the new language...
 if (aNewLangTxt.Len()  0)
@@ -369,6 +367,12 @@ void SwTextShell::Execute(SfxRequest rReq)
 bForSelection = false;
 }
 
+if (bForParagraph || !bForSelection)
+{
+rWrtSh.Push(); // save selection for later restoration
+rWrtSh.ClearMark(); // fdo#67796: invalidate table crsr
+}
+
 if (bForParagraph)
 SwLangHelper::SelectCurrentPara( rWrtSh );
 
@@ -383,10 +387,12 @@ void SwTextShell::Execute(SfxRequest rReq)
 SwLangHelper::ResetLanguages( rWrtSh, bForSelection );
 else
 SwLangHelper::SetLanguage( rWrtSh, aNewLangTxt, 
bForSelection, aCoreSet );
-}
 
-// restore selection...
-rWrtSh.Pop( sal_False );
+if (bForParagraph || !bForSelection)
+{
+rWrtSh.Pop(false); // restore selection...
+}
+}
 
 rWrtSh.LockView( sal_False );
 rWrtSh.EndAction();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-10-14 Thread Michael Stahl
 sw/source/core/crsr/findtxt.cxx |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 386d0c5d663fe50295be3714977a54b86212f766
Author: Michael Stahl mst...@redhat.com
Date:   Sat Oct 12 01:53:51 2013 +0200

fdo#64495: sw: fix regex search for soft hyphen \xAD

The problem is that the soft hyphen apparently needs special handling,
and SwPaM::DoSearch() looked for the no longer supported legacy syntax,
not for any of the unicode character syntax that ICU regex supports.

Change-Id: I754296d2cf9286242e083cc7906ce3b8fda78dd5
(cherry picked from commit dca5163b6ef206ceb1f2d56feb7546c1929afe60)
Reviewed-on: https://gerrit.libreoffice.org/6229
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index cb6ec35..eb66500 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -420,9 +420,14 @@ bool SwPaM::DoSearch( const SearchOptions rSearchOpt, 
utl::TextSearch rSTxt,
 bool bRemoveSoftHyphens = true;
 if ( bRegSearch )
 {
-const OUString a00AD(\\x00AD);
-if ( -1 != rSearchOpt.searchString.indexOf( a00AD ) )
+if (   -1 != rSearchOpt.searchString.indexOf(\\xAD)
+|| -1 != rSearchOpt.searchString.indexOf(\\x{00AD})
+|| -1 != rSearchOpt.searchString.indexOf(\\u00AD)
+|| -1 != rSearchOpt.searchString.indexOf(\\U00AD)
+|| -1 != rSearchOpt.searchString.indexOf(\\N{SOFT HYPHEN}))
+{
  bRemoveSoftHyphens = false;
+}
 }
 else
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-10-14 Thread Michael Stahl
 sw/source/core/crsr/findtxt.cxx |   16 
 1 file changed, 16 deletions(-)

New commits:
commit a6e066e3aa1fdf0e9001e4721171b523ac39d8d8
Author: Michael Stahl mst...@redhat.com
Date:   Sat Oct 12 01:54:37 2013 +0200

sw: fix regex search/replace of $ in selection

SwView::Replace() nowadays first searches for the to-be-replaced text in
the current selection, which does not work in the corner case of $
when the selection starts at end of a paragraph, as it will when
clicking Find to look for $ and then clicking Replace.

The problem is that there is some antique code in SwPaM::Find() to
move the cursor forward if it's at the end of a paragraph, which is
presumably some pointless micro-optimization; the result is that
Replace does not replace the selected paragraph break but the
one in the following paragraph.

(regression from 68a014dbca8bbd25056f75ef551fb81a0dbfb1b7)

Conflicts:
sw/source/core/crsr/findtxt.cxx

(cherry picked from commit b60ce8465c8f01242354abccebe00742d164af60)

Change-Id: I5aae9c272d102a48166c63e01775dc6322f9f02d
Reviewed-on: https://gerrit.libreoffice.org/6230
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index eb66500..f4d3408 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -226,22 +226,6 @@ sal_uInt8 SwPaM::Find( const SearchOptions rSearchOpt, 
sal_Bool bSearchInNotes
 SwNodeIndex rNdIdx = pPam-GetPoint()-nNode;
 SwIndex rCntntIdx = pPam-GetPoint()-nContent;
 
-// If a beginning/end, from out of node; stop if empty node
-if( bSrchForward
-? ( rCntntIdx.GetIndex() == pPam-GetCntntNode()-Len() 
-rCntntIdx.GetIndex() )
-: !rCntntIdx.GetIndex()  pPam-GetCntntNode()-Len() )
-{
-if( !(*fnMove-fnNds)( rNdIdx, sal_False ))
-{
-delete pPam;
-return sal_False;
-}
-SwCntntNode *pNd = rNdIdx.GetNode().GetCntntNode();
-xub_StrLen nTmpPos = bSrchForward ? 0 : pNd-Len();
-rCntntIdx.Assign( pNd, nTmpPos );
-}
-
 // If bFound is true then the string was found and is between nStart and 
nEnd
 sal_Bool bFound = sal_False;
 // start position in text or initial position
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-10-11 Thread Arnaud Versini
 sw/source/core/doc/docedt.cxx |   12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

New commits:
commit ca83560f3079289df88dd7df7c00917efbd72dc0
Author: Arnaud Versini arnaud.vers...@libreoffice.org
Date:   Mon Oct 7 21:09:26 2013 +0200

fdo#70143: fix SwDoc::ReplaceRangeImpl()

Fix fdo#70143 by reporting swaping of positions

(regression from 6b08fe833186a04f9aef698a540d3a7493ac4519,
which changed SwUndoReplace::Impl::SetEnd to use the wrongly set end
position in rPam)

Change-Id: I14c6f58bc5c1418c69eb565d42f1829856eed58c
(cherry picked from commit 9685d20f2a0526a4c454cea1bd947eccbaeefa84)

Fixes regex replace of $ with nothing (to delete line
breaks).

Change-Id: If7ec1e5f524f7bb308a2949ace16cb8aa6989106
(cherry picked from commit f011a5c5071ed4a60f0ee7117608b72cecbb958d)
Reviewed-on: https://gerrit.libreoffice.org/6175
Reviewed-by: Arnaud Versini arnaud.vers...@libreoffice.org
Tested-by: Caolán McNamara caol...@redhat.com
Reviewed-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index f169ae5..b0794e6 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -2442,17 +2442,23 @@ SetRedlineMode( eOld );
 }
 }
 
-*rPam.GetMark() = *aDelPam.GetMark();
-
+*rPam.GetPoint() = *aDelPam.GetMark();
 ++aPtNd;
 rPam.GetMark()-nNode = aPtNd;
 rPam.GetMark()-nContent.Assign( aPtNd.GetNode().GetCntntNode(),
 nPtCnt );
 
-if (bJoinTxt  !bJoinPrev)
+if (bJoinTxt)
 {
+assert(rPam.GetPoint() == rPam.End());
+// move so that SetEnd remembers position after sw_JoinText
 rPam.Move(fnMoveBackward);
 }
+else if (aDelPam.GetPoint() == pStt) // backward selection?
+{
+assert(*rPam.GetMark() = *rPam.GetPoint());
+rPam.Exchange(); // swap so that rPam is backwards
+}
 
 if( pUndoRpl )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-10-09 Thread Michael Stahl
 sw/source/core/txtnode/thints.cxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit a1d37630ae191f526cc83b0c964df9b9bcb7d41d
Author: Michael Stahl mst...@redhat.com
Date:   Tue Oct 8 18:37:35 2013 +0200

fdo#70201: sw: eliminate no-extent RSID-only AUTOFMT hints

These are already filtered out in SwpHints::TryInsertHint(), but they
can be produced by a SwTxtNode::Update() following some deletion like in
SwTxtNode::ReplaceText() (or maybe CutImpl() and RstAttr() too?).

So in order to prevent SwHistorySetTxt being created for these,
filter them out in SwpHints::MergePortions(), which has the advantage
that it's one location to change; probably filtering in Update() and
RstAttr() both would work too.

(regression from 6db39dbd7378351f6476f6db25eb7110c9cfb291)

Change-Id: I597a9ab290dcc3fb1b624dd2dca241c462acf256
(cherry picked from commit 91159b1c31a7fd474ba0b97828f593604790ce3c)
Reviewed-on: https://gerrit.libreoffice.org/6167
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/source/core/txtnode/thints.cxx 
b/sw/source/core/txtnode/thints.cxx
index 0893dac..34dac0a 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -2528,6 +2528,15 @@ bool SwpHints::MergePortions( SwTxtNode rNode )
 pHt-GetAutoFmt().GetStyleHandle());
 if ((pSet-Count() == 1)  pSet-GetItem(RES_CHRATR_RSID, false))
 {
+// fdo#70201: eliminate no-extent RSID-only AUTOFMT
+// could be produced by ReplaceText or (maybe?) RstAttr
+if (*pHt-GetStart() == *pHt-GetEnd())
+{
+SwpHintsArray::DeleteAtPos(i); // kill it without History!
+SwTxtAttr::Destroy(pHt, rNode.GetDoc()-GetAttrPool());
+--i;
+continue;
+}
 // fdo#52028: this one has _only_ RSID = ignore it completely
 if (!pHt-IsFormatIgnoreStart() || !pHt-IsFormatIgnoreEnd())
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-10-04 Thread Caolán McNamara
 sw/source/core/unocore/unotext.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 8c70fd938a001e30ea5e5562e9c49897df4ca026
Author: Caolán McNamara caol...@redhat.com
Date:   Thu Oct 3 11:35:53 2013 +0100

CID#705749 mem leak

Change-Id: I8626e60d802b1c97867d8c59ececff0a4255
(cherry picked from commit e17c91d1ff5c39b9b541b4d1bfb291c419fc76b5)
Reviewed-on: https://gerrit.libreoffice.org/6118
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com

diff --git a/sw/source/core/unocore/unotext.cxx 
b/sw/source/core/unocore/unotext.cxx
index 2817842..b5ed1fe 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -1886,6 +1886,8 @@ void SwXText::Impl::ConvertCell(
 
 SwPaM aNewEndPaM(pCorrectedRange-aEnd, nEndLen);
 aEndCellPam = aNewEndPaM;
+
+delete pCorrectedRange;
 }
 
 /** check the nodes between start and end
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-09-19 Thread Ivan Timofeev
 sw/source/ui/docvw/SidebarWin.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 195ac805ee3350adb5971c90edee3ee8481f41a9
Author: Ivan Timofeev timofeev@gmail.com
Date:   Tue Sep 17 18:34:17 2013 +0400

fdo#41833: fix visual cursor position after resizing

SetOutputArea updates a cursor position, SetVisArea doesn't = call 
SetOutputArea
after SetVisArea.

Change-Id: Ie8f079cb3d567f759c84587a8072b98fab43588b
(cherry picked from commit ddbcb6687722314b37cfda3170596ac7a4f69602)
Reviewed-on: https://gerrit.libreoffice.org/5977
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/source/ui/docvw/SidebarWin.cxx 
b/sw/source/ui/docvw/SidebarWin.cxx
index fa0fed6..b8d150f 100644
--- a/sw/source/ui/docvw/SidebarWin.cxx
+++ b/sw/source/ui/docvw/SidebarWin.cxx
@@ -595,11 +595,11 @@ void SwSidebarWin::DoResize()
 }
 
 mpOutliner-SetPaperSize( PixelToLogic( Size(aWidth,aHeight) ) ) ;
-mpOutlinerView-SetOutputArea( PixelToLogic( Rectangle(0,0,aWidth,aHeight) 
) );
 if (!mpVScrollbar-IsVisible())
 {   // if we do not have a scrollbar anymore, we want to see the complete 
text
 mpOutlinerView-SetVisArea( PixelToLogic( 
Rectangle(0,0,aWidth,aHeight) ) );
 }
+mpOutlinerView-SetOutputArea( PixelToLogic( Rectangle(0,0,aWidth,aHeight) 
) );
 
 if (!Application::GetSettings().GetLayoutRTL())
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-09-19 Thread Caolán McNamara
 sw/source/filter/ww8/ww8scan.hxx |   16 +++-
 1 file changed, 15 insertions(+), 1 deletion(-)

New commits:
commit 7e0676734319ad62d1ee2d762fa3f5de71ee9a02
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Sep 18 10:22:29 2013 +0100

Resolves: fdo#69220 crash in doc (ww6)

Change-Id: I5a09d121a0b0342f28ba5d2d39027b27e9c9eba2
(cherry picked from commit 2e93541d00f9d4aaa6ad2aeb35ee0c901d216cc0)
Reviewed-on: https://gerrit.libreoffice.org/5989
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx
index e52cbc5..f1cf6ec 100644
--- a/sw/source/filter/ww8/ww8scan.hxx
+++ b/sw/source/filter/ww8/ww8scan.hxx
@@ -790,7 +790,21 @@ struct WW8PLCFxDesc
 //With nStartPos set to WW8_CP_MAX then in the case of a pap or chp
 //GetSprms will not search for the sprms, but instead take the
 //existing ones.
-WW8PLCFxDesc() : pIdStk(0), nStartPos(WW8_CP_MAX) {}
+WW8PLCFxDesc()
+: pIdStk(0)
+, pMemPos(0)
+, nOrigSprmsLen(0)
+, nStartPos(WW8_CP_MAX)
+, nEndPos(WW8_CP_MAX)
+, nOrigStartPos(WW8_CP_MAX)
+, nOrigEndPos(WW8_CP_MAX)
+, nCp2OrIdx(WW8_CP_MAX)
+, nSprmsLen(0)
+, nCpOfs(0)
+, bFirstSprm(false)
+, bRealLineEnd(false)
+{
+}
 void ReduceByOffset();
 };
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-09-12 Thread Caolán McNamara
 sw/source/ui/misc/swruler.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 20d50a8c87c87f33c57397ca2c6f25d49e51f7cd
Author: Caolán McNamara caol...@redhat.com
Date:   Thu Sep 12 10:56:37 2013 +0100

Resolves: rhbz#1006850 crash in SwCommentRuler::GetCommentControlRegion

Change-Id: Ic846da3b22391d724da6f8df94dd771e89d2efb4
(cherry picked from commit b73dec8a06ef762098e642b2c37e4baad780b11a)
Reviewed-on: https://gerrit.libreoffice.org/5924
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sw/source/ui/misc/swruler.cxx b/sw/source/ui/misc/swruler.cxx
index a41fc0b..76fb8be 100644
--- a/sw/source/ui/misc/swruler.cxx
+++ b/sw/source/ui/misc/swruler.cxx
@@ -247,6 +247,13 @@ void SwCommentRuler::UpdateCommentHelpText()
 Rectangle SwCommentRuler::GetCommentControlRegion()
 {
 SwPostItMgr *pPostItMgr = mpViewShell-GetPostItMgr();
+
+//rhbz#1006850 When the SwPostItMgr ctor is called from SwView::SwView it
+//triggers an update of the uiview, but the result of the ctor hasn't been
+//set into the mpViewShell yet, so GetPostItMgr is temporarily still NULL
+if (!pPostItMgr)
+return Rectangle();
+
 //FIXME When the page width is larger then screen, the ruler is misplaced 
by one pixel
 long nLeft   = GetWinOffset() + GetPageOffset() + 
mpSwWin-LogicToPixel(Size(GetPageWidth(), 0)).Width();
 long nTop= 0 + 4; // Ruler::ImplDraw uses RULER_OFF (value: 3px) as 
offset, and Ruler::ImplFormat adds one extra pixel
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-09-04 Thread Ivan Timofeev
 sw/source/filter/html/css1atr.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3d0f56a10fbbe6e4c86248ff763f4c3806c7b387
Author: Ivan Timofeev timofeev@gmail.com
Date:   Tue Sep 3 18:57:42 2013 +0400

fix html export of line spacing

regression from 84931eb8aeeb55a2570edb24f5c2d3409f9c2398

Change-Id: Ifcedcd34721a1ca162495f57ad36cfc6859ab0c4
(cherry picked from commit 3103306f4753f546f881cfc6bcdb357d4e1857d8)
Reviewed-on: https://gerrit.libreoffice.org/5791
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/source/filter/html/css1atr.cxx 
b/sw/source/filter/html/css1atr.cxx
index 5a348e4..b791c6500 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -2899,7 +2899,7 @@ static Writer OutCSS1_SvxLineSpacing( Writer rWrt, 
const SfxPoolItem rHt )
 rHTMLWrt.OutCSS1_UnitProperty( sCSS1_P_line_height, (long)nHeight );
 else if( nPrcHeight )
 {
-OString sHeight(OString(nPrcHeight) + %);
+OString sHeight(OString::number(nPrcHeight) + %);
 rHTMLWrt.OutCSS1_PropertyAscii(sCSS1_P_line_height, sHeight);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-09-03 Thread Caolán McNamara
 sw/source/ui/index/swuiidxmrk.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 23e32272393c239a950948e92d83b5b0748cedd8
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Sep 2 21:26:49 2013 +0100

bDel is unused uninitialized

Change-Id: Idac3a6805700d896b8569d1df79d32ca493c48b3
(cherry picked from commit 91a557561c24c7532c525692f279b1fcfd520f92)
Reviewed-on: https://gerrit.libreoffice.org/5764
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com

diff --git a/sw/source/ui/index/swuiidxmrk.cxx 
b/sw/source/ui/index/swuiidxmrk.cxx
index e9cf706..c3fc58b 100644
--- a/sw/source/ui/index/swuiidxmrk.cxx
+++ b/sw/source/ui/index/swuiidxmrk.cxx
@@ -84,6 +84,7 @@ using namespace ::com::sun::star;
 SwIndexMarkPane::SwIndexMarkPane(Dialog rDialog, sal_Bool bNewDlg,
 SwWrtShell rWrtShell)
 : m_rDialog(rDialog)
+, bDel(false)
 , bNewMark(bNewDlg)
 , bSelected(sal_False)
 , bPhoneticED0_ChangedByUser(sal_False)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-08-29 Thread Michael Stahl
 sw/source/ui/docvw/edtwin.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 43003812ca085a642d262d5cbf1a63f8df043d40
Author: Michael Stahl mst...@redhat.com
Date:   Wed Aug 28 14:28:40 2013 +0200

fdo#67358: sw: fix line painting artifacts when resizing columns

SwEditWin::MouseButtonDown(): for unknown reasons invalidating the
window here causes the column resizing lines to not be removed after the
resize is done, so disable it.

(regression from 289185fd02d6d9734b6dbde01f15c4e6c5beacbb)

Change-Id: If3ba0a72c53c5c2734fb905ae35d62f6a3e8938b
(cherry picked from commit a2c67975c03010b90c706523293f180c1f29e229)
Reviewed-on: https://gerrit.libreoffice.org/5661
Reviewed-by: Miklos Vajna vmik...@suse.cz
Tested-by: Miklos Vajna vmik...@suse.cz

diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index 8576258..6e208f0 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -2742,7 +2742,9 @@ void SwEditWin::MouseButtonDown(const MouseEvent _rMEvt)
 rSh.SetShowHeaderFooterSeparator( Footer, false );
 
 // Repaint everything
-rSh.GetWin()-Invalidate();
+// FIXME fdo#67358 for unknown reasons this causes painting
+// problems when resizing table columns, so disable it
+//rSh.GetWin()-Invalidate();
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-08-27 Thread Adam Co
 sw/source/filter/ww8/docxattributeoutput.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 59d8dde3fc9a4dc653e43efb8552efc4ab3efc92
Author: Adam Co rattles2...@gmail.com
Date:   Sun Jul 21 16:27:45 2013 +0300

fdo#66145 DOCX export: fix not-well-formed output

Reviewed-on: https://gerrit.libreoffice.org/5002
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org
(partially cherry picked from commit 
2d5978b22b402dea9dee5b468d2044ccc1208a15)

Change-Id: Id8cc3829ccd5806295b0f240a570dc1d66ed0c87
Signed-off-by: Miklos Vajna vmik...@suse.cz

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 0e2ee5e8..d7c008f 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -419,7 +419,9 @@ void DocxAttributeOutput::StartParagraphProperties( const 
SwTxtNode rNode )
 if ( aNextIndex.GetNode().IsTxtNode() )
 {
 const SwTxtNode* pTxtNode = static_cast SwTxtNode* ( 
aNextIndex.GetNode() );
-m_rExport.OutputSectionBreaks( pTxtNode-GetpSwAttrSet(), *pTxtNode );
+// If next node has no string - it is an empty node, so no need to 
output the section break
+if (!pTxtNode-GetTxt().isEmpty())
+m_rExport.OutputSectionBreaks( pTxtNode-GetpSwAttrSet(), 
*pTxtNode );
 }
 else if ( aNextIndex.GetNode().IsTableNode() )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-08-26 Thread Caolán McNamara
 sw/source/core/undo/untbl.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 2b27404184688cc5bdfd68ed15da5159950a318d
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Aug 26 14:32:41 2013 +0100

Resolves: fdo#59048 crash on text-to-table undo

Delete the SwCellFrms attached to the layout of this SwTableNode early,
otherwise the SwCellFrms will dereference the SwTableNode after it is 
deleted
in _DeleteBox during the DelFrms of the DeleteSection in _DeleteBox when
invalidating following SwFrms.

SwUndoInsTbl::UndoImpl calls SwTableNode::DelFrms so presumably this is the
right way to go about it.

Change-Id: I6e088a30500d721bd18c57ced5c8ec331bb567eb
Reviewed-on: https://gerrit.libreoffice.org/5634
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com
(cherry picked from commit 34f09dadd99a15aaad7fc8b982e01d6ec764c74c)
Signed-off-by: Michael Stahl mst...@redhat.com

diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index a3793d2..4ed6fa7 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -734,6 +734,7 @@ void SwUndoTxtToTbl::UndoImpl(::sw::UndoRedoContext  
rContext)
 
 if( pDelBoxes )
 {
+pTNd-DelFrms();
 SwTable rTbl = pTNd-GetTable();
 for( sal_uInt16 n = pDelBoxes-size(); n; )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-08-23 Thread Michael Stahl
 sw/source/core/txtnode/txatritr.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e680d71b75f18be9b99b13a3a2f63e5f54e42d3f
Author: Michael Stahl mst...@redhat.com
Date:   Sat Aug 24 01:19:21 2013 +0200

fdo#68319: sw: fix Chinese Conversion

... and perhaps other things too: the SwScriptIterator constructor gets
passed a temporary String created by implicit conversion from OUString
and retains a reference to that; don't convert it to OUString like on
master but just cast to String.

(regression from 0295c8a34e39326414c1b98cf4da905802f061b0)

Change-Id: I30c7309c14ec8f9e41ee5fe89eed513ddad154fe
Reviewed-on: https://gerrit.libreoffice.org/5600
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sw/source/core/txtnode/txatritr.cxx 
b/sw/source/core/txtnode/txatritr.cxx
index 00e007a..b9a15b6 100644
--- a/sw/source/core/txtnode/txatritr.cxx
+++ b/sw/source/core/txtnode/txatritr.cxx
@@ -94,7 +94,7 @@ bool SwScriptIterator::Next()
 SwTxtAttrIterator::SwTxtAttrIterator( const SwTxtNode rTNd, sal_uInt16 
nWhchId,
 xub_StrLen nStt,
 bool bUseGetWhichOfScript )
-: aSIter( rTNd.GetTxt(), nStt ), rTxtNd( rTNd ),
+: aSIter( reinterpret_castconst String(rTNd.GetTxt()), nStt ), rTxtNd( 
rTNd ),
 pParaItem( 0 ), nChgPos( nStt ), nAttrPos( 0 ), nWhichId( nWhchId ),
 bIsUseGetWhichOfScript( bUseGetWhichOfScript )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-08-20 Thread Boris Dušek
 sw/source/core/access/accpara.cxx |   10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit e5c7249382c12349e4e032c225c0153f6f41
Author: Boris Dušek m...@dusek.me
Date:   Sat Aug 17 17:23:40 2013 +0200

fdo#68219: Parent style text attributes missing in accessibility

Thanks to Niklas Johansson for testing.

Change-Id: I550076e7d62f8db389cdbf902fce0ff7f8f98165
Reviewed-on: https://gerrit.libreoffice.org/5499
Reviewed-by: Tor Lillqvist t...@iki.fi
Tested-by: Tor Lillqvist t...@iki.fi

diff --git a/sw/source/core/access/accpara.cxx 
b/sw/source/core/access/accpara.cxx
index 3b6ef33..34d9dbd 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -1197,6 +1197,14 @@ uno::SequencePropertyValue 
SwAccessibleParagraph::getCharacterAttributes(
 return aValues;
 }
 
+static void SetPutRecursive(SfxItemSet targetSet, const SfxItemSet sourceSet)
+{
+const SfxItemSet *const pParentSet = sourceSet.GetParent();
+if (pParentSet)
+SetPutRecursive(targetSet, *pParentSet);
+targetSet.Put(sourceSet);
+}
+
 // #i63870#
 void SwAccessibleParagraph::_getDefaultAttributesImpl(
 const uno::Sequence OUString  aRequestedAttributes,
@@ -1243,7 +1251,7 @@ void SwAccessibleParagraph::_getDefaultAttributesImpl(
 SfxItemSet aCharSet( 
const_castSwAttrPool(pTxtNode-GetDoc()-GetAttrPool()),
  RES_CHRATR_BEGIN, RES_CHRATR_END - 1,
  0 );
-aCharSet.Put( pTxtNode-GetTxtColl()-GetAttrSet() );
+SetPutRecursive( aCharSet, pTxtNode-GetTxtColl()-GetAttrSet() );
 pSet-Put( aCharSet );
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-08-16 Thread Michael Stahl
 sw/source/core/doc/doc.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit a8d35a87d65e6be12bcd3fc410ba32b2fb9ecd65
Author: Michael Stahl mst...@redhat.com
Date:   Wed Aug 14 12:27:29 2013 +0200

sw: do non-incremental word count in one step

Not sure if it solves a real problem, but seems sensible.

Change-Id: I3a75da924aaffb452da158a6e5c0b3465fe5687b
(cherry picked from commit 3f66fadc2ddbec42a5fd7ee34b18826ef4ede503)
Reviewed-on: https://gerrit.libreoffice.org/5410
Reviewed-by: Petr Mladek pmla...@suse.cz
Tested-by: Petr Mladek pmla...@suse.cz

diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 1993018..8cf4f11 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -1758,7 +1758,8 @@ void SwDoc::UpdateDocStat( bool bCompleteAsync, bool 
bFields )
 {
 if (!bCompleteAsync)
 {
-while (IncrementalDocStatCalculate(5000, bFields)) {}
+while (IncrementalDocStatCalculate(
+::std::numeric_limitslong::max(), bFields)) {}
 maStatsUpdateTimer.Stop();
 }
 else if (IncrementalDocStatCalculate(5000, bFields))
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-08-15 Thread Caolán McNamara
 sw/source/core/docnode/ndtbl.cxx |   19 +--
 1 file changed, 9 insertions(+), 10 deletions(-)

New commits:
commit 52aa68ba22e62a6c4e2699574cc6dd812c011c51
Author: Caolán McNamara caol...@redhat.com
Date:   Thu Aug 15 11:39:59 2013 +0100

Resolves: fdo#67554 avoid ooxml import crash

check if the endrange is empty before dereferencing

while I'm at it, don't copy the entire vector and make it a little more
readable

Change-Id: I1f2a0096791ca0ef51aad595f71e1a18aa448c3b
(cherry picked from commit ce791697cbf260b592f7cad095539a41423f)
Reviewed-on: https://gerrit.libreoffice.org/5435
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index f8b224f..689ac04 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -1121,25 +1121,24 @@ const SwTable* SwDoc::TextToTable( const std::vector 
std::vectorSwNodeRange 
 if (rTableNodes.empty())
 return NULL;
 
-std::vectorSwNodeRange rFirstRange = *rTableNodes.begin();
+const std::vectorSwNodeRange rFirstRange = *rTableNodes.begin();
 
 if (rFirstRange.empty())
 return NULL;
 
+const std::vectorSwNodeRange rLastRange = *rTableNodes.rbegin();
+
+if (rLastRange.empty())
+return NULL;
+
 /* Save first node in the selection if it is a content node. */
 SwCntntNode * pSttCntntNd = 
rFirstRange.begin()-aStart.GetNode().GetCntntNode();
 
-/**debug**/
-#if OSL_DEBUG_LEVEL  1
-const SwNodeRange rStartRange = *rTableNodes.begin()-begin();
-const SwNodeRange rEndRange = *rTableNodes.rbegin()-rbegin();
-(void) rStartRange;
-(void) rEndRange;
-#endif
-/**debug**/
+const SwNodeRange rStartRange = *rFirstRange.begin();
+const SwNodeRange rEndRange = *rLastRange.rbegin();
 
 //!!! not necessarily TextNodes !!!
-SwPaM aOriginal( rTableNodes.begin()-begin()-aStart, 
rTableNodes.rbegin()-rbegin()-aEnd );
+SwPaM aOriginal( rStartRange.aStart, rEndRange.aEnd );
 const SwPosition *pStt = aOriginal.GetMark();
 const SwPosition *pEnd = aOriginal.GetPoint();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-08-14 Thread Stephan Bergmann
 sw/source/core/docnode/nodes.cxx |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit b1b99974960259bd721f381723f74b1c00e034bb
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Aug 13 18:13:49 2013 +0200

fdo#68064: Do not insert aTempEntry multiple times

...and do not let it go out of scope before being used in 
BigPtrArray::Remove.
(And, en passant, avoid use of reserved identifier, starting with an 
underscore
followed by a capital letter.)

Change-Id: Ic5730f707601a2070f2eed3ba017650026657df3
(cherry picked from commit ebc81f19ef4ffe8d54f83c019ea80d10c98647d7)
Reviewed-on: https://gerrit.libreoffice.org/5406
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index 543aa24..89be73e 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -2326,11 +2326,14 @@ void SwNodes::ForEach( const SwNodeIndex rStart, const 
SwNodeIndex rEnd,
 (FnForEach) fnForEach, pArgs );
 }
 
-struct _TempBigPtrEntry : public BigPtrEntry
+namespace {
+
+struct TempBigPtrEntry : public BigPtrEntry
 {
-_TempBigPtrEntry() {}
+TempBigPtrEntry() {}
 };
 
+}
 
 void SwNodes::RemoveNode( sal_uLong nDelPos, sal_uLong nSz, sal_Bool bDel )
 {
@@ -2374,6 +2377,7 @@ void SwNodes::RemoveNode( sal_uLong nDelPos, sal_uLong 
nSz, sal_Bool bDel )
 }
 }
 
+std::vectorTempBigPtrEntry aTempEntries;
 if( bDel )
 {
 sal_uLong nCnt = nSz;
@@ -2386,14 +2390,14 @@ void SwNodes::RemoveNode( sal_uLong nDelPos, sal_uLong 
nSz, sal_Bool bDel )
 //  ablaueft, wird hier ein temp. Objekt eingefuegt, das
 //  dann mit dem Remove wieder entfernt wird.
 // siehe Bug 55406
-_TempBigPtrEntry aTempEntry;
-BigPtrEntry* pTempEntry = aTempEntry;
+aTempEntries.resize(nCnt);
 
 while( nCnt-- )
 {
 delete pDel;
 pDel = pPrev;
 sal_uLong nPrevNdIdx = pPrev-GetIndex();
+BigPtrEntry* pTempEntry = aTempEntries[nCnt];
 BigPtrArray::Replace( nPrevNdIdx+1, pTempEntry );
 if( nCnt )
 pPrev = (*this)[ nPrevNdIdx  - 1 ];
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-08-14 Thread Tor Lillqvist
 sw/source/ui/envelp/labelcfg.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 58077522b19e06d8d86d28a9b5ff2b3c505b84ad
Author: Tor Lillqvist t...@iki.fi
Date:   Sat Aug 10 15:19:41 2013 +0300

WaE: variable 'res' set but not used

Change-Id: I3fc3f55d10dad177451100affacfff74d04a1fe8
(cherry picked from commit f115934e0a9146c0adf115abcb99e048c530349d)

Signed-off-by: Eike Rathke er...@redhat.com

diff --git a/sw/source/ui/envelp/labelcfg.cxx b/sw/source/ui/envelp/labelcfg.cxx
index f24f440..81f49f3 100644
--- a/sw/source/ui/envelp/labelcfg.cxx
+++ b/sw/source/ui/envelp/labelcfg.cxx
@@ -38,6 +38,7 @@ static inline void lcl_assertEndingItem(xmlreader::XmlReader 
reader)
 xmlreader::XmlReader::Result res;
 res = reader.nextItem(xmlreader::XmlReader::TEXT_NONE, name, nsId);
 assert(res == xmlreader::XmlReader::RESULT_END);
+(void) res;
 }
 
 static inline OUString lcl_getValue(xmlreader::XmlReader reader,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-08-10 Thread Matúš Kukan
 sw/source/ui/envelp/labelcfg.cxx |9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

New commits:
commit 7d8ab35f1f4a069d08b57652f79870fdcfc649af
Author: Matúš Kukan matus.ku...@gmail.com
Date:   Sat Aug 10 12:57:52 2013 +0200

fdo#67799 read ending item also when assert is noop

Change-Id: I056212d0a01f7a647e846bbd1b605c04e1798a14
Reviewed-on: https://gerrit.libreoffice.org/5336
Tested-by: Norbert Thiebaud nthieb...@gmail.com
Reviewed-by: Norbert Thiebaud nthieb...@gmail.com

diff --git a/sw/source/ui/envelp/labelcfg.cxx b/sw/source/ui/envelp/labelcfg.cxx
index dc815c7..f24f440 100644
--- a/sw/source/ui/envelp/labelcfg.cxx
+++ b/sw/source/ui/envelp/labelcfg.cxx
@@ -33,14 +33,11 @@ using namespace ::com::sun::star::beans;
 
 static inline void lcl_assertEndingItem(xmlreader::XmlReader reader)
 {
-#if OSL_DEBUG_LEVEL  0
 int nsId;
 xmlreader::Span name;
-assert(reader.nextItem(xmlreader::XmlReader::TEXT_NONE, name, nsId)
-== xmlreader::XmlReader::RESULT_END);
-#else
-(void)reader;
-#endif
+xmlreader::XmlReader::Result res;
+res = reader.nextItem(xmlreader::XmlReader::TEXT_NONE, name, nsId);
+assert(res == xmlreader::XmlReader::RESULT_END);
 }
 
 static inline OUString lcl_getValue(xmlreader::XmlReader reader,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-08-08 Thread Ivan Timofeev
 sw/source/ui/misc/glossary.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 9b82bd95224203f62cf8d26f2af9f915e85e
Author: Ivan Timofeev timofeev@gmail.com
Date:   Thu Aug 8 10:46:25 2013 +0400

fdo#67817: GetParent returns a VclGrid instance after conversion to .ui

Change-Id: Ib37e2de784823fec209c195963d925748412c692
(cherry picked from commit a0bbc768a5fac2c3d27cd70877961561fe7f0ffa)
Reviewed-on: https://gerrit.libreoffice.org/5310
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index 3494051..e39d6bf 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -919,7 +919,7 @@ DragDropMode SwGlTreeListBox::NotifyStartDrag(
 eRet = SV_DRAGDROP_NONE;
 else
 {
-SwGlossaryDlg* pDlg = (SwGlossaryDlg*)Window::GetParent();
+SwGlossaryDlg* pDlg = (SwGlossaryDlg*)GetParentDialog();
 SvTreeListEntry* pParent = GetParent(pEntry);
 
 GroupUserData* pGroupData = (GroupUserData*)pParent-GetUserData();
@@ -967,7 +967,7 @@ sal_Bool  SwGlTreeListBox::NotifyMoving(   SvTreeListEntry* 
 pTarget,
 sal_Bool bRet = sal_False;
 if(pDestParent != pSrcParent)
 {
-SwGlossaryDlg* pDlg = (SwGlossaryDlg*)Window::GetParent();
+SwGlossaryDlg* pDlg = (SwGlossaryDlg*)GetParentDialog();
 SwWait aWait( *pDlg-pSh-GetView().GetDocShell(), sal_True );
 
 GroupUserData* pGroupData = (GroupUserData*)pSrcParent-GetUserData();
@@ -1013,7 +1013,7 @@ sal_Bool  SwGlTreeListBox::NotifyCopying(   
SvTreeListEntry*  pTarget,
 sal_Bool bRet = sal_False;
 if(pDestParent != pSrcParent)
 {
-SwGlossaryDlg* pDlg = (SwGlossaryDlg*)Window::GetParent();
+SwGlossaryDlg* pDlg = (SwGlossaryDlg*)GetParentDialog();
 SwWait aWait( *pDlg-pSh-GetView().GetDocShell(), sal_True );
 
 GroupUserData* pGroupData = (GroupUserData*)pSrcParent-GetUserData();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-08-06 Thread Tomaž Vajngerl
 sw/source/ui/shells/grfsh.cxx |   24 +++-
 1 file changed, 23 insertions(+), 1 deletion(-)

New commits:
commit 5f2010ed8436e6da90a996efbf070f34e485efd6
Author: Tomaž Vajngerl qui...@gmail.com
Date:   Thu Aug 1 23:18:13 2013 +0200

fdo#67639 Rotate crop area when the image is rotated.

Change-Id: Ifdd0080f278b67b815f15c71523497de59e615bd
Reviewed-on: https://gerrit.libreoffice.org/5235
Reviewed-by: Miklos Vajna vmik...@suse.cz
Tested-by: Miklos Vajna vmik...@suse.cz

diff --git a/sw/source/ui/shells/grfsh.cxx b/sw/source/ui/shells/grfsh.cxx
index 33108c0..911d1e2 100644
--- a/sw/source/ui/shells/grfsh.cxx
+++ b/sw/source/ui/shells/grfsh.cxx
@@ -764,11 +764,33 @@ void SwGrfShell::ExecuteRotation(SfxRequest rReq)
 aTransform.rotate(aRotation);
 rShell.ReRead(aEmptyStr, aEmptyStr, (const Graphic*) aGraphic);
 
-SwFlyFrmAttrMgr aManager( false, rShell, rShell.IsFrmSelected() ? 
FRMMGR_TYPE_NONE : FRMMGR_TYPE_GRF);
+SwFlyFrmAttrMgr aManager(false, rShell, rShell.IsFrmSelected() ? 
FRMMGR_TYPE_NONE : FRMMGR_TYPE_GRF);
 Size aSize(aManager.GetSize().Height(), aManager.GetSize().Width());
 aManager.SetSize(aSize);
 aManager.UpdateFlyFrm();
 
+SfxItemSet aSet( rShell.GetAttrPool(), RES_GRFATR_CROPGRF, 
RES_GRFATR_CROPGRF );
+rShell.GetCurAttr( aSet );
+SwCropGrf aCrop( (const SwCropGrf) aSet.Get(RES_GRFATR_CROPGRF) );
+Rectangle aCropRectangle(aCrop.GetLeft(),  aCrop.GetTop(), 
aCrop.GetRight(), aCrop.GetBottom());
+
+if (rReq.GetSlot() == SID_ROTATE_GRAPHIC_LEFT)
+{
+aCrop.SetLeft(   aCropRectangle.Top());
+aCrop.SetTop(aCropRectangle.Right()  );
+aCrop.SetRight(  aCropRectangle.Bottom() );
+aCrop.SetBottom( aCropRectangle.Left()   );
+}
+else if (rReq.GetSlot() == SID_ROTATE_GRAPHIC_RIGHT)
+{
+aCrop.SetLeft(   aCropRectangle.Bottom() );
+aCrop.SetTop(aCropRectangle.Left()   );
+aCrop.SetRight(  aCropRectangle.Top());
+aCrop.SetBottom( aCropRectangle.Right()  );
+}
+
+rShell.SetAttr(aCrop);
+
 rShell.EndUndo(UNDO_END);
 rShell.EndAllAction();
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-07-30 Thread Fridrich Štrba
 sw/source/core/doc/doctxm.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 44ad2d98a5e9dbf7f6429caf920cdcf3931a62c4
Author: Fridrich Å trba fridrich.st...@bluewin.ch
Date:   Fri May 31 12:27:49 2013 +0200

Resolves: rhbz#989686 Fix crash with ooo120774-1.doc

Do not try to remove line breaks from empty string

Reviewed-on: https://gerrit.libreoffice.org/4114
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org
(cherry picked from commit 2cb9aaf44dc589af79d62d7b1136b5d65e9f47d4)

Change-Id: Ieb12c541d42944aac813cee10ce479207b1c674b
Reviewed-on: https://gerrit.libreoffice.org/5195
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 2029d9f..6498585 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -1536,6 +1536,8 @@ static String lcl_GetNumString( const SwTOXSortTabBase 
rBase, bool bUsePrefix,
 /// to a single space, and trailing space removed.
 String lcl_RemoveLineBreaks( String sRet )
 {
+if (!sRet.Len())
+return sRet;
 xub_StrLen nOffset = 0;
 sRet.SearchAndReplaceAll('\n', ' ');
 for (xub_StrLen i = 1; i  sRet.Len(); i++)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-07-25 Thread Caolán McNamara
 sw/source/ui/app/swmodule.cxx|2 
 sw/source/ui/inc/workctrl.hxx|   25 +++
 sw/source/ui/ribbar/workctrl.cxx |  256 ---
 3 files changed, 186 insertions(+), 97 deletions(-)

New commits:
commit cf908fbf1119446000fe75c57f15d08046b8091d
Author: Caolán McNamara caol...@redhat.com
Date:   Thu Jul 25 14:47:01 2013 +0100

Resolves: fdo#67113 split insert autotext and field controls

autotext is a modal dialog and insert field is a modeless dialog so I don't
want autotext to show a toggle in insert-autotext

At the same time we want the autotext entry in the insert toolbar to have a
dropdown and we appear to want to be able to close the insert field dialog 
from
the toolbar.

So split the combined handler class into two and remove the other if/else
branch in each with the insert field a SfxBoolItem and the insert autotext 
an
SfxVoidItem.

Change-Id: I3d59052ee70a00d63f7706166290b00ad9ae22c0
(cherry picked from commit bb98778dbf761a0c88c96117add00a66e5cc6c95)
Reviewed-on: https://gerrit.libreoffice.org/5112
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sw/source/ui/app/swmodule.cxx b/sw/source/ui/app/swmodule.cxx
index fb53d18..b0465ca 100644
--- a/sw/source/ui/app/swmodule.cxx
+++ b/sw/source/ui/app/swmodule.cxx
@@ -300,7 +300,7 @@ void SwDLL::RegisterControls()
 SwTbxAnchor::RegisterControl(FN_TOOL_ANCHOR, pMod );
 SwTbxInsertCtrl::RegisterControl(FN_INSERT_CTRL, pMod );
 SwTbxInsertCtrl::RegisterControl(FN_INSERT_OBJ_CTRL, pMod );
-SwTbxAutoTextCtrl::RegisterControl(FN_INSERT_FIELD_CTRL, pMod );
+SwTbxFieldCtrl::RegisterControl(FN_INSERT_FIELD_CTRL, pMod );
 SwTbxAutoTextCtrl::RegisterControl(FN_GLOSSARY_DLG, pMod );
 
 SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_BASIC, pMod );
diff --git a/sw/source/ui/inc/workctrl.hxx b/sw/source/ui/inc/workctrl.hxx
index 8dcd318..1c7b231 100644
--- a/sw/source/ui/inc/workctrl.hxx
+++ b/sw/source/ui/inc/workctrl.hxx
@@ -95,7 +95,7 @@ public:
 SFX_DECL_TOOLBOX_CONTROL();
 
 SwTbxAutoTextCtrl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox rTbx );
-~SwTbxAutoTextCtrl();
+virtual ~SwTbxAutoTextCtrl();
 
 virtual SfxPopupWindowType  GetPopupWindowType() const;
 virtual SfxPopupWindow* CreatePopupWindow();
@@ -106,6 +106,29 @@ public:
 DECL_LINK(PopupHdl, PopupMenu*);
 };
 
+class SwTbxFieldCtrl : public SfxToolBoxControl
+{
+PopupMenu*  pPopup;
+SwView* pView;
+
+
+voidDelPopup();
+public:
+SFX_DECL_TOOLBOX_CONTROL();
+
+SwTbxFieldCtrl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox rTbx );
+virtual ~SwTbxFieldCtrl();
+
+virtual SfxPopupWindowType  GetPopupWindowType() const;
+virtual SfxPopupWindow* CreatePopupWindow();
+virtual voidStateChanged( sal_uInt16 nSID,
+  SfxItemState eState,
+  const SfxPoolItem* pState );
+
+DECL_LINK(PopupHdl, PopupMenu*);
+};
+
+
 
 //
 //
diff --git a/sw/source/ui/ribbar/workctrl.cxx b/sw/source/ui/ribbar/workctrl.cxx
index 384db99..ccbc2bf 100644
--- a/sw/source/ui/ribbar/workctrl.cxx
+++ b/sw/source/ui/ribbar/workctrl.cxx
@@ -57,7 +57,8 @@ using namespace ::com::sun::star::beans;
 using namespace ::com::sun::star::frame;
 
 SFX_IMPL_TOOLBOX_CONTROL( SwTbxInsertCtrl, SfxImageItem);
-SFX_IMPL_TOOLBOX_CONTROL( SwTbxAutoTextCtrl, SfxBoolItem );
+SFX_IMPL_TOOLBOX_CONTROL( SwTbxAutoTextCtrl, SfxVoidItem );
+SFX_IMPL_TOOLBOX_CONTROL( SwTbxFieldCtrl, SfxBoolItem );
 
 SwTbxInsertCtrl::SwTbxInsertCtrl(
 sal_uInt16 nSlotId,
@@ -187,44 +188,30 @@ SfxPopupWindow* SwTbxAutoTextCtrl::CreatePopupWindow()
 {
 Link aLnk = LINK(this, SwTbxAutoTextCtrl, PopupHdl);
 
-if (GetSlotId() == FN_INSERT_FIELD_CTRL)
+pPopup = new PopupMenu;
+SwGlossaryList* pGlossaryList = ::GetGlossaryList();
+sal_uInt16 nGroupCount = pGlossaryList-GetGroupCount();
+for(sal_uInt16 i = 1; i = nGroupCount; i++)
 {
-pPopup = new PopupMenu(SW_RES(RID_INSERT_FIELD_CTRL));
-pPopup-SetSelectHdl(aLnk);
-
-if (::GetHtmlMode(pView-GetDocShell())  HTMLMODE_ON)
-{
-
pPopup-RemoveItem(pPopup-GetItemPos(FN_INSERT_FLD_PGCOUNT));
-
pPopup-RemoveItem(pPopup-GetItemPos(FN_INSERT_FLD_TOPIC));
-}
-}
-else
-{
-pPopup = new PopupMenu;
-SwGlossaryList* pGlossaryList = ::GetGlossaryList();
-sal_uInt16 nGroupCount = pGlossaryList-GetGroupCount();
-for(sal_uInt16 i = 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-07-25 Thread Ivan Timofeev
 sw/source/ui/ribbar/workctrl.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit ab79f3def7ce98d27e096e6b40203787dde2f3fb
Author: Ivan Timofeev timofeev@gmail.com
Date:   Thu Jul 25 14:58:42 2013 +0400

Related: fdo#67113 restore some code, it has side effects

these lines were removed in 8275c8fc33b63aa40a0a8a8c215f32b9986edab6

fixes missing AutoText menu entries and AutoText insertion via menu

Change-Id: Ifa498d1cbfc096cca7751de9c9667fda6f1b3b48
(cherry picked from commit a645a14cf46a1160c426052823772ad117f0bd8b)
Reviewed-on: https://gerrit.libreoffice.org/5111
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sw/source/ui/ribbar/workctrl.cxx b/sw/source/ui/ribbar/workctrl.cxx
index b7d959c..384db99 100644
--- a/sw/source/ui/ribbar/workctrl.cxx
+++ b/sw/source/ui/ribbar/workctrl.cxx
@@ -207,6 +207,7 @@ SfxPopupWindow* SwTbxAutoTextCtrl::CreatePopupWindow()
 {
 // Acquire group name with path extension
 String sTitle;
+pGlossaryList-GetGroupName(i - 1, sal_False, sTitle);
 sal_uInt16 nBlockCount = pGlossaryList-GetBlockCount(i 
-1);
 if(nBlockCount)
 {
@@ -303,6 +304,7 @@ IMPL_LINK(SwTbxAutoTextCtrl, PopupHdl, PopupMenu*, pMenu)
 SwGlossaryList* pGlossaryList = ::GetGlossaryList();
 String sShortName;
 String sGroup = pGlossaryList-GetGroupName(nBlock - 1, false);
+pGlossaryList-GetBlockName(nBlock - 1, nId - (100 * nBlock) - 1, 
sShortName);
 
 SwGlossaryHdl* pGlosHdl = pView-GetGlosHdl();
 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-07-12 Thread Miklos Vajna
 sw/source/ui/uiview/formatclipboard.cxx |   13 +
 1 file changed, 1 insertion(+), 12 deletions(-)

New commits:
commit 5156749cde88c5274b36a22dab7b561d59b93cf1
Author: Miklos Vajna vmik...@suse.cz
Date:   Fri Jul 12 16:02:43 2013 +0200

bnc#828598 fdo#59643 SwFormatClipboard: fix undo of paragraph attributes

Paragraph attributes were set directly on the SwTxtNodes, instead of
going through SwWrtShell::SetAttr(), which handles undo/redo.

Regression from 357fac9713875302d30185feabaf5c165e040ca4.

(cherry picked from commit b1cd73d3e62c5192bc3d77f5ecd1036ff42bde61)

Change-Id: I5dc86e20e3c006dab60a075355ce9ad1f1b67bb6
Reviewed-on: https://gerrit.libreoffice.org/4868
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com

diff --git a/sw/source/ui/uiview/formatclipboard.cxx 
b/sw/source/ui/uiview/formatclipboard.cxx
index 5dd7ef2..f7e41a6 100644
--- a/sw/source/ui/uiview/formatclipboard.cxx
+++ b/sw/source/ui/uiview/formatclipboard.cxx
@@ -538,19 +538,8 @@ void SwFormatClipboard::Paste( SwWrtShell rWrtShell, 
SfxStyleSheetBasePool* pPo
 // remove attribute that were applied by named text and paragraph 
formatting
 lcl_RemoveEqualItems( *pTemplateItemSet, aItemVector );
 
-// it can't be a multiple selection
-SwPaM* pCrsr = rWrtShell.GetCrsr();
-
 // apply the paragraph automatic attributes to all the nodes in 
the selection
-for (SwNodeIndex pNodeIndexIterator = pCrsr-Start()-nNode,
- pNodeIndexEnd = pCrsr-End()-nNode;
-pNodeIndexIterator != pNodeIndexEnd;
-++pNodeIndexIterator )
-{
-pNodeIndexIterator.GetNode().GetCntntNode()-SetAttr( 
*pTemplateItemSet );
-}
-// same as pCrsr-End()-nNode.GetNode().GetCntntNode()-SetAttr
-pCrsr-GetCntntNode()-SetAttr( *pTemplateItemSet );
+rWrtShell.SetAttr(*pTemplateItemSet);
 
 // store the attributes in aItemVector in order not to apply them 
as
 // text automatic formating attributes later in the code
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source vcl/source

2013-07-08 Thread Michael Stahl
 sw/source/core/txtnode/fntcache.cxx |4 ++--
 sw/source/core/txtnode/fntcap.cxx   |9 -
 vcl/source/gdi/outdev3.cxx  |   10 +++---
 3 files changed, 13 insertions(+), 10 deletions(-)

New commits:
commit 4d268e8302d13b81494305eab68e60ab6d0ef264
Author: Michael Stahl mst...@redhat.com
Date:   Sun Jul 7 11:58:42 2013 +0200

fdo#66478: sw: un-break hyphenation

The main problem is calling SetHyphPos with a stack pointer.
Converting STRING_LEN - -1 can't hurt though.

(regression from a2f6402b1fe769a430019042e14e63c9414715dc)

Change-Id: I59a4e3b16b418082de468c7d7f7f38a9b0bccd01
(cherry picked from commit 6fa07d2d608646004bc45261275c4ebabb578a09)
Reviewed-on: https://gerrit.libreoffice.org/4757
Reviewed-by: Michael Meeks michael.me...@suse.com
Tested-by: Michael Meeks michael.me...@suse.com

diff --git a/sw/source/core/txtnode/fntcache.cxx 
b/sw/source/core/txtnode/fntcache.cxx
index 8398159..80b2ea8 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -2444,8 +2444,8 @@ xub_StrLen SwFont::GetTxtBreak( SwDrawTextInfo rInf, 
long nTextWidth )
 nTxtBreak = rInf.GetOut().GetTextBreak( sTmpText, nTextWidth,
  static_castsal_Unicode('-'), nHyphPos,
  nTmpIdx2, nTmpLen2, nKern );
-xub_StrLen nTmpHyphPos = static_castxub_StrLen(nHyphPos);
-rInf.SetHyphPos(nTmpHyphPos);
+*rInf.GetHyphPos() = (nHyphPos == -1)
+? STRING_LEN : static_castxub_StrLen(nHyphPos);
 }
 else
 nTxtBreak = rInf.GetOut().GetTextBreak( sTmpText, nTextWidth,
diff --git a/sw/source/core/txtnode/fntcap.cxx 
b/sw/source/core/txtnode/fntcap.cxx
index 1868698..9735b2c 100644
--- a/sw/source/core/txtnode/fntcap.cxx
+++ b/sw/source/core/txtnode/fntcap.cxx
@@ -209,26 +209,25 @@ void SwDoGetCapitalBreak::Do()
 {
 xub_StrLen nEnd = rInf.GetEnd();
 OUString sText(rInf.GetText()); // only needed until 
rInf.GetText() returns OUString
-long nTxtWidth2 = nTxtWidth;// only needed until variables are 
migrated to sal_Int32
 sal_Int32 nIdx2 = rInf.GetIdx(); // ditto
 sal_Int32 nLen2 = rInf.GetLen(); // ditto
 if( pExtraPos )
 {
 sal_Int32 nExtraPos = *pExtraPos; // ditto
-nBreak = GetOut().GetTextBreak( sText, nTxtWidth2, 
static_castsal_Unicode('-'),
+nBreak = GetOut().GetTextBreak( sText, nTxtWidth,
+static_castsal_Unicode('-'),
  nExtraPos, nIdx2, nLen2, rInf.GetKern() );
 if( nExtraPos  nEnd )
 nExtraPos = nEnd;
-*pExtraPos = nExtraPos;
+*pExtraPos = (nExtraPos == -1) ? STRING_LEN : nExtraPos;
 }
 else
-nBreak = GetOut().GetTextBreak( sText, nTxtWidth2,
+nBreak = GetOut().GetTextBreak( sText, nTxtWidth,
nIdx2, nLen2, rInf.GetKern() );
 
 rInf.SetText(sText); // ditto
 rInf.SetIdx(nIdx2);  // ditto
 rInf.SetLen(nLen2);  // ditto
-nTxtWidth = nTxtWidth2; // ditto
 
 if( nBreak  nEnd )
 nBreak = nEnd;
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 3b8e3c5..8304746 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -6156,10 +6156,14 @@ xub_StrLen OutputDevice::GetTextBreak( const OUString 
rStr, long nTextWidth,
 if( nExtraPixelWidth  0 )
 nTextPixelWidth -= nExtraPixelWidth;
 
-rHyphenatorPos = 
sal::static_int_castsal_Int32(pSalLayout-GetTextBreak( nTextPixelWidth, 
nExtraPixelWidth, nSubPixelFactor ));
+// why does this return int and use STRING_LEN for errors???
+xub_StrLen nTmp = sal::static_int_castxub_StrLen(
+pSalLayout-GetTextBreak(nTextPixelWidth, nExtraPixelWidth, 
nSubPixelFactor));
 
-if( rHyphenatorPos  nRetVal )
-rHyphenatorPos = nRetVal;
+nTmp = std::min(nTmp, nRetVal);
+
+// TODO: remove nTmp when GetTextBreak sal_Int32
+rHyphenatorPos = (nTmp == STRING_LEN) ? -1 : nTmp;
 }
 
 pSalLayout-Release();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-07-02 Thread Michael Stahl
 sw/source/filter/ww8/wrtw8nds.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 235a543619d74f024087983cee35e4f03e5993b0
Author: Michael Stahl mst...@redhat.com
Date:   Mon Jul 1 19:04:38 2013 +0200

fdo#66165: WW8 export: fix duplicated paragraph breaks

MSWordExportBase::OutputTextNode(): in commit
8f2a21eac4a904db3cc4c448179e2d2cf5878ef4
(which is not merged) a WriteCR( pTextNodeInfoInner ); was moved up
a few lines, so it shows up as context in the other commit, and
the bug is that the cherry-pick 83ba821c10392c08334f7d8d3775fe3e8d08f8fd
erroneously adds this context line so now there are 2 WriteCR().

Change-Id: I08434b284f3d8d8426fa997623be352c37d6c7c2
(cherry picked from commit a201ae63ce798438057a1328dc644dc8b64fe4e8)
Reviewed-on: https://gerrit.libreoffice.org/4662
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sw/source/filter/ww8/wrtw8nds.cxx 
b/sw/source/filter/ww8/wrtw8nds.cxx
index 83bd794..330d70c 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -2023,7 +2023,6 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode 
rNode )
 aAttrIter.OutFlys( nEnd );
 // insert final bookmarks if any before CR and after flys
 AppendBookmarks( rNode, nEnd, 1 );
-WriteCR( pTextNodeInfoInner );
 // #i120928 - position of the bullet's graphic is at end of doc
 if (bLastCR  (!bExported))
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-07-02 Thread Michael Stahl
 sw/source/core/unocore/unosett.cxx |6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

New commits:
commit fc53b5cb942726a878f4950509e42eb9b312017a
Author: Michael Stahl mst...@redhat.com
Date:   Mon Jul 1 23:48:59 2013 +0200

fdo#65650: fix Writer ODF import of list style with bullets and color

For such lists xmloff tries to set a BulletColor property but
SwXNumberingRules::SetNumberingRuleByIndex() throws a RuntimeException
and does not set any of the list properties on the NumRule.

(regression from abf18610998aa8330f8330f1d769508e47ef5b20)

Change-Id: Id3e80ee1ed67497786258a1096bc5c8dec90ce21
(cherry picked from commit 0520eaf9e661abddadf9a21cfbeab37b0b85dd68)
Reviewed-on: https://gerrit.libreoffice.org/4664
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sw/source/core/unocore/unosett.cxx 
b/sw/source/core/unocore/unosett.cxx
index 68b135c..bbb4223 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -1658,8 +1658,6 @@ void SwXNumberingRules::SetNumberingRuleByIndex(
 const sal_uInt16 NotInChapterLast = 23;
 const sal_uInt16 InChapterFirst = 24;
 const sal_uInt16 InChapterLast = 24;
-const sal_uInt16 IgnoredFirst = 25;
-const sal_uInt16 IgnoredLast = 26;
 
 const beans::PropertyValue* pPropArray = rProperties.getConstArray();
 PropValDataArr aPropertyValues;
@@ -1670,8 +1668,6 @@ void SwXNumberingRules::SetNumberingRuleByIndex(
 bExcept = true;
 for(sal_uInt16 j = 0; j  SAL_N_ELEMENTS( aNumPropertyNames ); j++)
 {
-if( j = IgnoredFirst  j = IgnoredLast )
-continue;
 if( pDocShell  j = NotInChapterFirst  j = NotInChapterLast )
 continue;
 if( !pDocShell  j = InChapterFirst  j = InChapterLast )
@@ -2090,7 +2086,7 @@ void SwXNumberingRules::SetNumberingRuleByIndex(
 break;
 case 25: // BulletRelSize - unsupported - only available in 
Impress
 break;
-case 26: // ignored too
+case 26: // BulletColor - ignored too
 break;
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-07-02 Thread Caolán McNamara
 sw/source/core/unocore/unocrsrhelper.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2a25f32cef037417e399c88c29b0bfe53cb3c5a4
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Jul 1 12:56:17 2013 +0100

Resolves: rhbz#979758 crash on 'Diagrammen in LibreOffice' help page

Change-Id: I269846840b8e2f67838da525c020a305901cf903
(cherry picked from commit 3090cfc972287da3fbdc567387527b65b3bfd128)
Reviewed-on: https://gerrit.libreoffice.org/4655
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sw/source/core/unocore/unocrsrhelper.cxx 
b/sw/source/core/unocore/unocrsrhelper.cxx
index d949481..41044de 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -176,7 +176,7 @@ void GetSelectableFromAny(uno::Referenceuno::XInterface 
const xIfc,
 if (pRanges)
 {
 SwUnoCrsr const* pUnoCrsr = pRanges-GetCursor();
-if (pUnoCrsr-GetDoc() == rTargetDoc)
+if (pUnoCrsr  pUnoCrsr-GetDoc() == rTargetDoc)
 {
 o_rpPaM = lcl_createPamCopy(*pUnoCrsr);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-06-29 Thread Julien Nabet
 sw/source/core/layout/frmtool.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7af9fea258fe9429d0ff06a705fe294eb36d1c86
Author: Julien Nabet serval2...@yahoo.fr
Date:   Wed Jun 26 22:31:11 2013 +0200

fdo#66101: lowriter crashed when trying to open .docx file

Change-Id: I516bcb4bc18806d5a83f94c0776bd0f918a1e927
Reviewed-on: https://gerrit.libreoffice.org/4550
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org
Reviewed-on: https://gerrit.libreoffice.org/4610

diff --git a/sw/source/core/layout/frmtool.cxx 
b/sw/source/core/layout/frmtool.cxx
index 9123987..06dc22c 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -1913,7 +1913,7 @@ static bool lcl_hasTabFrm(const SwTxtFrm* pTxtFrm)
 if (pObject-IsA(TYPE(SwFlyFrm)))
 {
 SwFlyFrm* pFly = (SwFlyFrm*)pObject;
-if (pFly-Lower()-IsTabFrm())
+if (pFly-Lower()  pFly-Lower()-IsTabFrm())
 return true;
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-06-25 Thread Michael Stahl
 sw/source/core/view/viewsh.cxx |   73 ++---
 1 file changed, 40 insertions(+), 33 deletions(-)

New commits:
commit 280a43a8e35993eb5ec7d317599eb7cffb5d8e7f
Author: Michael Stahl mst...@redhat.com
Date:   Mon Jun 24 18:09:35 2013 +0200

fdo#43765, fdo#57884, fdo#58052, fdo#63949: disappearing form controls

Transparent form controls in Writer may not be painted properly, if
painted from ViewShell::ImplUnlockPaint(true), called from
SwLayIdle::SwLayIdle.

The problem is that SdrPaintWindow::OutputPreRenderDevice will paint
the background of the transparent form controls (thus over-painting the
controls), so it has to be followed by painting the controls themselves.

Change-Id: Icda4ad835a398bbd50139be32ff5014a34f23bd5
(cherry picked from commit cfa994ccbd6ee681f5ab3648ce068c4881b495f5)
Reviewed-on: https://gerrit.libreoffice.org/4486
Reviewed-by: Thorsten Behrens tbehr...@suse.com
Tested-by: Thorsten Behrens tbehr...@suse.com

diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index b1ac5c3..993a037 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -101,6 +101,43 @@ void ViewShell::ToggleHeaderFooterEdit()
 GetWin()-Invalidate();
 }
 
+static void
+lcl_PaintTransparentFormControls(ViewShell  rShell, SwRect const rRect)
+{
+// Direct paint has been performed: the background of transparent child
+// windows has been painted, so need to paint the child windows now.
+if (rShell.GetWin())
+{
+Window rWindow = *(rShell.GetWin());
+if (rWindow.IsChildTransparentModeEnabled())
+{
+Window * pCandidate = rWindow.GetWindow( WINDOW_FIRSTCHILD );
+if (pCandidate)
+{
+const Rectangle aRectanglePixel(
+rWindow.LogicToPixel(rRect.SVRect()));
+while (pCandidate)
+{
+if (pCandidate-IsPaintTransparent())
+{
+const Rectangle aCandidatePosSizePixel(
+pCandidate-GetPosPixel(),
+pCandidate-GetSizePixel());
+
+if (aCandidatePosSizePixel.IsOver(aRectanglePixel))
+{
+pCandidate-Invalidate(
+INVALIDATE_NOTRANSPARENT|INVALIDATE_CHILDREN );
+pCandidate-Update();
+}
+}
+pCandidate = pCandidate-GetWindow( WINDOW_NEXT );
+}
+}
+}
+}
+}
+
 // #i72754# 2nd set of Pre/PostPaints
 // This time it uses the lock counter (mPrePostPaintRegions empty/non-empty) 
to allow only one activation
 // and deactivation and mpPrePostOutDev to remember the OutDev from the 
BeginDrawLayers
@@ -358,39 +395,7 @@ void ViewShell::ImplEndAction( const sal_Bool bIdleEnd )
 DLPostPaint2(true);
 }
 
-// #i107365#
-// Direct paint has been performed. Thus, take care of
-// transparent child windows.
-if ( GetWin() )
-{
-Window rWindow = *(GetWin());
-if (rWindow.IsChildTransparentModeEnabled())
-{
-Window* pCandidate = rWindow.GetWindow( 
WINDOW_FIRSTCHILD );
-if (pCandidate)
-{
-const Rectangle 
aRectanglePixel(rWindow.LogicToPixel(aRect.SVRect()));
-
-while (pCandidate)
-{
-if ( pCandidate-IsPaintTransparent() )
-{
-const Rectangle aCandidatePosSizePixel(
-
pCandidate-GetPosPixel(),
-
pCandidate-GetSizePixel());
-
-if ( 
aCandidatePosSizePixel.IsOver(aRectanglePixel) )
-{
-pCandidate-Invalidate( 
INVALIDATE_NOTRANSPARENT|INVALIDATE_CHILDREN );
-pCandidate-Update();
-}
-}
-
-pCandidate = pCandidate-GetWindow( 
WINDOW_NEXT );
-}
-}
-}
-}
+lcl_PaintTransparentFormControls(*this, aRect); // i#107365
 }
 
 delete pVout;
@@ -473,6 +478,8 @@ void 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-06-20 Thread Tor Lillqvist
 sw/source/core/txtnode/thints.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 140da2c862b60a885dd35b86e197e919c28c9e6a
Author: Tor Lillqvist t...@iki.fi
Date:   Thu Jun 20 10:29:59 2013 +0300

WaE: macro is not used

Change-Id: I2f55abf4526f4184ba04fc173df8cf5236219cfc
(cherry picked from commit 1410cac73fc6e4d2c360e33ac5d185ad900cd728)

Signed-off-by: Eike Rathke er...@redhat.com

diff --git a/sw/source/core/txtnode/thints.cxx 
b/sw/source/core/txtnode/thints.cxx
index 9bcfcf4..0893dac 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -75,7 +75,6 @@
 #define CHECK   Check(true);
 #define CHECK_NOTMERGED Check(false);
 #else
-#define CHECK
 #define CHECK_NOTMERGED
 #endif
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-06-19 Thread Caolán McNamara
 sw/source/ui/chrdlg/drpcps.cxx |   10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

New commits:
commit 90f381f02336126e850c657dc62ae0d2cc7b33ca
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Jun 19 13:55:23 2013 +0100

Resolves: fdo#65931 why are we futzing with leading on the preview anyway

Change-Id: I0eff88f165a737dfd9a2f348f04b17b6a6212e6f
(cherry picked from commit cb1ec05a72d54d55c8a98778c56ee01197cf45f4)
Reviewed-on: https://gerrit.libreoffice.org/4363
Reviewed-by: David Tardon dtar...@redhat.com
Tested-by: David Tardon dtar...@redhat.com

diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx
index 1a11874..afb51f1 100644
--- a/sw/source/ui/chrdlg/drpcps.cxx
+++ b/sw/source/ui/chrdlg/drpcps.cxx
@@ -71,7 +71,6 @@ class SwDropCapsPict : public Control
 longmnLineH;
 longmnTextH;
 sal_uInt16  mnDistance;
-sal_Int32   mnLeading;
 Printer*mpPrinter;
 boolmbDelPrinter;
 /// The _ScriptInfo structure holds information on where we change from one
@@ -243,7 +242,6 @@ void SwDropCapsPict::UpdatePaintSettings( void )
 // gray lines
 mnTotLineH = (GetOutputSizePixel().Height() - 2 * BORDER) / LINES;
 mnLineH = mnTotLineH - 2;
-mnLeading = GetFontMetric().GetIntLeading();
 
 Font aFont;
 {
@@ -302,11 +300,11 @@ void SwDropCapsPict::UpdatePaintSettings( void )
 maCJKFont.SetFillColor(GetSettings().GetStyleSettings().GetWindowColor());
 maCTLFont.SetFillColor(GetSettings().GetStyleSettings().GetWindowColor());
 
-maCJKFont.SetSize(Size(0, maCJKFont.GetSize().Height() + mnLeading));
-maCTLFont.SetSize(Size(0, maCTLFont.GetSize().Height() + mnLeading));
+maCJKFont.SetSize(Size(0, maCJKFont.GetSize().Height()));
+maCTLFont.SetSize(Size(0, maCTLFont.GetSize().Height()));
 
 SetFont(aFont);
-aFont.SetSize(Size(0, aFont.GetSize().Height() + mnLeading));
+aFont.SetSize(Size(0, aFont.GetSize().Height()));
 SetFont(aFont);
 maFont = aFont;
 
@@ -356,7 +354,7 @@ void  SwDropCapsPict::Paint(const Rectangle /*rRect*/)
 DrawRect( Rectangle( Point( BORDER, nY0 ), aTextSize ) );
 
 // draw Text
-DrawPrev( Point( BORDER, nY0 - mnLeading ) );
+DrawPrev( Point( BORDER, nY0 ) );
 }
 
 SetClipRegion();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-06-19 Thread Caolán McNamara
 sw/source/core/txtnode/txtedt.cxx |   13 +
 1 file changed, 13 insertions(+)

New commits:
commit d1252e284460998d36409d4462e953cc0e813809
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Jun 19 12:14:52 2013 +0100

bounds can be -1 for not-found

Change-Id: I941ef1dae00167460f2f0de39e472ed047539f27
(cherry picked from commit 18eba6a69f49c9e8e2902f84e96cb6906ee337f1)
Reviewed-on: https://gerrit.libreoffice.org/4359
Reviewed-by: Noel Power noel.po...@suse.com
Tested-by: Noel Power noel.po...@suse.com

diff --git a/sw/source/core/txtnode/txtedt.cxx 
b/sw/source/core/txtnode/txtedt.cxx
index e1c2824..d498eb7 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -593,6 +593,15 @@ void SwTxtNode::RstAttr(const SwIndex rIdx, xub_StrLen 
nLen, sal_uInt16 nWhich,
 }
 }
 
+sal_Int32 clipIndexBounds(const OUString rStr, sal_Int32 nPos)
+{
+if (nPos  0)
+return 0;
+if (nPos  rStr.getLength())
+return rStr.getLength();
+return nPos;
+}
+
 /*
  *SwTxtNode::GetCurWord()
  *
@@ -638,6 +647,10 @@ XubString SwTxtNode::GetCurWord( xub_StrLen nPos ) const
 if (aBndry.endPos != aBndry.startPos  IsSymbol( 
(xub_StrLen)aBndry.startPos ))
 aBndry.endPos = aBndry.startPos;
 
+// can have -1 as start/end of bounds not found
+aBndry.startPos = clipIndexBounds(m_Text, aBndry.startPos);
+aBndry.endPos = clipIndexBounds(m_Text, aBndry.endPos);
+
 return m_Text.copy(aBndry.startPos,
aBndry.endPos - aBndry.startPos);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-06-19 Thread Caolán McNamara
 sw/source/core/undo/unins.cxx |   13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

New commits:
commit db83cb5a7e1703b512676df6e4dfb103d936d56d
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Jun 19 11:10:08 2013 +0100

unusual negative start point on split node undo

Change-Id: I787371e95d9787616ca713c808098b80e40acab0
(cherry picked from commit 967b623031cd115722e2708f1281282ca8dccbe0)
Reviewed-on: https://gerrit.libreoffice.org/4360
Reviewed-by: Noel Power noel.po...@suse.com
Tested-by: Noel Power noel.po...@suse.com

diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx
index 4ac9ecb..eafb7f4 100644
--- a/sw/source/core/undo/unins.cxx
+++ b/sw/source/core/undo/unins.cxx
@@ -74,9 +74,18 @@ String * SwUndoInsert::GetTxtFromDoc() const
 
 if( pCNd-IsTxtNode() )
 {
-pResult = new String(
-static_castSwTxtNode*(pCNd)-GetTxt().copy(nCntnt-nLen, nLen));
+OUString sTxt = static_castSwTxtNode*(pCNd)-GetTxt();
 
+sal_Int32 nStart = nCntnt-nLen;
+sal_Int32 nLength = nLen;
+
+if (nStart  0)
+{
+nLength += nStart;
+nStart = 0;
+}
+
+pResult = new String(sTxt.copy(nStart, nLength));
 }
 
 return pResult;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-06-18 Thread Michael Meeks
 sw/source/filter/xml/XMLRedlineImportHelper.cxx |   39 ++--
 1 file changed, 23 insertions(+), 16 deletions(-)

New commits:
commit 23ff4ca909f960a7fb36ac87791d448a2ed5eb6d
Author: Michael Meeks michael.me...@suse.com
Date:   Tue Jun 18 10:00:12 2013 +0100

fdo#65882 - fix intermittent writer unit test failure on exit.

Change-Id: Iffa4ea724f2192f85df66eaf4e9e4f30e6ba3d4b

diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx 
b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
index b4f85a5..e922d3c 100644
--- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx
+++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
@@ -368,25 +368,32 @@ XMLRedlineImportHelper::~XMLRedlineImportHelper()
 }
 
 // set redline mode  key
-Any aAny;
+try
+{
+Any aAny;
 
-aAny.setValue( bShowChanges, ::getBooleanCppuType() );
-if ( bHandleShowChanges )
-xModelPropertySet-setPropertyValue( sShowChanges, aAny );
-else
-xImportInfoPropertySet-setPropertyValue( sShowChanges, aAny );
+aAny.setValue( bShowChanges, ::getBooleanCppuType() );
+if ( bHandleShowChanges )
+xModelPropertySet-setPropertyValue( sShowChanges, aAny );
+else
+xImportInfoPropertySet-setPropertyValue( sShowChanges, aAny );
 
-aAny.setValue( bRecordChanges, ::getBooleanCppuType() );
-if ( bHandleRecordChanges )
-xModelPropertySet-setPropertyValue( sRecordChanges, aAny );
-else
-xImportInfoPropertySet-setPropertyValue( sRecordChanges, aAny );
+aAny.setValue( bRecordChanges, ::getBooleanCppuType() );
+if ( bHandleRecordChanges )
+xModelPropertySet-setPropertyValue( sRecordChanges, aAny );
+else
+xImportInfoPropertySet-setPropertyValue( sRecordChanges, aAny );
 
-aAny = aProtectionKey;
-if ( bHandleProtectionKey )
-xModelPropertySet-setPropertyValue( sRedlineProtectionKey, aAny );
-else
-xImportInfoPropertySet-setPropertyValue( sRedlineProtectionKey, aAny);
+aAny = aProtectionKey;
+if ( bHandleProtectionKey )
+xModelPropertySet-setPropertyValue( sRedlineProtectionKey, aAny );
+else
+xImportInfoPropertySet-setPropertyValue( sRedlineProtectionKey, 
aAny);
+}
+catch (const uno::RuntimeException ) // fdo#65882
+{
+SAL_WARN( sw, potentially benign ordering issue during shutdown );
+}
 }
 
 void XMLRedlineImportHelper::Add(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-06-18 Thread László Németh
 sw/source/ui/dialog/uiregionsw.cxx |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit f46a894687be63e29d556621c278b909d417f6fc
Author: László Németh nem...@numbertext.org
Date:   Tue Jun 18 17:02:36 2013 +0200

fdo#65666 keep tab characters in footnote settings of sections, too

Change-Id: I9728ffb7ddae2ca58af083a4748585b0ca8d1437
Reviewed-on: https://gerrit.libreoffice.org/4341
Reviewed-by: Andras Timar ati...@suse.com
Tested-by: Andras Timar ati...@suse.com

diff --git a/sw/source/ui/dialog/uiregionsw.cxx 
b/sw/source/ui/dialog/uiregionsw.cxx
index eb0117d..af33f8c 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -1926,8 +1926,8 @@ sal_Bool SwSectionFtnEndTabPage::FillItemSet( SfxItemSet 
rSet )
 {
 case FTNEND_ATTXTEND_OWNNUMANDFMT:
 aFtn.SetNumType( aFtnNumViewBox.GetSelectedNumberingType() );
-aFtn.SetPrefix( aFtnPrefixED.GetText() );
-aFtn.SetSuffix( aFtnSuffixED.GetText() );
+aFtn.SetPrefix( aFtnPrefixED.GetText().replaceAll(\\t, \t) ); // 
fdo#65666
+aFtn.SetSuffix( aFtnSuffixED.GetText().replaceAll(\\t, \t) );
 // no break;
 
 case FTNEND_ATTXTEND_OWNNUMSEQ:
@@ -1947,8 +1947,8 @@ sal_Bool SwSectionFtnEndTabPage::FillItemSet( SfxItemSet 
rSet )
 {
 case FTNEND_ATTXTEND_OWNNUMANDFMT:
 aEnd.SetNumType( aEndNumViewBox.GetSelectedNumberingType() );
-aEnd.SetPrefix( aEndPrefixED.GetText() );
-aEnd.SetSuffix( aEndSuffixED.GetText() );
+aEnd.SetPrefix( aEndPrefixED.GetText().replaceAll(\\t, \t) );
+aEnd.SetSuffix( aEndSuffixED.GetText().replaceAll(\\t, \t) );
 // no break;
 
 case FTNEND_ATTXTEND_OWNNUMSEQ:
@@ -2017,8 +2017,8 @@ void SwSectionFtnEndTabPage::ResetState( sal_Bool bFtn,
 
 pNumViewBox-SelectNumberingType( rAttr.GetNumType() );
 pOffsetFld-SetValue( rAttr.GetOffset() + 1 );
-pPrefixED-SetText( rAttr.GetPrefix() );
-pSuffixED-SetText( rAttr.GetSuffix() );
+pPrefixED-SetText( rAttr.GetPrefix().replaceAll(\t, \\t) );
+pSuffixED-SetText( rAttr.GetSuffix().replaceAll(\t, \\t) );
 
 switch( eState )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-06-16 Thread Michael Stahl
 sw/source/core/text/pormulti.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b5c5ec048fa6370d2e1455b2c23700aeac66
Author: Michael Stahl mst...@redhat.com
Date:   Sun Jun 16 11:25:40 2013 +0100

fdo#64925 - fix crash on paste of Arabic text on windows.

Change-Id: I4c1c5416d6ce486f257f499c39e269d1f1619add

diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx
index 3443d69..05bf26f 100644
--- a/sw/source/core/text/pormulti.cxx
+++ b/sw/source/core/text/pormulti.cxx
@@ -1830,7 +1830,7 @@ sal_Bool SwTxtFormatter::BuildMultiPortion( 
SwTxtFormatInfo rInf,
 const OUString* pOldTxt = (rInf.GetTxt());
 const SwTwips nOldPaintOfst = rInf.GetPaintOfst();
 
-XubString aMultiStr( rInf.GetTxt(), 0, nMultiLen + rInf.GetIdx() );
+OUString const aMultiStr( rInf.GetTxt().copy(0, nMultiLen + rInf.GetIdx()) 
);
 rInf.SetTxt( aMultiStr );
 SwTxtFormatInfo aInf( rInf, rMulti.GetRoot(), nActWidth );
 // Do we allow break cuts? The FirstMulti-Flag is evaluated during
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-06-13 Thread László Németh
 sw/source/ui/misc/docfnote.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit c0ec2caf1b35c5bc296f0ce86082eb0a6e2b19b2
Author: László Németh nem...@numbertext.org
Date:   Wed Jun 12 11:22:27 2013 +0200

fdo#65666 keep tab characters in footnote settings (Begin/After)

Change-Id: I3fbd0f2dea5926981c0cd351c3235f6b61e66aaa
Reviewed-on: https://gerrit.libreoffice.org/4234
Reviewed-by: Németh László nem...@numbertext.org
Tested-by: Németh László nem...@numbertext.org
Reviewed-by: Andras Timar ati...@suse.com
Tested-by: Andras Timar ati...@suse.com

diff --git a/sw/source/ui/misc/docfnote.cxx b/sw/source/ui/misc/docfnote.cxx
index 70741dd..63f1dc9 100644
--- a/sw/source/ui/misc/docfnote.cxx
+++ b/sw/source/ui/misc/docfnote.cxx
@@ -162,8 +162,8 @@ void SwEndNoteOptionPage::Reset( const SfxItemSet )
 // art
 m_pNumViewBox-SelectNumberingType( pInf-aFmt.GetNumberingType());
 m_pOffsetFld-SetValue(pInf-nFtnOffset + 1);
-m_pPrefixED-SetText(pInf-GetPrefix());
-m_pSuffixED-SetText(pInf-GetSuffix());
+m_pPrefixED-SetText(pInf-GetPrefix().replaceAll(\t, \\t)); // 
fdo#65666
+m_pSuffixED-SetText(pInf-GetSuffix().replaceAll(\t, \\t));
 
 const SwCharFmt* pCharFmt = pInf-GetCharFmt(
 *pSh-GetView().GetDocShell()-GetDoc());
@@ -368,8 +368,8 @@ sal_Bool SwEndNoteOptionPage::FillItemSet( SfxItemSet  )
 
 pInf-nFtnOffset = static_cast sal_uInt16 (m_pOffsetFld-GetValue() -1);
 pInf-aFmt.SetNumberingType(m_pNumViewBox-GetSelectedNumberingType() );
-pInf-SetPrefix(m_pPrefixED-GetText());
-pInf-SetSuffix(m_pSuffixED-GetText());
+pInf-SetPrefix(m_pPrefixED-GetText().replaceAll(\\t, \t));
+pInf-SetSuffix(m_pSuffixED-GetText().replaceAll(\\t, \t));
 
 pInf-SetCharFmt( lcl_GetCharFormat( pSh,
 m_pFtnCharTextTemplBox-GetSelectEntry() ) );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-06-13 Thread Oliver-Rainer Wittmann
 sw/source/ui/docvw/edtwin.cxx |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit 7c7f71623cc2143b20c76a1349bd44580ba5b442
Author: Oliver-Rainer Wittmann o...@apache.org
Date:   Thu Jun 13 13:53:16 2013 +

Resolves: #i122529# only check position protection when...

moving a text frame, graphic or embedded object in Writer

(cherry picked from commit ba9e13a1ebad1569cd5ccf65925a06329ba0d188)

Conflicts:
sw/source/ui/docvw/edtwin.cxx

Change-Id: I126165d6be7505223c4255262103cfb123ec3d55
(cherry picked from commit 57bf1f75942c2c9c0fc264bf0f9b84b674ea55f7)

diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index 39526b9..8576258 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -987,10 +987,7 @@ void SwEditWin::ChangeFly( sal_uInt8 nDir, sal_Bool bWeb )
 SwWrtShell rSh = m_rView.GetWrtShell();
 SwRect aTmp = rSh.GetFlyRect();
 if( aTmp.HasArea() 
-// IsSelObjProtected() seems to be the correct condition, not
-// !HasReadonlySel(), otherwise frame is not moveable if content is
-// protected.
-!rSh.IsSelObjProtected( FLYPROTECT_POS|FLYPROTECT_SIZE ) )
+!rSh.IsSelObjProtected( FLYPROTECT_POS ) )
 {
 SfxItemSet aSet(rSh.GetAttrPool(),
 RES_FRM_SIZE, RES_FRM_SIZE,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-06-06 Thread Michael Stahl
 sw/source/ui/envelp/mailmrge.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 7a62dba0ba4915e4029a3eb4d41311489d73c933
Author: Michael Stahl mst...@redhat.com
Date:   Thu Jun 6 15:05:54 2013 +0200

fdo#64283: SwMailMergeDlg: add back missing initialize

(regression from b248624126c271c88381d3dad6e04fc954f65779)

Change-Id: I0ed8c4ec91a095babccd089c7fe4508d123ba86d
(cherry picked from commit 61ab0ca621898afa817c92c4d13229fa943dfba8)

diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx
index 077ad27..4937fe1 100644
--- a/sw/source/ui/envelp/mailmrge.cxx
+++ b/sw/source/ui/envelp/mailmrge.cxx
@@ -269,6 +269,7 @@ SwMailMergeDlg::SwMailMergeDlg(Window* pParent, SwWrtShell 
rShell,
 {
 // create a frame wrapper for myself
 m_xFrame = frame::Frame::create( 
comphelper::getProcessComponentContext() );
+m_xFrame-initialize( VCLUnoHelper::GetInterface ( pBeamerWin ) );
 }
 catch (const Exception)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-06-06 Thread Miklos Vajna
 sw/source/filter/ww8/docxattributeoutput.cxx |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit c0129c7199b1662caf010fa556b2973196ce7b07
Author: Miklos Vajna vmik...@suse.cz
Date:   Thu Jun 6 16:35:52 2013 +0200

bnc#382137 DocxAttributeOutput: don't store address of local variable

AttributeOutputBase::TextField() passes the address of its local
variable to WriteExpand(), and DocxAttributeOutput::WriteField_Impl()
stored this. When it was to be used, the variable already went out of
scope, resulting in a crash. Given that SwField is an abstract base
class, the easiest way is to just copy the field and manually delete it
when it's no longer needed.

Change-Id: I9d1fe2485277f1ac21a576d7ff0d05003f0ac8a1
(cherry picked from commit 92f328fb5eef672d379ed0b712b025eb80622d5a)

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 549ed52..66c003e 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -564,6 +564,8 @@ void DocxAttributeOutput::EndRun()
 // Unknown fields sould be removed too
 if ( !pIt-bClose || ( pIt-eType == ww::eUNKNOWN ) )
 {
+if (pIt-pField)
+delete pIt-pField;
 pIt = m_Fields.erase( pIt );
 continue;
 }
@@ -598,6 +600,8 @@ void DocxAttributeOutput::EndRun()
 
 // Remove the field if no end needs to be written
 if ( !pIt-bClose ) {
+if (pIt-pField)
+delete pIt-pField;
 pIt = m_Fields.erase( pIt );
 continue;
 }
@@ -646,6 +650,8 @@ void DocxAttributeOutput::EndRun()
 while ( m_Fields.begin() != m_Fields.end() )
 {
 EndField_Impl( m_Fields.front( ) );
+if (m_Fields.front().pField)
+delete m_Fields.front().pField;
 m_Fields.erase( m_Fields.begin( ) );
 }
 
@@ -3829,7 +3835,8 @@ void DocxAttributeOutput::WriteExpand( const SwField* 
pFld )
 void DocxAttributeOutput::WriteField_Impl( const SwField* pFld, ww::eField 
eType, const String rFldCmd, sal_uInt8 nMode )
 {
 struct FieldInfos infos;
-infos.pField = pFld;
+if (pFld)
+infos.pField = pFld-CopyField();
 infos.sCmd = rFldCmd;
 infos.eType = eType;
 infos.bClose = WRITEFIELD_CLOSE  nMode;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-06-06 Thread Luboš Luňák
 sw/source/core/doc/number.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit d420c713f25b619e64be59d1310300692d0a1638
Author: Luboš Luňák l.lu...@suse.cz
Date:   Thu Jun 6 19:36:09 2013 +0200

OpenSymbol is a symbol font

Change-Id: I2489b836950db63f5f53f8a272970b7769c29282

diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index e028eb2..9e5be22 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -1278,6 +1278,7 @@ namespace numfunc
 mpFont = new Font( msFontname, aEmptyStr, Size( 0, 14 ) );
 mpFont-SetWeight( meFontWeight );
 mpFont-SetItalic( meFontItalic );
+mpFont-SetCharSet( RTL_TEXTENCODING_SYMBOL );
 }
 
 void SwDefBulletConfig::Notify( const uno::SequenceOUString )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-06-04 Thread Michael Stahl
 sw/source/core/unocore/unotext.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 27f64bb866037c0321966bdb0c96cac92db2a208
Author: Michael Stahl mst...@redhat.com
Date:   Tue Jun 4 15:24:56 2013 +0200

fdo#64761: sw: avoid another ~SwIndexReg assert

SwXText::convertToTextFrame(): This one is rather spurious since the
local variables aren't used later anyway, so just park them  somewhere safe.

Change-Id: I47d3092fbf22a228fa3f440602c0affa43fbb6d7
(cherry picked from commit 0e86210bc480de38919aacf709513f95fab26d35)

diff --git a/sw/source/core/unocore/unotext.cxx 
b/sw/source/core/unocore/unotext.cxx
index 00c6e85..14c11e4 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -1656,6 +1656,8 @@ throw (lang::IllegalArgumentException, 
uno::RuntimeException)
 if (bParaBeforeInserted)
 {
 SwCursor aDelete(*aStartPam.GetPoint(), 0, false);
+*aStartPam.GetPoint() = // park it because node is deleted
+SwPosition(GetDoc()-GetNodes().GetEndOfContent());
 aDelete.MovePara(fnParaCurr, fnParaStart);
 aDelete.SetMark();
 aDelete.MovePara(fnParaCurr, fnParaEnd);
@@ -1664,6 +1666,8 @@ throw (lang::IllegalArgumentException, 
uno::RuntimeException)
 if (bParaAfterInserted)
 {
 SwCursor aDelete(*pEndPam-GetPoint(), 0, false);
+*pEndPam-GetPoint() = // park it because node is deleted
+SwPosition(GetDoc()-GetNodes().GetEndOfContent());
 aDelete.MovePara(fnParaCurr, fnParaStart);
 aDelete.SetMark();
 aDelete.MovePara(fnParaCurr, fnParaEnd);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-06-04 Thread Andrzej J . R . Hunt
 sw/source/ui/uiview/viewsrch.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 660f54347433b05cb2d0ab081ddf6209aff47cd2
Author: Andrzej J.R. Hunt andr...@ahunt.org
Date:   Mon May 27 18:55:05 2013 +0100

fdo#65014 Fix backwards/forwards search change of direction.

Begin a search from the extremity of the selected region instead of from the
cursor position. Previously when changing search direction the first
result is the same  as has been previously found when searching forwards 
as
the cursor is at the end of the selection, and the search region is from the
end of the previous result to the begin of the document. Now the selected
or previously found region is ignored. This only affects normal searches,
and does not have any effect when multiple regions are selected.

Change-Id: I65a5d94b898dd4b7467889b1932f42c9b6b523fe
Reviewed-on: https://gerrit.libreoffice.org/4061
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com
(cherry picked from commit c73a65db14f8ee57e382a04b0d38a704c0308458)

Signed-off-by: Michael Stahl mst...@redhat.com

diff --git a/sw/source/ui/uiview/viewsrch.cxx b/sw/source/ui/uiview/viewsrch.cxx
index fce4d50..7e07a36 100644
--- a/sw/source/ui/uiview/viewsrch.cxx
+++ b/sw/source/ui/uiview/viewsrch.cxx
@@ -444,6 +444,13 @@ sal_Bool SwView::SearchAndWrap(sal_Bool bApi)
 // aus 'Suche alle'
 m_pWrtShell-StartAllAction();
 m_pWrtShell-Push();
+
+// fdo#65014 : Ensure that the point of the cursor is at the extremity of 
the
+// selection closest to the end being searched to as to exclude the 
selected
+// region from the search. (This doesn't work in the case of multiple
+// selected regions as the cursor doesn't mark the selection in that case.)
+m_pWrtShell-GetCrsr()-Normalize( m_pSrchItem-GetBackward() );
+
 // falls in selektierten Bereichen gesucht werden soll, duerfen sie
 // nicht aufgehoben werden
 if (!m_pSrchItem-GetSelection())
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-06-04 Thread Michael Stahl
 sw/source/core/doc/acmplwrd.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 452b2172c37537aa059d08307b4592adecc20960
Author: Michael Stahl mst...@redhat.com
Date:   Tue Jun 4 23:32:09 2013 +0200

fdo#61923: sw: word completion: do not add trailing '.'

SwAutoCompleteWord::InsertWord(): use the computed nWrdLen to cut off
trailing periods.

(regression from d602a3b280fcc1cf16660d8719cd8eb8797dd2ad)

Change-Id: I9f4ace62f8d9e7d233e7e210f476856d7841d869
(cherry picked from commit 246d7e280ea8b7d1e27e14a6568d2a65cc8c9e7b)

diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx
index 4853ffc..2c865b4 100644
--- a/sw/source/core/doc/acmplwrd.cxx
+++ b/sw/source/core/doc/acmplwrd.cxx
@@ -265,7 +265,7 @@ bool SwAutoCompleteWord::InsertWord( const String rWord, 
SwDoc rDoc )
 std::pairediteng::SortedAutoCompleteStrings::const_iterator, bool
 aInsPair = m_WordList.insert(pNew);
 
-m_LookupTree-insert( OUString(aNewWord) );
+m_LookupTree-insert( OUString(aNewWord).copy(0, nWrdLen) );
 
 if (aInsPair.second)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-06-03 Thread Michael Stahl
 sw/source/core/doc/doctxm.cxx |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 40c21a597f7c9709c88b398ec74a401a70835b12
Author: Michael Stahl mst...@redhat.com
Date:   Tue Jun 4 01:04:02 2013 +0200

i#30979: sw: fix crash on Flys anchored in ToX

When a fly is anchored at the first paragraph of a ToX, as happens in
the WW8 bugdoc in i#30979, updating the ToX will remove the anchor
node, and bad things happen, including ~SwIndexReg assert and also
eventually a crash when editing the Frame and updating the ToX a few
times.  Probably best to really remove all anchored flys here.

Note that it's not enough to re-anchor to the empty node that is
inserted here because that one will also be removed again.

While we're at it the _DelBookmarks is superfluous because CorrAbs
does exactly that 2 lines above.

Change-Id: Id40ae1d88ad99813b93bea7470f5dc790edcc80c
(cherry picked from commit a396485f5b8bd5724f9897e1df466c5dcee0ffed)

diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 4ed21ab..1bcd892 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -856,9 +856,10 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr,
 SwPosition aPos( aEndIdx, SwIndex( pFirstEmptyNd, 0 ));
 pDoc-CorrAbs( aSttIdx, aEndIdx, aPos, sal_True );
 
-// delete all before
-DelFlyInRange( aSttIdx, aEndIdx );
-_DelBookmarks( aSttIdx, aEndIdx );
+// delete flys in whole range including start node which requires
+// giving the node before start node as Mark parameter, hence -1.
+// (flys must be deleted because the anchor nodes are removed)
+DelFlyInRange( SwNodeIndex(aSttIdx, -1), aEndIdx );
 
 pDoc-GetNodes().Delete( aSttIdx, aEndIdx.GetIndex() - 
aSttIdx.GetIndex() );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-05-31 Thread Michael Stahl
 sw/source/core/unocore/unoframe.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit f4743b5e7e6be74c1f399b7726ca85e38c96c132
Author: Michael Stahl mst...@redhat.com
Date:   Fri May 31 12:34:35 2013 +0200

sw: SwXFrame: fix gradient import problem:

BaseFrameProperties_Impl::FillBaseProperties: It may happen that
checkForUniqueItem returns an item with a name that already exists, if
the same gradient appears multiple times; don't crash with unhandled
ElementExistException then.
(can be reproduced with test3.docx from fdo#41466)
(regression from 1a3c90a292c7fc9060604151de9dc51eecf5b6a7)

Change-Id: Iace7af4c5679c1c7e978525fa31abf884038567c
(cherry picked from commit f5e8f5b0b5410d29b5cb1fb6fbbd8bf3c48a0201)

diff --git a/sw/source/core/unocore/unoframe.cxx 
b/sw/source/core/unocore/unoframe.cxx
index d3d5ed5..0273a1e 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -267,7 +267,10 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SwDoc* 
pDoc, SfxItemSet rToSe
 uno::Referenceframe::XModel 
xModel(pDoc-GetDocShell()-GetModel());
 uno::Referencelang::XMultiServiceFactory 
xServiceFact(xModel, uno::UNO_QUERY);
 uno::Reference container::XNameContainer  
xGradients(xServiceFact-createInstance(com.sun.star.drawing.GradientTable), 
uno::UNO_QUERY);
-xGradients-insertByName(pItem-GetName(), *pFillGradient);
+if (!xGradients-hasByName(pItem-GetName()))
+{
+xGradients-insertByName(pItem-GetName(), 
*pFillGradient);
+}
 
 delete pItem;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-05-31 Thread Luboš Luňák
 sw/source/core/txtnode/fntcap.cxx |   11 ++-
 sw/source/core/txtnode/swfont.cxx |2 ++
 2 files changed, 8 insertions(+), 5 deletions(-)

New commits:
commit c7880eff4d1ae4112ce786cff7f141a6f69c475d
Author: Luboš Luňák l.lu...@suse.cz
Date:   Fri May 31 17:51:36 2013 +0200

audit incorrect uses of SwDrawTextInfo (fdo#65013)

f22006dc6ac34a35a060e15466cf6b2d2058617d stopped SwDrawTextInfo using
pointers to outside data (which lead to various uses of variables
that have already gone out of scope). This commit (hopefully) fixes
all uses of the clash that relied on the fact that the underlying
data changed behind the scenes.

Change-Id: I820f13a90b9d1a8055f8e317ca8debc969c39bc0

diff --git a/sw/source/core/txtnode/fntcap.cxx 
b/sw/source/core/txtnode/fntcap.cxx
index e2b48e4..1868698 100644
--- a/sw/source/core/txtnode/fntcap.cxx
+++ b/sw/source/core/txtnode/fntcap.cxx
@@ -556,7 +556,6 @@ void SwSubFont::DoOnCapitals( SwDoCapitals rDo )
 {
 OSL_ENSURE( pLastFont, SwFont::DoOnCapitals: No LastFont?! );
 
-Size aPartSize;
 long nKana = 0;
 const XubString aTxt( CalcCaseMap( rDo.GetInf().GetText() ) );
 xub_StrLen nMaxPos = std::min( 
sal_uInt16(rDo.GetInf().GetText().getLength() - rDo.GetInf().GetIdx()),
@@ -565,7 +564,6 @@ void SwSubFont::DoOnCapitals( SwDoCapitals rDo )
 
 const XubString rOldText = rDo.GetInf().GetText();
 rDo.GetInf().SetText( aTxt );
-rDo.GetInf().SetSize( aPartSize );
 xub_StrLen nPos = rDo.GetInf().GetIdx();
 xub_StrLen nOldPos = nPos;
 nMaxPos = nMaxPos + nPos;
@@ -686,11 +684,12 @@ void SwSubFont::DoOnCapitals( SwDoCapitals rDo )
 
 rDo.GetInf().SetUpper( sal_False );
 rDo.GetInf().SetOut( *pOutSize );
-aPartSize = pSmallFont-GetTextSize( rDo.GetInf() );
+Size aPartSize = pSmallFont-GetTextSize( rDo.GetInf() );
 nKana += rDo.GetInf().GetKanaDiff();
 rDo.GetInf().SetOut( *pOldOut );
 if( nTmpKern  nPos  nMaxPos )
 aPartSize.Width() += nTmpKern;
+rDo.GetInf().SetSize( aPartSize );
 rDo.Do();
 nOldPos = nPos;
 }
@@ -750,13 +749,14 @@ void SwSubFont::DoOnCapitals( SwDoCapitals rDo )
 }
 
 rDo.GetInf().SetOut( *pOutSize );
-aPartSize = pBigFont-GetTextSize( rDo.GetInf() );
+Size aPartSize = pBigFont-GetTextSize( rDo.GetInf() );
 nKana += rDo.GetInf().GetKanaDiff();
 rDo.GetInf().SetOut( *pOldOut );
 if( nSpaceAdd )
 aPartSize.Width() += nSpaceAdd * ( nTmp - nOldPos 
);
 if( nTmpKern  nPos  nMaxPos )
 aPartSize.Width() += nTmpKern;
+rDo.GetInf().SetSize( aPartSize );
 rDo.Do();
 aStartPos = rDo.GetInf().GetPos();
 nOldPos = nTmp;
@@ -790,7 +790,7 @@ void SwSubFont::DoOnCapitals( SwDoCapitals rDo )
 }
 
 rDo.GetInf().SetOut( *pOutSize );
-aPartSize = pBigFont-GetTextSize( rDo.GetInf() );
+Size aPartSize = pBigFont-GetTextSize( rDo.GetInf() );
 nKana += rDo.GetInf().GetKanaDiff();
 rDo.GetInf().SetOut( *pOldOut );
 if( !bWordWise  rDo.GetInf().GetSpace() )
@@ -803,6 +803,7 @@ void SwSubFont::DoOnCapitals( SwDoCapitals rDo )
 }
 if( nTmpKern  nPos  nMaxPos )
 aPartSize.Width() += nTmpKern;
+rDo.GetInf().SetSize( aPartSize );
 rDo.Do();
 nOldPos = nTmp;
 }
diff --git a/sw/source/core/txtnode/swfont.cxx 
b/sw/source/core/txtnode/swfont.cxx
index 068fd71..977b6d2 100644
--- a/sw/source/core/txtnode/swfont.cxx
+++ b/sw/source/core/txtnode/swfont.cxx
@@ -1002,6 +1002,8 @@ void SwSubFont::_DrawStretchText( SwDrawTextInfo rInf )
 
 if ( rInf.GetFrm()-IsVertical() )
 rInf.GetFrm()-SwitchHorizontalToVertical( aPos );
+
+rInf.SetPos( aPos );
 }
 
 if ( !IsCaseMap() )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-05-28 Thread Jian Fang Zhang
 sw/source/filter/xml/xmltbli.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit b4311a2871e16001138e6d0009a552dc53d7bcd3
Author: Jian Fang Zhang zhan...@apache.org
Date:   Tue Sep 4 01:05:22 2012 +

Resolves: #i113600# Add call to subtable SwXMLTableRow_Impl.dispose()...

to break cycle reference to SwXMLTableContext object

Found by: zhangjf
Patch by: zhangjf

(cherry picked from commit ba47a717e009b2b497cbccfca2872e66f9ecb130)

Change-Id: Iba0b581920417b3866b07542621d56ccdc272261
(cherry picked from commit fc08fc98655397103ce7aacc18c2aa538ccff4e1)

diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx
index 617faf4..dd8b358 100644
--- a/sw/source/filter/xml/xmltbli.cxx
+++ b/sw/source/filter/xml/xmltbli.cxx
@@ -2867,6 +2867,9 @@ void SwXMLTableContext::MakeTable( SwTableBox *pBox, 
sal_Int32 nW )
 bRelWidth = GetParentTable()-bRelWidth;
 
 _MakeTable( pBox );
+
+for (size_t i=0; i  pRows-size(); ++i) // i113600, to break the cyclic 
reference to SwXMLTableContext object
+(*pRows)[i].Dispose();
 }
 
 const SwStartNode *SwXMLTableContext::InsertTableSection(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-05-27 Thread Khaled Hosny
 sw/source/core/txtnode/swfont.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 0c0e7f1bd48d1a89ccdba3f5e773186123943e43
Author: Khaled Hosny khaledho...@eglug.org
Date:   Sat May 25 14:33:46 2013 +0200

Fix fdo#64685 - Superscript broken in master

After f22006dc6ac34a35a060e15466cf6b2d2058617d the position member of
SwDrawTextInfo is no longer a pointer, so changing the passed Point
after calling SetPos() has no effect, but some code seems to be relying
on it being pointer. Moving SetPos() to after changing the point seems
to do the trick, but there may be other similarly broken code like
SwSubFont::_DrawStretchText() below.

Change-Id: I2f563c1543ff7bff68e573f69fce39694181b370
Reviewed-on: https://gerrit.libreoffice.org/4032
Reviewed-by: David Tardon dtar...@redhat.com
Tested-by: David Tardon dtar...@redhat.com
(cherry picked from commit 6e6b028164176e39219dccbe1b84380b10b6e64f)

Signed-off-by: David Tardon dtar...@redhat.com

diff --git a/sw/source/core/txtnode/swfont.cxx 
b/sw/source/core/txtnode/swfont.cxx
index 02b5add..068fd71 100644
--- a/sw/source/core/txtnode/swfont.cxx
+++ b/sw/source/core/txtnode/swfont.cxx
@@ -850,12 +850,12 @@ void SwSubFont::_DrawText( SwDrawTextInfo rInf, const 
sal_Bool bGrey )
 SwDigitModeModifier aDigitModeModifier( rInf.GetOut(), 
rInf.GetFont()-GetLanguage() );
 
 Point aPos( rInf.GetPos() );
-const Point rOld = rInf.GetPos();
-rInf.SetPos( aPos );
 
 if( GetEscapement() )
 CalcEsc( rInf, aPos );
 
+const Point rOld = rInf.GetPos();
+rInf.SetPos( aPos );
 rInf.SetKern( CheckKerning() + rInf.GetSperren() / 
SPACING_PRECISION_FACTOR );
 
 if( IsCapital() )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

2013-05-26 Thread Luke Deller
 sw/source/filter/xml/xmltbli.cxx |   26 ++
 1 file changed, 6 insertions(+), 20 deletions(-)

New commits:
commit 1834009c19946ab47de343deb97cbc50475fb96a
Author: Luke Deller l...@deller.id.au
Date:   Thu May 23 02:05:36 2013 +1000

fix fdo#64872 infinite loop saving as doc

When loading from odt, table cells which are covered (due to merging of
cells) are replaced with an empty cell by
SwXMLTableContext::ReplaceWithEmptyCell.  However if there is a sequence
of cells covered from above then their replacements are accidentally
inserted in reverse order, which produces this infinite loop problem when
saving as doc.

The reverse ordering in SwXMLTableContext::ReplaceWithEmptyCell was because
the insert position came from SwXMLTableContext::GetPrevStartNode which was
very careful to skip previous covered cells.  However those cells have
already been replaced with an empty cell so they should not be skipped.

Change-Id: I6a022cd1490afa181dbc3e4b2d6ed4af3077b363
Reviewed-on: https://gerrit.libreoffice.org/4028
Reviewed-by: David Tardon dtar...@redhat.com
Tested-by: David Tardon dtar...@redhat.com

diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx
index 5a367cd..617faf4 100644
--- a/sw/source/filter/xml/xmltbli.cxx
+++ b/sw/source/filter/xml/xmltbli.cxx
@@ -1804,29 +1804,15 @@ const SwStartNode *SwXMLTableContext::GetPrevStartNode( 
sal_uInt32 nRow,
 // The last cell is the right one here.
 pPrevCell = GetCell( pRows-size()-1U, GetColumnCount()-1UL );
 }
-else if( 0UL == nRow )
+else if( nCol  0UL )
 {
-// There are no vertically merged cells within the first row, so the
-// previous cell is the right one always.
-if( nCol  0UL )
-pPrevCell = GetCell( nRow, nCol-1UL );
+// The previous cell in this row.
+pPrevCell = GetCell( nRow, nCol-1UL );
 }
-else
+else if( nRow  0UL )
 {
-// If there is a previous cell in the current row that is not spanned
-// from the previous row, its the right one.
-const SwXMLTableRow_Impl *pPrevRow = (*pRows)[(sal_uInt16)nRow-1U];
-sal_uInt32 i = nCol;
-while( !pPrevCell   i  0UL )
-{
-i--;
-if( 1UL == pPrevRow-GetCell( i )-GetRowSpan() )
-pPrevCell = GetCell( nRow, i );
-}
-
-// Otherwise, the last cell from the previous row is the right one.
-if( !pPrevCell )
-pPrevCell = pPrevRow-GetCell( GetColumnCount()-1UL );
+// The last cell from the previous row.
+pPrevCell = GetCell( nRow-1UL, GetColumnCount()-1UL );
 }
 
 const SwStartNode *pSttNd = 0;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits