[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - 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 6add0104e250fd8653a93450d371404aa3ff3a6c
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.

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

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

diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index 427c4fa..6b55cea 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -416,9 +416,14 @@ bool SwPaM::DoSearch( const SearchOptions rSearchOpt, 
utl::TextSearch rSTxt,
 bool bRemoveSoftHyphens = true;
 if ( bRegSearch )
 {
-const rtl::OUString a00AD(RTL_CONSTASCII_USTRINGPARAM(\\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-0' - 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 e3fdff9d00c9ef598210853f7094e8f986586e0b
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

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

diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx
index c351e38..373731e 100644
--- a/sw/source/ui/shells/textsh1.cxx
+++ b/sw/source/ui/shells/textsh1.cxx
@@ -311,8 +311,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)
@@ -352,6 +350,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 );
 
@@ -366,10 +370,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-0' - 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 f431f2fbaad8098870b1f9bdb71b6db514d2cbda
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/6176
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 6d34685..52b0b40 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -2469,17 +2469,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-0' - 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 2da3517dd289e00b98f7f8616a4faa9b00fb8403
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/5978
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 17c0aea..ca7326b 100644
--- a/sw/source/ui/docvw/SidebarWin.cxx
+++ b/sw/source/ui/docvw/SidebarWin.cxx
@@ -596,11 +596,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-0' - 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 9471b1704f64a0c08f76ad8d88eff58be7ed414a
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/5990
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 84112df..23f0895 100644
--- a/sw/source/filter/ww8/ww8scan.hxx
+++ b/sw/source/filter/ww8/ww8scan.hxx
@@ -797,7 +797,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-0' - sw/source

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

New commits:
commit 00aabe82947b1452931a7164738c94af6f47b520
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/5765
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sw/source/ui/index/swuiidxmrk.cxx 
b/sw/source/ui/index/swuiidxmrk.cxx
index c20fc11..704029e 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-0' - sw/source

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

New commits:
commit 5f387c93e42ba1028e9fc54e10cb0e8c0e1b7a75
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/5663
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 37210b2..e971d1e 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -2749,7 +2749,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-0' - sw/source

2013-08-21 Thread Michael Stahl
 sw/source/core/doc/docdesc.cxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit 1514f2c5d00a6f4743f942c93c3a930e13c14263
Author: Michael Stahl mst...@redhat.com
Date:   Tue Aug 20 14:56:41 2013 +0200

fix undetected(?) merge conflict

commits 49e308ce893e461a121ea7d90ec9514f05bf62aa and
f7433971d901f8f66538ef8df3e7729b0047ca2c were pushed out-of-order and as
a result the pDesc-ChgFirstShare( rChged.IsFirstShared() );
somehow managed to get duplicated, which makes
f7433971d901f8f66538ef8df3e7729b0047ca2c ineffective for footers;
remove the duplicate.

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

diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index 2e45e60..932eb84 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -352,8 +352,6 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc 
rChged )
 CopyMasterHeader(rChged, rHead, pDesc, true); // Copy left header
 CopyMasterHeader(rChged, rHead, pDesc, false); // Copy first header
 pDesc-ChgHeaderShare( rChged.IsHeaderShared() );
-// there is just one first shared flag for both header and footer?
-pDesc-ChgFirstShare( rChged.IsFirstShared() );
 
 // Synch Footer.
 const SwFmtFooter rFoot = rChged.GetMaster().GetFooter();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-08-21 Thread Michael Stahl
 sw/source/core/doc/docdesc.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 34f55adfd701c4cc3dd7c804690cd946cec30e48
Author: Michael Stahl mst...@redhat.com
Date:   Mon Aug 19 14:45:20 2013 +0200

fdo#66145: revert change to CopyMasterHeader

Not copying the nodes for first page is not an option; the real problem
with the fdo45183.rtf is that flys in the header are not copied
along with the nodes, like it is done in
SwDoc::CopyPageDescHeaderFooterImpl.

Also, the same problem may occur for footers too (CopyMasterFooter).

Conflicts:
sw/source/core/doc/docdesc.cxx

The comment above is for the master commit, but copyting the flys is
actually necessary with e1a9a348a519a69f898c9c1e6d87a5837b8267f9 too,
since that copying code is now executed when changing sharing flags in
the UI so withtout this commit you lose any flys anchored in the
header/footer.

(cherry picked from commit bf206549228685a68e1504db05119d8fa1d354b3)

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

diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index 932eb84..5f37fe2 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -215,6 +215,8 @@ void SwDoc::CopyMasterHeader(const SwPageDesc rChged, 
const SwFmtHeader rHead,
 *aRCnt.GetCntntIdx()-GetNode().EndOfSectionNode() 
);
 aTmp = *pSttNd-EndOfSectionNode();
 GetNodes()._Copy( aRange, aTmp, sal_False );
+aTmp = *pSttNd;
+CopyFlyInFlyImpl(aRange, 0, aTmp);
 
 pFmt-SetFmtAttr( SwFmtCntnt( pSttNd ) );
 rDescFrmFmt.SetFmtAttr( SwFmtHeader( pFmt ) );
@@ -274,6 +276,8 @@ void SwDoc::CopyMasterFooter(const SwPageDesc rChged, 
const SwFmtFooter rFoot,
 *aRCnt.GetCntntIdx()-GetNode().EndOfSectionNode() 
);
 aTmp = *pSttNd-EndOfSectionNode();
 GetNodes()._Copy( aRange, aTmp, sal_False );
+aTmp = *pSttNd;
+CopyFlyInFlyImpl(aRange, 0, aTmp);
 
 pFmt-SetFmtAttr( SwFmtCntnt( pSttNd ) );
 rDescFrmFmt.SetFmtAttr( SwFmtFooter( pFmt ) );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-08-20 Thread Michael Stahl
 sw/source/core/doc/docdesc.cxx |   14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

New commits:
commit f7433971d901f8f66538ef8df3e7729b0047ca2c
Author: Michael Stahl mst...@redhat.com
Date:   Tue Aug 20 11:50:34 2013 +0200

fdo#66145: fix copying of header/footer when un-sharing

SwDoc::CopyMasterHeader/Footer(): this could result in sharing the
first-page header/footer with the left-page (!) when un-sharing
via the dialog; the reason is that what actually happens here is that
the left-page header/footer was never changed but the master one
was copied in SwDocStyleSheet::SetItemSet(), so it sort of worked
by accident before the first-page header/footer was added...

Change-Id: Ia24df6ad59cda484559f2ca48ecaa7563878120b
(cherry picked from commit e1a9a348a519a69f898c9c1e6d87a5837b8267f9)
Reviewed-on: https://gerrit.libreoffice.org/5536
Reviewed-by: Petr Mladek pmla...@suse.cz
Tested-by: Petr Mladek pmla...@suse.cz

diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index 1852b4c..6c31cbf 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -197,7 +197,11 @@ void SwDoc::CopyMasterHeader(const SwPageDesc rChged, 
const SwFmtHeader rHead,
 const SwFrmFmt rChgedFrmFmt = (bLeft ? rChged.GetLeft() : 
rChged.GetFirst());
 rDescFrmFmt.SetFmtAttr( rChgedFrmFmt.GetHeader() );
 }
-else if( (*aRCnt.GetCntntIdx()) == (*aCnt.GetCntntIdx()) )
+else if ((*aRCnt.GetCntntIdx() == *aCnt.GetCntntIdx()) ||
+// 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()))
 {
 SwFrmFmt *pFmt = new SwFrmFmt( GetAttrPool(), (bLeft ? Left 
header : First header),
 GetDfltFrmFmt() );
@@ -252,7 +256,11 @@ void SwDoc::CopyMasterFooter(const SwPageDesc rChged, 
const SwFmtFooter rFoot,
 const SwFrmFmt rChgedFrmFmt = (bLeft ? rChged.GetLeft() : 
rChged.GetFirst());
 rDescFrmFmt.SetFmtAttr( rChgedFrmFmt.GetFooter() );
 }
-else if( (*aRCnt.GetCntntIdx()) == (*aLCnt.GetCntntIdx()) )
+else if ((*aRCnt.GetCntntIdx() == *aLCnt.GetCntntIdx()) ||
+// 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()))
 {
 SwFrmFmt *pFmt = new SwFrmFmt( GetAttrPool(), (bLeft ? Left 
footer : First footer),
 GetDfltFrmFmt() );
@@ -362,6 +370,8 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc 
rChged )
 CopyMasterFooter(rChged, rFoot, pDesc, true); // Copy left footer
 CopyMasterFooter(rChged, rFoot, pDesc, false); // Copy first footer
 pDesc-ChgFooterShare( rChged.IsFooterShared() );
+// there is just one first shared flag for both header and footer?
+pDesc-ChgFirstShare( rChged.IsFirstShared() );
 
 if ( pDesc-GetName() != rChged.GetName() )
 pDesc-SetName( rChged.GetName() );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-08-20 Thread Michael Stahl
 sw/source/core/layout/pagedesc.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit a0342b16c6a837f8fcecd3c7983df119e459b67f
Author: Michael Stahl mst...@redhat.com
Date:   Tue Aug 20 11:41:37 2013 +0200

fdo#66145: do not check IsFirstShared() in SwPageDesc::GetLeftFmt()

... and GetRightFmt().  If the first format is requested it must be
returned; the sharing works by copying the SwFmtHeader/Footer from
aMaster to the other members.

(regression from 4dc78aee9bcdb6ea5e9dc47ebb4a4b9e590c725a)

Change-Id: I1708f01c18b155ae75c14fc407e52ccd2bd798d7
(cherry picked from commit 4df438c9a9d5e698c47c1e85903eb81880a5e6fa)
Reviewed-on: https://gerrit.libreoffice.org/5534
Reviewed-by: Petr Mladek pmla...@suse.cz
Tested-by: Petr Mladek pmla...@suse.cz

diff --git a/sw/source/core/layout/pagedesc.cxx 
b/sw/source/core/layout/pagedesc.cxx
index 7e8586b..aa966df 100644
--- a/sw/source/core/layout/pagedesc.cxx
+++ b/sw/source/core/layout/pagedesc.cxx
@@ -348,14 +348,14 @@ sal_Bool SwPageDesc::IsFollowNextPageOfNode( const 
SwNode rNd ) const
 SwFrmFmt *SwPageDesc::GetLeftFmt(bool const bFirst)
 {
 return (nsUseOnPage::PD_LEFT  eUse)
-? (bFirst  !IsFirstShared()) ? aFirst : aLeft
+? ((bFirst) ? aFirst : aLeft)
 : 0;
 }
 
 SwFrmFmt *SwPageDesc::GetRightFmt(bool const bFirst)
 {
 return (nsUseOnPage::PD_RIGHT  eUse)
-? (bFirst  !IsFirstShared()) ? aFirst : aMaster
+? ((bFirst) ? aFirst : aMaster)
 : 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-0' - sw/source

2013-08-20 Thread Michael Stahl
 sw/source/core/doc/docdesc.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 49e308ce893e461a121ea7d90ec9514f05bf62aa
Author: Michael Stahl mst...@redhat.com
Date:   Tue Aug 20 11:51:27 2013 +0200

fdo#66145: fix Undo invalidation in SwDoc::ChgPageDesc()

SwDoc::ChgPageDesc(): make the invalidation of the Undo stack on
change of IsFirstShared work by delaying ChgFirstShare() until after
the check.

Change-Id: Ifbefe446df8b6d785ed1bb6394ec5beb803fb1fe
(cherry picked from commit 0b7a823bb6df79384939dda4de3b7f28e5e52758)
Reviewed-on: https://gerrit.libreoffice.org/5535
Reviewed-by: Petr Mladek pmla...@suse.cz
Tested-by: Petr Mladek pmla...@suse.cz

diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index 6c31cbf..2e45e60 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -332,7 +332,6 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc 
rChged )
 
 // Take over orientation
 pDesc-SetLandscape( rChged.GetLandscape() );
-pDesc-ChgFirstShare( rChged.IsFirstShared() );
 
 // #i46909# no undo if header or footer changed
 bool bHeaderFooterChanged = false;
@@ -353,6 +352,8 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc 
rChged )
 CopyMasterHeader(rChged, rHead, pDesc, true); // Copy left header
 CopyMasterHeader(rChged, rHead, pDesc, false); // Copy first header
 pDesc-ChgHeaderShare( rChged.IsHeaderShared() );
+// there is just one first shared flag for both header and footer?
+pDesc-ChgFirstShare( rChged.IsFirstShared() );
 
 // Synch Footer.
 const SwFmtFooter rFoot = rChged.GetMaster().GetFooter();
@@ -363,8 +364,7 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc 
rChged )
 const SwFmtFooter rOldFoot = pDesc-GetMaster().GetFooter();
 bHeaderFooterChanged |=
 ( rFoot.IsActive() != rOldFoot.IsActive() ||
-  rChged.IsFooterShared() != pDesc-IsFooterShared() ||
-  rChged.IsFirstShared() != pDesc-IsFirstShared() );
+  rChged.IsFooterShared() != pDesc-IsFooterShared() );
 }
 pDesc-GetMaster().SetFmtAttr( rFoot );
 CopyMasterFooter(rChged, rFoot, pDesc, true); // Copy left footer
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - 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 3ea53259def615152c2edb0381cbe0cd5a78cc48
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/5434
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 df85ebc..7505830 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -1116,25 +1116,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-0' - 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 8bf69e2abf94b94afedeb0b7d7644e5626954122
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/5407
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 49ea80a..1b3dda4 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -2332,11 +2332,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 )
 {
@@ -2380,6 +2383,7 @@ void SwNodes::RemoveNode( sal_uLong nDelPos, sal_uLong 
nSz, sal_Bool bDel )
 }
 }
 
+std::vectorTempBigPtrEntry aTempEntries;
 if( bDel )
 {
 sal_uLong nCnt = nSz;
@@ -2392,14 +2396,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-0' - 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 a179db327c739f3580cf11201b1f6c8520bc2dcb
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/4870
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 59ac47c..7ee8a63 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-0' - sw/source

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

New commits:
commit 2a36c1fb1b5d33b49444deb465c861bb1850732b
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/4663
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 e5b312d..cb69180 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -2024,7 +2024,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-0' - 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 213f32fc9839fce3b01af938293eca331b544dd3
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/4611

diff --git a/sw/source/core/layout/frmtool.cxx 
b/sw/source/core/layout/frmtool.cxx
index 73d891b..56fd4dd 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -1931,7 +1931,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-0' - sw/source

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

New commits:
commit 31a53b30b040021e503f779fd63d62ef723d82b0
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.

(cherry picked from commit cfa994ccbd6ee681f5ab3648ce068c4881b495f5)

Conflicts:
sw/source/core/view/viewsh.cxx

Change-Id: Icda4ad835a398bbd50139be32ff5014a34f23bd5
Reviewed-on: https://gerrit.libreoffice.org/4489
Reviewed-by: Thorsten Behrens tbehr...@suse.com
Tested-by: Thorsten Behrens tbehr...@suse.com
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index e50adf9..a3418ef 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -106,6 +106,44 @@ void ViewShell::ToggleHeaderFooterEdit()
 }
 
 //
+
+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
@@ -367,39 +405,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 );
-}
-  

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

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

New commits:
commit 5a246765fced0099ae9071c8df98636638ee0b18
Author: László Németh nem...@numbertext.org
Date:   Wed Jun 19 12:11:10 2013 +0200

fdo#65666 keep tabs in footnote settings of sections (backport)

Change-Id: I7dc2f54e6e3a83de59e20fd568b46a3b25fb6b66
Reviewed-on: https://gerrit.libreoffice.org/4353
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 7f476f1..a195847 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -1969,11 +1969,16 @@ sal_Bool SwSectionFtnEndTabPage::FillItemSet( 
SfxItemSet rSet )
 switch( aFtn.GetValue() )
 {
 case FTNEND_ATTXTEND_OWNNUMANDFMT:
+  {
 aFtn.SetNumType( aFtnNumViewBox.GetSelectedNumberingType() );
-aFtn.SetPrefix( aFtnPrefixED.GetText() );
-aFtn.SetSuffix( aFtnSuffixED.GetText() );
+String aPrefix( aFtnPrefixED.GetText() );
+aPrefix.SearchAndReplaceAllAscii(\\t, '\t'); // fdo#65666
+aFtn.SetPrefix( aPrefix );
+String aSuffix( aFtnSuffixED.GetText() );
+aSuffix.SearchAndReplaceAllAscii(\\t, '\t');
+aFtn.SetSuffix( aSuffix );
 // no break;
-
+  }
 case FTNEND_ATTXTEND_OWNNUMSEQ:
 aFtn.SetOffset( static_cast sal_uInt16 ( aFtnOffsetFld.GetValue()-1 
) );
 // no break;
@@ -1990,11 +1995,16 @@ sal_Bool SwSectionFtnEndTabPage::FillItemSet( 
SfxItemSet rSet )
 switch( aEnd.GetValue() )
 {
 case FTNEND_ATTXTEND_OWNNUMANDFMT:
+  {
 aEnd.SetNumType( aEndNumViewBox.GetSelectedNumberingType() );
-aEnd.SetPrefix( aEndPrefixED.GetText() );
-aEnd.SetSuffix( aEndSuffixED.GetText() );
+String aPrefix( aEndPrefixED.GetText() );
+aPrefix.SearchAndReplaceAllAscii(\\t, '\t');
+aEnd.SetPrefix( aPrefix );
+String aSuffix( aEndSuffixED.GetText() );
+aSuffix.SearchAndReplaceAllAscii(\\t, '\t');
+aEnd.SetSuffix( aSuffix );
 // no break;
-
+  }
 case FTNEND_ATTXTEND_OWNNUMSEQ:
 aEnd.SetOffset( static_cast sal_uInt16 ( aEndOffsetFld.GetValue()-1 
) );
 // no break;
@@ -2061,8 +2071,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-0' - 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 49c783437f37b52f1feeb415d1fc9274b185a488
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
Reviewed-on: https://gerrit.libreoffice.org/4336
Reviewed-by: Noel Power noel.po...@suse.com
Tested-by: Noel Power noel.po...@suse.com

diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx 
b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
index fb942bb..3fe4709 100644
--- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx
+++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
@@ -369,25 +369,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-0' - sw/source

2013-06-18 Thread Andras Timar
 sw/source/ui/dialog/uiregionsw.cxx |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 595d667e64c1559b51ce407f6893b51014bdc11d
Author: Andras Timar ati...@suse.com
Date:   Tue Jun 18 19:29:35 2013 +0200

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

This reverts commit 78c6f41401da08d27301d09d3d04ad01cb6df939.

diff --git a/sw/source/ui/dialog/uiregionsw.cxx 
b/sw/source/ui/dialog/uiregionsw.cxx
index 08cf79d..7f476f1 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -1970,8 +1970,8 @@ sal_Bool SwSectionFtnEndTabPage::FillItemSet( SfxItemSet 
rSet )
 {
 case FTNEND_ATTXTEND_OWNNUMANDFMT:
 aFtn.SetNumType( aFtnNumViewBox.GetSelectedNumberingType() );
-aFtn.SetPrefix( aFtnPrefixED.GetText().replaceAll(\\t, \t) ); // 
fdo#65666
-aFtn.SetSuffix( aFtnSuffixED.GetText().replaceAll(\\t, \t) );
+aFtn.SetPrefix( aFtnPrefixED.GetText() );
+aFtn.SetSuffix( aFtnSuffixED.GetText() );
 // no break;
 
 case FTNEND_ATTXTEND_OWNNUMSEQ:
@@ -1991,8 +1991,8 @@ sal_Bool SwSectionFtnEndTabPage::FillItemSet( SfxItemSet 
rSet )
 {
 case FTNEND_ATTXTEND_OWNNUMANDFMT:
 aEnd.SetNumType( aEndNumViewBox.GetSelectedNumberingType() );
-aEnd.SetPrefix( aEndPrefixED.GetText().replaceAll(\\t, \t) );
-aEnd.SetSuffix( aEndSuffixED.GetText().replaceAll(\\t, \t) );
+aEnd.SetPrefix( aEndPrefixED.GetText() );
+aEnd.SetSuffix( aEndSuffixED.GetText() );
 // no break;
 
 case FTNEND_ATTXTEND_OWNNUMSEQ:
@@ -2061,8 +2061,8 @@ void SwSectionFtnEndTabPage::ResetState( sal_Bool bFtn,
 
 pNumViewBox-SelectNumberingType( rAttr.GetNumType() );
 pOffsetFld-SetValue( rAttr.GetOffset() + 1 );
-pPrefixED-SetText( rAttr.GetPrefix().replaceAll(\t, \\t) );
-pSuffixED-SetText( rAttr.GetSuffix().replaceAll(\t, \\t) );
+pPrefixED-SetText( rAttr.GetPrefix() );
+pSuffixED-SetText( rAttr.GetSuffix() );
 
 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-0' - 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 0d583c89697cb2349d125becc14bc8a8b56d6bc8
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/4235
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 3a59919..4ca616d 100644
--- a/sw/source/ui/misc/docfnote.cxx
+++ b/sw/source/ui/misc/docfnote.cxx
@@ -170,8 +170,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());
@@ -376,8 +376,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-0' - sw/source

2013-06-13 Thread David Tardon
 sw/source/ui/misc/docfnote.cxx |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit f6cf8c5d32c44a77ee245f580c6c8721eddd8618
Author: David Tardon dtar...@redhat.com
Date:   Thu Jun 13 16:29:55 2013 +0200

i#1 adapt to old String API

Change-Id: I52375929e149feae8bc6df0bc0938c5f8055fe5a

diff --git a/sw/source/ui/misc/docfnote.cxx b/sw/source/ui/misc/docfnote.cxx
index 4ca616d..6cec8bf 100644
--- a/sw/source/ui/misc/docfnote.cxx
+++ b/sw/source/ui/misc/docfnote.cxx
@@ -376,8 +376,12 @@ 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().replaceAll(\\t, \t));
-pInf-SetSuffix(m_pSuffixED-GetText().replaceAll(\\t, \t));
+String aPrefix(m_pPrefixED-GetText());
+aPrefix.SearchAndReplaceAllAscii(\\t, '\t');
+pInf-SetPrefix(aPrefix);
+String aSuffix(m_pSuffixED-GetText());
+aSuffix.SearchAndReplaceAllAscii(\\t, '\t');
+pInf-SetSuffix(aSuffix);
 
 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-0' - sw/source

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

New commits:
commit fe86346c4900914da1e0ebf87f97a0044640490e
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)
Reviewed-on: https://gerrit.libreoffice.org/4159
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx
index 3588290..d59d84f 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-0' - sw/source

2013-06-05 Thread Caolán McNamara
 sw/source/ui/config/optdlg.src |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 9743dc5aca9f286b869614c944168737a2c2be28
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Jun 5 09:31:04 2013 +0100

Resolves: fdo#64151 increase checkbox size to fit last 'h' into it

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

diff --git a/sw/source/ui/config/optdlg.src b/sw/source/ui/config/optdlg.src
index 4454fee..03c2943 100644
--- a/sw/source/ui/config/optdlg.src
+++ b/sw/source/ui/config/optdlg.src
@@ -1039,7 +1039,7 @@ TabPage TP_COMPARISON_OPT
 CheckBox CB_RSID
 {
 Pos = MAP_APPFONT ( 12 , 69 ) ;
-Size = MAP_APPFONT ( 70 , 10 ) ;
+Size = MAP_APPFONT ( 80 , 10 ) ;
 Text [ en-US ] = Use ~RSID;
 TabStop = TRUE ;
 Group = TRUE ;
@@ -1047,7 +1047,7 @@ TabPage TP_COMPARISON_OPT
 CheckBox CB_IGNORE
 {
 Pos = MAP_APPFONT ( 12 , 82 ) ;
-Size = MAP_APPFONT ( 70 , 10 ) ;
+Size = MAP_APPFONT ( 80 , 10 ) ;
 Text [ en-US ] = Ignore ~pieces of length;
 };
 NumericField NF_LEN
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-05-27 Thread Luke Deller
 sw/source/filter/ww8/writerwordglue.cxx |2 ++
 sw/source/filter/ww8/wrtw8sty.cxx   |   28 ++--
 2 files changed, 28 insertions(+), 2 deletions(-)

New commits:
commit d414e84c438f0b0dd935d1ba1d351f7af27d49a8
Author: Luke Deller l...@deller.id.au
Date:   Fri May 3 00:32:22 2013 +1000

Fix style renaming confusion in ww8 filter (solves fdo#63603)

(cherry pick my fix from master 2d3d942683d1cce738eab09b58e4fd693d5e7241)
- Mapping LO default style to Word Normal style for docx output used a
  hard coded style name, so it broke when LO's default style was renamed
  in 4.0 (plus it would never have worked for non-English languages)
- This renaming did not cater for nameclashes, leading to fdo#63603
- Similar renaming when importing doc styles did cater for nameclashes,
  but had a minor bug in that

Change-Id: Icd4f27fb1760f0c1ca068c742c48ebcd71d1eb15
Reviewed-on: https://gerrit.libreoffice.org/4039
Reviewed-by: Luboš Luňák l.lu...@suse.cz
Tested-by: Luboš Luňák l.lu...@suse.cz

diff --git a/sw/source/filter/ww8/writerwordglue.cxx 
b/sw/source/filter/ww8/writerwordglue.cxx
index 12e9a1c..663e1e1 100644
--- a/sw/source/filter/ww8/writerwordglue.cxx
+++ b/sw/source/filter/ww8/writerwordglue.cxx
@@ -296,11 +296,13 @@ namespace myImplHelpers
 aName.InsertAscii(WW- , 0);
 
 sal_Int32 nI = 1;
+String aBaseName = aName;
 while (
 0 != (pColl = maHelper.GetStyle(aName)) 
 (nI  SAL_MAX_INT32)
   )
 {
+aName = aBaseName;
 aName += String::CreateFromInt32(nI++);
 }
 }
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx 
b/sw/source/filter/ww8/wrtw8sty.cxx
index d837181..b0371ff 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -526,8 +526,32 @@ void MSWordStyles::OutputStyle( SwFmt* pFmt, sal_uInt16 
nPos )
 GetStyleData( pFmt, bFmtColl, nBase, nWwNext );
 
 String aName = pFmt-GetName();
-if ( aName.EqualsAscii( Default ) )
-aName = rtl::OUString(Normal);
+// We want to map LO's default style to Word's Normal style.
+// Word looks for this specific style name when reading docx files.
+// (It must be the English word regardless of language settings)
+if ( nPos == 0 ) {
+assert( pFmt-GetPoolFmtId() == RES_POOLCOLL_STANDARD );
+aName = OUString(Normal);
+} else if (aName.EqualsIgnoreCaseAscii(Normal)) {
+// If LO has a style named Normal(!) rename it to something 
unique
+aName.InsertAscii(LO- , 0);
+String aBaseName = aName;
+// Check if we still have a clash, in which case we add a suffix
+for ( int nSuffix = 0; ; ++nSuffix ) {
+bool clash=false;
+for ( int n = 1; n  nUsedSlots; ++n )
+if ( pFmtA[n] 
+ pFmtA[n]-GetName().EqualsIgnoreCaseAscii(aName) )
+{
+clash = true;
+break;
+}
+if (!clash)
+break;
+aName = aBaseName;
+aName += OUString::number(++nSuffix);
+}
+}
 
 m_rExport.AttrOutput().StartStyle( aName, bFmtColl,
 nBase, nWwNext, GetWWId( *pFmt ), nPos,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-05-27 Thread Luboš Luňák
 sw/source/filter/ww8/wrtw8sty.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6a2df328ded9771e3589c4f123ab64048279690f
Author: Luboš Luňák l.lu...@suse.cz
Date:   Mon May 27 15:39:02 2013 +0200

fix backport (OUString::number - valueOf)

Change-Id: I19920a19543a5dde1761711a736090e56c3254f6

diff --git a/sw/source/filter/ww8/wrtw8sty.cxx 
b/sw/source/filter/ww8/wrtw8sty.cxx
index b0371ff..36ee09b 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -549,7 +549,7 @@ void MSWordStyles::OutputStyle( SwFmt* pFmt, sal_uInt16 
nPos )
 if (!clash)
 break;
 aName = aBaseName;
-aName += OUString::number(++nSuffix);
+aName += OUString::valueOf(sal_Int32(++nSuffix));
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-05-27 Thread Luke Deller
 sw/source/filter/ww8/wrtw8sty.cxx |2 +-
 sw/source/filter/xml/xmltbli.cxx  |   26 ++
 2 files changed, 7 insertions(+), 21 deletions(-)

New commits:
commit b571605129426a1bf8eb7c9e9927785f8a9a5305
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
Signed-off-by: Miklos Vajna vmik...@suse.cz

diff --git a/sw/source/filter/ww8/wrtw8sty.cxx 
b/sw/source/filter/ww8/wrtw8sty.cxx
index 36ee09b..f5370ea 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -531,7 +531,7 @@ void MSWordStyles::OutputStyle( SwFmt* pFmt, sal_uInt16 
nPos )
 // (It must be the English word regardless of language settings)
 if ( nPos == 0 ) {
 assert( pFmt-GetPoolFmtId() == RES_POOLCOLL_STANDARD );
-aName = OUString(Normal);
+aName = rtl::OUString(Normal);
 } else if (aName.EqualsIgnoreCaseAscii(Normal)) {
 // If LO has a style named Normal(!) rename it to something 
unique
 aName.InsertAscii(LO- , 0);
diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx
index 6cd2cdc..50d5e99 100644
--- a/sw/source/filter/xml/xmltbli.cxx
+++ b/sw/source/filter/xml/xmltbli.cxx
@@ -1807,29 +1807,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


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

2013-05-24 Thread Bjoern Michaelsen
 sw/source/filter/ww8/ww8par.cxx |  172 
 1 file changed, 88 insertions(+), 84 deletions(-)

New commits:
commit 8bccae5d816abace259c9a1d0249e7195a2490d0
Author: Bjoern Michaelsen bjoern.michael...@canonical.com
Date:   Wed Feb 13 02:49:57 2013 +0100

fdo#43105: apply old sw-nested-positionned-tables-ww8-import-fix.diff

- replaced the really ugly goto hack though

(cherry picked from commit ee1db992b98378b5e2f5e9aa8af0e36c375e582f)

Change-Id: I14dfbe414dc16b634fbaca0a365e2e9ec37ab08e
Reviewed-on: https://gerrit.libreoffice.org/2133
Reviewed-by: Björn Michaelsen bjoern.michael...@canonical.com
Tested-by: Björn Michaelsen bjoern.michael...@canonical.com
Signed-off-by: Miklos Vajna vmik...@suse.cz

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 26cfd3e..09d31b0 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2229,113 +2229,117 @@ bool SwWW8ImplReader::ProcessSpecial(bool rbReSync, 
WW8_CP nStartCp)
 if (!nCellLevel)
 nCellLevel = 0 != pPlcxMan-HasParaSprm(0x244B);
 }
-
-WW8_TablePos *pTabPos=0;
-WW8_TablePos aTabPos;
-if (nCellLevel  !bVer67)
+do
 {
-WW8PLCFxSave1 aSave;
-pPlcxMan-GetPap()-Save( aSave );
-rbReSync = true;
-WW8PLCFx_Cp_FKP* pPap = pPlcxMan-GetPapPLCF();
-WW8_CP nMyStartCp=nStartCp;
+WW8_TablePos *pTabPos=0;
+WW8_TablePos aTabPos;
+if(nCellLevel  !bVer67)
+{
+WW8PLCFxSave1 aSave;
+pPlcxMan-GetPap()-Save( aSave );
+rbReSync = true;
+WW8PLCFx_Cp_FKP* pPap = pPlcxMan-GetPapPLCF();
+WW8_CP nMyStartCp=nStartCp;
 
-if (const sal_uInt8 *pLevel = pPlcxMan-HasParaSprm(0x6649))
-nCellLevel = *pLevel;
+if (const sal_uInt8 *pLevel = pPlcxMan-HasParaSprm(0x6649))
+nCellLevel = *pLevel;
 
-bool bHasRowEnd = SearchRowEnd(pPap, nMyStartCp, nCellLevel-1);
+bool bHasRowEnd = SearchRowEnd(pPap, nMyStartCp, 
(nInTablenCellLevel?nInTable:nCellLevel-1));
 
-//Bad Table, remain unchanged in level, e.g. #i19667#
-if (!bHasRowEnd)
-nCellLevel = static_cast sal_uInt8 (nInTable);
+//Bad Table, remain unchanged in level, e.g. #i19667#
+if (!bHasRowEnd)
+nCellLevel = static_cast sal_uInt8 (nInTable);
 
-if (bHasRowEnd  ParseTabPos(aTabPos,pPap))
-pTabPos = aTabPos;
+if (bHasRowEnd  ParseTabPos(aTabPos,pPap))
+pTabPos = aTabPos;
 
-pPlcxMan-GetPap()-Restore( aSave );
-}
+pPlcxMan-GetPap()-Restore( aSave );
+}
 
-//  then look if we are in an Apo
+//  then look if we are in an Apo
 
-ApoTestResults aApo = TestApo(nCellLevel, bTableRowEnd, pTabPos);
+ApoTestResults aApo = TestApo(nCellLevel, bTableRowEnd, pTabPos);
 
-//look to see if we are in a Table, but Table in foot/end note not allowed
-bool bStartTab = (nInTable  nCellLevel)  !bFtnEdn;
+//look to see if we are in a Table, but Table in foot/end note not 
allowed
+bool bStartTab = (nInTable  nCellLevel)  !bFtnEdn;
 
-bool bStopTab = bWasTabRowEnd  (nInTable  nCellLevel)  !bFtnEdn;
+bool bStopTab = bWasTabRowEnd  (nInTable  nCellLevel)  !bFtnEdn;
 
-bWasTabRowEnd = false;  // must be deactivated right here to prevent next
-// WW8TabDesc::TableCellEnd() from making nonsense
+bWasTabRowEnd = false;  // must be deactivated right here to prevent 
next
+// WW8TabDesc::TableCellEnd() from making 
nonsense
 
-if (nInTable  !bTableRowEnd  !bStopTab  (nInTable == nCellLevel  
aApo.HasStartStop()))
-bStopTab = bStartTab = true;// Required to stop and start table
+if (nInTable  !bTableRowEnd  !bStopTab  (nInTable == nCellLevel 
 aApo.HasStartStop()))
+bStopTab = bStartTab = true;// Required to stop and start table
 
-//  Dann auf Anl (Nummerierung) testen
-//  und dann alle Ereignisse in der richtigen Reihenfolge bearbeiten
+//  Dann auf Anl (Nummerierung) testen
+//  und dann alle Ereignisse in der richtigen Reihenfolge bearbeiten
 
-if( bAnl  !bTableRowEnd )
-{
-const sal_uInt8* pSprm13 = pPlcxMan-HasParaSprm( 13 );
-if( pSprm13 )
-{   // Noch Anl ?
-sal_uInt8 nT = static_cast sal_uInt8 (GetNumType( *pSprm13 ));
-if( ( nT != WW8_Pause  nT != nWwNumType ) // Anl-Wechsel
-|| aApo.HasStartStop()  // erzwungenes Anl-Ende
-|| bStopTab || bStartTab )
-{
-StopAnlToRestart(nT);  // Anl-Restart ( = Wechsel ) ueber sprms
+if( bAnl  !bTableRowEnd )
+{
+const sal_uInt8* pSprm13 = 

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

2013-05-21 Thread Lionel Elie Mamane
 sw/source/ui/envelp/mailmrge.cxx |   16 
 1 file changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 500aa2b680c036f0d171b274423ab8a832459572
Author: Lionel Elie Mamane lio...@mamane.lu
Date:   Thu May 16 09:46:05 2013 +0200

fdo#47951 work around underlying cause

The true cause is that the flat text file database driver mishandles
the case of two ResultSets being open on the same table: the moving
commands of one impact the other.

Since in this case:

 - one ResultSet is open by the dispatch of
   .component:DB/DataSourceBrowser, that is the grid UI shown to the
   user, and that ResultSet is kept open to serve requests by the user
   to scroll;

 - the second ResultSet is opened by the call to
   pNewDBMgr-GetColumnNames
   and that ResultSet is closed by the time GetColumnNames returns

We just swap the order of these calls to work around the underlying
driver bug.

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

diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx
index 4a675dc..d2a1d49 100644
--- a/sw/source/ui/envelp/mailmrge.cxx
+++ b/sw/source/ui/envelp/mailmrge.cxx
@@ -210,6 +210,14 @@ SwMailMergeDlg::SwMailMergeDlg(Window* pParent, 
SwWrtShell rShell,
 aAttachED.Show(sal_False);
 aAttachPB.Show(sal_False);
 
+SwNewDBMgr* pNewDBMgr = rSh.GetNewDBMgr();
+if(_xConnection.is())
+pNewDBMgr-GetColumnNames(aAddressFldLB, _xConnection, rTableName);
+else
+pNewDBMgr-GetColumnNames(aAddressFldLB, rDBName, rTableName);
+for(sal_uInt16 nEntry = 0; nEntry  aAddressFldLB.GetEntryCount(); 
nEntry++)
+aColumnLB.InsertEntry(aAddressFldLB.GetEntry(nEntry));
+
 Point aMailPos = aMailingRB.GetPosPixel();
 Point aFilePos = aFileRB.GetPosPixel();
 aFilePos.X() -= (aFilePos.X() - aMailPos.X()) /2;
@@ -361,14 +369,6 @@ SwMailMergeDlg::SwMailMergeDlg(Window* pParent, 
SwWrtShell rShell,
 aFromNF.SetMax(SAL_MAX_INT32);
 aToNF.SetMax(SAL_MAX_INT32);
 
-SwNewDBMgr* pNewDBMgr = rSh.GetNewDBMgr();
-if(_xConnection.is())
-pNewDBMgr-GetColumnNames(aAddressFldLB, _xConnection, rTableName);
-else
-pNewDBMgr-GetColumnNames(aAddressFldLB, rDBName, rTableName);
-for(sal_uInt16 nEntry = 0; nEntry  aAddressFldLB.GetEntryCount(); 
nEntry++)
-aColumnLB.InsertEntry(aAddressFldLB.GetEntry(nEntry));
-
 aAddressFldLB.SelectEntry(rtl::OUString(EMAIL));
 
 String sPath(pModOpt-GetMailingPath());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-05-15 Thread Miklos Vajna
 sw/source/filter/ww8/wrtww8.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit dc6c363f0c7fec8be700b272ea94eebc8e3534a9
Author: Miklos Vajna vmik...@suse.cz
Date:   Wed May 15 11:47:08 2013 +0200

fdo#36876 WW8 filter: fix export of table margins

Actually no testcase, as the export bug does not affect our import
filter. The problem was that we wrote SPRM's, which are properties of
floating tables, so once the user edited the resulting document in Word
and imported it back to Writer, frames around tables got created.  Fix
this by only writing floating table SPRM's for tables which are already
in a fly frame.

Regression from cbba191cf0fff148935f24d111cb124bd5a5328b.

(cherry picked from commits 335c264d508a9c73845b94483475435a0cebfe64 and
a935a154c3911b466a9b1c8da3c2cf0be2e0014d)

Change-Id: Ifeae93100ca80dcde34fc79f69a91064d44ea8f4
Reviewed-on: https://gerrit.libreoffice.org/3915
Reviewed-by: Luboš Luňák l.lu...@suse.cz
Tested-by: Luboš Luňák l.lu...@suse.cz

diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 269b913..2ee4569 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -2121,7 +2121,9 @@ void 
WW8AttributeOutput::TableSpacing(ww8::WW8TableNodeInfoInner::Pointer_t pTab
 const SwTable * pTable = pTableTextNodeInfoInner-getTable();
 const SwTableFmt * pTableFmt = pTable-GetTableFmt();
 
-if (pTableFmt != NULL)
+// Writing these SPRM's will make the table a floating one, so only write
+// them in case the table is already inside a frame.
+if (pTableFmt != NULL  pTable-GetTableNode()-GetFlyFmt())
 {
 const SvxULSpaceItem  rUL = pTableFmt-GetULSpace();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-05-03 Thread Miklos Vajna
 sw/source/ui/docvw/PostItMgr.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 19e60e1a0507e041d2bf639782e990f7a55e
Author: Miklos Vajna vmik...@suse.cz
Date:   Fri May 3 11:46:58 2013 +0200

SwPostItMgr::Delete: fix crash when layout is not yet ready

pPostIt is 0 when we have a large document, and the layout is not yet
ready for a later part of the document, having a comment. Just don't try
to delete such comments, better than a crash.

(cherry picked from commit 9a7641451dad5c73a936de5361aa3c3f148132d0)

Change-Id: I5fd5c908bc7b1feba926214863e84391b9037484
Reviewed-on: https://gerrit.libreoffice.org/3757
Reviewed-by: Bosdonnat Cedric cedric.bosdon...@free.fr
Tested-by: Bosdonnat Cedric cedric.bosdon...@free.fr

diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx
index 7f67fb0..4a37c00 100644
--- a/sw/source/ui/docvw/PostItMgr.cxx
+++ b/sw/source/ui/docvw/PostItMgr.cxx
@@ -1169,7 +1169,7 @@ void SwPostItMgr::Delete(String aAuthor)
 aTmp.reserve( mvPostItFlds.size() );
 for(std::listSwSidebarItem*::iterator pPostIt = mvPostItFlds.begin(); 
pPostIt!= mvPostItFlds.end() ; ++pPostIt)
 {
-if ((*pPostIt)-GetFmtFld()  ((*pPostIt)-pPostIt-GetAuthor() == 
aAuthor) )
+if ((*pPostIt)-GetFmtFld()  (*pPostIt)-pPostIt  
((*pPostIt)-pPostIt-GetAuthor() == aAuthor) )
 aTmp.push_back( (*pPostIt)-GetFmtFld() );
 }
 for(std::vectorSwFmtFld*::iterator i = aTmp.begin(); i!= aTmp.end() ; 
++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-0' - sw/source

2013-04-29 Thread Michael Meeks
 sw/source/filter/writer/wrtswtbl.cxx |   12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 0a115d48057867c60bfcd527e90433b2dca1f28a
Author: Michael Meeks michael.me...@suse.com
Date:   Mon Apr 29 18:06:27 2013 +0100

fdo#62336 - fix horribly coupled table rendering code to not crash.

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

diff --git a/sw/source/filter/writer/wrtswtbl.cxx 
b/sw/source/filter/writer/wrtswtbl.cxx
index 55afa3c..4699005 100644
--- a/sw/source/filter/writer/wrtswtbl.cxx
+++ b/sw/source/filter/writer/wrtswtbl.cxx
@@ -404,6 +404,10 @@ sal_Bool SwWriteTable::ShouldExpandSub(const SwTableBox 
*pBox, sal_Bool /*bExpan
 return !pBox-GetSttNd()  nDepth  0;
 }
 
+// FIXME: the degree of coupling between this method and
+// FillTableRowsCols which is called immediately afterwards
+// is -extremely- unpleasant and potentially problematic.
+
 void SwWriteTable::CollectTableRowsCols( long nStartRPos,
sal_uInt32 nStartCPos,
long nParentLineHeight,
@@ -747,10 +751,16 @@ SwWriteTable::SwWriteTable(const SwTableLines rLines, 
long nWidth,
 // Erstmal die Tabellen-Struktur festlegen. Hinter der Tabelle ist in
 // jedem Fall eine Spalte zu Ende
 SwWriteTableCol *pCol = new SwWriteTableCol( nParentWidth );
+bUseLayoutHeights = true;
 aCols.insert( pCol );
 CollectTableRowsCols( 0, 0, 0, nParentWidth, rLines, nMaxDepth - 1 );
 
-// Und jetzt mit leben fuellen
+// FIXME: awfully GetLineHeight writes to this in its first call
+// and proceeds to return a rather odd number fdo#62336, we have to
+// behave identically since the code in FillTableRowsCols duplicates
+// and is highly coupled to CollectTableRowsCols - sadly.
+bUseLayoutHeights = true;
+// And now fill with life
 FillTableRowsCols( 0, 0, 0, 0, 0, nParentWidth, rLines, 0, nMaxDepth - 1, 
static_cast sal_uInt16 (nNumOfRowsToRepeat) );
 
 // Einige Twip-Werte an Pixel-Grenzen anpassen
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-04-25 Thread Fridrich Štrba
 sw/source/core/unocore/unotext.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 7bd7e75d6914573289656ea544f8928097614b14
Author: Fridrich Å trba fridrich.st...@bluewin.ch
Date:   Thu Apr 25 12:17:17 2013 +0200

Belts and braces for crash in null pointer dereference

Change-Id: I17fa205f16929b913084c8eee320a73416b1eda0
(cherry picked from commit d34a159010fc24e13613058d25a9d6b56f7855bd)
Reviewed-on: https://gerrit.libreoffice.org/3605
Reviewed-by: Michael Meeks michael.me...@suse.com
Tested-by: Michael Meeks michael.me...@suse.com

diff --git a/sw/source/core/unocore/unotext.cxx 
b/sw/source/core/unocore/unotext.cxx
index 004e7af..77b44f4 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -1626,7 +1626,8 @@ throw (lang::IllegalArgumentException, 
uno::RuntimeException)
 SwTableNode * pStartTableNode(pStartStartNode-FindTableNode());
 // Is it the same table start node than the end?
 SwTableNode *const 
pEndStartTableNode(pEndStartNode-FindTableNode());
-while (pEndStartTableNode-GetIndex()  
pStartTableNode-GetIndex())
+while (pEndStartTableNode  pStartTableNode 
+   pEndStartTableNode-GetIndex()  
pStartTableNode-GetIndex())
 {
 SwStartNode* pStartStartTableNode = 
pStartTableNode-StartOfSectionNode();
 pStartTableNode = pStartStartTableNode-FindTableNode();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-04-24 Thread László Németh
 sw/source/core/txtnode/atrftn.cxx |   10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 3263ce60c9ccede366ee2e24667ca10a6f823659
Author: László Németh nem...@numbertext.org
Date:   Tue Apr 16 15:40:24 2013 +0200

fdo#40102 show full footnote text in index tooltip

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

diff --git a/sw/source/core/txtnode/atrftn.cxx 
b/sw/source/core/txtnode/atrftn.cxx
index 6814ec4..6540e97 100644
--- a/sw/source/core/txtnode/atrftn.cxx
+++ b/sw/source/core/txtnode/atrftn.cxx
@@ -172,8 +172,16 @@ void SwFmtFtn::GetFtnText( XubString rStr ) const
 if( !pCNd )
 pCNd = aIdx.GetNodes().GoNext( aIdx );
 
-if( pCNd-IsTxtNode() )
+if( pCNd-IsTxtNode() ) {
 rStr = ((SwTxtNode*)pCNd)-GetExpandTxt();
+
+++aIdx;
+while ( !aIdx.GetNode().IsEndNode() ) {
+if ( aIdx.GetNode().IsTxtNode() )
+rStr += OUString(  ) + 
((SwTxtNode*)(aIdx.GetNode().GetTxtNode()))-GetExpandTxt();
+++aIdx;
+}
+}
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-04-24 Thread Michael Stahl
 sw/source/core/doc/notxtfrm.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit f3e8a9649ac653eafaf8c5fa57e20d3dbe90d82c
Author: Michael Stahl mst...@redhat.com
Date:   Tue Apr 23 22:27:57 2013 +0200

fdo#60280: sw: restore anti-aliasing for all OLE objects

The OLE case in SwNoTxtFrm::PaintPicture() was mis-merged to modify the
anti-aliasing always but reset it only for Charts.

(regression from 44cfc7cb6533d827fd2d6e586d92c61d7d7f7a70)

Change-Id: I0d740e621c3fd71f308d980581edb3c16308c06e
(cherry picked from commit 954d695827431a5badd1a993d8f364c669ca9c9c)
Reviewed-on: https://gerrit.libreoffice.org/3589
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 914e189..a839420 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -1143,8 +1143,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const 
SwRect rGrfArea ) cons
 }
 
 // see #i99665#
-if ( pOLENd-IsChart() 
-pShell-Imp()-GetDrawView()-IsAntiAliasing() )
+if (pShell-Imp()-GetDrawView()-IsAntiAliasing())
 {
 pOut-SetAntialiasing( nFormerAntialiasingAtOutput );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-04-23 Thread Michael Stahl
 sw/source/filter/xml/xmltbli.cxx |   18 +++---
 sw/source/filter/xml/xmltbli.hxx |3 ++-
 2 files changed, 17 insertions(+), 4 deletions(-)

New commits:
commit 00a8e4604802cecfb87d62a5edc9ef314400ebb4
Author: Michael Stahl mst...@redhat.com
Date:   Tue Apr 23 00:17:03 2013 +0200

fdo#62147: sw: ODF import: apply styles in cells with string-value

Apply the table-cell-style to paragraphs inside the table cell
for cells with value-type=string and office:string-value attribute.
This should complete commit 1b5839f49c07beb6fbde6c7370a5636d22f9ab77.

Change-Id: Ief34de1e7c5087906ea597ce3ca96e020f6eebe6
(cherry picked from commit 84217e299724b8ee80dff63cb561b4bae0f44835)
Reviewed-on: https://gerrit.libreoffice.org/3575
Reviewed-by: Miklos Vajna vmik...@suse.cz
Tested-by: Miklos Vajna vmik...@suse.cz

diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx
index 9ffba48..6cd2cdc 100644
--- a/sw/source/filter/xml/xmltbli.cxx
+++ b/sw/source/filter/xml/xmltbli.cxx
@@ -589,8 +589,11 @@ SwXMLTableCellContext_Impl::~SwXMLTableCellContext_Impl()
 
 inline void SwXMLTableCellContext_Impl::_InsertContent()
 {
+SwStartNode const*const pStartNode( GetTable()-InsertTableSection(0,
+(m_bHasStringValue  m_bValueTypeIsString 
+ !aStyleName.isEmpty()) ?  aStyleName : 0) );
 GetTable()-InsertCell( aStyleName, nRowSpan, nColSpan,
-GetTable()-InsertTableSection(),
+pStartNode,
 mXmlId,
 NULL, bProtect, sFormula, bHasValue, fValue,
 (m_bHasStringValue  m_bValueTypeIsString) ? m_StringValue : 0);
@@ -2883,12 +2886,14 @@ void SwXMLTableContext::MakeTable( SwTableBox *pBox, 
sal_Int32 nW )
 }
 
 const SwStartNode *SwXMLTableContext::InsertTableSection(
-const SwStartNode *pPrevSttNd )
+const SwStartNode *const pPrevSttNd,
+OUString const*const pStringValueStyleName)
 {
 // The topmost table is the only table that maintains the two members
 // pBox1 and bFirstSection.
 if( xParentTable.Is() )
-return ((SwXMLTableContext *)xParentTable)-InsertTableSection( 
pPrevSttNd );
+return static_castSwXMLTableContext *(xParentTable)
+-InsertTableSection(pPrevSttNd, pStringValueStyleName);
 
 const SwStartNode *pStNd;
 ReferenceXUnoTunnel xCrsrTunnel( 
GetImport().GetTextImport()-GetCursor(),
@@ -2943,6 +2948,13 @@ const SwStartNode *SwXMLTableContext::InsertTableSection(
 }
 }
 
+if (pStringValueStyleName)
+{   // fdo#62147: apply style to paragraph on string-value cell
+GetImport().GetTextImport()-SetStyleAndAttrs( GetImport(),
+GetImport().GetTextImport()-GetCursor(), *pStringValueStyleName,
+true, false, -1, false); // parameters same as sCellParaStyleName
+}
+
 return pStNd;
 }
 
diff --git a/sw/source/filter/xml/xmltbli.hxx b/sw/source/filter/xml/xmltbli.hxx
index e9854cc..cfd886b 100644
--- a/sw/source/filter/xml/xmltbli.hxx
+++ b/sw/source/filter/xml/xmltbli.hxx
@@ -186,7 +186,8 @@ public:
 void InsertRepRows( sal_uInt32 nCount );
 const SwXMLTableCell_Impl *GetCell( sal_uInt32 nRow, sal_uInt32 nCol ) 
const;
 SwXMLTableCell_Impl *GetCell( sal_uInt32 nRow, sal_uInt32 nCol );
-const SwStartNode *InsertTableSection( const SwStartNode *pPrevSttNd=0 );
+const SwStartNode *InsertTableSection(const SwStartNode *pPrevSttNd = 0,
+  OUString const* pStringValueStyleName = 0);
 
 virtual void EndElement();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-04-13 Thread Caolán McNamara
 sw/source/core/fields/reffld.cxx |   13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

New commits:
commit 9f3fad8804bfcd03e514d0c725c6380a16fb8f5a
Author: Caolán McNamara caol...@redhat.com
Date:   Thu Apr 11 20:57:49 2013 +0100

Resolves: fdo#48039 use same algorithm for assigning get/set replacement ids

i.e. use the same algorithm for assigning replacement ids for both get and 
set
exp fields.

Otherwise, consider for ex.
1. fields exists with ids of 1 and 2 in master document
2. a field exists with id of 1 in subdocument and must be reassigned a new
id to not collide with the pre existing master ids

In get orig algorithm assigned first unused slot of master to subdocument 
field
i.e. 0 unused in master, so subdocument:1 converted to master:0

In set orig algorithm sorted all used master slots and assigned largest 
used id
plus 1 (therefore unused) to subdocument field i.e. largest id used in 
master is
2, so subdocument:1 converted to master:3

so get can't find set and error's out with:
Error: Reference source not found

Change-Id: Ie8758dc22cf8dff079532284e57eeaf4a9bd
(cherry picked from commit 74d942fb2396a268adfcc915e75b8b32fae851dc)
Reviewed-on: https://gerrit.libreoffice.org/3346
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index 806f055..8285416 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -994,14 +994,9 @@ void _RefIdsMap::Init( SwDoc rDoc, SwDoc rDestDoc, bool 
bField )
 GetFieldIdsFromDoc( rDestDoc, aIds );
 GetFieldIdsFromDoc( rDoc, aDstIds );
 
-// Define the mappings now
-sal_uInt16 nMaxDstId = -1;
-if ( !aIds.empty() )
-nMaxDstId = *aIds.rbegin();
-
-// Map all the src fields to their value + nMaxDstId
+// Map all the new src fields to the next available unused id
 for ( std::setsal_uInt16::iterator pIt = aDstIds.begin(); pIt != 
aDstIds.end(); ++pIt )
-AddId( ++nMaxDstId, *pIt );
+AddId( GetFirstUnusedId(aIds), *pIt );
 
 // Change the Sequence number of all the SetExp fields in the 
destination document
 SwFieldType* pType = rDoc.GetFldType( RES_SETEXPFLD, aName, false );
@@ -1024,9 +1019,9 @@ void _RefIdsMap::Init( SwDoc rDoc, SwDoc rDestDoc, bool 
bField )
 bInit = true;
 }
 
-/// Get the lowest unused ID in the passed set.
+/// Get the lowest number unused in the passed set.
 /// @param[in] rIds The set of used ID numbers.
-/// @returns The lowest unused ID.
+/// @returns The lowest number unused by the passed set
 sal_uInt16 _RefIdsMap::GetFirstUnusedId( std::setsal_uInt16 rIds )
 {
 sal_uInt16 num(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-0' - sw/source

2013-04-04 Thread Jan Holesovsky
 sw/source/core/docnode/ndtbl.cxx |   38 +-
 1 file changed, 21 insertions(+), 17 deletions(-)

New commits:
commit 11f9cdc2e273a827dfe29316de6f679077ee6a59
Author: Jan Holesovsky ke...@suse.cz
Date:   Wed Apr 3 11:49:38 2013 +0200

fdo#32082: Do not reset number format in table cells on edit.

When we changed the default to _not_ to recognize the number formats in 
table
cells (commit 334c34e4ec803c65e43abf20edbc6faf7fa95e76), it caused that any
edit of a number formatted cell had reset it to text on edit.

This was quite unexpected, because when eg. there was a number that 
contributed
to a sum, and it changed to text, the sum changed as if there was a '0' 
there.

To solve this, try hard to retain the number format regardless of the
'Recognize Number Formats' setting when there was a number formatting 
assigned
to the cell.

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

diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 08b710a..df85ebc 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -4022,31 +4022,35 @@ void SwDoc::ChkBoxNumFmt( SwTableBox rBox, sal_Bool 
bCallUpdate )
 SwTableBoxFmt* pBoxFmt = (SwTableBoxFmt*)rBox.GetFrmFmt();
 SfxItemSet aBoxSet( GetAttrPool(), RES_BOXATR_FORMAT, 
RES_BOXATR_VALUE );
 
-sal_Bool bSetNumFmt = IsInsTblFormatNum();
 sal_Bool bLockModify = sal_True;
+sal_Bool bSetNumFmt = sal_False;
+const bool bForceNumberFormat = IsInsTblFormatNum()  
IsInsTblChangeNumFormat();
 
-if( bSetNumFmt  !IsInsTblChangeNumFormat() )
+// if the user forced a number format in this cell previously,
+// keep it, unless the user set that she wants the full number
+// format recognition
+if( pNumFmtItem  !bForceNumberFormat )
 {
-if( !pNumFmtItem )
-bSetNumFmt = sal_False;
+sal_uLong nOldNumFmt = 
((SwTblBoxNumFormat*)pNumFmtItem)-GetValue();
+SvNumberFormatter* pNumFmtr = GetNumberFormatter();
+
+short nFmtType = pNumFmtr-GetType( nFmtIdx );
+if( nFmtType == pNumFmtr-GetType( nOldNumFmt ) || 
NUMBERFORMAT_NUMBER == nFmtType )
+{
+// Current and specified NumFormat match
+// - keep old Format
+nFmtIdx = nOldNumFmt;
+bSetNumFmt = sal_True;
+}
 else
 {
-sal_uLong nOldNumFmt = 
((SwTblBoxNumFormat*)pNumFmtItem)-GetValue();
-SvNumberFormatter* pNumFmtr = GetNumberFormatter();
-
-short nFmtType = pNumFmtr-GetType( nFmtIdx );
-if( nFmtType == pNumFmtr-GetType( nOldNumFmt ) || 
NUMBERFORMAT_NUMBER == nFmtType )
-// Current and specified NumFormat match
-// - keep old Format
-nFmtIdx = nOldNumFmt;
-else
-// Current and specified NumFormat do not match
-// - insert as Text
-bLockModify = bSetNumFmt = sal_False;
+// Current and specified NumFormat do not match
+// - insert as Text
+bLockModify = bSetNumFmt = sal_False;
 }
 }
 
-if( bSetNumFmt )
+if( bSetNumFmt || bForceNumberFormat )
 {
 pBoxFmt = (SwTableBoxFmt*)rBox.ClaimFrmFmt();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-04-03 Thread Jan Holesovsky
 sw/source/core/docnode/ndtbl.cxx |   51 ++-
 1 file changed, 24 insertions(+), 27 deletions(-)

New commits:
commit 715323ece4c1c96714f6de51f98f5c58f30e5147
Author: Jan Holesovsky ke...@suse.cz
Date:   Wed Apr 3 11:44:28 2013 +0200

Keep semantics, but improve readibility.

Change-Id: I32c18cb7b080f4847118a2d7e8d77dcd2bbce308
Reviewed-on: https://gerrit.libreoffice.org/3186
Reviewed-by: Thomas Arnhold tho...@arnhold.org
Tested-by: Thomas Arnhold tho...@arnhold.org

diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 252ac7f..08b710a 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -4022,39 +4022,36 @@ void SwDoc::ChkBoxNumFmt( SwTableBox rBox, sal_Bool 
bCallUpdate )
 SwTableBoxFmt* pBoxFmt = (SwTableBoxFmt*)rBox.GetFrmFmt();
 SfxItemSet aBoxSet( GetAttrPool(), RES_BOXATR_FORMAT, 
RES_BOXATR_VALUE );
 
-sal_Bool bSetNumFmt = IsInsTblFormatNum(), bLockModify = sal_True;
-if( bSetNumFmt )
+sal_Bool bSetNumFmt = IsInsTblFormatNum();
+sal_Bool bLockModify = sal_True;
+
+if( bSetNumFmt  !IsInsTblChangeNumFormat() )
 {
-if( !IsInsTblChangeNumFormat() )
+if( !pNumFmtItem )
+bSetNumFmt = sal_False;
+else
 {
-if( !pNumFmtItem )
-bSetNumFmt = sal_False;
+sal_uLong nOldNumFmt = 
((SwTblBoxNumFormat*)pNumFmtItem)-GetValue();
+SvNumberFormatter* pNumFmtr = GetNumberFormatter();
+
+short nFmtType = pNumFmtr-GetType( nFmtIdx );
+if( nFmtType == pNumFmtr-GetType( nOldNumFmt ) || 
NUMBERFORMAT_NUMBER == nFmtType )
+// Current and specified NumFormat match
+// - keep old Format
+nFmtIdx = nOldNumFmt;
 else
-{
-sal_uLong nOldNumFmt = 
((SwTblBoxNumFormat*)pNumFmtItem)-
-GetValue();
-SvNumberFormatter* pNumFmtr = GetNumberFormatter();
-
-short nFmtType = pNumFmtr-GetType( nFmtIdx );
-if( nFmtType == pNumFmtr-GetType( nOldNumFmt ) ||
-NUMBERFORMAT_NUMBER == nFmtType )
-// Current and specified NumFormat match
-// - keep old Format
-nFmtIdx = nOldNumFmt;
-else
-// Current and specified NumFormat do not match
-// - insert as Text
-bLockModify = bSetNumFmt = sal_False;
-}
+// Current and specified NumFormat do not match
+// - insert as Text
+bLockModify = bSetNumFmt = sal_False;
 }
+}
 
-if( bSetNumFmt )
-{
-pBoxFmt = (SwTableBoxFmt*)rBox.ClaimFrmFmt();
+if( bSetNumFmt )
+{
+pBoxFmt = (SwTableBoxFmt*)rBox.ClaimFrmFmt();
 
-aBoxSet.Put( SwTblBoxValue( fNumber ));
-aBoxSet.Put( SwTblBoxNumFormat( nFmtIdx ));
-}
+aBoxSet.Put( SwTblBoxValue( fNumber ));
+aBoxSet.Put( SwTblBoxNumFormat( nFmtIdx ));
 }
 
 // It's not enough to only reset the Formula.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-03-28 Thread Michael Stahl
 sw/source/core/crsr/crsrsh.cxx |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit 710eb8c34cbd8fa80b6190107856cdc1d16f7cf8
Author: Michael Stahl mst...@redhat.com
Date:   Wed Mar 27 23:09:59 2013 +0100

fdo#60513: SwCrsrShell::Push(): take position from table cursor

If there is a table cursor, store its point/mark position on the cursor
stack instead of pCurCrsr, which in this case is just one cell in a ring
that contains a SwShellCrsr for every selected cell.

SwCrsrShell::Pop() is surprisingly able to restore the prior state,
because it calls UpdateCrsr(), which detects that the pCurCrsr spans
multiple table cells and re-creates pTblCrsr, and then later on the
first GetCrsr() call SwTableCursor::MakeBoxSels() will restore the ring
of SwShellCrsrs from the pTblCrsr selection.

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

diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 379af07..ac00ff7 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -1859,13 +1859,17 @@ void SwCrsrShell::RefreshBlockCursor()
 /// create a copy of the cursor and save it in the stack
 void SwCrsrShell::Push()
 {
-pCrsrStk = new SwShellCrsr( *this, *pCurCrsr-GetPoint(),
-pCurCrsr-GetPtPos(), pCrsrStk );
+// fdo#60513: if we have a table cursor, copy that; else copy current.
+// This seems to work because UpdateCrsr() will fix this up on Pop(),
+// then MakeBoxSels() will re-create the current pCurCrsr cell ring.
+SwShellCrsr *const pCurrent((pTblCrsr) ? pTblCrsr : pCurCrsr);
+pCrsrStk = new SwShellCrsr( *this, *pCurrent-GetPoint(),
+pCurrent-GetPtPos(), pCrsrStk );
 
-if( pCurCrsr-HasMark() )
+if (pCurrent-HasMark())
 {
 pCrsrStk-SetMark();
-*pCrsrStk-GetMark() = *pCurCrsr-GetMark();
+*pCrsrStk-GetMark() = *pCurrent-GetMark();
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-03-26 Thread Joren De Cuyper
 sw/source/ui/table/splittbl.cxx |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit 64a3b58a9ace11c6a01708e8de14712e27e02043
Author: Joren De Cuyper joren.libreoff...@telenet.be
Date:   Mon Mar 25 22:11:59 2013 +0100

fix fdo#62670 - TABLE: Splitting a table options are mixed

Change-Id: I1ba647844aaae3a57ee91d5785c82ca082d3e10b
Reviewed-on: https://gerrit.libreoffice.org/3042
Reviewed-by: Petr Mladek pmla...@suse.cz
Tested-by: Petr Mladek pmla...@suse.cz

diff --git a/sw/source/ui/table/splittbl.cxx b/sw/source/ui/table/splittbl.cxx
index f82d642..d85bb95 100644
--- a/sw/source/ui/table/splittbl.cxx
+++ b/sw/source/ui/table/splittbl.cxx
@@ -30,7 +30,7 @@ SwSplitTblDlg::SwSplitTblDlg( Window *pParent, SwWrtShell 
rSh )
 get(mpCntntCopyRB, copyheading);
 get(mpBoxAttrCopyWithParaRB, customheadingapplystyle);
 get(mpBoxAttrCopyNoParaRB, customheading);
-get(mpBorderCopyRB, customheading);
+get(mpBorderCopyRB, noheading);
 }
 
 void SwSplitTblDlg::Apply()
@@ -38,7 +38,7 @@ void SwSplitTblDlg::Apply()
 m_nSplit = HEADLINE_CNTNTCOPY;
 if(mpBoxAttrCopyWithParaRB-IsChecked())
 m_nSplit = HEADLINE_BOXATRCOLLCOPY;
-if(mpBoxAttrCopyNoParaRB-IsChecked())
+else if(mpBoxAttrCopyNoParaRB-IsChecked())
 m_nSplit = HEADLINE_BOXATTRCOPY;
 else if(mpBorderCopyRB-IsChecked())
 m_nSplit = HEADLINE_BORDERCOPY;
@@ -46,6 +46,4 @@ void SwSplitTblDlg::Apply()
 rShell.SplitTable(m_nSplit);
 }
 
-
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-03-20 Thread Miklos Vajna
 sw/source/core/doc/docfld.cxx |   14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

New commits:
commit 326be48e3e3edd151e59abbafac6c70077296675
Author: Miklos Vajna vmik...@suse.cz
Date:   Wed Mar 20 13:19:32 2013 +0100

fdo#55814 SwDoc::UpdateExpFlds: hiding the last section may be safe

In case we know there is a non-section paragraph at the end of the
document.  Intentionally not adding a unit test as David Ostrovsky is
working on one already.

(cherry picked from commit 62344016de056965a58ea2016d912a68eac0d6b0)

Change-Id: Ia6026846981b5af014246a8a604c5f762d34c891
Reviewed-on: https://gerrit.libreoffice.org/2876
Reviewed-by: David Ostrovsky david.ostrov...@gmx.de
Tested-by: David Ostrovsky david.ostrov...@gmx.de

diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index c2d1dbc..e99954b 100644
--- a/sw/source/core/doc/docfld.cxx
+++ b/sw/source/core/doc/docfld.cxx
@@ -1304,10 +1304,16 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool 
bUpdRefFlds )
 // This section will be hidden, but it wasn't before
 if (nShownSections == 1)
 {
-// This would be the last section, so set its 
condition to false, and avoid hiding it.
-OUString aCond(0);
-pSect-SetCondition(aCond);
-bHide = false;
+// Is the last node part of a section?
+SwPaM aPam(GetNodes());
+aPam.Move(fnMoveForward, fnGoDoc);
+if 
(aPam.Start()-nNode.GetNode().StartOfSectionNode()-IsSectionNode())
+{
+// This would be the last section, so set its 
condition to false, and avoid hiding it.
+OUString aCond(0);
+pSect-SetCondition(aCond);
+bHide = false;
+}
 }
 nShownSections--;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-03-15 Thread László Németh
 sw/source/core/txtnode/txtedt.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 76d1ff428bd514e858c91ca9b521afd729f5f242
Author: László Németh nem...@numbertext.org
Date:   Fri Mar 15 04:31:25 2013 +0100

fdo#62360: fix word breaking in Writer for spell checking

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

diff --git a/sw/source/core/txtnode/txtedt.cxx 
b/sw/source/core/txtnode/txtedt.cxx
index 0cdacdb..d0f155a 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -779,7 +779,10 @@ sal_Bool SwScanner::NextWord()
 OSL_ENSURE( aBound.endPos = aBound.startPos, broken aBound result );
 
 // we don't want to include preceeding text
-if (aBound.startPos  nBegin)
+// to count words in text with mixed script punctuation correctly,
+// but we want to include preceeding symbols (eg. percent sign, 
section sign,
+// degree sign defined by dict_word_hu to spell check their affixed 
forms).
+if (nWordType == i18n::WordType::WORD_COUNT  aBound.startPos  
nBegin)
 aBound.startPos = nBegin;
 
 //no word boundaries could be found
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-03-14 Thread Caolán McNamara
 sw/source/core/doc/docfmt.cxx |   18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 1525a2ca952d04e331c13f85bfdb16d89116ae6b
Author: Caolán McNamara caol...@redhat.com
Date:   Thu Mar 14 10:44:59 2013 +

hackaround for assert

regression since 1c22545edf9085b9f2656ca92781158b6b123db3

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

diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 352a451..4341aa9 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1035,15 +1035,15 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM rRg, const 
SfxItemSet rChgSet,
 if (aEndPos.nNode.GetNode().GetTxtNode()  aEndPos.nContent != 
aEndPos.nNode.GetNode().GetTxtNode()-Len())
 aEndPos.nNode--;
 
-for (;aStartPos=aEndPos;aStartPos.nNode++)
-{
-SwTxtNode* pCurrentNd = aStartPos.nNode.GetNode().GetTxtNode();
-
-if (pCurrentNd)
-{
- pCurrentNd-TryCharSetExpandToNum(*pCharSet);
-
-}
+sal_uLong nStart = aStartPos.nNode.GetIndex();
+sal_uLong nEnd = aEndPos.nNode.GetIndex();
+for(; nStart = nEnd; ++nStart)
+{
+SwNode* pNd = pDoc-GetNodes()[ nStart ];
+if (!pNd || !pNd-IsTxtNode())
+continue;
+SwTxtNode *pCurrentNd = (SwTxtNode*)pNd;
+pCurrentNd-TryCharSetExpandToNum(*pCharSet);
 
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-03-08 Thread Miklos Vajna
 sw/source/core/table/swtable.cxx |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit a31707dd91aec5d2dc5b8060ef42960b709ec068
Author: Miklos Vajna vmik...@suse.cz
Date:   Fri Mar 8 18:11:16 2013 +0100

SwTableBox::IsValidNumTxtNd: Allow trivial formatting

Not allowing flys or footnotes during string - number conversion is
fine, but I don't see what's the reason for rejecting simple formatting
(like bold) completely.

(cherry picked from commit 332fa1344aaaf8ff190c594fe5829cf1551c5211)

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

diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index c37ff85..4b95b15 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -2518,7 +2518,6 @@ sal_uLong SwTableBox::IsValidNumTxtNd( sal_Bool 
bCheckAttr ) const
 if( bCheckAttr )
 {
 const SwpHints* pHts = pTextNode-GetpSwpHints();
-const String rTxt = pTextNode-GetTxt();
 // do some tests if there's only text in the node!
 // Flys/fields/...
 if( pHts )
@@ -2527,9 +2526,7 @@ sal_uLong SwTableBox::IsValidNumTxtNd( sal_Bool 
bCheckAttr ) const
 for( sal_uInt16 n = 0; n  pHts-Count(); ++n )
 {
 const SwTxtAttr* pAttr = (*pHts)[ n ];
-if( RES_TXTATR_NOEND_BEGIN = pAttr-Which() ||
-*pAttr-GetStart() ||
-*pAttr-GetAnyEnd()  rTxt.Len() )
+if( RES_TXTATR_NOEND_BEGIN = pAttr-Which() )
 {
 if ((*pAttr-GetStart() == nNextSetField) 
 (pAttr-Which() == RES_TXTATR_FIELD))
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-03-01 Thread Michael Stahl
 sw/source/core/crsr/bookmrk.cxx |7 +++
 sw/source/core/doc/docbm.cxx|   20 +++-
 sw/source/core/inc/bookmrk.hxx  |5 -
 3 files changed, 18 insertions(+), 14 deletions(-)

New commits:
commit d10c1b3a54f0264f895c2e5b0056e955f7d07380
Author: Michael Stahl mst...@redhat.com
Date:   Thu Feb 28 13:27:57 2013 +0100

sw: remove CH_TXT_ATR_FORMELEMENT when CheckboxFieldmark is deleted

Change-Id: I5f58b558b15f7d11b75554195e10a258d027bcfc
(cherry picked from commit 75b2f6b241046d4467a7c0c9cbf49b4533b46045)
Reviewed-on: https://gerrit.libreoffice.org/2467
Reviewed-by: Miklos Vajna vmik...@suse.cz
Tested-by: Miklos Vajna vmik...@suse.cz

diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx
index 7e84482..a3c5217 100644
--- a/sw/source/core/crsr/bookmrk.cxx
+++ b/sw/source/core/crsr/bookmrk.cxx
@@ -355,6 +355,13 @@ namespace sw { namespace mark
 // want this for checkboxes
 this-GetMarkEnd( ).nContent--;
 }
+
+void CheckboxFieldmark::ReleaseDoc(SwDoc* const pDoc)
+{
+lcl_RemoveFieldMarks(this, pDoc,
+CH_TXT_ATR_FIELDSTART, CH_TXT_ATR_FORMELEMENT);
+}
+
 void CheckboxFieldmark::SetChecked(bool checked)
 {
 if ( IsChecked() != checked )
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index afd9fc2..8f785dd 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -670,18 +670,17 @@ namespace sw { namespace mark
 #endif
 }
 
-struct LazyTextFieldmarkDeleter : public IDocumentMarkAccess::ILazyDeleter
+struct LazyFieldmarkDeleter : public IDocumentMarkAccess::ILazyDeleter
 {
-::boost::shared_ptrIMark const m_pTextFieldmark;
+::boost::shared_ptrIMark const m_pFieldmark;
 SwDoc *const m_pDoc;
-LazyTextFieldmarkDeleter(
+LazyFieldmarkDeleter(
 ::boost::shared_ptrIMark const pMark, SwDoc *const pDoc)
-: m_pTextFieldmark(pMark), m_pDoc(pDoc)
+: m_pFieldmark(pMark), m_pDoc(pDoc)
 { }
-virtual ~LazyTextFieldmarkDeleter()
+virtual ~LazyFieldmarkDeleter()
 {
-dynamic_castTextFieldmark*(m_pTextFieldmark.get())
--ReleaseDoc(m_pDoc);
+dynamic_castFieldmark *(m_pFieldmark.get())-ReleaseDoc(m_pDoc);
 }
 };
 
@@ -713,12 +712,7 @@ namespace sw { namespace mark
 MarkManager::deleteMark(..)
  - Bookmark not found.);
 m_vFieldmarks.erase(ppFieldmark);
-sw::mark::TextFieldmark* pTextFieldmark = 
dynamic_castsw::mark::TextFieldmark*(ppMark-get());
-if (pTextFieldmark)
-{
-ret.reset(
-new LazyTextFieldmarkDeleter(*ppMark, m_pDoc));
-}
+ret.reset(new LazyFieldmarkDeleter(*ppMark, m_pDoc));
 break;
 }
 case IDocumentMarkAccess::NAVIGATOR_REMINDER:
diff --git a/sw/source/core/inc/bookmrk.hxx b/sw/source/core/inc/bookmrk.hxx
index 6937a19..d4959b2 100644
--- a/sw/source/core/inc/bookmrk.hxx
+++ b/sw/source/core/inc/bookmrk.hxx
@@ -213,6 +213,8 @@ namespace sw {
 virtual void SetFieldHelptext(const ::rtl::OUString 
aFieldHelptext)
 { m_aFieldHelptext = aFieldHelptext; }
 
+virtual void ReleaseDoc(SwDoc* const) = 0;
+
 virtual void Invalidate();
 virtual rtl::OUString ToString() const;
 
@@ -228,7 +230,7 @@ namespace sw {
 public:
 TextFieldmark(const SwPaM rPaM);
 virtual void InitDoc(SwDoc* const io_pDoc);
-void ReleaseDoc(SwDoc* const pDoc);
+virtual void ReleaseDoc(SwDoc* const pDoc);
 };
 
 class CheckboxFieldmark
@@ -238,6 +240,7 @@ namespace sw {
 public:
 CheckboxFieldmark(const SwPaM rPaM);
 virtual void InitDoc(SwDoc* const io_pDoc);
+virtual void ReleaseDoc(SwDoc* const pDoc);
 bool IsChecked() const;
 void SetChecked(bool checked);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-02-28 Thread Herbert Dürr
 sw/source/filter/ww8/ww8par.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 4ffa2ddf2490005347a6567fcd2f619f06c33025
Author: Herbert Dürr h...@apache.org
Date:   Thu Jun 14 05:36:24 2012 +

#c708928# avoid double free error

Signed-off-by: Michael Meeks michael.me...@suse.com

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 8760c72..d18106e 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -793,6 +793,8 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream rSt,
 if (SeekToContent(DFF_Prop_pWrapPolygonVertices, rSt))
 {
 delete pImpRec-pWrapPolygon;
+pImpRec-pWrapPolygon = NULL;
+
 sal_uInt16 nNumElemVert, nNumElemMemVert, nElemSizeVert;
 rSt  nNumElemVert  nNumElemMemVert  nElemSizeVert;
 if (nNumElemVert  ((nElemSizeVert == 8) || (nElemSizeVert == 4)))
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-02-25 Thread Caolán McNamara
 sw/source/core/access/accmap.cxx |9 +
 sw/source/core/text/txtfrm.cxx   |   18 ++
 2 files changed, 23 insertions(+), 4 deletions(-)

New commits:
commit 791a060bd1031c844a9a1b283689dee6a8a7ef77
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Feb 25 16:55:07 2013 +

Resolves: fdo#56031 RSID attr changes drop content change events

So if we have an INVALID_ATTR event in the queue and receive
INVALID_CONTENT, drop the attr and replace it with invalid-content

And anyway filter out the RSID change event from hitting the
a11y queue, humans don't care that this changed, it's just noise

Change-Id: I4842f217153fc90aa1dce75c3445053004c74536
(cherry picked from commit 8d08ccd5b84c121867d7b3102f9d10b26005c682)
Reviewed-on: https://gerrit.libreoffice.org/2401
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index 4f737a8..714b37b 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -887,10 +887,19 @@ void SwAccessibleMap::AppendEvent( const 
SwAccessibleEvent_Impl rEvent )
 // POS_CHANGED event.
 // Therefor, the event's type has to be adapted and the event
 // has to be put at the end.
+//
+// fdo#56031 An INVALID_CONTENT event overwrites a INVALID_ATTR
+// event and overwrites its flags
 OSL_ENSURE( aEvent.GetType() != 
SwAccessibleEvent_Impl::CHILD_POS_CHANGED,
 invalid event combination );
 if( aEvent.GetType() == 
SwAccessibleEvent_Impl::CARET_OR_STATES )
 aEvent.SetType( SwAccessibleEvent_Impl::INVALID_CONTENT );
+else if ( aEvent.GetType() == 
SwAccessibleEvent_Impl::INVALID_ATTR )
+{
+aEvent.SetType( SwAccessibleEvent_Impl::INVALID_CONTENT );
+aEvent.SetStates( rEvent.GetAllStates() );
+}
+
 break;
 case SwAccessibleEvent_Impl::POS_CHANGED:
 // A pos changed event overwrites CARET_STATES (keeping its
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index cebe0b5..d76c4fa 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -912,6 +912,13 @@ static void lcl_ModifyOfst( SwTxtFrm* pFrm, xub_StrLen 
nPos, xub_StrLen nLen )
 }
 }
 
+//Related: fdo#56031 filter out attribute changes that don't matter for
+//humans/a11y to stop flooding the destination mortal with useless noise
+static bool isA11yRelevantAttribute(MSHORT nWhich)
+{
+return nWhich != RES_CHRATR_RSID;
+}
+
 /*
  *  SwTxtFrm::Modify()
  */
@@ -1294,11 +1301,14 @@ void SwTxtFrm::Modify( const SfxPoolItem* pOld, const 
SfxPoolItem *pNew )
 SwCntntFrm::Modify( pOld, pNew );
 }
 
-// #i88069#
-ViewShell* pViewSh = getRootFrm() ? getRootFrm()-GetCurrShell() : 
0;
-if ( pViewSh  )
+if (isA11yRelevantAttribute(nWhich))
 {
-pViewSh-InvalidateAccessibleParaAttrs( *this );
+// #i88069#
+ViewShell* pViewSh = getRootFrm() ? 
getRootFrm()-GetCurrShell() : 0;
+if ( pViewSh  )
+{
+pViewSh-InvalidateAccessibleParaAttrs( *this );
+}
 }
 }
 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-0' - sw/source

2013-02-25 Thread Michael Stahl
 sw/source/core/txtnode/ndtxt.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 3f5361a9402cd6df4da7fb98108ae1906b41edd3
Author: Michael Stahl mst...@redhat.com
Date:   Mon Feb 25 22:06:18 2013 +0100

fdo#61428: SwTxtNode::ReplaceText: brown paperbag fix

Fix the optimization to return only if both replacement and replaced
strings are empty.
(regression from b6d45f26ea5bcc848737921b59a16253eb1d8587)

Change-Id: I984fb151a5ac3e6eb8d03f854ad6a3df88f96000
(cherry picked from commit 3e6a0b6d04722d43a1fc8d3745b5e79b7ced90eb)
Reviewed-on: https://gerrit.libreoffice.org/2407
Reviewed-by: Björn Michaelsen bjoern.michael...@canonical.com
Tested-by: Björn Michaelsen bjoern.michael...@canonical.com

diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index ee1dd01..2cc28ae 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -3337,9 +3337,9 @@ void SwTxtNode::ReplaceText( const SwIndex rStart, const 
xub_StrLen nDelLen,
 SwTxtNode::ReplaceText: node text with insertion  TXTNODE_MAX.);
 OUString const sInserted(
 (nOverflow  0) ? rStr.Copy(0, rStr.Len() - nOverflow) : rStr);
-if (sInserted.isEmpty())
+if (sInserted.isEmpty()  0 == nDelLen)
 {
-return;
+return; // nothing to do
 }
 
 const xub_StrLen nStartPos = rStart.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-0' - sw/source

2013-02-20 Thread Michael Stahl
 sw/source/ui/docvw/edtwin.cxx |   43 +++---
 sw/source/ui/wrtsh/wrtsh2.cxx |   11 --
 2 files changed, 29 insertions(+), 25 deletions(-)

New commits:
commit 7063ea7cc1eadb22ac3ca6c2d54001408b60ef95
Author: Michael Stahl mst...@redhat.com
Date:   Wed Feb 20 00:08:45 2013 +0100

fdo#59928: sw: fix mouse selection of fields differently

Unfortunately selecting the field in SwEditWin::MouseButtonDown()
prevents the click field handling code in SwEditWin::MouseButtonUp()
from running.  Instead select the field in MouseButtonUp and
SwWrtShell::ClickToField(), which seems to work better.
(regression from 94721b2aec614e0d99504138d484b2ad6cd550c7)

Conflicts:
sw/source/ui/wrtsh/wrtsh2.cxx

Change-Id: I3d769487b9d5225ffd07b384fbb0ce01e0733be5
(cherry picked from commit a4a457100a3a6e9f59113e82c9d0b12786273671)
Reviewed-on: https://gerrit.libreoffice.org/2286
Reviewed-by: Bosdonnat Cedric cedric.bosdon...@free.fr
Tested-by: Bosdonnat Cedric cedric.bosdon...@free.fr

diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index 289aa15..27853a8 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -3557,36 +3557,17 @@ void SwEditWin::MouseButtonDown(const MouseEvent 
_rMEvt)
 // Are we clicking on a field?
 if (rSh.GetContentAtPos(aDocPos, aFieldAtPos))
 {
-bool bAddMode(false); // AdditionalMode if applicable
-if (KEY_MOD1 == rMEvt.GetModifier()  !rSh.IsAddMode())
-{
-bAddMode = true;
-rSh.EnterAddMode();
-}
 rSh.SetCursor(aDocPos, bOnlyText);
-// Select the field. Unfortunately cursor may be on field
+// Unfortunately the cursor may be on field
 // position or on position after field depending on which
 // half of the field was clicked on.
 SwTxtAttr const*const pTxtFld(aFieldAtPos.pFndTxtAttr);
 if (rSh.GetCurrentShellCursor().GetPoint()-nContent
-.GetIndex() == *pTxtFld-GetStart())
-{
-rSh.Right( CRSR_SKIP_CHARS, true, 1, false );
-rSh.NormalizePam();
-}
-else
+.GetIndex() != *pTxtFld-GetStart())
 {
 assert(rSh.GetCurrentShellCursor().GetPoint()-nContent
 .GetIndex() == (*pTxtFld-GetStart() + 1));
-rSh.Left( CRSR_SKIP_CHARS, true, 1, false );
-}
-// it's a bit of a mystery what this is good for?
-// in this case we assume it's valid since we just
-// selected a field
-bValidCrsrPos = true;
-if (bAddMode)
-{
-rSh.LeaveAddMode();
+rSh.Left( CRSR_SKIP_CHARS, false, 1, false );
 }
 // don't go into the !bOverSelect block below - it moves
 // the cursor
@@ -4421,7 +4402,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent rMEvt)
 if(pApplyTempl)
 bExecHyperlinks = sal_False;
 
-SwContentAtPos aCntntAtPos( 
SwContentAtPos::SW_CLICKFIELD |
+SwContentAtPos aCntntAtPos( SwContentAtPos::SW_FIELD |
 
SwContentAtPos::SW_INETATTR |
 
SwContentAtPos::SW_SMARTTAG  | SwContentAtPos::SW_FORMCTRL);
 
@@ -4440,7 +4421,23 @@ void SwEditWin::MouseButtonUp(const MouseEvent rMEvt)
 
 if( SwContentAtPos::SW_FIELD == 
aCntntAtPos.eCntntAtPos )
 {
+bool bAddMode(false);
+// AdditionalMode if applicable
+if (KEY_MOD1 == rMEvt.GetModifier()
+ !rSh.IsAddMode())
+{
+bAddMode = true;
+rSh.EnterAddMode();
+}
 rSh.ClickToField( *aCntntAtPos.aFnd.pFld );
+// a bit of a mystery what this is good for?
+// in this case we assume it's valid since we
+// just selected a field
+bValidCrsrPos = true;
+if (bAddMode)
+{
+ 

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

2013-02-19 Thread Michael Stahl
 sw/source/core/txtnode/txtedt.cxx |   17 +++--
 1 file changed, 15 insertions(+), 2 deletions(-)

New commits:
commit 47211c07ebb9e56caeb57e4d879da6e67a1119df
Author: Michael Stahl mst...@redhat.com
Date:   Fri Feb 15 16:27:34 2013 +0100

fdo#60732: check max size in SwTxtNode::ReplaceTextOnly

Change-Id: I1ca2075ab99fe1b09df700f55645b44f38cf5bcc
(cherry picked from commit 0e49d87d92a3f1aeeeda547f1a7e710dcd4fee95)
Reviewed-on: https://gerrit.libreoffice.org/2182
Reviewed-by: Petr Mladek pmla...@suse.cz
Tested-by: Petr Mladek pmla...@suse.cz

diff --git a/sw/source/core/txtnode/txtedt.cxx 
b/sw/source/core/txtnode/txtedt.cxx
index a538701..0cdacdb 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -1787,9 +1787,19 @@ void SwTxtNode::TransliterateText(
 {
 // now apply the changes from end to start to leave the offsets of 
the
 // yet unchanged text parts remain the same.
+size_t nSum(m_Text.Len());
 for (size_t i = 0; i  aChanges.size(); ++i)
-{
-swTransliterationChgData rData = aChanges[ aChanges.size() - 
1 - i ];
+{   // check this here since AddChanges cannot be moved below
+// call to ReplaceTextOnly
+swTransliterationChgData  rData =
+aChanges[ aChanges.size() - 1 - i ];
+nSum = nSum + rData.sChanged.Len() - rData.nLen;
+if (nSum  TXTNODE_MAX)
+{
+SAL_WARN(sw.core, SwTxtNode::ReplaceTextOnly: 
+node text with insertion  TXTNODE_MAX.);
+return;
+}
 if (pUndo)
 pUndo-AddChanges( *this, rData.nStart, rData.nLen, 
rData.aOffsets );
 ReplaceTextOnly( rData.nStart, rData.nLen, rData.sChanged, 
rData.aOffsets );
@@ -1802,6 +1812,9 @@ void SwTxtNode::ReplaceTextOnly( xub_StrLen nPos, 
xub_StrLen nLen,
 const XubString rText,
 const Sequencesal_Int32 rOffsets )
 {
+assert(static_castsize_t(m_Text.Len()) +
+static_castsize_t(rText.Len()) - nLen = TXTNODE_MAX);
+
 m_Text.Replace( nPos, nLen, rText );
 
 xub_StrLen nTLen = rText.Len();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-02-19 Thread Luboš Luňák
 sw/source/core/txtnode/ndtxt.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 586faf3589e23c10e7259e000d13f746212e8eda
Author: Luboš Luňák l.lu...@suse.cz
Date:   Sun Feb 17 11:19:29 2013 +0100

apparently there's no ssize_t on windows

Change-Id: Ic9aef7fe5295b7dae6f5b7ee7f28378d393cbfe4

diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index c8182b6..ee1dd01 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -1711,8 +1711,8 @@ OUString SwTxtNode::InsertText( const XubString  rStr, 
const SwIndex  rIdx,
 
 xub_StrLen aPos = rIdx.GetIndex();
 xub_StrLen nLen = m_Text.Len() - aPos;
-ssize_t const nOverflow(static_castssize_t(m_Text.Len())
-+ static_castssize_t(rStr.Len()) - TXTNODE_MAX);
+long const nOverflow(static_castlong(m_Text.Len())
++ static_castlong(rStr.Len()) - TXTNODE_MAX);
 SAL_WARN_IF(nOverflow  0, sw.core,
 SwTxtNode::InsertText: node text with insertion  TXTNODE_MAX.);
 OUString const sInserted(
@@ -3331,8 +3331,8 @@ void SwTxtNode::ReplaceText( const SwIndex rStart, const 
xub_StrLen nDelLen,
 rStart.GetIndex() + nDelLen = m_Text.Len(),
 SwTxtNode::ReplaceText: index out of bounds );
 
-ssize_t const nOverflow(static_castssize_t(m_Text.Len())
-+ static_castssize_t(rStr.Len()) - nDelLen - TXTNODE_MAX);
+long const nOverflow(static_castlong(m_Text.Len())
++ static_castlong(rStr.Len()) - nDelLen - TXTNODE_MAX);
 SAL_WARN_IF(nOverflow  0, sw.core,
 SwTxtNode::ReplaceText: node text with insertion  TXTNODE_MAX.);
 OUString const sInserted(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-02-18 Thread Michael Stahl
 sw/source/core/doc/doclay.cxx |   17 ++---
 1 file changed, 14 insertions(+), 3 deletions(-)

New commits:
commit 838a3ae5e7e2efedfbd07734aedb85c7ec8f2356
Author: Michael Stahl mst...@redhat.com
Date:   Thu Feb 14 23:02:35 2013 +0100

sw: do not crash when it's not possible to insert fly

Change-Id: Idfcf54013107ba6b7ce3de0d0bddbef306698f33
(cherry picked from commit 5a80c24b145c8efe0dd384ef88e7d31173522fb8)
Reviewed-on: https://gerrit.libreoffice.org/2176
Reviewed-by: Miklos Vajna vmik...@suse.cz
Tested-by: Miklos Vajna vmik...@suse.cz

diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index f31c998..3bac734 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -654,7 +654,11 @@ SwFlyFrmFmt* SwDoc::_MakeFlySection( const SwPosition 
rAnchPos,
 if (pTxtNode != NULL)
 {
 SwFmtFlyCnt aFmt( pFmt );
-pTxtNode-InsertItem( aFmt, nStt, nStt );
+bool const bSuccess( pTxtNode-InsertItem(aFmt, nStt, nStt) );
+if (!bSuccess) // may fail if there's no space left or header/ftr
+{   // pFmt is dead now
+return 0;
+}
 }
 }
 
@@ -740,7 +744,9 @@ SwFlyFrmFmt* SwDoc::MakeFlySection( RndStdIds eAnchorType,
 if (bCalledFromShell  !lcl_IsItemSet(*pNewTxtNd, RES_PARATR_ADJUST) 

 SFX_ITEM_SET == pAnchorNode-GetSwAttrSet().
 GetItemState(RES_PARATR_ADJUST, sal_True, pItem))
+{
 static_castSwCntntNode *(pNewTxtNd)-SetAttr(*pItem);
+}
 
  pFmt = _MakeFlySection( *pAnchorPos, *pNewTxtNd,
 eAnchorType, pFlySet, pFrmFmt );
@@ -941,8 +947,13 @@ SwDrawFrmFmt* SwDoc::Insert( const SwPaM rRg,
 {
 xub_StrLen nStt = rRg.GetPoint()-nContent.GetIndex();
 SwFmtFlyCnt aFmt( pFmt );
-rRg.GetPoint()-nNode.GetNode().GetTxtNode()-InsertItem(
-aFmt, nStt, nStt );
+bool const bSuccess( // may fail if there's no space left
+rRg.GetPoint()-nNode.GetNode().GetTxtNode()-InsertItem(
+aFmt, nStt, nStt));
+if (!bSuccess)
+{   // pFmt is dead now
+return 0;
+}
 }
 
 SwDrawContact* pContact = new SwDrawContact( pFmt, rDrawObj );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-02-18 Thread Michael Stahl
 sw/source/filter/xml/xmltbli.cxx |   83 +--
 sw/source/filter/xml/xmltbli.hxx |2 
 2 files changed, 64 insertions(+), 21 deletions(-)

New commits:
commit 2b08767693604e43023dda30734ab1ff5921048c
Author: Michael Stahl mst...@redhat.com
Date:   Fri Feb 15 22:36:55 2013 +0100

fdo#60842: sw ODF import: support value-type=string on cells:

According to ODF 1.2 part 1 19.385 office:value-type, the attributes of
table:table-cell, namely office:value-type=string and
office:string-value=foo, should override the element content of the
cell.

Change-Id: Ic580307effb046d127c4d64a4f963f0e91b3a2d1
(cherry picked from commit 1b5839f49c07beb6fbde6c7370a5636d22f9ab77)
Reviewed-on: https://gerrit.libreoffice.org/2177
Reviewed-by: Miklos Vajna vmik...@suse.cz
Tested-by: Miklos Vajna vmik...@suse.cz

diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx
index 0b68893..9ffba48 100644
--- a/sw/source/filter/xml/xmltbli.cxx
+++ b/sw/source/filter/xml/xmltbli.cxx
@@ -95,6 +95,7 @@ enum SwXMLTableCellAttrTokens
 XML_TOK_TABLE_BOOLEAN_VALUE,
 XML_TOK_TABLE_PROTECTED,
 XML_TOK_TABLE_STRING_VALUE,
+XML_TOK_TABLE_VALUE_TYPE,
 XML_TOK_TABLE_CELL_ATTR_END=XML_TOK_UNKNOWN
 };
 
@@ -136,6 +137,7 @@ static SvXMLTokenMapEntry aTableCellAttrTokenMap[] =
 { XML_NAMESPACE_TABLE, XML_PROTECTED, XML_TOK_TABLE_PROTECTED },
 { XML_NAMESPACE_TABLE, XML_PROTECT, XML_TOK_TABLE_PROTECTED }, // for 
backwards compatibility with SRC629 (and before)
 { XML_NAMESPACE_OFFICE, XML_STRING_VALUE, XML_TOK_TABLE_STRING_VALUE },
+{ XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_TOK_TABLE_VALUE_TYPE },
 XML_TOKEN_MAP_END
 };
 
@@ -162,6 +164,7 @@ class SwXMLTableCell_Impl
 OUString aStyleName;
 
 OUString mXmlId;
+OUString m_StringValue;
 
 OUString sFormula;  // cell formula; valid if length  0
 double dValue;  // formula value
@@ -175,7 +178,7 @@ class SwXMLTableCell_Impl
 sal_Bool bProtected : 1;
 sal_Bool bHasValue; // determines whether dValue attribute is valid
 sal_Bool mbCovered;
-sal_Bool mbTextValue;
+bool m_bHasStringValue;
 
 public:
 
@@ -185,18 +188,19 @@ public:
 nColSpan( nCSpan ),
 bProtected( sal_False ),
 mbCovered( sal_False )
+, m_bHasStringValue(false)
 {}
 
 inline void Set( const OUString rStyleName,
   sal_uInt32 nRSpan, sal_uInt32 nCSpan,
  const SwStartNode *pStNd, SwXMLTableContext *pTable,
- sal_Bool bProtect = sal_False,
- const OUString* pFormula = NULL,
- sal_Bool bHasValue = sal_False,
- sal_Bool mbCovered = sal_False,
- double dVal = 0.0,
- sal_Bool mbTextValue = sal_False,
- OUString const i_rXmlId = OUString());
+ sal_Bool bProtect,
+ const OUString* pFormula,
+ sal_Bool bHasValue,
+ sal_Bool bCovered,
+ double dVal,
+ OUString const*const pStringValue,
+ OUString const i_rXmlId);
 
 bool IsUsed() const { return pStartNode!=0 ||
  xSubTable.Is() || bProtected;}
@@ -210,7 +214,10 @@ public:
 sal_Bool HasValue() const { return bHasValue; }
 sal_Bool IsProtected() const { return bProtected; }
 sal_Bool IsCovered() const { return mbCovered; }
-sal_Bool HasTextValue() const { return mbTextValue; }
+bool HasStringValue() const { return m_bHasStringValue; }
+OUString const* GetStringValue() const {
+return (m_bHasStringValue) ? m_StringValue : 0;
+}
 const OUString GetXmlId() const { return mXmlId; }
 
 const SwStartNode *GetStartNode() const { return pStartNode; }
@@ -230,7 +237,7 @@ inline void SwXMLTableCell_Impl::Set( const OUString 
rStyleName,
   sal_Bool bHasVal,
   sal_Bool bCov,
   double dVal,
-  sal_Bool bTextVal,
+  OUString const*const pStringValue,
   OUString const i_rXmlId )
 {
 aStyleName = rStyleName;
@@ -241,7 +248,11 @@ inline void SwXMLTableCell_Impl::Set( const OUString 
rStyleName,
 dValue = dVal;
 bHasValue = bHasVal;
 mbCovered = bCov;
-mbTextValue = bTextVal;
+if (pStringValue)
+{
+m_StringValue = *pStringValue;
+}
+m_bHasStringValue = (pStringValue != 0);
 bProtected = bProtect;
 
 if (!mbCovered) // ensure uniqueness
@@ -396,12 +407,14 @@ class SwXMLTableCellContext_Impl : public 
SvXMLImportContext
 OUString sFormula;
 OUString sSaveParaDefault;
 OUString mXmlId;
+OUString m_StringValue;
 
 

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

2013-02-18 Thread Michael Stahl
 sw/source/core/doc/docedt.cxx |   14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

New commits:
commit 00967d738e02155d793830e23e5c33696f3a759a
Author: Michael Stahl mst...@redhat.com
Date:   Thu Feb 14 23:34:16 2013 +0100

SwDoc::Overwrite: probably a bad idea to overwrite fieldmarks

Change-Id: Iba94df67c21514cf4f5361bab28629c6d5d9d3e8
(cherry picked from commit 447bb5b5006051672ec526b75bec7db02d2db82e)
Reviewed-on: https://gerrit.libreoffice.org/2175
Reviewed-by: Björn Michaelsen bjoern.michael...@canonical.com
Tested-by: Miklos Vajna vmik...@suse.cz

diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 693e2bf..47829ea 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -159,8 +159,18 @@ typedef boost::ptr_vector _SaveRedline  _SaveRedlines;
 static bool lcl_MayOverwrite( const SwTxtNode *pNode, const xub_StrLen nPos )
 {
 sal_Unicode cChr = pNode-GetTxt().GetChar( nPos );
-return !( ( CH_TXTATR_BREAKWORD == cChr || CH_TXTATR_INWORD == cChr ) 
-  (0 != pNode-GetTxtAttrForCharAt( nPos ) ) );
+switch (cChr)
+{
+case CH_TXTATR_BREAKWORD:
+case CH_TXTATR_INWORD:
+return !pNode-GetTxtAttrForCharAt(nPos);// how could there be 
none?
+case CH_TXT_ATR_FIELDSTART:
+case CH_TXT_ATR_FIELDEND:
+case CH_TXT_ATR_FORMELEMENT:
+return false;
+default:
+return true;
+}
 }
 
 static void lcl_SkipAttr( const SwTxtNode *pNode, SwIndex rIdx, xub_StrLen 
rStart )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-02-18 Thread Miklos Vajna
 sw/source/core/unocore/unoportenum.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 3d9911a925607ed58002c6c9488507bd5a818975
Author: Miklos Vajna vmik...@suse.cz
Date:   Mon Feb 18 11:16:38 2013 +0100

fdo#60710 SwXTextPortionEnumeration: filter out fields from the undo stack

The UNO API provides the annotation field associated to a comment range
fieldmark when the fieldmark starts. To achieve this, it looks up the
annotation field by name, but it failed to ignore the fields which are
present only because the undo stack still holds a reference to them,
making the ODF export filter fail to export the document.

(cherry picked from commit f6a02947896e19160c137032a7fc2e56277656af)

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

diff --git a/sw/source/core/unocore/unoportenum.cxx 
b/sw/source/core/unocore/unoportenum.cxx
index 6849d03..d05b8f5 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -330,7 +330,8 @@ static const SwFmtFld* lcl_getFieldByName(SwDoc* pDoc, 
const OUString rName)
 SwIteratorSwFmtFld, SwFieldType aIter(*pCurType);
 for (const SwFmtFld* pCurFldFmt = aIter.First(); pCurFldFmt; 
pCurFldFmt = aIter.Next())
 {
-if (pCurFldFmt-GetFld()-GetTyp()-Which() != RES_POSTITFLD)
+// Ignore the field if it's not an annotation or it doesn't have 
an anchor.
+if (pCurFldFmt-GetFld()-GetTyp()-Which() != RES_POSTITFLD || 
!pCurFldFmt-GetTxtFld())
 continue;
 
 const SwPostItField* pField = dynamic_castconst 
SwPostItField*(pCurFldFmt-GetFld());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-02-14 Thread Luke Deller
 sw/source/filter/ww8/ww8par6.cxx |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit d2c2bd5508f331f82bb77b40587d12040752eabf
Author: Luke Deller l...@deller.id.au
Date:   Thu Feb 14 00:04:52 2013 +1100

minimal change to fix fdo#57908 for backport

wwSectionManager::GetPageULData adjusts margins and header/footer
heights according to whether there is a header/footer or not.
It could be confused into thinking there was no header/footer when
indeed there was, in the case where a first page header/footer was
inherited from a previous section which contained but did not actually
show that header.

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

diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 761a68a..691b8f7 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -1115,10 +1115,14 @@ void wwSectionManager::CreateSep(const long nTxtPos, 
bool /*bMustHaveBreak*/)
 aNewSection.maSep.grpfIhdt = ReadBSprm(pSep, eVer = ww::eWW2 ? 128 : 
153, 0);
 else if (mrReader.pHdFt)
 {
-aNewSection.maSep.grpfIhdt = WW8_HEADER_ODD | WW8_FOOTER_ODD;
-
-if (aNewSection.HasTitlePage())
-aNewSection.maSep.grpfIhdt |= WW8_HEADER_FIRST | WW8_FOOTER_FIRST;
+aNewSection.maSep.grpfIhdt = WW8_HEADER_ODD | WW8_FOOTER_ODD
+| WW8_HEADER_FIRST | WW8_FOOTER_FIRST;
+
+// It is possible for a first page header to be provided
+// for this section, but not actually shown in this section.  In this
+// case (aNewSection.maSep.grpfIhdt  WW8_HEADER_FIRST) will be nonzero
+// but aNewSection.HasTitlePage() will be false.
+// Likewise for first page footer.
 
 if (mrReader.pWDop-fFacingPages)
 aNewSection.maSep.grpfIhdt |= WW8_HEADER_EVEN | WW8_FOOTER_EVEN;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-02-13 Thread Michael Stahl
 sw/source/core/txtnode/ndtxt.cxx |   43 +++
 1 file changed, 30 insertions(+), 13 deletions(-)

New commits:
commit aa3c9716c2492447e7dc3daa3592efbf52e8f186
Author: Michael Stahl mst...@redhat.com
Date:   Tue Feb 12 19:43:16 2013 +0100

fdo#60668: filter out fieldmark chars from Index entries:

SwTxtNode::GetExpandTxt must filter out all dummy characters used to
represent fields, footnotes, field marks, etc.

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

diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 4fedcfa..eb2dd25 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -2959,8 +2959,7 @@ sal_Bool SwTxtNode::GetExpandTxt( SwTxtNode rDestNd, 
const SwIndex* pDestIdx,
 
 // mask hidden characters
 const sal_Unicode cChar = CH_TXTATR_BREAKWORD;
-sal_uInt16 nHiddenChrs =
-SwScriptInfo::MaskHiddenRanges( *this, sTmpText, 0, sTmpText.Len(), 
cChar );
+SwScriptInfo::MaskHiddenRanges(*this, sTmpText, 0, sTmpText.Len(), cChar);
 
 sTmpText = sTmpText.Copy( nIdx, nLen );
 rDestNd.InsertText( sTmpText, aDestIdx );
@@ -3063,22 +3062,40 @@ sal_Bool SwTxtNode::GetExpandTxt( SwTxtNode rDestNd, 
const SwIndex* pDestIdx,
 rDestNd.InsertText( GetNumString(), aDestIdx );
 }
 
-if ( nHiddenChrs  0 )
+aDestIdx = 0;
+sal_Int32 nStartDelete(-1);
+while (aDestIdx  rDestNd.GetTxt().Len())
 {
-aDestIdx = 0;
-while ( aDestIdx  rDestNd.GetTxt().Len() )
+sal_Unicode const cur(rDestNd.GetTxt().GetChar(aDestIdx.GetIndex()));
+if (   (cChar == cur) // filter substituted hidden text
+|| (CH_TXT_ATR_FIELDSTART  == cur) // filter all fieldmarks
+|| (CH_TXT_ATR_FIELDEND== cur)
+|| (CH_TXT_ATR_FORMELEMENT == cur))
 {
-if ( cChar == rDestNd.GetTxt().GetChar( aDestIdx.GetIndex() ) )
+if (-1 == nStartDelete)
 {
-xub_StrLen nIndex = aDestIdx.GetIndex();
-while ( nIndex  rDestNd.GetTxt().Len() 
-cChar == rDestNd.GetTxt().GetChar( ++nIndex ) )
-;
-rDestNd.EraseText( aDestIdx, nIndex - aDestIdx.GetIndex() );
+nStartDelete = aDestIdx.GetIndex(); // start deletion range
 }
-else
-++aDestIdx;
+++aDestIdx;
+if (aDestIdx  rDestNd.GetTxt().Len())
+{
+continue;
+} // else: end of paragraph = delete, see below
 }
+else
+{
+if (-1 == nStartDelete)
+{
+++aDestIdx;
+continue;
+} // else: delete, see below
+}
+assert(-1 != nStartDelete); // without delete range, would have 
contined
+rDestNd.EraseText(
+SwIndex(rDestNd, static_castxub_StrLen(nStartDelete)),
+aDestIdx.GetIndex() - nStartDelete);
+assert(aDestIdx.GetIndex() == nStartDelete);
+nStartDelete = -1; // reset
 }
 
 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-0' - sw/source

2013-02-13 Thread Michael Stahl
 sw/source/ui/dbui/dbinsdlg.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit b1004870a37aba0232c451580ca21d33184bbeca
Author: Michael Stahl mst...@redhat.com
Date:   Tue Feb 12 14:48:56 2013 +0100

fdo#60092: fix STL regression in SwInsertDBColAutoPilot::DataToDoc

(regression from f7d681dc34e60eb8532403079d007ca1250f4941)

Change-Id: Ida92854efe6ddb8fe10e5ef1f42c53747f40
(cherry picked from commit cbc722733bb272b0f26efec09b478bed9a3cdb96)
Reviewed-on: https://gerrit.libreoffice.org/2119
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Miklos Vajna vmik...@suse.cz

diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index 617da5a..451cb66 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -1002,8 +1002,8 @@ void SwInsertDBColAutoPilot::DataToDoc( const 
SequenceAny rSelection,
 {
 SwInsDBColumn aSrch( aLbTableCol.GetEntry( n ), 0 );
 SwInsDBColumns::const_iterator it = aDBColumns.find( aSrch );
-if( it != aDBColumns.end() )
-aColFlds[ n ] = *it;
+if (it != aDBColumns.end())
+aColFlds.push_back(*it);
 else {
 OSL_ENSURE( !this, database column not found );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-02-12 Thread Caolán McNamara
 sw/source/core/txtnode/txtedt.cxx |   49 --
 1 file changed, 49 deletions(-)

New commits:
commit df52800121871f1fd1d8d48a149c15f5618476d9
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Dec 11 10:37:23 2012 +

prefer my own cjk char-as-word counting

Change-Id: I120acd40b83cad074869b404d4e74b5ec69d493d
Signed-off-by: Michael Meeks michael.me...@suse.com

diff --git a/sw/source/core/txtnode/txtedt.cxx 
b/sw/source/core/txtnode/txtedt.cxx
index 578579c..e0cc703 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -1898,9 +1898,6 @@ void SwTxtNode::CountWords( SwDocStat rStat,
 // map start and end points onto the ConversionMap
 const sal_uInt32 nExpandBegin = aConversionMap.ConvertToViewPosition( nStt 
);
 const sal_uInt32 nExpandEnd   = aConversionMap.ConvertToViewPosition( nEnd 
);
-#ifdef FIXME_REMOVE_WHEN_RE_BASE_COMPLETE
-aExpandText = aExpandText.copy( nExpandBegin, nExpandEnd - nExpandBegin );
-#endif
 
 if (aExpandText.isEmpty()  !bCountNumbering)
 {
@@ -1922,49 +1919,9 @@ void SwTxtNode::CountWords( SwDocStat rStat,
 {
 if (pBreakIt-GetBreakIter().is())
 {
-#ifdef FIXME_REMOVE_WHEN_RE_BASE_COMPLETE
-// FIXME: check if in fact this is a (sadly) duplicated fix.
-
-// split into different script languages
-sal_Int32 nScriptBegin = 0;
-while ( nScriptBegin  aExpandText.getLength() )
-{
-const sal_Int16 nCurrScript = 
pBreakIt-GetBreakIter()-getScriptType( aExpandText, nScriptBegin );
-const sal_Int32 nScriptEnd = 
pBreakIt-GetBreakIter()-endOfScript( aExpandText, nScriptBegin, nCurrScript );
-rtl::OUString aScriptText = aExpandText.copy( nScriptBegin, 
nScriptEnd - nScriptBegin );
-
-// Asian languages count words as characters
-if ( nCurrScript == ::com::sun::star::i18n::ScriptType::ASIAN )
-{
-// substract white spaces
-sal_Int32 nSpaceCount = 0;
-sal_Int32 nSpacePos = 0;
-
-// substract normal white spaces
-nSpacePos = -1;
-while ( ( nSpacePos = aScriptText.indexOf( ' ', nSpacePos 
+ 1 ) ) != -1 )
-{
-nSpaceCount++;
-}
-// substract Asian full-width white spaces
-nSpacePos = -1;
-while ( ( nSpacePos = aScriptText.indexOf( 12288, 
nSpacePos + 1 ) ) != -1 )
-{
-nSpaceCount++;
-}
-nTmpWords += nScriptEnd - nScriptBegin - nSpaceCount;
-}
-else
-{
-#endif
-
 // zero is NULL for pLanguage ---v   last 
param = true for clipping
 SwScanner aScanner( *this, aExpandText, 0, aConversionMap, 
i18n::WordType::WORD_COUNT,
-#ifdef FIXME_REMOVE_WHEN_RE_BASE_COMPLETE
-(xub_StrLen)0, 
(xub_StrLen)aScriptText.getLength() );
-#else
 nExpandBegin, nExpandEnd, true );
-#endif
 
 // used to filter out scanner returning almost empty strings 
(len=1; unichar=0x0001)
 const rtl::OUString aBreakWord( CH_TXTATR_BREAKWORD );
@@ -1982,12 +1939,6 @@ void SwTxtNode::CountWords( SwDocStat rStat,
 }
 }
 
-#ifdef FIXME_REMOVE_WHEN_RE_BASE_COMPLETE
-nScriptBegin = nScriptEnd;
-}
-}
-#endif
-
 nTmpCharsExcludingSpaces += aScanner.getOverriddenDashCount();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-02-07 Thread Michael Stahl
 sw/source/core/layout/flylay.cxx |   28 +---
 1 file changed, 17 insertions(+), 11 deletions(-)

New commits:
commit 00ae381d515d67401b1800280083c9356bf5bd5f
Author: Michael Stahl mst...@redhat.com
Date:   Thu Feb 7 00:08:00 2013 +0100

SwPageFrm::RemoveFlyFromPage: fix a11y problem:

This problem can be reproduced with the bugdoc from fdo#60234, by
dragging and dropping the lower left drawing object.
The ATK bridge is notified of the change, and updates its list of
children by calling getAccessibleChildCount() and then
getAccessibleChild() in a loop.  Unfortunately the count returned does
not match the available children (the difference is the object that is
being dragged).  The implementations in
SwAccessibleFrame::GetChildCount() and SwAccessibleFrame::GetChild()
use slightly different iterators for the SwPageFrm, and the
SwAccessibleChildMap one is implemented as a std::map, using the OrdNum
of the drawing object as a key.  On the dragged object, that OrdNum has
been reset to 0 in RemoveFlyFromPage, but it is still in the pSortedObjs
of the SwPageFrm, and so it is not inserted into the map, and iteration
over the map is missing one element.

149 return _SwAccessibleChildMap::insert( aEntry );
Value returned is $22 = {first = {first = {eLayerId =
SwAccessibleChildMapKey::HELL, nOrdNum = 0}, second = ...}, second = false}

Fix this by removing the object from pSortedObjs before disposing
the a11y frames.

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

diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx
index 5d8f77b..6f7a283 100644
--- a/sw/source/core/layout/flylay.cxx
+++ b/sw/source/core/layout/flylay.cxx
@@ -701,6 +701,23 @@ void SwPageFrm::RemoveFlyFromPage( SwFlyFrm *pToRemove )
 if ( pToRemove-IsFlyInCntFrm() )
 return;
 
+// Don't delete collections just yet. This will happen at the end of the
+// action in the RemoveSuperfluous of the page, kicked off by a method of
+// the same name in the root.
+// The FlyColl might be gone already, because the page's dtor is being
+// executed.
+// Remove it _before_ disposing accessible frames to avoid accesses to
+// the Frm from event handlers.
+if (pSortedObjs)
+{
+pSortedObjs-Remove(*pToRemove);
+if (!pSortedObjs-Count())
+{
+delete pSortedObjs;
+pSortedObjs = 0;
+}
+}
+
 // Notify accessible layout. That's required at this place for
 // frames only where the anchor is moved. Creation of new frames
 // is additionally handled by the SwFrmNotify class.
@@ -712,17 +729,6 @@ void SwPageFrm::RemoveFlyFromPage( SwFlyFrm *pToRemove )
   -DisposeAccessibleFrm( pToRemove, sal_True 
);
 }
 
-// Don't delete collections just yet. This will happen at the end of the
-// action in the RemoveSuperfluous of the page, kicked off by a method of
-// the same name in the root.
-// The FlyColl might be gone already, because the page's dtor is being 
executed.
-if ( pSortedObjs )
-{
-pSortedObjs-Remove( *pToRemove );
-if ( !pSortedObjs-Count() )
-{   DELETEZ( pSortedObjs );
-}
-}
 // #i28701# - use new method SetPageFrm(..)
 pToRemove-SetPageFrm( 0L );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-02-06 Thread Caolán McNamara
 sw/source/core/inc/tabfrm.hxx|2 ++
 sw/source/core/layout/tabfrm.cxx |   20 
 2 files changed, 22 insertions(+)

New commits:
commit dc65bfac2597430ea087a9dcbcded7316d9319b7
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Feb 5 17:33:49 2013 +

Resolves: rhbz#907933 crash on removing second last para in cell...

if (basically) the last para is on next page

Change-Id: Iaff610ea94a829e73bfb8c694a27e0e9b4f6e295
Reviewed-on: https://gerrit.libreoffice.org/2012
Tested-by: Michael Stahl mst...@redhat.com
Reviewed-by: Michael Stahl mst...@redhat.com
(cherry picked from commit 15d8b51bf82610c663f80fe552a1c0315e137ad3)

diff --git a/sw/source/core/inc/tabfrm.hxx b/sw/source/core/inc/tabfrm.hxx
index 464fc9c..1041385 100644
--- a/sw/source/core/inc/tabfrm.hxx
+++ b/sw/source/core/inc/tabfrm.hxx
@@ -151,6 +151,8 @@ public:
 //
 sal_Bool HasFollowFlowLine() const { return bHasFollowFlowLine; }
 void SetFollowFlowLine( sal_Bool bNew ) { bHasFollowFlowLine = bNew; }
+//return the SwTabFrm (if any) that this SwTabFrm is a follow flow line for
+SwTabFrm* GetFollowFlowLineFor();
 
 sal_Bool IsRebuildLastLine() const { return bIsRebuildLastLine; }
 void SetRebuildLastLine( sal_Bool bNew ) { bIsRebuildLastLine = bNew; }
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 3945383..6aa2cee 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -132,8 +132,28 @@ extern const SwTable   *pRowCacheLastTable;
 extern const SwTabFrm  *pRowCacheLastTabFrm;
 extern const SwFrm *pRowCacheLastCellFrm;
 
+//return the SwTabFrm (if any) that this SwTabFrm is a follow flow line for
+SwTabFrm* SwTabFrm::GetFollowFlowLineFor()
+{
+SwFlowFrm *pPrec = GetPrecede();
+if (pPrec  pPrec-GetFrm()-IsTabFrm())
+{
+SwTabFrm *pPrevTabFrm = (SwTabFrm*)pPrec;
+assert(this == pPrevTabFrm-GetFollow());
+if (pPrevTabFrm-HasFollowFlowLine()  pPrevTabFrm-GetFollow() == 
this)
+return pPrevTabFrm;
+}
+return NULL;
+}
+
 SwTabFrm::~SwTabFrm()
 {
+//rhbz#907933, we are a follow flow line for something and have been
+//deleted, remove ourself as a follow flowline
+SwTabFrm* pFlowFrameFor = GetFollowFlowLineFor();
+if (pFlowFrameFor)
+pFlowFrameFor-RemoveFollowFlowLine();
+
 // There is some terrible code in fetab.cxx, that
 // makes use of these global pointers. Obviously
 // this code did not consider that a TabFrm can be
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-02-05 Thread Michael Stahl
 sw/source/core/layout/frmtool.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 7fea9d676296b380aa18a13d361f1c08957e5ec3
Author: Michael Stahl mst...@redhat.com
Date:   Mon Feb 4 23:26:50 2013 +0100

fdo#60250: InsertNewPage: copy margins for mirrored pages

When there is no explicit first page, set the proper left or right
margins, which are different for mirrored page styles.
(regression from a964cf666abb0c4df4e29ea8709532b7d45c104f)

Change-Id: I56ccc6f7987accefc27d627d2427ee37d83bd758
(cherry picked from commit 2fc87188bd4a73d25b64b32e0287cee5d6ee4a48)
Reviewed-on: https://gerrit.libreoffice.org/1987
Reviewed-by: Miklos Vajna vmik...@suse.cz
Tested-by: Miklos Vajna vmik...@suse.cz

diff --git a/sw/source/core/layout/frmtool.cxx 
b/sw/source/core/layout/frmtool.cxx
index 9a60553..bdc6138 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -2742,11 +2742,14 @@ SwPageFrm * InsertNewPage( SwPageDesc rDesc, SwFrm 
*pUpper,
 {
 rDesc.GetFirst().SetFmtAttr( rDesc.GetMaster().GetHeader() );
 rDesc.GetFirst().SetFmtAttr( rDesc.GetMaster().GetFooter() );
+// fdo#60250 copy margins for mirrored pages
+rDesc.GetFirst().SetFmtAttr( rDesc.GetMaster().GetLRSpace() );
 }
 else
 {
 rDesc.GetFirst().SetFmtAttr( rDesc.GetLeft().GetHeader() );
 rDesc.GetFirst().SetFmtAttr( rDesc.GetLeft().GetFooter() );
+rDesc.GetFirst().SetFmtAttr( rDesc.GetLeft().GetLRSpace() );
 }
 }
 pFmt = rDesc.GetFirstFmt();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits