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

2014-12-01 Thread Tor Lillqvist
 sw/source/ui/misc/swruler.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit a0cfe0f2dac64eb880a134a69fefa5c7825be7b8
Author: Tor Lillqvist t...@collabora.com
Date:   Fri Dec 20 14:56:33 2013 +0200

Prevent occasional crash

I came across the crash by accident when checking how it works to have
multiple windows showing the same document. Pasting in lots of text
and then quickly telling LO to exit with Cmd-Q caused a crash here as
GetPostItMgr() returned NULL.

Change-Id: Ib9e636df0832a679a1d81fa3856ea0a7105a69c3
(cherry picked from commit 0eb1ef39084a978e8c2bec977ebabf6708f0c073)
Reviewed-on: https://gerrit.libreoffice.org/13219
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com

diff --git a/sw/source/ui/misc/swruler.cxx b/sw/source/ui/misc/swruler.cxx
index fa396d0..b1035c9 100644
--- a/sw/source/ui/misc/swruler.cxx
+++ b/sw/source/ui/misc/swruler.cxx
@@ -56,7 +56,8 @@ void SwCommentRuler::Paint( const Rectangle rRect )
 {
 SvxRuler::Paint( rRect );
 // Don't draw if there is not any note
-if ( mpViewShell-GetPostItMgr()-HasNotes() )
+if ( mpViewShell-GetPostItMgr()
+  mpViewShell-GetPostItMgr()-HasNotes() )
 DrawCommentControl();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-11-27 Thread Caolán McNamara
 sw/source/core/crsr/swcrsr.cxx |   14 +++---
 sw/source/core/doc/docruby.cxx |2 +-
 sw/source/filter/html/htmlfldw.cxx |2 +-
 3 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 383535196f9924202fc997c388e34a7865a2250e
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Jan 15 10:45:41 2014 +

Related: #i17171# identify places where -1 was cast to 0x in the past

try and do so anyway. Could be picking that sort of lint out of writer
for a while to come :-(

(cherry picked from commit 16c565461b40c6876e69dc7bcc18f7c4db7fb94d)

Note: this fixes fdo#80571

Note: for backport, removed any changes where the variables are still
xub_StrLen; only sal_Int32 variables may have values  0.

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

Conflicts:
sw/source/core/crsr/swcrsr.cxx
sw/source/core/text/porfld.cxx
sw/source/core/text/txthyph.cxx
sw/source/core/txtnode/fntcap.cxx
sw/source/core/txtnode/txtedt.cxx

Change-Id: I4efb94e5ed33025f7f416c096af25ba358ef45af

diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index d27ebca..971c1b7 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -1233,7 +1233,7 @@ sal_Bool SwCursor::GoStartWordWT( sal_Int16 nWordType )
 nWordType,
 sal_False ).startPos;
 
-if (nPtPos  pTxtNd-GetTxt().getLength())
+if (nPtPos  pTxtNd-GetTxt().getLength()  nPtPos = 0)
 {
 GetPoint()-nContent = nPtPos;
 if( !IsSelOvr() )
@@ -1257,7 +1257,7 @@ sal_Bool SwCursor::GoEndWordWT( sal_Int16 nWordType )
 nWordType,
 sal_True ).endPos;
 
-if (nPtPos = pTxtNd-GetTxt().getLength() 
+if (nPtPos = pTxtNd-GetTxt().getLength()  nPtPos = 0 
 GetPoint()-nContent.GetIndex() != nPtPos )
 {
 GetPoint()-nContent = nPtPos;
@@ -1282,7 +1282,7 @@ sal_Bool SwCursor::GoNextWordWT( sal_Int16 nWordType )
 g_pBreakIt-GetLocale( pTxtNd-GetLang( nPtPos, 1 ) ),
 nWordType ).startPos;
 
-if (nPtPos  pTxtNd-GetTxt().getLength())
+if (nPtPos  pTxtNd-GetTxt().getLength()  nPtPos = 0)
 {
 GetPoint()-nContent = nPtPos;
 if( !IsSelOvr() )
@@ -1309,7 +1309,7 @@ sal_Bool SwCursor::GoPrevWordWT( sal_Int16 nWordType )
 g_pBreakIt-GetLocale( pTxtNd-GetLang( nPtPos, 1 ) ),
 nWordType ).startPos;
 
-if (nPtPos  pTxtNd-GetTxt().getLength())
+if (nPtPos  pTxtNd-GetTxt().getLength()  nPtPos = 0)
 {
 GetPoint()-nContent = nPtPos;
 if( !IsSelOvr() )
@@ -1474,7 +1474,7 @@ sal_Bool SwCursor::GoSentence( SentenceMoveType eMoveType 
)
 
 // it is allowed to place the PaM just behind the last
 // character in the text thus = ...Len
-if (nPtPos = pTxtNd-GetTxt().getLength())
+if (nPtPos = pTxtNd-GetTxt().getLength()  nPtPos = 0)
 {
 GetPoint()-nContent = nPtPos;
 if( !IsSelOvr() )
@@ -1511,12 +1511,12 @@ sal_Bool SwCursor::ExpandToSentenceBorders()
 // it is allowed to place the PaM just behind the last
 // character in the text thus = ...Len
 bool bChanged = false;
-if (nStartPos = pStartNd-GetTxt().getLength())
+if (nStartPos = pStartNd-GetTxt().getLength()  nStartPos = 0)
 {
 GetMark()-nContent = nStartPos;
 bChanged = true;
 }
-if (nEndPos = pEndNd-GetTxt().getLength())
+if (nEndPos = pEndNd-GetTxt().getLength()  nEndPos = 0)
 {
 GetPoint()-nContent = nEndPos;
 bChanged = true;
diff --git a/sw/source/core/doc/docruby.cxx b/sw/source/core/doc/docruby.cxx
index acc91a0..44d7915 100644
--- a/sw/source/core/doc/docruby.cxx
+++ b/sw/source/core/doc/docruby.cxx
@@ -235,7 +235,7 @@ sal_Bool SwDoc::_SelectNextRubyChars( SwPaM rPam, 
SwRubyListEntry rEntry, sal_
 g_pBreakIt-GetLocale( pTNd-GetLang( nStart )),
 WordType::ANYWORD_IGNOREWHITESPACES,
 sal_True ).startPos;
-if( nWordStt  nStart  -1 != nWordStt )
+if (nWordStt  nStart  nWordStt = 0)
 {
 nStart = nWordStt;
 pPos-nContent = nStart;
diff --git a/sw/source/filter/html/htmlfldw.cxx 
b/sw/source/filter/html/htmlfldw.cxx
index 29c9c76..a77c95d 100644
--- a/sw/source/filter/html/htmlfldw.cxx
+++ b/sw/source/filter/html/htmlfldw.cxx
@@ -315,7 +315,7 @@ static Writer OutHTML_SwField( Writer rWrt, const 
SwField* pFld,
 
 sal_uInt16 nScript =
 SwHTMLWriter::GetCSS1ScriptForScriptType( nScriptType );
-if( nPos  sExpand.getLength() || nScript != rHTMLWrt.nCSS1Script )
+if( (nPos  

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

2014-09-23 Thread Matúš Kukan
 sw/source/filter/html/htmlgrin.cxx |   23 ---
 1 file changed, 16 insertions(+), 7 deletions(-)

New commits:
commit 64bed43ef763f6e4435ae31f705f9639671f14d9
Author: Matúš Kukan matus.ku...@collabora.com
Date:   Wed Sep 17 11:57:24 2014 +0200

bnc#580834: HTML import: Embed images if source URL is a local file.

Use also INET_PROT_FILE to determine whether to import images as links.

(cherry picked from commits 3914a711060341345f15b83656457f90095f32d6
and 72703173066a2db5c977d422ace59d60b998bbfc and
38faee21e0b874359246e513b0a8c0af399a864d)

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

Change-Id: I22a5ded92d9aac4220c0c4fa8bb8a9490f5c61a6
Reviewed-on: https://gerrit.libreoffice.org/11542
Reviewed-by: Andras Timar andras.ti...@collabora.com
Tested-by: Andras Timar andras.ti...@collabora.com

diff --git a/sw/source/filter/html/htmlgrin.cxx 
b/sw/source/filter/html/htmlgrin.cxx
index 231555e..d32c473 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -696,8 +696,9 @@ IMAGE_SETEVENT:
 aFrmSize.SetHeightPercent( nPrcHeight );
 aFrmSet.Put( aFrmSize );
 
-Graphic aEmptyGrf;
-if( sGrfNm.startsWith(data:) )
+Graphic aGraphic;
+INetURLObject aGraphicURL( sGrfNm );
+if( aGraphicURL.GetProtocol() == INET_PROT_DATA )
 {
 // use embedded base64 encoded data
 ::com::sun::star::uno::Sequence sal_Int8  aPass;
@@ -705,15 +706,23 @@ IMAGE_SETEVENT:
 ::sax::Converter::decodeBase64(aPass, sBase64Data);
 if( aPass.hasElements() )
 {
-SvMemoryStream aStream(aPass.getArray(), aPass.getLength(), 
STREAM_READ);
-GraphicFilter::GetGraphicFilter().ImportGraphic( aEmptyGrf, 
OUString(), aStream );
+SvMemoryStream aStream(aPass.getArray(), aPass.getLength(), 
STREAM_READ);
+if (GRFILTER_OK == 
GraphicFilter::GetGraphicFilter().ImportGraphic(aGraphic, , aStream))
+sGrfNm = ;
 }
 }
-else
+// sBaseURL is empty if the source is clipboard
+else if (sBaseURL.isEmpty())
+{
+if (GRFILTER_OK == 
GraphicFilter::GetGraphicFilter().ImportGraphic(aGraphic, aGraphicURL))
+sGrfNm = ;
+}
+if (!sGrfNm.isEmpty())
 {
-aEmptyGrf.SetDefaultType();
+aGraphic.SetDefaultType();
 }
-SwFrmFmt *pFlyFmt = pDoc-Insert( *pPam, sGrfNm, aEmptyOUStr, aEmptyGrf,
+// passing empty sGrfNm here, means we don't want the graphic to be linked
+SwFrmFmt *pFlyFmt = pDoc-Insert( *pPam, sGrfNm, aEmptyOUStr, aGraphic,
   aFrmSet, NULL, NULL );
 SwGrfNode *pGrfNd = pDoc-GetNodes()[ pFlyFmt-GetCntnt().GetCntntIdx()
   -GetIndex()+1 ]-GetGrfNode();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-08-21 Thread Caolán McNamara
 sw/source/filter/ww8/ww8par.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit da1b74b4d8707948740d37059b1ea49b6cff9364
Author: Caolán McNamara caol...@redhat.com
Date:   Thu Aug 21 12:59:50 2014 +0100

avoid crash on document ending before contained table ends

Change-Id: I003b7e00673cd5a4b4f0ed5218e2d30cfef04ffb
(cherry picked from commit 5a2123376dc010ca4e3f0a19d7dbbfaeb25ea963)
Reviewed-on: https://gerrit.libreoffice.org/11057
Reviewed-by: David Tardon dtar...@redhat.com
Tested-by: David Tardon dtar...@redhat.com

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 21ba56d..b07a5d0 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -5323,6 +5323,8 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, 
const SwPosition rPos)
 
 UpdatePageDescs(rDoc, nPageDescOffset);
 
+SAL_WARN_IF(mpTableEndPaM, sw.ww8, document ended without table 
ending);
+mpTableEndPaM.reset();  //ensure this is deleted before pPaM
 delete pPaM, pPaM = 0;
 return nErrRet;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-08-20 Thread Michael Stahl
 sw/source/filter/ww8/ww8par6.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 953a77abf6466165d5fbcc88cd87ce062ad901e8
Author: Michael Stahl mst...@redhat.com
Date:   Tue Aug 19 18:11:42 2014 +0200

sw: ww8: fix another ~SwIndexReg() assertion

If the position is the same as the body text anchor position, don't
delete the node.  Probably something should have inserted more nodes
between StartApo() and StopApo().

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

diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 14cb5b3..392fdac 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -2374,7 +2374,7 @@ bool SwWW8ImplReader::StartApo(const ApoTestResults rApo,
 pAnchorStck-AddAnchor(*pPaM-GetPoint(),pSFlyPara-pFlyFmt);
 }
 
-// merke Pos im Haupttext
+// remember Pos in body text
 pSFlyPara-pMainTextPos = new SwPosition( *pPaM-GetPoint() );
 
 //remove fltanchors, otherwise they will be closed inside the
@@ -2470,7 +2470,9 @@ void SwWW8ImplReader::StopApo()
 
 Color aBg(0xFE, 0xFF, 0xFF, 0xFF);  //Transparent by default
 
-if (SwTxtNode* pNd = aPref.GetNode().GetTxtNode())
+SwTxtNode* pNd = aPref.GetNode().GetTxtNode();
+if (pNd  pPaM-GetPoint()-nNode.GetNode()
+!= pSFlyPara-pMainTextPos-nNode.GetNode())
 {
 /*
 #i582#
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-08-14 Thread Caolán McNamara
 sw/source/core/unocore/unotext.cxx |   18 +-
 1 file changed, 13 insertions(+), 5 deletions(-)

New commits:
commit 8f8fd00b8f67028c7f158e38d30e94819984a811
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Aug 12 12:06:49 2014 +0100

Resolves: fdo#81046 don't crash on compilers that enforce exception specs

bit of a hammer here, the offending property is IsSplitAllowed if someone
wants to attempt a more subtle fix

(cherry picked from commit b59931d8a62f761022929f58f27d7ba22536b570)

Change-Id: I37ed623a9947473fcb5c9e2b987d7a3dd9147ffa
Signed-off-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/sw/source/core/unocore/unotext.cxx 
b/sw/source/core/unocore/unotext.cxx
index f8867d9..e066325 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -2136,12 +2136,20 @@ lcl_ApplyCellProperties(
 xCellCurs-gotoEnd( sal_True );
 const uno::Reference beans::XPropertyState 
 xCellTextPropState(xCellCurs, uno::UNO_QUERY);
-const beans::PropertyState state = 
xCellTextPropState-getPropertyState(rName);
-if (state == beans::PropertyState_DEFAULT_VALUE)
+try
 {
-const uno::Reference beans::XPropertySet 
-xCellTextProps(xCellCurs, uno::UNO_QUERY);
-xCellTextProps-setPropertyValue(rName, rValue);
+const beans::PropertyState state = 
xCellTextPropState-getPropertyState(rName);
+if (state == beans::PropertyState_DEFAULT_VALUE)
+{
+const uno::Reference beans::XPropertySet 
+xCellTextProps(xCellCurs, uno::UNO_QUERY);
+xCellTextProps-setPropertyValue(rName, rValue);
+}
+}
+catch (const uno::Exception e)
+{
+SAL_WARN( sw.uno, Exception when getting PropertyState: 

++ rName + . Message:  + e.Message );
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-08-07 Thread Michael Stahl
 sw/source/core/doc/docfmt.cxx |   16 
 1 file changed, 16 insertions(+)

New commits:
commit f23d6a124dc413bcbb98f5145d230de707ca85db
Author: Michael Stahl mst...@redhat.com
Date:   Tue Aug 5 22:50:23 2014 +0200

fdo#69282: sw: fix updating of page styles via SwDocShell::_LoadStyles()

SwDoc::CopyPageDesc() only copies master and left SwFrmFmt attributes,
but not first-master and first-left.  They will contain exactly the same
attributes as master and left but they still need to be copied...

(see also: that FIXME in pagedesc.hxx)

(regression from 75084f6c42c27dc95418df9cefed2fddfb26000e)

Change-Id: I3dcc3627708b5d6a477eb7fef76cf6c42c95c004
(cherry picked from commit 5c1cc92ee09f9fcc99077cacd3fc55640f03b7b2)
Reviewed-on: https://gerrit.libreoffice.org/10774
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 561cb0f..b987918 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -2148,6 +2148,22 @@ void SwDoc::CopyPageDesc( const SwPageDesc rSrcDesc, 
SwPageDesc rDstDesc,
 
 rDstDesc.GetLeft().DelDiffs( aAttrSet );
 rDstDesc.GetLeft().SetFmtAttr( aAttrSet );
+
+aAttrSet.ClearItem();
+aAttrSet.Put( rSrcDesc.GetFirstMaster().GetAttrSet() );
+aAttrSet.ClearItem( RES_HEADER );
+aAttrSet.ClearItem( RES_FOOTER );
+
+rDstDesc.GetFirstMaster().DelDiffs( aAttrSet );
+rDstDesc.GetFirstMaster().SetFmtAttr( aAttrSet );
+
+aAttrSet.ClearItem();
+aAttrSet.Put( rSrcDesc.GetFirstLeft().GetAttrSet() );
+aAttrSet.ClearItem( RES_HEADER );
+aAttrSet.ClearItem( RES_FOOTER );
+
+rDstDesc.GetFirstLeft().DelDiffs( aAttrSet );
+rDstDesc.GetFirstLeft().SetFmtAttr( aAttrSet );
 }
 
 CopyHeader( rSrcDesc.GetMaster(), rDstDesc.GetMaster() );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-08-07 Thread Michael Stahl
 sw/source/core/doc/docfmt.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 01db6d0f9b3cfa88eaedd3b9ac98f76c2a90571b
Author: Michael Stahl mst...@redhat.com
Date:   Tue Aug 5 22:56:17 2014 +0200

SwDoc::CopyPageDesc(): probably sending Modify for first too cannot hurt

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

diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index b987918..43cfe77 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -2215,6 +2215,12 @@ void SwDoc::CopyPageDesc( const SwPageDesc rSrcDesc, 
SwPageDesc rDstDesc,
 {
 rDstDesc.GetLeft().ModifyBroadcast( aInfo, 0, TYPE(SwFrm) );
 }
+{
+rDstDesc.GetFirstMaster().ModifyBroadcast( aInfo, 0, TYPE(SwFrm) 
);
+}
+{
+rDstDesc.GetFirstLeft().ModifyBroadcast( aInfo, 0, TYPE(SwFrm) );
+}
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-07-22 Thread Zolnai Tamás
 sw/source/core/layout/paintfrm.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 17e55304319a6046e649adcfc5d3fbd573d5d43e
Author: Zolnai Tamás tamas.zol...@collabora.com
Date:   Tue Jul 22 14:01:40 2014 +0200

fdo#79221: Wrong rendering of bottom and right character border

Regression from 2cd1673f41cb5bd8502a9a48a5721244660fe3a0.

SetMirrorWidths() works only when there are two lines
(double border), but breaks one line borders.

Change-Id: I2727afbc071bb4038c6cef18e6b96c796ef3a8b9
(cherry picked from commit bdbf6cee5a3a012412699dba103b9f6430084722)
Reviewed-on: https://gerrit.libreoffice.org/10456
Reviewed-by: Kohei Yoshida libreoff...@kohei.us
Tested-by: Kohei Yoshida libreoff...@kohei.us

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index 3e4ed87..3098638 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -5080,7 +5080,8 @@ void PaintCharacterBorder(
 
 if( aBottomBorder )
 {
-aBottomBorder-SetMirrorWidths(true);
+if( aBottomBorder-isDouble() )
+aBottomBorder-SetMirrorWidths(true);
 
 Point aLeftTop(
 aAlignedRect.Left(),
@@ -5118,7 +5119,8 @@ void PaintCharacterBorder(
 
 if( aRightBorder )
 {
-aRightBorder-SetMirrorWidths(true);
+if( aRightBorder-isDouble() )
+aRightBorder-SetMirrorWidths(true);
 
 Point aLeftTop(
 aAlignedRect.Right() - aRightBorder.get().GetScaledWidth(),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-07-15 Thread Caolán McNamara
 sw/source/filter/ww8/docxattributeoutput.cxx |   18 -
 sw/source/filter/ww8/rtfattributeoutput.cxx  |   28 ++-
 sw/source/filter/ww8/wrtww8gr.cxx|2 -
 3 files changed, 37 insertions(+), 11 deletions(-)

New commits:
commit 5b11f8b75b1ee6da439c3cd7892990b601e03d83
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Jul 14 11:36:32 2014 +0100

Resolves: fdo#52226 swap in graphics on .docx and .rtf export

(cherry picked from commit 9dd5caac62083f7162d83319284df68ee83e3777)

Conflicts:
sw/source/filter/ww8/docxattributeoutput.cxx
sw/source/filter/ww8/rtfattributeoutput.cxx
sw/source/filter/ww8/wrtww8gr.cxx

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

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 2056863..22612f5 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -2757,13 +2757,29 @@ void DocxAttributeOutput::FlyFrameGraphic( const 
SwGrfNode* pGrfNode, const Size
 // inline, we also have to write the image itself
 const Graphic* pGraphic = 0;
 if (pGrfNode)
-pGraphic = const_cast Graphic ( pGrfNode-GetGrf() );
+pGraphic = pGrfNode-GetGrf();
 else
 pGraphic = pOLENode-GetGraphic();
 
 m_rDrawingML.SetFS( m_pSerializer ); // to be sure that we write to 
the right stream
+
+bool bSwapped = pGraphic-IsSwapOut();
+if (bSwapped)
+{
+if (pGrfNode)
+{
+// always swapin via the Node
+const_castSwGrfNode*(pGrfNode)-SwapIn();
+}
+else
+const_castGraphic*(pGraphic)-SwapIn();
+}
+
 OUString aImageId = m_rDrawingML.WriteImage( *pGraphic );
 
+if (bSwapped)
+const_castGraphic*(pGraphic)-SwapOut();
+
 aRelId = OUStringToOString( aImageId, RTL_TEXTENCODING_UTF8 );
 
 nImageType = XML_embed;
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx 
b/sw/source/filter/ww8/rtfattributeoutput.cxx
index f73ab4d..9b3887f 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -3610,17 +3610,24 @@ void RtfAttributeOutput::FlyFrameGraphic( const 
SwFlyFrmFmt* pFlyFrmFmt, const S
 const sal_uInt8* pGraphicAry = 0;
 sal_uInt32 nSize = 0;
 
-Graphic aGraphic(pGrfNode-GetGrf());
+const Graphic rGraphic(pGrfNode-GetGrf());
 
 // If there is no graphic there is not much point in parsing it
-if(aGraphic.GetType()==GRAPHIC_NONE)
+if (rGraphic.GetType()==GRAPHIC_NONE)
 return;
 
+bool bSwapped = rGraphic.IsSwapOut();
+if (bSwapped)
+{
+// always swapin via the Node
+const_castSwGrfNode*(pGrfNode)-SwapIn();
+}
+
 GfxLink aGraphicLink;
 const sal_Char* pBLIPType = 0;
-if (aGraphic.IsLink())
+if (rGraphic.IsLink())
 {
-aGraphicLink = aGraphic.GetLink();
+aGraphicLink = rGraphic.GetLink();
 nSize = aGraphicLink.GetDataSize();
 pGraphicAry = aGraphicLink.GetData();
 switch (aGraphicLink.GetType())
@@ -3640,10 +3647,10 @@ void RtfAttributeOutput::FlyFrameGraphic( const 
SwFlyFrmFmt* pFlyFrmFmt, const S
 }
 }
 
-GraphicType eGraphicType = aGraphic.GetType();
+GraphicType eGraphicType = rGraphic.GetType();
 if (!pGraphicAry)
 {
-if (ERRCODE_NONE == GraphicConverter::Export(aStream, aGraphic,
+if (ERRCODE_NONE == GraphicConverter::Export(aStream, rGraphic,
 (eGraphicType == GRAPHIC_BITMAP) ? CVT_PNG : CVT_WMF))
 {
 pBLIPType = (eGraphicType == GRAPHIC_BITMAP) ?
@@ -3654,7 +3661,7 @@ void RtfAttributeOutput::FlyFrameGraphic( const 
SwFlyFrmFmt* pFlyFrmFmt, const S
 }
 }
 
-Size aMapped(eGraphicType == GRAPHIC_BITMAP ? aGraphic.GetSizePixel() : 
aGraphic.GetPrefSize());
+Size aMapped(eGraphicType == GRAPHIC_BITMAP ? rGraphic.GetSizePixel() : 
rGraphic.GetPrefSize());
 
 const SwCropGrf rCr = (const SwCropGrf 
)pGrfNode-GetAttr(RES_GRFATR_CROPGRF);
 
@@ -3683,7 +3690,7 @@ void RtfAttributeOutput::FlyFrameGraphic( const 
SwFlyFrmFmt* pFlyFrmFmt, const S
 else
 {
 aStream.Seek(0);
-GraphicConverter::Export(aStream, aGraphic, CVT_WMF);
+GraphicConverter::Export(aStream, rGraphic, CVT_WMF);
 pBLIPType = OOO_STRING_SVTOOLS_RTF_WMETAFILE;
 aStream.Seek(STREAM_SEEK_TO_END);
 nSize = aStream.Tell();
@@ -3697,7 +3704,7 @@ void RtfAttributeOutput::FlyFrameGraphic( const 
SwFlyFrmFmt* pFlyFrmFmt, const S
 m_rExport.Strm()  } { OOO_STRING_SVTOOLS_RTF_NONSHPPICT;
 
 

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

2014-07-09 Thread Michael Stahl
 sw/source/filter/ww8/ww8par.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit e16fe2a30164822e9345f5ad3f2ab94b754e7baf
Author: Michael Stahl mst...@redhat.com
Date:   Tue Jul 8 13:05:41 2014 +0200

sw: do more input validation in SwWW8ImplReader::Read_And

(to fix up f2945255df273404ee2457dcf761cb8f334b732b)

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

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 42e4ad3..e2e9080 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2173,7 +2173,9 @@ long SwWW8ImplReader::Read_And(WW8PLCFManResult* pRes)
 //that relate to each annotation index as the parser passes
 //those points.
 sal_Int32 nLen = nEnd - nStart;
-if( nLen )
+// the start and end positions are apparently stored in
+// different arrays, so in an invalid file only one could exist
+if(SAL_MAX_INT32 != nEnd  SAL_MAX_INT32 != nStart  nLen  
0)
 {
 if (pPaM-GetPoint()-nContent.GetIndex() = nLen)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-07-08 Thread Caolán McNamara
 sw/source/filter/ww8/ww8par.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 012e30066a83dda4d20b87834944c818a91a2aab
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Jan 24 13:13:59 2014 +

coverity#1158240 Dereference before null check

Change-Id: I5ce6d5514c6bb2298dd00c43d21a43dba55268c3
(cherry picked from commit 6c7b64bad403fb6eeac6e79d356f456f741a00d4)
Reviewed-on: https://gerrit.libreoffice.org/10139
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 7312c7b..ed42bf4 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2190,8 +2190,8 @@ long SwWW8ImplReader::Read_And(WW8PLCFManResult* pRes)
 }
 while( !pNode-IsTxtNode()  
pPaM-GetPoint()-nNode = 0 );
 
-// Subtrackt previous text node's length
-if( pNode  pNode-IsTxtNode() )
+// Subtract previous text node's length
+if( pNode-IsTxtNode() )
 {
 pTxtNode = pNode-GetTxtNode();
 if( nLen  pTxtNode-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-2' - sw/source

2014-07-08 Thread Miklos Vajna
 sw/source/filter/ww8/ww8par.cxx |   14 +-
 sw/source/filter/ww8/ww8par.hxx |2 ++
 2 files changed, 15 insertions(+), 1 deletion(-)

New commits:
commit d791e45741a7ff36c0942a600d2ee0c7fabcd06a
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Tue Feb 4 16:02:49 2014 +0100

DOC import: fix nested comments

See 2.9.70 (FBKF) in the spec, the ibkl field should be used to find the
position in PlcfBkf.

Previously we assumed that PlcfBkl and PlcfBkf is parallel for
annotations, as but that's not true for nested comments.

Change-Id: I76a6a757b41d2f9b7fe7fe9c9e01a92c251f7b32
(cherry picked from commit 5cfda4f4de8da82485e27b1f0f0d94211d3b4d95)
Reviewed-on: https://gerrit.libreoffice.org/10138
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index ed42bf4..0ba789b 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2162,7 +2162,7 @@ long SwWW8ImplReader::Read_And(WW8PLCFManResult* pRes)
 if (nAtnIndex != -1)
 {
 WW8_CP nStart = GetAnnotationStart(nAtnIndex);
-WW8_CP nEnd = GetAnnotationEnd(nAtnIndex);
+WW8_CP nEnd = 
GetAnnotationEnd(GetAnnotationEndIndex(nAtnIndex));
 sal_Int32 nLen = nEnd - nStart;
 if( nLen )
  {
@@ -5951,6 +5951,18 @@ int SwWW8ImplReader::GetAnnotationIndex(sal_uInt32 nTag)
 return -1;
 }
 
+sal_uInt16 SwWW8ImplReader::GetAnnotationEndIndex(sal_uInt16 nStart)
+{
+WW8_CP nStartAkt;
+void* p;
+if (mpAtnStarts-GetData(nStart, nStartAkt, p)  p)
+{
+// p is an FBKF, and its first 2 bytes is the ibkl member, which is 
the end index.
+return SVBT16ToShort(*((SVBT16*)p));
+}
+return nStart;
+}
+
 WW8_CP SwWW8ImplReader::GetAnnotationStart(int nIndex)
 {
 if (!mpAtnStarts.get()  pWwFib-lcbPlcfAtnbkf)
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index 772da4c..9434c2e 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -1635,6 +1635,8 @@ private:
 
 const OUString* GetAnnotationAuthor(sal_uInt16 nIdx);
 int GetAnnotationIndex(sal_uInt32 nTag);
+/// Return the end index based on the start one.
+sal_uInt16 GetAnnotationEndIndex(sal_uInt16 nStart);
 WW8_CP GetAnnotationStart(int nIndex);
 WW8_CP GetAnnotationEnd(int nIndex);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-07-08 Thread Caolán McNamara
 sw/source/filter/ww8/ww8par.cxx |   39 ++-
 1 file changed, 26 insertions(+), 13 deletions(-)

New commits:
commit 66c3f4ad802a8d24caa30c772381db66dd52dc7f
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Jul 4 16:50:54 2014 +0100

fix crash loading ooo#93570-3.doc

regression from f2945255df273404ee2457dcf761cb8f334b732b
cp#201310151026: doc import of comments affecting more text nodes

use Move(fnMoveBackward, fnGoNode) to at least ensure we stop going
backwards when we run out of valid places to go backwards to.

This still isn't great because the distance between two msword character
indexes only equates to the same distance between our characters in the very
simple cases

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

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 0ba789b..42e4ad3 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2163,9 +2163,18 @@ long SwWW8ImplReader::Read_And(WW8PLCFManResult* pRes)
 {
 WW8_CP nStart = GetAnnotationStart(nAtnIndex);
 WW8_CP nEnd = 
GetAnnotationEnd(GetAnnotationEndIndex(nAtnIndex));
+//It is unfortunately fragile and wrong to assume that two
+//character positions in the original word document, which is
+//what nStart and nEnd are, will equate to the same length in
+//the destination writer document.
+//
+//Better would be, while writing the content into the writer
+//document to store the equivalent writer document positions
+//that relate to each annotation index as the parser passes
+//those points.
 sal_Int32 nLen = nEnd - nStart;
 if( nLen )
- {
+{
 if (pPaM-GetPoint()-nContent.GetIndex() = nLen)
 {
 pPaM-SetMark();
@@ -2177,24 +2186,28 @@ long SwWW8ImplReader::Read_And(WW8PLCFManResult* pRes)
 nLen -= pPaM-GetPoint()-nContent.GetIndex();
 
 SwTxtNode* pTxtNode = 0;
-// Find first text node which affected by the comment
-while( pPaM-GetPoint()-nNode = 0 )
+
+// Find first text node which is affected by the 
comment
+while (nLen  0)
 {
-SwNode* pNode = 0;
-// Find previous text node
-do
+// Move to previous content node
+bool bSuccess = pPaM-Move(fnMoveBackward, 
fnGoNode);
+
+if (!bSuccess)
 {
-pPaM-GetPoint()-nNode--;
-nLen--; // End line character
-pNode = pPaM-GetPoint()-nNode.GetNode();
+nLen = 0;
+break;
 }
-while( !pNode-IsTxtNode()  
pPaM-GetPoint()-nNode = 0 );
+
+--nLen; // End line character
+
+SwNode rNode = pPaM-GetPoint()-nNode.GetNode();
 
 // Subtract previous text node's length
-if( pNode-IsTxtNode() )
+if (rNode.IsTxtNode())
 {
-pTxtNode = pNode-GetTxtNode();
-if( nLen  pTxtNode-Len() )
+pTxtNode = rNode.GetTxtNode();
+if (nLen  pTxtNode-Len())
 break;
 else
 nLen -= pTxtNode-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-2' - sw/source

2014-07-01 Thread Caolán McNamara
 sw/source/ui/frmdlg/frmpage.cxx |   10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 1ad76412e3fa74f2b7547d7cc283933775b2760e
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Jun 30 16:29:48 2014 +0100

Resolves: fdo#80681 widget is not transparent

regression from 12dfca2ea61116665a7abefd43a9a4caa2b8920b
Author: Armin Le Grand a...@apache.org
Date:   Mon May 14 15:16:00 2012 +
Resolves: #i119307# added deletion of sw's BmpWindow control...
...due to the fact that graphics may be transparent

Change-Id: I7eb2ee8ed53f0ef907a4573a735c71de43b6e8d3
(cherry picked from commit 1caad856de1c1c5b0a8c31d2226416a2db9632cd)
Reviewed-on: https://gerrit.libreoffice.org/9987
Reviewed-by: Andras Timar andras.ti...@collabora.com
Tested-by: Andras Timar andras.ti...@collabora.com

diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index de476b5..0fbdfb9 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -2595,8 +2595,12 @@ BmpWindow::BmpWindow(Window* pPar, WinBits nStyle)
 , bGraphic(false)
 , bLeftAlign(false)
 {
-// #i119307# use background, the graphic might have transparency
-SetBackground(Wallpaper(Color(COL_WHITE)));
+SetBackground();
+SetPaintTransparent(sal_True);
+// #i119307# the graphic might have transparency, set up white as the color
+// to use when drawing a rectangle under the image
+SetLineColor(COL_WHITE);
+SetFillColor(COL_WHITE);
 }
 
 Size BmpWindow::GetOptimalSize() const
@@ -2654,7 +2658,7 @@ void BmpWindow::Paint( const Rectangle )
 }
 
 // #i119307# clear window background, the graphic might have transparency
-Erase();
+DrawRect(Rectangle(aPntPos, aPntSz));
 
 if ( bGraphic )
 aGraphic.Draw( this, aPntPos, aPntSz );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-06-26 Thread Julien Nabet
 sw/source/core/frmedt/feshview.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 01ee29125610a0fe4d6dcb080da09e3961f1236a
Author: Julien Nabet serval2...@yahoo.fr
Date:   Wed Jun 25 21:58:47 2014 +0200

Resolves fdo#54155: Crash when playing with a Group inside a Group

Cherry-picked from 7bd94d73ec56622685d0e23f8b5133ba110524be

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

diff --git a/sw/source/core/frmedt/feshview.cxx 
b/sw/source/core/frmedt/feshview.cxx
index c13dd12..04f2945 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -1198,7 +1198,7 @@ sal_Bool SwFEShell::ShouldObjectBeSelected(const Point 
rPt)
 
 // Don't select header / footer objects in body edition and 
vice-versa
 SwContact* pContact = static_castSwContact*(pObj-GetUserCall());
-if ( !pContact-ObjAnchoredAtPage() )
+if (pContact  !pContact-ObjAnchoredAtPage() )
 {
 const SwPosition rPos = pContact-GetCntntAnchor();
 bool bInHdrFtr = GetDoc()-IsInHeaderFooter( rPos.nNode );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-06-13 Thread Stephan Bergmann
 sw/source/filter/ww8/writerwordglue.cxx |   41 +---
 1 file changed, 17 insertions(+), 24 deletions(-)

New commits:
commit 6a4e688c84a12ced4113ea28f9d8837d2d616690
Author: Stephan Bergmann sberg...@redhat.com
Date:   Fri Jun 13 10:09:41 2014 +0200

fdo#77979: Make rtl_TextEncodingToWinCharsetRTF work for non-Unicode

LC_ALL=C make CppunitTest_sw_rtfexport was still failing after
e47a02b1524061143d8e77a54eb95c77f2e6dae2 fdo#77979: sw: RTF export: write 
non-
ASCII font names encoded, so for each given eTextEncoding determine a 
Windows
charset that can at least encode the font's name, and not only for Unicode-
related eTextEncodings.

Change-Id: If547566bb0cffc60411d8f667d76749a904f7a3f
(cherry picked from commit 0dc7d6367dcedff8741b64f5b8775ebf26f7f14f)
Reviewed-on: https://gerrit.libreoffice.org/9763
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com

diff --git a/sw/source/filter/ww8/writerwordglue.cxx 
b/sw/source/filter/ww8/writerwordglue.cxx
index f4141e5..0f4c133 100644
--- a/sw/source/filter/ww8/writerwordglue.cxx
+++ b/sw/source/filter/ww8/writerwordglue.cxx
@@ -725,38 +725,31 @@ namespace sw
 OUString const rFontName, OUString const rAltName,
 rtl_TextEncoding eTextEncoding)
 {
-static struct { rtl_TextEncoding enc; sal_uInt8 charset; }
+sal_uInt8 nRet =
+rtl_getBestWindowsCharsetFromTextEncoding(eTextEncoding);
+rtl_TextEncoding enc2 = 
rtl_getTextEncodingFromWindowsCharset(nRet);
+if (!(CanEncode(rFontName, enc2)  CanEncode(rAltName, enc2)))
+{
+static struct { rtl_TextEncoding enc; sal_uInt8 charset; }
 const s_fallbacks [] = {
 { RTL_TEXTENCODING_MS_932, 0x80 }, // Shift-JIS
 { RTL_TEXTENCODING_MS_936, 0x86 }, // GB-2312
 { RTL_TEXTENCODING_MS_950, 0x88 }, // Big5
 { RTL_TEXTENCODING_MS_949, 0x81 }, // EUC-KR
 };
-sal_uInt8 nRet =
-rtl_getBestWindowsCharsetFromTextEncoding(eTextEncoding);
-switch (eTextEncoding)
-{
-case RTL_TEXTENCODING_DONTKNOW:
-case RTL_TEXTENCODING_UCS2:
-case RTL_TEXTENCODING_UTF7:
-case RTL_TEXTENCODING_UTF8:
-case RTL_TEXTENCODING_JAVA_UTF8:
-for (size_t i = 0; i  SAL_N_ELEMENTS(s_fallbacks); ++i)
+for (size_t i = 0; i  SAL_N_ELEMENTS(s_fallbacks); ++i)
+{
+// fall back to a charset that can at least encode the
+// font's name
+if (CanEncode(rFontName, s_fallbacks[i].enc)
+ CanEncode(rAltName, s_fallbacks[i].enc))
 {
-// fall back to a charset that can at least encode
-// the font's name
-if (CanEncode(rFontName, s_fallbacks[i].enc)
- CanEncode(rAltName, s_fallbacks[i].enc))
-{
-return s_fallbacks[i].charset;
-}
+return s_fallbacks[i].charset;
 }
-SAL_INFO(sw.rtf, no fallback charset found for font: 
- rFontName rAltName);
-nRet = 0x01; // all hope lost: default, whatever that is
-break;
-default:
-break;
+}
+SAL_INFO(sw.rtf, no fallback charset found for font: 
+  rFontName rAltName);
+nRet = 0x01; // all hope lost: default, whatever that is
 }
 return nRet;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-06-11 Thread Oliver-Rainer Wittmann
 sw/source/core/unocore/unoframe.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 49940766a52f5eccb1d5f4392304a9437bad0c49
Author: Oliver-Rainer Wittmann o...@apache.org
Date:   Tue Jun 10 14:49:06 2014 +

Related: #i125072# map given style name to corresponding UI name...

before searching for it.

(cherry picked from commit 4a76d7f700da112a553ec9d9811731e645581a7f)

Conflicts:
sw/source/core/unocore/unoframe.cxx

Change-Id: I294bd7f21ec0acee0f7b8e7be067e04b5a785e43
(cherry picked from commit 3a72f4ba07458ee9c4c726486304f31900d89044)
Reviewed-on: https://gerrit.libreoffice.org/9736
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com

diff --git a/sw/source/core/unocore/unoframe.cxx 
b/sw/source/core/unocore/unoframe.cxx
index e2093aa..c7f0a44 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -693,6 +693,7 @@ bool SwGraphicProperties_Impl::AnyToItemSet(
 {
 OUString sStyle;
 *pStyleName = sStyle;
+SwStyleNameMapper::FillUIName(sStyle, sStyle, 
nsSwGetPoolIdFromName::GET_POOLID_FRMFMT, true);
 pStyle = 
(SwDocStyleSheet*)pDoc-GetDocShell()-GetStyleSheetPool()-Find(sStyle,
 SFX_STYLE_FAMILY_FRAME);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-06-09 Thread Elie Roux
 sw/source/core/unocore/unoframe.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit dc59f010248fbb95d7a67ccb914e86c457dcea3a
Author: Elie Roux elie.r...@telecom-bretagne.eu
Date:   Sun Jun 8 22:28:18 2014 +0200

fix fdo#40073 : look for translated frame styles

LO was looking for untranslated frame styles,
while at this step, the style list contains only the
translated ones.

Change-Id: I36173fc871582f974184fc95bb4d1a82cd3de783
Reviewed-on: https://gerrit.libreoffice.org/9683
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com
(cherry picked from commit 6f6673c5d1b4e6ea4982621f2817eb5d5dc10377)
Signed-off-by: Michael Stahl mst...@redhat.com

diff --git a/sw/source/core/unocore/unoframe.cxx 
b/sw/source/core/unocore/unoframe.cxx
index 43520a7..e2093aa 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -616,6 +616,7 @@ bool SwFrameProperties_Impl::AnyToItemSet(SwDoc *pDoc, 
SfxItemSet rSet, SfxItem
 {
 OUString sStyle;
 *pStyleName = sStyle;
+SwStyleNameMapper::FillUIName(sStyle, sStyle, 
nsSwGetPoolIdFromName::GET_POOLID_FRMFMT, true);
 pStyle = 
(SwDocStyleSheet*)pDoc-GetDocShell()-GetStyleSheetPool()-Find(sStyle,
 SFX_STYLE_FAMILY_FRAME);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-06-05 Thread Caolán McNamara
 sw/source/ui/uno/SwXDocumentSettings.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit ece49b68c408edea1ebcb8149c41051d5bdac279
Author: Caolán McNamara caol...@redhat.com
Date:   Fri May 30 13:09:28 2014 +0100

coverity#736074 Missing break in switch

(cherry picked from commit 87574542fc953a60bc2bafe8ed725500f9322521)
(cherry picked from commit 035c802fa170af9fec84b2d9a6621043915accb2)

Conflicts:
sw/source/core/uibase/uno/SwXDocumentSettings.cxx

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

diff --git a/sw/source/ui/uno/SwXDocumentSettings.cxx 
b/sw/source/ui/uno/SwXDocumentSettings.cxx
index 8a218a1..cf47b1c 100644
--- a/sw/source/ui/uno/SwXDocumentSettings.cxx
+++ b/sw/source/ui/uno/SwXDocumentSettings.cxx
@@ -781,6 +781,7 @@ void SwXDocumentSettings::_setSingleValue( const 
comphelper::PropertyInfo  rInf
 sal_Bool bTmp = *(sal_Bool*)rValue.getValue();
 mpDoc-set(IDocumentSettingAccess::EMBED_FONTS, bTmp);
 }
+break;
 case HANDLE_EMBED_SYSTEM_FONTS:
 {
 sal_Bool bTmp = *(sal_Bool*)rValue.getValue();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-06-05 Thread Caolán McNamara
 sw/source/ui/fmtui/tmpdlg.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 90ea159e62bc6c884906220d9a0a97f70ae9c7ad
Author: Caolán McNamara caol...@redhat.com
Date:   Thu Jun 5 13:49:14 2014 +0100

Resolves: rhbz#1096747 crash/hang on format-page on html document

Change-Id: I9a989620375eb210e553b84b7a642a0360c8f03f
(cherry picked from commit 655377e90c57bb68e5000f06f76531baf9eeaa37)
(cherry picked from commit 829aa9e03ae570e15af1f754b292709f38f643ea)
Reviewed-on: https://gerrit.libreoffice.org/9650
Tested-by: Michael Stahl mst...@redhat.com
Reviewed-by: Michael Stahl mst...@redhat.com

diff --git a/sw/source/ui/fmtui/tmpdlg.cxx b/sw/source/ui/fmtui/tmpdlg.cxx
index bc224b7..7645249 100644
--- a/sw/source/ui/fmtui/tmpdlg.cxx
+++ b/sw/source/ui/fmtui/tmpdlg.cxx
@@ -290,6 +290,13 @@ SwTemplateDlg::SwTemplateDlg(Window* pParent,
 if(!aCJKOptions.IsAsianTypographyEnabled())
 RemoveTabPage(textgrid);
 }
+else
+{
+RemoveTabPage(borders);
+RemoveTabPage(columns);
+RemoveTabPage(footnotes);
+RemoveTabPage(textgrid);
+}
 }
 break;
 // numbering styles
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-29 Thread Michael Stahl
 sw/source/ui/shells/txtattr.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit f9d5d1a7dabb73b16b6528217a26924feb08c1b7
Author: Michael Stahl mst...@redhat.com
Date:   Wed May 28 23:05:28 2014 +0200

fdo#78737: sw: fix setting tab stops via ruler

The SvxRuler binds the SID_ATTR_PARA_LRSPACE, and its indents and the
positions of tab stops depend on the values it gets from there; in LO
4.0 the value came from the SwView::StateTabWin() but now it comes from
SwTextShell::GetAttrState(), and the difference is that the former does
a special request to get the NumRule indents as LR-space.

(regression from d02f75a8c36705924ddd6a5921fe3012fafce812)

Change-Id: I548ce18865f2473cb3973ce7aeb927d1a404
(cherry picked from commit 7c8b2f10310f0f64b111afb3012e82e9c4a690ac)
Reviewed-on: https://gerrit.libreoffice.org/9538
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/sw/source/ui/shells/txtattr.cxx b/sw/source/ui/shells/txtattr.cxx
index 706df62..7c71cde 100644
--- a/sw/source/ui/shells/txtattr.cxx
+++ b/sw/source/ui/shells/txtattr.cxx
@@ -506,7 +506,9 @@ void SwTextShell::GetAttrState(SfxItemSet rSet)
 SwWrtShell rSh = GetShell();
 SfxItemPool rPool = GetPool();
 SfxItemSet aCoreSet(rPool, aTxtFmtCollSetRange);
-rSh.GetCurAttr(aCoreSet); // Request *all* text attributes from the core.
+// Request *all* text attributes from the core.
+// fdo#78737: this is called from SvxRuler, which requires the list 
indents!
+rSh.GetCurAttr(aCoreSet, /* bMergeIndentValuesOfNumRule = */ true);
 
 SfxWhichIter aIter(rSet);
 sal_uInt16 nSlot = aIter.FirstWhich();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-28 Thread Michael Stahl
 sw/source/core/fields/ddefld.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 090c66b2c91378a83e294e872d6c8cb2a497eb80
Author: Michael Stahl mst...@redhat.com
Date:   Tue May 27 20:30:19 2014 +0200

fdo#78332: sw: fix separators in SwDDEFieldType::PutValue()

Setting 3 separators instead of 2 does not work.

(regression from 263153842741d7ce21cc0bf1c5296a55a1138024)

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

diff --git a/sw/source/core/fields/ddefld.cxx b/sw/source/core/fields/ddefld.cxx
index 9b0bf97..37d6f50 100644
--- a/sw/source/core/fields/ddefld.cxx
+++ b/sw/source/core/fields/ddefld.cxx
@@ -367,7 +367,8 @@ bool SwDDEFieldType::PutValue( const uno::Any rVal, 
sal_uInt16 nWhichId )
 {
 rVal = sToken;
 }
-sNewCmd += sToken + OUString(sfx2::cTokenSeparator);
+sNewCmd += (i  2)
+? sToken + OUString(sfx2::cTokenSeparator) : sToken;
 }
 SetCmd( sNewCmd );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-28 Thread Michael Stahl
 sw/source/filter/ww8/ww8graf.cxx |   10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit a1f385b74a542ab3caaa8abbefc39f14bf27ca72
Author: Michael Stahl mst...@redhat.com
Date:   Tue May 27 13:27:37 2014 +0200

fdo#77454: sw: ww8 import: add heuristic to ignore mangled crop values

Older versions of OOo/LO would mangle negative crop values on round-trip
of WW8, which now (since the drawing-layer does not ignore them) causes
the images to be rendered invisible; probably large factors don't make
sense anyway, so ignore the crop if it's 50x the image size, which
happens to work for the bugdoc.

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

diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 8051810..6a29887 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -1994,8 +1994,14 @@ void 
SwWW8ImplReader::MapWrapIntoFlyFmt(SvxMSDffImportRec* pRecord,
 static sal_Int32 lcl_ConvertCrop(sal_uInt32 const nCrop, sal_Int32 const nSize)
 {
 // cast to sal_Int32 to handle negative crop properly
-return ((static_castsal_Int32(nCrop)  16) * nSize)
-  + (((nCrop  0x) * nSize)  16) ;
+sal_Int32 const nIntegral(static_castsal_Int32(nCrop)  16);
+// fdo#77454: heuristic to detect mangled values written by old OOo/LO
+if (abs(nIntegral) = 50) // FIXME: what's a good cut-off?
+{
+SAL_INFO(sw.ww8, ignoring suspiciously large crop:   nIntegral);
+return 0;
+}
+return (nIntegral * nSize) + (((nCrop  0x) * nSize)  16);
 }
 
 void
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-26 Thread Julien Nabet
 sw/source/core/text/txtdrop.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9732b4a0045c1e72493f16d03f60a048d5fbfa9d
Author: Julien Nabet serval2...@yahoo.fr
Date:   Fri May 23 22:55:41 2014 +0200

Resolves: fdo#79139 Crash in SwDropCapCache::CalcFontSize

Minimum of nMaxFontHeight must be at least 1

Cherry-picked from 06afd4067f7bc321d7dd0a4e8c235b0b21e3d49a

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

diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx
index f4af8af..8d3f3b9 100644
--- a/sw/source/core/text/txtdrop.cxx
+++ b/sw/source/core/text/txtdrop.cxx
@@ -793,7 +793,7 @@ void SwDropCapCache::CalcFontSize( SwDropPortion* pDrop, 
SwTxtFormatInfo rInf )
 long nWishedHeight = pDrop-GetDropHeight();
 
 // find out biggest font size for initial scaling factor
-long nMaxFontHeight = 0;
+long nMaxFontHeight = 1;
 while ( pCurrPart )
 {
 const SwFont rFnt = pCurrPart-GetFont();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-23 Thread Luboš Luňák
 sw/source/filter/ww8/ww8par5.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit dc84a2e8c68a02c585433dd22978680b79d15963
Author: Luboš Luňák l.lu...@collabora.com
Date:   Fri May 23 11:35:10 2014 +0200

MSWord uses \xb for linebreaks in DB fields (bnc#878854)

Change-Id: I9b1e4f8dc44d3f6f41e395f6e5f3c1fdeff52441
(cherry picked from commit d4a19c4098f4556f05666ed92a85c6138b4f769a)
Signed-off-by: Andras Timar andras.ti...@collabora.com

diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 605f753..d98a046 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -2426,6 +2426,8 @@ eF_ResT SwWW8ImplReader::Read_F_DBField( WW8FieldDesc* 
pF, OUString rStr )
 pSBase-WW8ReadString( *pStrm, aResult, pPlcxMan-GetCpOfs()+
pF-nSRes, pF-nLRes, eTextCharSet );
 
+aResult = aResult.replace( '\xb', '\n' );
+
 aFld.InitContent(aResult);
 
 rDoc.InsertPoolItem(*pPaM, SwFmtFld( aFld ), 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-2' - sw/source

2014-05-20 Thread Eike Rathke
 sw/source/filter/ww8/writerwordglue.cxx |  104 
 1 file changed, 92 insertions(+), 12 deletions(-)

New commits:
commit 300d27b0ae4665001ec30b47af2142f6c253f370
Author: Eike Rathke er...@redhat.com
Date:   Mon May 19 21:43:06 2014 +0200

resolved fdo#66620 keywords occur in unquoted context only

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

diff --git a/sw/source/filter/ww8/writerwordglue.cxx 
b/sw/source/filter/ww8/writerwordglue.cxx
index 7fc6061..056268e 100644
--- a/sw/source/filter/ww8/writerwordglue.cxx
+++ b/sw/source/filter/ww8/writerwordglue.cxx
@@ -745,6 +745,83 @@ namespace sw
 return nDT;
 }
 
+
+/** Find cFind in rParams if not embedded in  double quotes.
+Will NOT find '\\' or ''.
+ */
+sal_Int32 findUnquoted( const OUString rParams, sal_Unicode cFind, 
sal_Int32 nFromPos )
+{
+const sal_Int32 nLen = rParams.getLength();
+if (nFromPos  0 || nLen = nFromPos)
+return -1;
+for (sal_Int32 nI = nFromPos; nI  nLen; ++nI)
+{
+const sal_Unicode c = rParams[nI];
+if (c == '\\')
+++nI;
+else if (c == '\')
+{
+++nI;
+// While not at the end and not at an unescaped end quote
+while (nI  nLen)
+{
+if (rParams[nI] == '\'  rParams[nI-1] != '\\')
+break;
+++nI;
+}
+}
+else //normal unquoted section
+{
+if (c == cFind)
+return nI;
+}
+}
+return -1;
+}
+
+/** Find all rFind in rParams if not embedded in  double quotes and
+replace with rReplace. Will NOT find '\\' or ''.
+ */
+bool replaceUnquoted( OUString rParams, const OUString rFind, const 
OUString rReplace )
+{
+bool bReplaced = false;
+if (rFind.isEmpty())
+return bReplaced;
+const sal_Unicode cFirst = rFind[0];
+
+sal_Int32 nLen = rParams.getLength();
+for (sal_Int32 nI = 0; nI  nLen; ++nI)
+{
+const sal_Unicode c = rParams[nI];
+if (rParams[nI] == '\\')
+++nI;
+else if (rParams[nI] == '\')
+{
+++nI;
+// While not at the end and not at an unescaped end quote
+while (nI  nLen)
+{
+if (rParams[nI] == '\'  rParams[nI-1] != '\\')
+break;
+++nI;
+}
+}
+else //normal unquoted section
+{
+if (c == cFirst  rParams.match( rFind, nI))
+{
+const sal_Int32 nFindLen = rFind.getLength();
+const sal_Int32 nDiff = rReplace.getLength() - 
nFindLen;
+rParams.replaceAt( nI, nFindLen, rReplace);
+nI += nFindLen + nDiff - 1;
+nLen += nDiff;
+bReplaced = true;
+}
+}
+}
+return bReplaced;
+}
+
 sal_uLong MSDateTimeFormatToSwFormat(OUString rParams,
 SvNumberFormatter *pFormatter, sal_uInt16 rLang, bool bHijri,
 sal_uInt16 nDocLang)
@@ -756,36 +833,39 @@ namespace sw
 
 SwapQuotesInField(rParams);
 
-// Force to Japanese when finding one of 'geaE'
-bool bForceJapanese = (-1 != rParams.indexOf('g')
-|| -1 != rParams.indexOf('e') || -1 != rParams.indexOf('E') );
-if ( bForceJapanese )
-{
-rParams = rParams.replaceAll( ee,  ).replaceAll( EE, 
 );
-}
+// Force to Japanese when finding one of 'geE'.
+// XXX This actually may not be correct, all era keywords could be
+// used in other locales as well. I just don't know about Word. But
+// this is how it was for 10 years..
+bool bForceJapanese = (-1 != findUnquoted( rParams, 'g', 0));
+// XXX Why replace? The number formatter does handle them and this
+// effectively changes from Gengou to Gregorian calendar. Legacy
+// because it wasn't supported a decade ago and now moot? Or is
+// that a Word specialty?
+   

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

2014-05-20 Thread Stephan Bergmann
 sw/source/filter/ww8/writerwordglue.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 4a86cd75a8e83b6910c5285812e86bf6575fa92b
Author: Stephan Bergmann sberg...@redhat.com
Date:   Mon May 19 23:26:22 2014 +0200

-Werror,-Wunused-result

Change-Id: Iaa06237d3e554d3a3d9c87f6c5dba715343afa25
(cherry picked from commit 9cf5e4c2500fc5d579896ea08802aba5ca671c96)

diff --git a/sw/source/filter/ww8/writerwordglue.cxx 
b/sw/source/filter/ww8/writerwordglue.cxx
index 056268e..bafa0f0 100644
--- a/sw/source/filter/ww8/writerwordglue.cxx
+++ b/sw/source/filter/ww8/writerwordglue.cxx
@@ -812,7 +812,7 @@ namespace sw
 {
 const sal_Int32 nFindLen = rFind.getLength();
 const sal_Int32 nDiff = rReplace.getLength() - 
nFindLen;
-rParams.replaceAt( nI, nFindLen, rReplace);
+rParams = rParams.replaceAt( nI, nFindLen, rReplace);
 nI += nFindLen + nDiff - 1;
 nLen += nDiff;
 bReplaced = 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-2' - sw/source

2014-05-09 Thread Michael Stahl
 sw/source/core/doc/doc.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 02172de1a9c1f4442514cc79583ecd0a46331f45
Author: Michael Stahl mst...@redhat.com
Date:   Thu Feb 6 13:02:19 2014 +0100

SwDoc::ConvertFieldsToText(): don't insert empty strings

Prevents an assert on accessing sText[0] in InsertString().

Manually cherry-picked from 85a8c1361dccb2c3b98458c2c1c377d5de275d0e
to resolve fdo#77720, see bt here 
https://bugs.freedesktop.org/attachment.cgi?id=97684

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

diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 6382d74..e1d84f3 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -2427,7 +2427,8 @@ bool SwDoc::ConvertFieldsToText()
 SwPaM aPam1(*pTxtFld-GetpTxtNode(), *pTxtFld-GetStart());
 aPam1.Move();
 //insert first to keep the field's attributes
-InsertString( aPam1, sText );
+if (!sText.isEmpty())
+InsertString( aPam1, sText );
 SwPaM aPam2(*pTxtFld-GetpTxtNode(), *pTxtFld-GetStart());
 aPam2.SetMark();
 aPam2.Move();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-09 Thread Michael Stahl
 sw/source/core/doc/doclay.cxx   |1 +
 sw/source/ui/utlui/unotools.cxx |3 +++
 2 files changed, 4 insertions(+)

New commits:
commit b5f4a53d6d718e170303ea3d9344f86735fb8c99
Author: Michael Stahl mst...@redhat.com
Date:   Thu May 8 23:43:56 2014 +0200

fdo#77720: Mail Merge: reset cursors after clearing document

The root cause for the crash is that the shell has an invalid cursor
that does not point at a paragraph; this is because first the document
is filled and the cursor is pointed at the content of a frame, then the
document is cleared from SwFrmCtrlWindow::Resize() [not sure why?] and
at that point the cursor remains on an SwEndNode (which is invalid).

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

diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index 2ea2fb9..815a4d9 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -717,6 +717,7 @@ SwFlyFrmFmt* SwDoc::MakeFlySection( RndStdIds eAnchorType,
 (SwNodeIndex( GetNodes().GetEndOfAutotext()),
  GetTxtCollFromPool( nCollId ));
 SwCntntNode * pAnchorNode = pAnchorPos-nNode.GetNode().GetCntntNode();
+assert(pAnchorNode); // pAnchorNode from cursor, must be valid
 
 const SfxPoolItem * pItem = NULL;
 
diff --git a/sw/source/ui/utlui/unotools.cxx b/sw/source/ui/utlui/unotools.cxx
index e25deec..b5b36ba 100644
--- a/sw/source/ui/utlui/unotools.cxx
+++ b/sw/source/ui/utlui/unotools.cxx
@@ -415,7 +415,10 @@ void SwOneExampleFrame::ClearDocument( sal_Bool 
bStartUpdateTimer )
 SwEditShell* pSh = pDoc-GetEditShell();
 pSh-LockPaint();
 pSh-StartAllAction();
+pSh-KillPams();
+pSh-ClearMark();
 pDoc-ClearDoc();
+pSh-ClearUpCrsrs();
 
 if( aLoadedTimer.IsActive() || !bStartUpdateTimer )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-08 Thread Michael Stahl
 sw/source/core/fields/chpfld.cxx |   31 ---
 1 file changed, 31 deletions(-)

New commits:
commit 17aeb9e1f0922154a1cf342d17a869161b114f65
Author: Michael Stahl mst...@redhat.com
Date:   Wed May 7 14:54:54 2014 +0200

fdo#75519: fix chapter cross references

It would be possible to modify the condition in
SwChapterField::ChangeExpansion() to check for rTxtNd.GetNumRule() as
well and make the bugdoc work again, but do we really want to use
chapter reference to refer to plain numbering?  Perhaps it would be
better to add a numbering reference field type; without investigating
what Word actually does here and what the actual problem is that was
supposedly fixed here (which is not possible given there's no reproducer
document) it's best for now to just revert it.

(regression from commit 6319803762d051c4aa645692cde7245a1bbcf7ee)

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

diff --git a/sw/source/core/fields/chpfld.cxx b/sw/source/core/fields/chpfld.cxx
index e7fe520..86c6de2 100644
--- a/sw/source/core/fields/chpfld.cxx
+++ b/sw/source/core/fields/chpfld.cxx
@@ -122,41 +122,11 @@ void SwChapterField::ChangeExpansion(const SwFrm* pFrm,
 
 void SwChapterField::ChangeExpansion(const SwTxtNode rTxtNd, sal_Bool 
bSrchNum)
 {
-//i120759,this function is for both the reference chapter field and normal 
chapter field
-//bSrchNum can distinguish the two types,to the latter type,the outline 
num rule is must...
 sNumber = OUString();
 sTitle = OUString();
 sPost = OUString();
 sPre = OUString();
-//The reference chapter field of normal num rule will be handled in this 
code segment
-if (bSrchNum  !rTxtNd.IsOutline())
-{
-SwNumRule* pRule(rTxtNd.GetNumRule());
-if (rTxtNd.IsCountedInList()  pRule)
-{
-sNumber = rTxtNd.GetNumString(false);
-
-int nListLevel = rTxtNd.GetActualListLevel();
-
-if (nListLevel  0)
-nListLevel = 0;
 
-if (nListLevel = MAXLEVEL)
-nListLevel = MAXLEVEL - 1;
-
-const SwNumFmt rNFmt = pRule-Get(static_castunsigned 
short(nListLevel));
-sPost = rNFmt.GetSuffix();
-sPre = rNFmt.GetPrefix();
-}
-else
-{
-sNumber = ??;
-}
-sTitle = removeControlChars(rTxtNd.GetExpandTxt());
-}
-else
-{
-//End
 SwDoc* pDoc = (SwDoc*)rTxtNd.GetDoc();
 const SwTxtNode *pTxtNd = rTxtNd.FindOutlineNodeOfLevel( nLevel );
 if( pTxtNd )
@@ -216,7 +186,6 @@ void SwChapterField::ChangeExpansion(const SwTxtNode 
rTxtNd, sal_Bool bSrchNum)
 sTitle = removeControlChars(pTxtNd-GetExpandTxt(0, -1, false, false, 
false, false));
 
 }
-}
 }
 
 bool SwChapterField::QueryValue( uno::Any rAny, sal_uInt16 nWhichId ) const
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-08 Thread Stephan Bergmann
 sw/source/filter/ww8/ww8par6.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit b803f86341a521f8d07db7ed6a29bb0c7fdf93a5
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu May 8 08:26:46 2014 +0200

Handle bad SwWW8ImplReader::GetCol input

With previously found offenders out of the way, looks like
sw/qa/core/data/ww8/pass/CVE-2009-3302-2.doc is the only case that triggers
this, and that is likely deliberately malformed input.

As the whole ww8 parser appears not to be build around robust eager input
validation and error signalling, there is little more we can do here than 
throw
up our hands in despair.

Change-Id: Idf61fcf14a784cef1539654f2825c013c218987f
(cherry picked from commit 9beda5ab8feaeb6d5e1c64e094065b02551532a4)

diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 685feae..43c93cd 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -126,8 +126,10 @@ ColorData SwWW8ImplReader::GetCol(sal_uInt8 nIco)
 COL_CYAN, COL_GREEN, COL_MAGENTA, COL_RED, COL_BROWN, COL_GRAY,
 COL_LIGHTGRAY
 };
-
-return eSwWW8ColA[nIco];
+SAL_WARN_IF(
+nIco = SAL_N_ELEMENTS(eSwWW8ColA), sw.ww8,
+ico   sal_uInt32(nIco)   =   SAL_N_ELEMENTS(eSwWW8ColA));
+return nIco  SAL_N_ELEMENTS(eSwWW8ColA) ? eSwWW8ColA[nIco] : COL_AUTO;
 }
 
 inline sal_uInt32 MSRoundTweak(sal_uInt32 x)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-03 Thread Caolán McNamara
 sw/source/core/frmedt/fefly1.cxx |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 8ff260e47873674ca03a334f6b3198d66dc68db7
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Apr 29 12:58:56 2014 +0100

fix crash found when exploring fdo#50697

(cherry picked from commit b25871da62facc20387ebfa2b908422578ca8ce9)

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

Change-Id: Ie781c2534cb41104dd3d91d4370639e98baa8112
Reviewed-on: https://gerrit.libreoffice.org/9202
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index 1931c73..025c752 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -342,10 +342,11 @@ const SwFrmFmt* SwFEShell::IsFlyInFly()
 aPoint.setX(aPoint.getX() - 1);//do not land in 
the fly!!
 GetLayout()-GetCrsrOfst( aPos, aPoint, aState );
 // determine text frame by left-top-corner of object
-pTxtFrm = aPos.nNode.GetNode().GetCntntNode()-getLayoutFrm( 
GetLayout(), aTmpPos, 0, sal_False );
+SwCntntNode *pNd = aPos.nNode.GetNode().GetCntntNode();
+pTxtFrm = pNd ? pNd-getLayoutFrm(GetLayout(), aTmpPos, 0, sal_False) 
: NULL;
 }
-const SwFrm *pTmp = ::FindAnchor( pTxtFrm, aTmpPos );
-const SwFlyFrm *pFly = pTmp-FindFlyFrm();
+const SwFrm *pTmp = pTxtFrm ? ::FindAnchor(pTxtFrm, aTmpPos) : NULL;
+const SwFlyFrm *pFly = pTmp ? pTmp-FindFlyFrm() : NULL;
 if( pFly )
 return pFly-GetFmt();
 return NULL;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-04-30 Thread Michael Stahl
 sw/source/ui/wrtsh/delete.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit d1782bfa94e1f526b90587b74f51b236b3b774c7
Author: Michael Stahl mst...@redhat.com
Date:   Fri Apr 25 20:09:47 2014 +0200

fdo#60967: fix deletion of paragraph following table

Surprisingly MovePara(fnParaCurr, fnParaEnd) actually moves to the end
of the next paragraph if the current one is empty.

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

diff --git a/sw/source/ui/wrtsh/delete.cxx b/sw/source/ui/wrtsh/delete.cxx
index bba3c3d..a9928aa 100644
--- a/sw/source/ui/wrtsh/delete.cxx
+++ b/sw/source/ui/wrtsh/delete.cxx
@@ -466,7 +466,10 @@ long SwWrtShell::DelToEndOfSentence()
 if (SwCrsrShell::Right(1,CRSR_SKIP_CHARS))
 {
 SetMark();
-SwCrsrShell::MovePara(fnParaCurr, fnParaEnd);
+if (!IsEndPara()) // can only be at the end if it's empty
+{   // for an empty paragraph this would actually select the _next_
+SwCrsrShell::MovePara(fnParaCurr, fnParaEnd);
+}
 if (!IsEndOfDoc()) // do not delete last paragraph in body text
 {
 nRet = DelFullPara() ? 1 : 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-2' - sw/source

2014-04-24 Thread Caolán McNamara
 sw/source/ui/shells/langhelper.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit f609515bbd0fda93fa8acd6d9c553f974fc9c03b
Author: Caolán McNamara caol...@redhat.com
Date:   Thu Apr 24 13:51:27 2014 +0100

crash in selecting text in comments midway in para

(cherry picked from commit 7dca5341d799d59a81e6dac84586fa2daa02a550)

Conflicts:
sw/source/core/uibase/shells/langhelper.cxx

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

diff --git a/sw/source/ui/shells/langhelper.cxx 
b/sw/source/ui/shells/langhelper.cxx
index d3055a2..52ca770 100644
--- a/sw/source/ui/shells/langhelper.cxx
+++ b/sw/source/ui/shells/langhelper.cxx
@@ -573,7 +573,8 @@ namespace SwLangHelper
 // string for guessing language
 OUString aText;
 
-aText = rEditEngine-GetText(aDocSelection);
+// get the full text of the paragraph that the end of selection is in
+aText = rEditEngine-GetText(aDocSelection.nEndPos);
 if (!aText.isEmpty())
 {
 xub_StrLen nStt = 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-2' - sw/source

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

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

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

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

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

(regression from bb665affbd8870652ade3951d626d76e99143f67)

(cherry picked from commit cbfcb837fb06a14daf5281ae13fc1886328cee6f)

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

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

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

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

2014-04-09 Thread Caolán McNamara
 sw/source/ui/app/docst.cxx |   22 +-
 1 file changed, 13 insertions(+), 9 deletions(-)

New commits:
commit 609e949bfe407487f417fadb377ead3a3a9cfa5c
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Feb 10 10:26:04 2014 +

Resolves: fdo#77174 crash with New style from selection with List

was coverity#1130423 Dereference null return value

(cherry picked from commit a434a8bfdd8b9323c8262edcd591641fe9ea8b19)

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

diff --git a/sw/source/ui/app/docst.cxx b/sw/source/ui/app/docst.cxx
index 30ed690..ff0a01f 100644
--- a/sw/source/ui/app/docst.cxx
+++ b/sw/source/ui/app/docst.cxx
@@ -1168,19 +1168,23 @@ sal_uInt16 SwDocShell::MakeByExample( const OUString 
rName, sal_uInt16 nFamily,
 
 case SFX_STYLE_FAMILY_PSEUDO:
 {
-pCurrWrtShell-StartAllAction();
+const SwNumRule* pCurRule = pCurrWrtShell-GetCurNumRule();
 
-SwNumRule aRule( *pCurrWrtShell-GetCurNumRule() );
-OUString sOrigRule( aRule.GetName() );
-// #i91400#
-aRule.SetName( pStyle-GetNumRule()-GetName(),
-   *(pCurrWrtShell-GetDoc()) );
-pCurrWrtShell-ChgNumRuleFmts( aRule );
+if (pCurRule)
+{
+pCurrWrtShell-StartAllAction();
 
-pCurrWrtShell-ReplaceNumRule( sOrigRule, aRule.GetName() );
+SwNumRule aRule( *pCurRule );
+OUString sOrigRule( aRule.GetName() );
+// #i91400#
+aRule.SetName( pStyle-GetNumRule()-GetName(),
+   *(pCurrWrtShell-GetDoc()) );
+pCurrWrtShell-ChgNumRuleFmts( aRule );
 
+pCurrWrtShell-ReplaceNumRule( sOrigRule, aRule.GetName() );
 
-pCurrWrtShell-EndAllAction();
+pCurrWrtShell-EndAllAction();
+}
 }
 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-2' - sw/source

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

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

fdo#69157 Apply object-in front selection on mouseUp

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

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

Change-Id: I5e02cfb2d5fe9cdb9fd7f50d0c961dcc418fadd6
Signed-off-by: Lennard Wasserthal wassert...@nefkom.net
Signed-off-by: Michael Stahl mst...@redhat.com

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


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

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

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

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

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

(regression from 1ba29be90f7141077f2d079d40dffc2efd4f1a2c)

(cherry picked from commit 206848294f686a0ccf4c741d7e92a2314a88ea48)

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

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

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


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

2014-03-25 Thread Bjoern Michaelsen
 sw/source/core/txtnode/ndtxt.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit f384598d8eec91c3c0f84a07ff3e59b8e3e13b3f
Author: Bjoern Michaelsen bjoern.michael...@canonical.com
Date:   Sun Mar 23 15:00:19 2014 +0100

fdo#74981: cutting nothing should do nothing, should fix field dupes

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

diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 619e203..2be6fbb9 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -1923,6 +1923,8 @@ OUString SwTxtNode::InsertText( const OUString  rStr, 
const SwIndex  rIdx,
 void SwTxtNode::CutText( SwTxtNode * const pDest,
 const SwIndex  rStart, const xub_StrLen nLen )
 {
+if(nLen == 0)
+return;
 if(pDest)
 {
 SwIndex aDestStt(pDest, pDest-GetTxt().getLength());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-03-24 Thread Andras Timar
 sw/source/ui/uno/unomailmerge.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6181b3fe2c11d55f46eaaf657877aa9396c16374
Author: Andras Timar andras.ti...@collabora.com
Date:   Mon Mar 24 10:50:02 2014 +0100

fdo#74155 mailmerge output path fix

regression from dd7acb3d76cd89b3f05dbdafe88eb50e60fd9d10

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

diff --git a/sw/source/ui/uno/unomailmerge.cxx 
b/sw/source/ui/uno/unomailmerge.cxx
index f1a75fe..398376fac 100644
--- a/sw/source/ui/uno/unomailmerge.cxx
+++ b/sw/source/ui/uno/unomailmerge.cxx
@@ -707,7 +707,7 @@ uno::Any SAL_CALL SwXMailMerge::execute(
 
 OUString aDelim = OUString(INET_PATH_TOKEN);
 if (aPath.getLength() = aDelim.getLength() 
-aPath.copy( aPath.getLength() - aDelim.getLength() ) == aDelim)
+aPath.copy( aPath.getLength() - aDelim.getLength() ) != aDelim)
 aPath += aDelim;
 if (bCurFileNameFromColumn)
 pMgr-SetEMailColumn( aCurFileNamePrefix );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-03-22 Thread Miklos Vajna
 sw/source/core/text/inftxt.hxx |2 +-
 sw/source/core/text/portxt.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit e7baa6fe82c9d4f8bc6841f82f04088e664dda08
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Fri Jan 10 10:32:12 2014 +0100

fdo#73466 SwTxtSizeInfo / SwTxtInputFldPortion: invalid string access

Change-Id: Ibd74e3b0cd45fa3bf6fd4135866b22acd16e372e
(cherry picked from commit fc0bd38051c7c8f4c68a1407aed32a96b2564510)
Signed-off-by: Andras Timar andras.ti...@collabora.com

diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index 6602f94..d4f19dd 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -268,7 +268,7 @@ public:
 inline const  SwViewOption GetOpt() const { return *m_pOpt; }
 inline const OUString GetTxt() const { return *m_pTxt; }
 inline sal_Unicode GetChar( const sal_Int32 nPos ) const
-{ if (m_pTxt  !m_pTxt-isEmpty()) return (*m_pTxt)[ nPos ]; return 0; }
+{ if (m_pTxt  nPos  m_pTxt-getLength()) return (*m_pTxt)[ nPos ]; 
return 0; }
 
 KSHORT  GetTxtHeight() const;
 
diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index ca0eaf5..6d6c94a 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -780,7 +780,7 @@ sal_Bool SwTxtInputFldPortion::GetExpTxt( const 
SwTxtSizeInfo rInf, OUString r
 {
 --nLen;
 }
-rTxt = rInf.GetTxt().copy( nIdx, nLen );
+rTxt = rInf.GetTxt().copy( nIdx, std::min( nLen, rInf.GetTxt().getLength() 
- nIdx ) );
 
 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-2' - sw/source

2014-03-22 Thread Oliver-Rainer Wittmann
 sw/source/core/text/inftxt.hxx |1 -
 sw/source/core/text/portxt.cxx |   10 ++
 2 files changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 835b0bec8d6b20382dd665ea8806de474602f0d0
Author: Oliver-Rainer Wittmann o...@apache.org
Date:   Mon Jan 20 10:57:12 2014 +

fdo#76235 #i124039# assure correct line break for multi-lined Input Fields

(cherry picked from commit 14e0270c3ebad9a1fb817fcfced2aa8ee2f3e3f0)

(cherry picked from commit 6789e6de929c7685cf1573170534891aeffe5fa1)
Signed-off-by: Andras Timar andras.ti...@collabora.com

Change-Id: If5664a5260e683cd5a80885b3f39b04f85de8db9

diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index d4f19dd..2127221 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -597,7 +597,6 @@ public:
 inline void Right( const SwTwips nNew ) { nRight = nNew; }
 inline SwTwips First() const { return nFirst; }
 inline void First( const SwTwips nNew ) { nFirst = nNew; }
-inline SwTwips CurrLeft() const { return (nLineStart ? nLeft : nFirst); }
 inline KSHORT RealWidth() const { return nRealWidth; }
 inline void RealWidth( const KSHORT nNew ) { nRealWidth = nNew; }
 inline KSHORT ForcedLeftMargin() const { return nForcedLeftMargin; }
diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index 6d6c94a..68a290bd 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -733,6 +733,12 @@ sal_Bool SwTxtInputFldPortion::Format( SwTxtFormatInfo 
rInf )
 }
 else
 {
+const sal_Int32 nFormerLineStart = rInf.GetLineStart();
+if ( !mbContainsInputFieldStart )
+{
+rInf.SetLineStart( 0 );
+}
+
 bRet = SwTxtPortion::Format( rInf );
 
 if ( mbContainsInputFieldEnd )
@@ -749,6 +755,10 @@ sal_Bool SwTxtInputFldPortion::Format( SwTxtFormatInfo 
rInf )
 // adjust portion length accordingly
 SetLen( GetLen() + 1 );
 }
+else
+{
+rInf.SetLineStart( nFormerLineStart );
+}
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-03-21 Thread Oliver-Rainer Wittmann
 sw/source/core/unocore/unofield.cxx |   21 -
 1 file changed, 16 insertions(+), 5 deletions(-)

New commits:
commit 3d53b2730eeabd06dfd6ad183c1d12b15836b777
Author: Oliver-Rainer Wittmann o...@apache.org
Date:   Fri Mar 21 12:32:09 2014 +

Resolves: fdo#75728 #i124474# on change of User Field via UNO-API...

trigger update to get dependent Input Fields updated.

(cherry picked from commit 40c8121fbeb89403418a90c77b88d13ad268d347)
Signed-off-by: Andras Timar andras.ti...@collabora.com

Change-Id: I0ead765729c93992103baca53924b7a127936b38

diff --git a/sw/source/core/unocore/unofield.cxx 
b/sw/source/core/unocore/unofield.cxx
index f49595c..ccca8f4 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -583,18 +583,29 @@ throw (beans::UnknownPropertyException, 
beans::PropertyVetoException,
 }
 }
 }
-if( bSetValue )
+if ( bSetValue )
 {
 // nothing special to be done here for the properties
 // UNO_NAME_DATA_BASE_NAME and UNO_NAME_DATA_BASE_URL.
 // We just call PutValue (empty string is allowed).
 // Thus the last property set will be used as Data Source.
 
-sal_uInt16 nMId = GetFieldTypeMId( rPropertyName, *pType  );
-if( USHRT_MAX != nMId )
-pType-PutValue( rValue, nMId );
+const sal_uInt16 nMemberValueId = GetFieldTypeMId( rPropertyName, 
*pType );
+if ( USHRT_MAX != nMemberValueId )
+{
+pType-PutValue( rValue, nMemberValueId );
+if ( pType-Which() == RES_USERFLD )
+{
+// trigger update of User field in order to get depending 
Input Fields updated.
+pType-UpdateFlds();
+}
+}
 else
-throw beans::UnknownPropertyException(OUString( Unknown 
property:  ) + rPropertyName, static_cast  cppu::OWeakObject *  ( this ) );
+{
+throw beans::UnknownPropertyException(
+OUString( Unknown property:  ) + rPropertyName,
+static_cast cppu::OWeakObject * ( this ) );
+}
 }
 }
 else if (!pType  m_pImpl-m_pDoc 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-03-20 Thread Kohei Yoshida
 sw/source/core/layout/paintfrm.cxx |   32 
 1 file changed, 20 insertions(+), 12 deletions(-)

New commits:
commit 0fbd73b8f02926664c9d04fc596f482f5977ae59
Author: Kohei Yoshida kohei.yosh...@collabora.com
Date:   Tue Mar 18 16:59:20 2014 -0400

fdo#75260: Apply the same fix from writer table to character bordering.

And mirror the right and bottom borders while I'm at it. I guess it was
originally meant to.

Change-Id: I408b077c1524d19bbadd6f0b284ce204064eb735
(cherry picked from commit 2cd1673f41cb5bd8502a9a48a5721244660fe3a0)
Reviewed-on: https://gerrit.libreoffice.org/8650
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index ee0047e..3e4ed87 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -5050,23 +5050,25 @@ void PaintCharacterBorder(
 
 // Init borders, after this initialization top, bottom, right and left 
means the
 // absolute position
-const boost::optionalediteng::SvxBorderLine aTopBorder =
+boost::optionalediteng::SvxBorderLine aTopBorder =
 (bTop ? rFont.GetAbsTopBorder(bVerticalLayout) : boost::none);
-const boost::optionalediteng::SvxBorderLine aBottomBorder =
+boost::optionalediteng::SvxBorderLine aBottomBorder =
 (bBottom ? rFont.GetAbsBottomBorder(bVerticalLayout) : boost::none);
-const boost::optionalediteng::SvxBorderLine aLeftBorder =
+boost::optionalediteng::SvxBorderLine aLeftBorder =
 (bLeft ? rFont.GetAbsLeftBorder(bVerticalLayout) : boost::none);
-const boost::optionalediteng::SvxBorderLine aRightBorder =
+boost::optionalediteng::SvxBorderLine aRightBorder =
 (bRight ? rFont.GetAbsRightBorder(bVerticalLayout) : boost::none);
 
 if( aTopBorder )
 {
+sal_uInt16 nOffset = aTopBorder-GetDistance();
+
 Point aLeftTop(
-aAlignedRect.Left(),
-aAlignedRect.Top());
+aAlignedRect.Left() - nOffset,
+aAlignedRect.Top() - nOffset);
 Point aRightBottom(
-aAlignedRect.Right(),
-aAlignedRect.Top() + aTopBorder.get().GetScaledWidth());
+aAlignedRect.Right() + nOffset,
+aAlignedRect.Top() - nOffset + aTopBorder-GetScaledWidth());
 
 lcl_MakeBorderLine(
 SwRect(aLeftTop, aRightBottom),
@@ -5078,6 +5080,8 @@ void PaintCharacterBorder(
 
 if( aBottomBorder )
 {
+aBottomBorder-SetMirrorWidths(true);
+
 Point aLeftTop(
 aAlignedRect.Left(),
 aAlignedRect.Bottom() - aBottomBorder.get().GetScaledWidth());
@@ -5095,12 +5099,14 @@ void PaintCharacterBorder(
 
 if( aLeftBorder )
 {
+sal_uInt16 nOffset = aLeftBorder-GetDistance();
+
 Point aLeftTop(
-aAlignedRect.Left(),
-aAlignedRect.Top());
+aAlignedRect.Left() - nOffset,
+aAlignedRect.Top() - nOffset);
 Point aRightBottom(
-aAlignedRect.Left() + aLeftBorder.get().GetScaledWidth(),
-aAlignedRect.Bottom());
+aAlignedRect.Left() - nOffset + aLeftBorder-GetScaledWidth(),
+aAlignedRect.Bottom() + nOffset);
 
 lcl_MakeBorderLine(
 SwRect(aLeftTop, aRightBottom),
@@ -5112,6 +5118,8 @@ void PaintCharacterBorder(
 
 if( aRightBorder )
 {
+aRightBorder-SetMirrorWidths(true);
+
 Point aLeftTop(
 aAlignedRect.Right() - aRightBorder.get().GetScaledWidth(),
 aAlignedRect.Top());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-03-20 Thread Kohei Yoshida
 sw/source/core/layout/paintfrm.cxx |   20 
 1 file changed, 20 insertions(+)

New commits:
commit 4d2ff40bf36f52c3fdd61311159a4ace5e631298
Author: Kohei Yoshida kohei.yosh...@collabora.com
Date:   Tue Mar 18 16:29:53 2014 -0400

fdo#75260: Apply the same fix from writer table to paragraph bordering.

Change-Id: Icb11a2e2f802cbf2af2362315f3acbc66f15334d
(cherry picked from commit 961da51ae28b46c96344be20abd1b5172a3faa3f)
Reviewed-on: https://gerrit.libreoffice.org/8649
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index c2719ddb..ee0047e 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -4899,6 +4899,16 @@ static void lcl_PaintLeftRightLine( const bool 
_bLeft,
 {
 (aRect.*_rRectFn-fnAddRight)( ::lcl_AlignWidth( lcl_GetLineWidth( 
pLeftRightBorder ) ) -
(aRect.*_rRectFn-fnGetWidth)() );
+
+// Shift the left border to the left.
+Point aCurPos = aRect.Pos();
+sal_uInt16 nOffset = pLeftRightBorder-GetDistance();
+aCurPos.X() -= nOffset;
+aCurPos.Y() -= nOffset;
+aRect.Pos(aCurPos);
+Size aCurSize = aRect.SSize();
+aCurSize.Height() += nOffset * 2;
+aRect.SSize(aCurSize);
 }
 else
 {
@@ -4965,6 +4975,16 @@ static void lcl_PaintTopBottomLine( const bool 
_bTop,
 {
 (aRect.*_rRectFn-fnAddBottom)( ::lcl_AlignHeight( lcl_GetLineWidth( 
pTopBottomBorder ) ) -
 (aRect.*_rRectFn-fnGetHeight)() );
+
+// Push the top border up a bit.
+sal_uInt16 nOffset = pTopBottomBorder-GetDistance();
+Point aCurPos = aRect.Pos();
+aCurPos.X() -= nOffset;
+aCurPos.Y() -= nOffset;
+aRect.Pos(aCurPos);
+Size aCurSize = aRect.SSize();
+aCurSize.Width() += nOffset * 2;
+aRect.SSize(aCurSize);
 }
 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-2' - sw/source

2014-03-18 Thread Kohei Yoshida
 sw/source/core/layout/paintfrm.cxx |   42 +++--
 1 file changed, 27 insertions(+), 15 deletions(-)

New commits:
commit e1823627f35e4419880769fdd05acddbd0a9c25c
Author: Kohei Yoshida kohei.yosh...@collabora.com
Date:   Mon Mar 17 19:41:07 2014 -0400

fdo#76195: Set the border type to NONE to ensure it won't be drawn.

We can no longer rely on the width being zero for no border condition.

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

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index 5557547..e6b9a66 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -108,13 +108,6 @@ using ::drawinglayer::primitive2d::BorderLinePrimitive2D;
 using ::std::pair;
 using ::std::make_pair;
 
-//subsidiary lines enabled?
-#define IS_SUBS_TABLE \
-(pGlobalShell-GetViewOptions()-IsTable()  \
-!pGlobalShell-GetViewOptions()-IsPagePreview()\
-!pGlobalShell-GetViewOptions()-IsReadonly()\
-!pGlobalShell-GetViewOptions()-IsFormView() \
- SwViewOption::IsTableBoundaries())
 //other subsidiary lines enabled?
 #define IS_SUBS (!pGlobalShell-GetViewOptions()-IsPagePreview()  \
 !pGlobalShell-GetViewOptions()-IsReadonly()  \
@@ -260,6 +253,27 @@ static sal_Bool bTableHack = sal_False;
 //To optimize the expensive RetouchColor determination
 Color aGlobalRetoucheColor;
 
+namespace {
+
+bool isTableBoundariesEnabled()
+{
+if (!pGlobalShell-GetViewOptions()-IsTable())
+return false;
+
+if (pGlobalShell-GetViewOptions()-IsPagePreview())
+return false;
+
+if (pGlobalShell-GetViewOptions()-IsReadonly())
+return false;
+
+if (pGlobalShell-GetViewOptions()-IsFormView())
+return false;
+
+return SwViewOption::IsTableBoundaries();
+}
+
+}
+
 // Set borders alignment statics.
 // adjustment for 'small' twip-to-pixel relations:
 // For 'small' twip-to-pixel relations (less then 2:1)
@@ -2571,8 +2585,10 @@ void SwTabFrmPainter::PaintLines(OutputDevice rDev, 
const SwRect rRect) const
 const Color* pTmpColor = 0;
 if (0 == aStyles[ 0 ].GetWidth())
 {
-if (IS_SUBS_TABLE  pGlobalShell-GetWin())
+if (isTableBoundariesEnabled()  pGlobalShell-GetWin())
 aStyles[ 0 ].Set( rCol, rCol, rCol, false, 1, 0, 0 );
+else
+aStyles[0].SetType(table::BorderLineStyle::NONE);
 }
 else
 pTmpColor = pHCColor;
@@ -4320,12 +4336,8 @@ void SwTabFrm::Paint(SwRect const rRect, SwPrintData 
const*const) const
 PaintShadow( rRect, aRect, rAttrs );
 }
 
-if (pViewOption-IsTableBoundaries())
-{
-// fdo#75118 Paint border lines only when it's enabled.
-SwTabFrmPainter aHelper(*this);
-aHelper.PaintLines(*pGlobalShell-GetOut(), rRect);
-}
+SwTabFrmPainter aHelper(*this);
+aHelper.PaintLines(*pGlobalShell-GetOut(), rRect);
 }
 // -- collapsing
 
@@ -6623,7 +6635,7 @@ void SwFrm::PaintBackground( const SwRect rRect, const 
SwPageFrm *pPage,
 
 void SwPageFrm::RefreshSubsidiary( const SwRect rRect ) const
 {
-if ( IS_SUBS || IS_SUBS_TABLE || IS_SUBS_SECTION || IS_SUBS_FLYS )
+if ( IS_SUBS || isTableBoundariesEnabled() || IS_SUBS_SECTION || 
IS_SUBS_FLYS )
 {
 SwRect aRect( rRect );
 // OD 18.02.2003 #104989# - Not necessary and incorrect alignment of
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

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

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

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

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

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


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

2014-03-17 Thread Bjoern Michaelsen
 sw/source/core/text/frmform.cxx |8 
 1 file changed, 8 deletions(-)

New commits:
commit a54da6a84f751250c694120d1a29aaac89cd3af4
Author: Bjoern Michaelsen bjoern.michael...@canonical.com
Date:   Sat Mar 15 16:25:41 2014 +0100

fdo#47355: partially revert c5a8a2c3cbcee0175127a0662e3d820ea4deea22

- that commit claimed to fix i#84870
- however that example document _still_ loops for me on current master
  even with the change
- this caused the fdo#47355 regression in addition
- thus reverting to heal fdo#47355, expecting i#84870 unchanged as broken
  before and in need of a proper fix

Change-Id: I067a8ef222ee2af6cd97579451c40ddba53ca294
Reviewed-on: https://gerrit.libreoffice.org/8606
Reviewed-by: Björn Michaelsen bjoern.michael...@canonical.com
Tested-by: Björn Michaelsen bjoern.michael...@canonical.com
(cherry picked from commit 72a4987434368bfb0b15f5ebb70a52108d349d5f)
Reviewed-on: https://gerrit.libreoffice.org/8617

diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index 4291e92..093e40b 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -1059,14 +1059,6 @@ void SwTxtFrm::FormatAdjust( SwTxtFormatter rLine,
 const SwTwips nDocPrtTop = Frm().Top() + Prt().Top();
 const SwTwips nOldHeight = Prt().SSize().Height();
 SwTwips nChg = rLine.CalcBottomLine() - nDocPrtTop - nOldHeight;
-// -- OD #i84870# - no shrink of text frame, if it only contains one
-// as-character anchored object.
-if ( nChg  0 
- bOnlyContainsAsCharAnchoredObj )
-{
-nChg = 0;
-}
-// --
 
 // Vertical Formatting:
 // The (rotated) repaint rectangle's x coordinate referes to the frame.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

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

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

fdo#75460: sw: fix AutoScroll

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

(regression from 8880c773e779710dc0a08760e92afd709a73ca31)

Change-Id: I958f1403ad23d0c0631eca5dbbef977a9ca1210d
(cherry picked from commit 6795b251e2011cae945c6bb903de8053953b5e30)
Reviewed-on: https://gerrit.libreoffice.org/8596
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Miklos Vajna vmik...@collabora.co.uk

diff --git a/sw/source/ui/uiview/viewport.cxx b/sw/source/ui/uiview/viewport.cxx
index 1d4acb3..ac0b21a 100644
--- a/sw/source/ui/uiview/viewport.cxx
+++ b/sw/source/ui/uiview/viewport.cxx
@@ -1242,14 +1242,9 @@ void SwView::Move()
 
 sal_Bool SwView::HandleWheelCommands( const CommandEvent rCEvt )
 {
-const CommandWheelData* pWData = rCEvt.GetWheelData();
-if (!pWData)
-{
-return sal_False;
-}
-
 sal_Bool bOk = sal_False;
-if( COMMAND_WHEEL_ZOOM == pWData-GetMode() )
+const CommandWheelData* pWData = rCEvt.GetWheelData();
+if (pWData  COMMAND_WHEEL_ZOOM == pWData-GetMode())
 {
 long nFact = m_pWrtShell-GetViewOptions()-GetZoom();
 if( 0L  pWData-GetDelta() )
@@ -1260,7 +1255,7 @@ sal_Bool SwView::HandleWheelCommands( const CommandEvent 
rCEvt )
 SetZoom( SVX_ZOOM_PERCENT, nFact );
 bOk = sal_True;
 }
-else if( COMMAND_WHEEL_ZOOM_SCALE == pWData-GetMode() )
+else if (pWData  COMMAND_WHEEL_ZOOM_SCALE == pWData-GetMode())
 {
 // mobile touch zoom (pinch) section
 // remember the center location to reach in logic
@@ -1304,13 +1299,13 @@ sal_Bool SwView::HandleWheelCommands( const 
CommandEvent rCEvt )
 }
 else
 {
-if( pWData-GetMode()==COMMAND_WHEEL_SCROLL )
+if (pWData  pWData-GetMode()==COMMAND_WHEEL_SCROLL)
 {
 // This influences whether quick help is shown
 m_bWheelScrollInProgress=true;
 }
 
-if( (COMMAND_WHEEL_SCROLL==pWData-GetMode())  
(((sal_uLong)0x) == pWData-GetScrollLines()) )
+if (pWData  (COMMAND_WHEEL_SCROLL==pWData-GetMode())  
(((sal_uLong)0x) == pWData-GetScrollLines()))
 {
 if (pWData-GetDelta()0)
 PhyPageDown();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-03-15 Thread Andras Timar
 sw/source/filter/html/htmlcss1.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ca1e73d7e91f35cede3d3e6220f9b86dcd55e427
Author: Andras Timar andras.ti...@collabora.com
Date:   Sat Mar 15 18:51:49 2014 +0100

fdo#75040 fix application of help's stylesheet

it was regression from 73e3aafa990168aa532fa7b81fc4de8f455b10e1

Change-Id: I059f08b12bb7847472946f3b2a669015ec437be5
(cherry picked from commit 2e3969cb8bb235fed483ce49ddee5ea731376893)
Reviewed-on: https://gerrit.libreoffice.org/8608
Reviewed-by: Björn Michaelsen bjoern.michael...@canonical.com
Tested-by: Björn Michaelsen bjoern.michael...@canonical.com

diff --git a/sw/source/filter/html/htmlcss1.cxx 
b/sw/source/filter/html/htmlcss1.cxx
index ea8ea42..69eddb7 100644
--- a/sw/source/filter/html/htmlcss1.cxx
+++ b/sw/source/filter/html/htmlcss1.cxx
@@ -646,7 +646,7 @@ static CSS1SelectorType GetTokenAndClass( const 
CSS1Selector *pSelector,
 }
 }
 
-rToken = rToken.toAsciiUpperCase();
+rToken = rToken.toAsciiLowerCase();
 return eType;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-03-12 Thread Kohei Yoshida
 sw/source/core/layout/paintfrm.cxx |   21 +
 1 file changed, 9 insertions(+), 12 deletions(-)

New commits:
commit 95a6f31773e0ae03630ac301d0415361496243a4
Author: Kohei Yoshida kohei.yosh...@collabora.com
Date:   Tue Mar 11 10:36:15 2014 -0400

fdo#76030: Use the table boundaries view option to toggle border drawing.

Unless I'm missing something, fixing the problem reported in fdo#75118 this
way is more reliable, and certainly avoids the problem reported in 
fdo#76030.

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

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index f10d7b4..5557547 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -2658,12 +2658,6 @@ void SwTabFrmPainter::PaintLines(OutputDevice rDev, 
const SwRect rRect) const
 aPaintStart.Y() -= nTwipYCorr;
 aPaintEnd.Y()   -= nTwipYCorr;
 
-if (::rtl::math::approxEqual(aStyles[0].Prim(), 0.0) 
-::rtl::math::approxEqual(aStyles[0].Secn(), 0.0))
-{
-continue; // fdo#75118 do not paint zero-width lines
-}
-
 // Here comes the painting stuff: Thank you, DR, great job!!!
 if (bHori)
 {
@@ -4309,7 +4303,8 @@ void SwFlyFrm::Paint(SwRect const rRect, SwPrintData 
const*const) const
 
 void SwTabFrm::Paint(SwRect const rRect, SwPrintData const*const) const
 {
-if ( pGlobalShell-GetViewOptions()-IsTable() )
+const SwViewOption* pViewOption = pGlobalShell-GetViewOptions();
+if (pViewOption-IsTable())
 {
 // #i29550#
 if ( IsCollapsingBorders() )
@@ -4325,9 +4320,12 @@ void SwTabFrm::Paint(SwRect const rRect, SwPrintData 
const*const) const
 PaintShadow( rRect, aRect, rAttrs );
 }
 
-// paint lines
-SwTabFrmPainter aHelper( *this );
-aHelper.PaintLines( *pGlobalShell-GetOut(), rRect );
+if (pViewOption-IsTableBoundaries())
+{
+// fdo#75118 Paint border lines only when it's enabled.
+SwTabFrmPainter aHelper(*this);
+aHelper.PaintLines(*pGlobalShell-GetOut(), rRect);
+}
 }
 // -- collapsing
 
@@ -4341,8 +4339,7 @@ void SwTabFrm::Paint(SwRect const rRect, SwPrintData 
const*const) const
 aTabRect.Pos() += Frm().Pos();
 SwRect aTabOutRect( rRect );
 aTabOutRect.Intersection( aTabRect );
-pGlobalShell-GetViewOptions()-
-DrawRect( pGlobalShell-GetOut(), aTabOutRect, COL_LIGHTGRAY );
+pViewOption-DrawRect( pGlobalShell-GetOut(), aTabOutRect, 
COL_LIGHTGRAY );
 }
 ((SwTabFrm*)this)-ResetComplete();
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-03-09 Thread Michael Stahl
 sw/source/core/layout/atrfrm.cxx |   12 
 1 file changed, 12 insertions(+)

New commits:
commit 6beed55f62dacf365b16fd64dc32682e5db30a8f
Author: Michael Stahl mst...@redhat.com
Date:   Fri Mar 7 15:56:37 2014 +0100

rhbz#1043551: sw: avoid division-by-0 in Text Grid painting code

Possible to trigger with a document containing:
style:layout-grid-base-height=0cm

(cherry picked from commit 71b55cf57460aec3fec948676251448934ba31d1)

got to love the sal_Int32 as long/int
(cherry picked from commit 18c89ae6ff01f3d555a7cb030eb4572d504e8de7)

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

diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index b06cea4..3c40518 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -2262,12 +2262,24 @@ bool SwTextGridItem::PutValue( const uno::Any rVal, 
sal_uInt8 nMemberId )
 bRet = (rVal = nTmp);
 nTmp = MM100_TO_TWIP( nTmp );
 if( bRet  (nTmp = 0)  ( nTmp = USHRT_MAX) )
+{
+// rhbz#1043551 round up to 5pt -- 0 causes divide-by-zero
+// in layout; 1pt ties the painting code up in knots for
+// minutes with bazillion lines...
+#define MIN_TEXTGRID_SIZE 100
 if( (nMemberId  ~CONVERT_TWIPS) == MID_GRID_BASEHEIGHT )
+{
+nTmp = std::maxsal_Int32(nTmp, MIN_TEXTGRID_SIZE);
 SetBaseHeight( (sal_uInt16)nTmp );
+}
 else if( (nMemberId  ~CONVERT_TWIPS) == MID_GRID_BASEWIDTH )
+{
+nTmp = std::maxsal_Int32(nTmp, MIN_TEXTGRID_SIZE);
 SetBaseWidth( (sal_uInt16)nTmp );
+}
 else
 SetRubyHeight( (sal_uInt16)nTmp );
+}
 else
 bRet = 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-2' - sw/source

2014-03-09 Thread Bjoern Michaelsen
 sw/source/core/fields/cellfml.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3c0bc4edf5bde8e8494c2ef7e44105f9d90d85c3
Author: Bjoern Michaelsen bjoern.michael...@canonical.com
Date:   Fri Mar 7 12:50:46 2014 +0100

fdo#75492: table names can start the same way and still be different

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

diff --git a/sw/source/core/fields/cellfml.cxx 
b/sw/source/core/fields/cellfml.cxx
index dc07249..4a56bfb 100644
--- a/sw/source/core/fields/cellfml.cxx
+++ b/sw/source/core/fields/cellfml.cxx
@@ -698,7 +698,7 @@ const SwTable* SwTableFormula::FindTable( SwDoc rDoc, 
const OUString rNm ) con
 SwFrmFmt* pFmt = rTblFmts[ --nFmtCnt ];
 // if we are called from Sw3Writer, a number is dependent on the 
format name
 SwTableBox* pFBox;
-if ( rNm.startsWith(pFmt-GetName().getToken(0, 0x0a)) 
+if ( rNm.equals(pFmt-GetName().getToken(0, 0x0a)) 
 0 != ( pTmpTbl = SwTable::FindTable( pFmt ) ) 
 0 != (pFBox = pTmpTbl-GetTabSortBoxes()[0] ) 
 pFBox-GetSttNd() 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-03-07 Thread Bjoern Michaelsen
 sw/source/core/crsr/crsrsh.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 0f6431dd4d9b91e3819abee35ebc946c800f53fd
Author: Bjoern Michaelsen bjoern.michael...@canonical.com
Date:   Fri Mar 7 10:15:55 2014 +0100

fdo#74854: better loose selection than crashing

- this is just a bandaid

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

diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index b51c3cc..5241423 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -1428,6 +1428,13 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, 
sal_Bool bIdleEnd )
 m_pCurCrsr-SwSelPaintRects::Hide();
 
 CheckTblBoxCntnt();
+if(!m_pTblCrsr)
+{
+SAL_WARN(sw, fdo#74854: 
+this should not happen, but better loose the 
selection 
+rather than crashing);
+return;
+}
 }
 
 SwCrsrMoveState aTmpState( MV_NONE );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-03-04 Thread Michael Stahl
 sw/source/core/unocore/unofield.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1609eb8d6e9b8d9b4d82be5c46656d4d43256125
Author: Michael Stahl mst...@redhat.com
Date:   Sat Mar 1 23:13:39 2014 +0100

fdo#47811: fix setPropertyValue(Name) of Database fieldmaster

This one is assigning to the wrong pType variable.

(regression from CWS swwarnings)

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

diff --git a/sw/source/core/unocore/unofield.cxx 
b/sw/source/core/unocore/unofield.cxx
index 11f347f..f49595c 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -652,7 +652,7 @@ throw (beans::UnknownPropertyException, 
beans::PropertyVetoException,
 case RES_DBFLD :
 {
 rValue = m_pImpl-m_sParam3;
-pType = GetFldType();
+pType2 = GetFldType();
 }
 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-2' - sw/source

2014-02-20 Thread Michael Stahl
 sw/source/core/layout/paintfrm.cxx |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit 1639e174ebb3945f4fda08c30f535f98d3e54d7e
Author: Michael Stahl mst...@redhat.com
Date:   Wed Feb 19 21:46:11 2014 +0100

fdo#75118: sw: do not paint zero-width lines

Since commit 6a3fb868b2b8af21f7b6140424b6f8377599a786 zero-width
BorderLinePrimitive2D will actually be painted as hairlines by
VclPixelProcessor2D::tryDrawBorderLinePrimitive2DDirect(), so don't
create such pointless primitives.

(cherry picked from commit 128d3d51c208ec5c37a105ea5c751530bd017d4b)

fdo#75118: actually these are floats, compare with approxEqual

(cherry picked from commit 9fb9fc301502c2762ad4a8059d8d1c818d2843db)

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

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index ba57797..54de397 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -2474,8 +2474,8 @@ void SwTabFrmPainter::PaintLines( OutputDevice rDev, 
const SwRect rRect ) cons
 break;
 
 const SwLineEntrySet rEntrySet = (*aIter).second;
-SwLineEntrySetConstIter aSetIter = rEntrySet.begin();
-while ( aSetIter != rEntrySet.end() )
+for (SwLineEntrySetConstIter aSetIter = rEntrySet.begin();
+ aSetIter != rEntrySet.end(); ++aSetIter)
 {
 const SwLineEntry rEntry = *aSetIter;
 const svx::frame::Style rEntryStyle( (*aSetIter).maAttribute );
@@ -2608,6 +2608,12 @@ void SwTabFrmPainter::PaintLines( OutputDevice rDev, 
const SwRect rRect ) cons
 aPaintStart.Y() -= nTwipYCorr;
 aPaintEnd.Y()   -= nTwipYCorr;
 
+if (::rtl::math::approxEqual(aStyles[0].Prim(), 0.0) 
+::rtl::math::approxEqual(aStyles[0].Secn(), 0.0))
+{
+continue; // fdo#75118 do not paint zero-width lines
+}
+
 // Here comes the painting stuff: Thank you, DR, great job!!!
 if ( bHori )
 {
@@ -2642,8 +2648,6 @@ void SwTabFrmPainter::PaintLines( OutputDevice rDev, 
const SwRect rRect ) cons
 );
 }
 }
-
-++aSetIter;
 }
 
 ++aIter;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-02-17 Thread Michael Stahl
 sw/source/core/doc/notxtfrm.cxx|   56 +
 sw/source/core/inc/frmtool.hxx |7 
 sw/source/core/layout/paintfrm.cxx |   11 ++-
 3 files changed, 49 insertions(+), 25 deletions(-)

New commits:
commit 884aa71132efe05aed456a5ca0cfd69ca148939f
Author: Michael Stahl mst...@redhat.com
Date:   Fri Feb 14 22:18:27 2014 +0100

fdo#68927: sw: fix painting of SVG page background

There was a fix for a wrong constant resulting in too large image size in
a1a0830d1ac3ffabbe35bd8a0264b64f1f7a9d67, and it turns out that painting
of SVG backgrounds was relying on the wasteful rasterization:  the SVG
is rasterized only once (at the initial zoom level) and then cached, and
now the correct image size for 100% is simply scaled up when zooming in.

Fix that by painting SVGs with the drawing layer primitives instead,
which appears to give better results.

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

diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 4d29dec..3dc2a3c 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -735,6 +735,36 @@ bool paintUsingPrimitivesHelper(
 return false;
 }
 
+
+void paintGraphicUsingPrimitivesHelper(OutputDevice  rOutputDevice,
+ Graphic const rGraphic, GraphicAttr const rGraphicAttr,
+ SwRect const rAlignedGrfArea)
+{
+// unify using GraphicPrimitive2D
+// - the primitive handles all crop and mirror stuff
+// - the primitive renderer will create the needed pdf export data
+// - if bitmap content, it will be cached system-dependent
+const basegfx::B2DRange aTargetRange(
+rAlignedGrfArea.Left(), rAlignedGrfArea.Top(),
+rAlignedGrfArea.Right(), rAlignedGrfArea.Bottom());
+const basegfx::B2DHomMatrix aTargetTransform(
+basegfx::tools::createScaleTranslateB2DHomMatrix(
+aTargetRange.getRange(),
+aTargetRange.getMinimum()));
+drawinglayer::primitive2d::Primitive2DSequence aContent(1);
+
+aContent[0] = new drawinglayer::primitive2d::GraphicPrimitive2D(
+aTargetTransform,
+rGraphic,
+rGraphicAttr);
+
+paintUsingPrimitivesHelper(
+rOutputDevice,
+aContent,
+aTargetRange,
+aTargetRange);
+}
+
 /** Paint the graphic.
 
 We require either a QuickDraw-Bitmap or a graphic here. If we do not have
@@ -857,30 +887,8 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const 
SwRect rGrfArea ) cons
 }
 else
 {
-// unify using GraphicPrimitive2D
-// - the primitive handles all crop and mirror stuff
-// - the primitive renderer will create the needed pdf 
export data
-// - if bitmap conent, it will be cached system-dependent
-const basegfx::B2DRange aTargetRange(
-aAlignedGrfArea.Left(), aAlignedGrfArea.Top(),
-aAlignedGrfArea.Right(), aAlignedGrfArea.Bottom());
-const basegfx::B2DHomMatrix aTargetTransform(
-basegfx::tools::createScaleTranslateB2DHomMatrix(
-aTargetRange.getRange(),
-aTargetRange.getMinimum()));
-drawinglayer::primitive2d::Primitive2DSequence aContent;
-
-aContent.realloc(1);
-aContent[0] = new 
drawinglayer::primitive2d::GraphicPrimitive2D(
-aTargetTransform,
-rGrfObj.GetGraphic(),
-aGrfAttr);
-
-paintUsingPrimitivesHelper(
-*pOut,
-aContent,
-aTargetRange,
-aTargetRange);
+paintGraphicUsingPrimitivesHelper(*pOut,
+rGrfObj.GetGraphic(), aGrfAttr, aAlignedGrfArea);
 }
 }
 else
diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx
index 3304351..02569bf 100644
--- a/sw/source/core/inc/frmtool.hxx
+++ b/sw/source/core/inc/frmtool.hxx
@@ -42,6 +42,8 @@ class XFillGradientItem;
 class SdrMarkList;
 class SwNodeIndex;
 class OutputDevice;
+class Graphic;
+class GraphicAttr;
 class SwPageDesc;
 
 #define FAR_AWAY LONG_MAX - 2  // initial position of a Fly
@@ -57,6 +59,11 @@ void DrawGraphic( const SvxBrushItem *, const 
XFillStyleItem*, const XFillGradie
   const SwRect rOrg, const SwRect rOut, const sal_uInt8 
nGrfNum = GRFNUM_NO,
   const sal_Bool 

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

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

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

Fix crash in css rgb color handling.

Crashing since 2000 (or earlier).

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

diff --git a/sw/source/filter/html/parcss1.cxx 
b/sw/source/filter/html/parcss1.cxx
index c498db9..575351e 100644
--- a/sw/source/filter/html/parcss1.cxx
+++ b/sw/source/filter/html/parcss1.cxx
@@ -1279,7 +1279,7 @@ sal_Bool CSS1Expression::GetColor( Color rColor ) const
 ')' == aValue[aValue.getLength()-1],
 keine gueltiges RGB(...) );
 
-OUString aColorStr( aValue.copy( 4, aValue.getLength()-1 ) );
+OUString aColorStr(aValue.copy(4, aValue.getLength() - 5));
 
 sal_Int32 nPos = 0;
 sal_uInt16 nCol = 0;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-02-14 Thread Chr . Rossmanith
 sw/source/core/doc/notxtfrm.cxx|2 ++
 sw/source/core/graphic/ndgrf.cxx   |9 -
 sw/source/filter/html/htmlgrin.cxx |   20 +++-
 3 files changed, 29 insertions(+), 2 deletions(-)

New commits:
commit 047913ea8f0cb8b03f78be0780c5e828be9ef323
Author: Chr. Rossmanith chrrossman...@gmx.de
Date:   Thu Feb 13 22:30:53 2014 +0100

fdo#50763: handle inlined base64 images

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

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

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

diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index fb4abbf..4d29dec 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -83,6 +83,8 @@ inline bool GetRealURL( const SwGrfNode rNd, OUString rTxt )
 if( bRet )
 rTxt = URIHelper::removePassword( rTxt, INetURLObject::WAS_ENCODED,
INetURLObject::DECODE_UNAMBIGUOUS);
+if (rTxt.startsWith(data:image)) rTxt = inline image;
+
 return bRet;
 }
 
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 21cc72a..725296f 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -76,7 +76,14 @@ SwGrfNode::SwGrfNode(
 bFrameInPaint = bScaleImageMap = sal_False;
 
 bGrafikArrived = sal_True;
-ReRead(rGrfName,rFltName, pGraphic, 0, sal_False);
+
+// fdo#50763 inline image has already been read into memory
+if (rGrfName.startsWith(data:)) {
+maGrfObj.SetGraphic( *pGraphic, rGrfName );
+}
+else {
+ReRead(rGrfName,rFltName, pGraphic, 0, sal_False);
+}
 }
 
 SwGrfNode::SwGrfNode( const SwNodeIndex  rWhere,
diff --git a/sw/source/filter/html/htmlgrin.cxx 
b/sw/source/filter/html/htmlgrin.cxx
index 221b967..231555e 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -68,6 +68,9 @@
 #include numrule.hxx
 #include boost/shared_ptr.hpp
 
+#include sax/tools/converter.hxx
+#include vcl/graphicfilter.hxx
+
 using namespace ::com::sun::star;
 
 
@@ -694,7 +697,22 @@ IMAGE_SETEVENT:
 aFrmSet.Put( aFrmSize );
 
 Graphic aEmptyGrf;
-aEmptyGrf.SetDefaultType();
+if( sGrfNm.startsWith(data:) )
+{
+// use embedded base64 encoded data
+::com::sun::star::uno::Sequence sal_Int8  aPass;
+OUString sBase64Data = sGrfNm.replaceAt(0,22,);
+::sax::Converter::decodeBase64(aPass, sBase64Data);
+if( aPass.hasElements() )
+{
+SvMemoryStream aStream(aPass.getArray(), aPass.getLength(), 
STREAM_READ);
+GraphicFilter::GetGraphicFilter().ImportGraphic( aEmptyGrf, 
OUString(), aStream );
+}
+}
+else
+{
+aEmptyGrf.SetDefaultType();
+}
 SwFrmFmt *pFlyFmt = pDoc-Insert( *pPam, sGrfNm, aEmptyOUStr, aEmptyGrf,
   aFrmSet, NULL, NULL );
 SwGrfNode *pGrfNd = pDoc-GetNodes()[ pFlyFmt-GetCntnt().GetCntntIdx()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

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

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

nPDescPos is never read

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

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

loop that read past the end of the maPageDescs vector.

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

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


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

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

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

Do not reference a dangling OUString

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

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


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

2014-02-12 Thread Oliver-Rainer Wittmann
 sw/source/core/unocore/unoportenum.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e46392bbe25028528086a43a4c414dcb0acde401
Author: Oliver-Rainer Wittmann o...@apache.org
Date:   Tue Feb 11 10:15:45 2014 +

Resolves: fdo#74780 #i124178# correct export of User Variable Input Fields

(cherry picked from commit b95fa33a4d2827adb8e16de5bae4e535d8c826c9)

Conflicts:
sw/source/core/unocore/unoportenum.cxx

(cherry picked from commit 91f509fda9a04670e0752a214188be87bce1f2ac)

Change-Id: If645dd2f02ef0e511e44615339d6403cc469c784

diff --git a/sw/source/core/unocore/unoportenum.cxx 
b/sw/source/core/unocore/unoportenum.cxx
index 8d5377d..b745582 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -748,7 +748,7 @@ lcl_ExportHints(
 {
 
 pUnoCrsr-Right(
-
pAttr-GetFmtFld().GetField()-GetPar1().getLength() + 2,
+pAttr-GetFmtFld().GetField()-ExpandField( true 
).getLength() + 2,
 CRSR_SKIP_CHARS,
 sal_False,
 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-2' - sw/source

2014-02-10 Thread Caolán McNamara
 sw/source/ui/dbui/mmaddressblockpage.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0a3cddc4573f3d6d884bef84fed8dbe287e4e6be
Author: Caolán McNamara caol...@redhat.com
Date:   Sun Feb 9 21:07:10 2014 +

coverity#1130443 Improper use of negative value

Change-Id: Ie56b1d5ceeb68bb3d7dffe6ad8949485a93e1fbb
(cherry picked from commit 0419524c57a7c18386c6cdc893a59fd95e589de9)
Reviewed-on: https://gerrit.libreoffice.org/7957
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx 
b/sw/source/ui/dbui/mmaddressblockpage.cxx
index 21e0cf8..d2754c7 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -1344,7 +1344,7 @@ void AddressMultiLineEdit::SetText( const OUString rStr )
 while(true)
 {
 sal_Int32 nStart = sPara.indexOf( '', nIndex );
-sal_Int32 nEnd = sPara.indexOf( '', nStart );
+sal_Int32 nEnd = nStart == -1 ? -1 : sPara.indexOf( '', nStart );
 nIndex = nEnd;
 if(nStart != -1  nEnd != -1)
 pTextEngine-SetAttrib( aProtectAttr, nPara, nStart, nEnd + 1, 
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-2' - sw/source

2014-02-07 Thread Michael Stahl
 sw/source/core/bastyp/calc.cxx |3 +--
 sw/source/ui/app/appenv.cxx|9 +
 2 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit e44e7942929ba063715861abe53412c6d867cd50
Author: Michael Stahl mst...@redhat.com
Date:   Thu Feb 6 23:49:20 2014 +0100

fdo#74474: sw: fix Label wizard document creation (2 in 1)

Infinite loop in InsertLabEnvText() due to wrong handling of starting ''.

(regression from fa469b2e00d83459faebe4c1fcb3ea1aac5fb20d)

(cherry picked from commit 7e61bfe813347949307cdf2876ead3cc42e4cd7b)

The function ReplacePoint() was changed to return a value but not all
call sites were adapted.
(regression from 263153842741d7ce21cc0bf1c5296a55a1138024)

(cherry picked from commit 9dbe5a576330b7fadd8838249d07aafe548a4ee2)

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

diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx
index b550bfb..8463ac8 100644
--- a/sw/source/core/bastyp/calc.cxx
+++ b/sw/source/core/bastyp/calc.cxx
@@ -512,8 +512,7 @@ SwCalcExp* SwCalc::VarLook( const OUString rStr, 
sal_uInt16 ins )
 }
 
 // At this point the real case variable has to be used
-OUString sTmpName( rStr );
-::ReplacePoint( sTmpName );
+OUString const sTmpName( ::ReplacePoint(rStr) );
 
 if( !ins )
 {
diff --git a/sw/source/ui/app/appenv.cxx b/sw/source/ui/app/appenv.cxx
index 63b614a6..acf8684 100644
--- a/sw/source/ui/app/appenv.cxx
+++ b/sw/source/ui/app/appenv.cxx
@@ -88,10 +88,11 @@ OUString InsertLabEnvText( SwWrtShell rSh, SwFldMgr 
rFldMgr, const OUString r
 bool bField = false;
 
 sal_Int32 nPos = aLine.indexOf( '' );
-if ( nPos != -1)
+if (0 != nPos)
 {
-sTmpText = aLine.copy( 0, nPos );
-aLine = aLine.copy( nPos );
+sal_Int32 const nCopy((nPos != -1) ? nPos : aLine.getLength());
+sTmpText = aLine.copy(0, nCopy);
+aLine = aLine.copy(nCopy);
 }
 else
 {
@@ -111,7 +112,7 @@ OUString InsertLabEnvText( SwWrtShell rSh, SwFldMgr 
rFldMgr, const OUString r
 sal_uInt16 nCnt = 
comphelper::string::getTokenCount(sDBName, '.');
 if (nCnt = 3)
 {
-::ReplacePoint(sDBName, true);
+sDBName = ::ReplacePoint(sDBName, true);
 SwInsertFld_Data aData(TYP_DBFLD, 0, sDBName, 
aEmptyOUStr, 0, rSh );
 rFldMgr.InsertFld( aData );
 sRet = sDBName;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-02-06 Thread Caolán McNamara
 sw/source/ui/docvw/edtwin.cxx |   38 --
 1 file changed, 32 insertions(+), 6 deletions(-)

New commits:
commit 148ed6783b3c6e5e3c068f1a802c8bdfaba14e21
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Jan 31 23:36:02 2014 +

fdo#61251 prefer exact matches before case guess matching

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

diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index 2e981c4..7e978d0 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -283,7 +283,7 @@ struct QuickHelpData
 
 // Fills internal structures with hopefully helpful information.
 void FillStrArr( SwWrtShell rSh, const OUString rWord );
-void SortAndFilter();
+void SortAndFilter(const OUString rOrigWord);
 };
 
 /**
@@ -5850,6 +5850,11 @@ void QuickHelpData::FillStrArr( SwWrtShell rSh, const 
OUString rWord )
 if( rStr.getLength()  rWord.getLength() 
 rCC.lowercase( rStr, 0, rWord.getLength() ) == sWordLower )
 {
+//fdo#61251 if it's an exact match, ensure unchanged 
replacement
+//exists as a candidate
+if (rStr.startsWith(rWord))
+m_aHelpStrings.push_back(rStr);
+
 if ( aWordCase == CASE_LOWER )
 m_aHelpStrings.push_back( rCC.lowercase( rStr ) );
 else if ( aWordCase == CASE_SENTENCE )
@@ -5878,6 +5883,10 @@ void QuickHelpData::FillStrArr( SwWrtShell rSh, const 
OUString rWord )
 for (unsigned int i= 0; istrings.size(); i++)
 {
 OUString aCompletedString = strings[i];
+//fdo#61251 if it's an exact match, ensure unchanged replacement
+//exists as a candidate
+if (aCompletedString.startsWith(rWord))
+m_aHelpStrings.push_back(aCompletedString);
 if ( aWordCase == CASE_LOWER )
 m_aHelpStrings.push_back( rCC.lowercase( aCompletedString ) );
 else if ( aWordCase == CASE_SENTENCE )
@@ -5897,11 +5906,28 @@ void QuickHelpData::FillStrArr( SwWrtShell rSh, const 
OUString rWord )
 
 namespace {
 
-struct CompareIgnoreCaseAscii
+class CompareIgnoreCaseAsciiFavorExact
+: public std::binary_functionconst OUString, const OUString, bool
 {
+const OUString m_rOrigWord;
+public:
+CompareIgnoreCaseAsciiFavorExact(const OUString rOrigWord)
+: m_rOrigWord(rOrigWord)
+{
+}
+
 bool operator()(const OUString s1, const OUString s2) const
 {
-return s1.compareToIgnoreAsciiCase(s2)  0;
+int nRet = s1.compareToIgnoreAsciiCase(s2);
+if (nRet == 0)
+{
+//fdo#61251 sort stuff that starts with the exact rOrigWord before
+//another ignore-case candidate
+int n1StartsWithOrig = s1.startsWith(m_rOrigWord) ? 0 : 1;
+int n2StartsWithOrig = s2.startsWith(m_rOrigWord) ? 0 : 1;
+return n1StartsWithOrig  n2StartsWithOrig;
+}
+return nRet  0;
 }
 };
 
@@ -5916,11 +5942,11 @@ struct EqualIgnoreCaseAscii
 } // anonymous namespace
 
 // TODO Implement an i18n aware sort
-void QuickHelpData::SortAndFilter()
+void QuickHelpData::SortAndFilter(const OUString rOrigWord)
 {
 std::sort( m_aHelpStrings.begin(),
m_aHelpStrings.end(),
-   CompareIgnoreCaseAscii() );
+   CompareIgnoreCaseAsciiFavorExact(rOrigWord) );
 
 std::vectorOUString::iterator it = std::unique( m_aHelpStrings.begin(),
 m_aHelpStrings.end(),
@@ -5957,7 +5983,7 @@ void SwEditWin::ShowAutoTextCorrectQuickHelp(
 
 if( !m_pQuickHlpData-m_aHelpStrings.empty() )
 {
-m_pQuickHlpData-SortAndFilter();
+m_pQuickHlpData-SortAndFilter(rWord);
 m_pQuickHlpData-Start( rSh, rWord.getLength() );
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-02-06 Thread Andras Timar
 sw/source/core/fields/chpfld.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 107241c5e2a7b08bab676732ed0185fa843df025
Author: Andras Timar andras.ti...@collabora.com
Date:   Tue Feb 4 20:05:15 2014 +0100

fdo#74489 replace '\n' to ' ' in fields (e.g. multiline headings)

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

diff --git a/sw/source/core/fields/chpfld.cxx b/sw/source/core/fields/chpfld.cxx
index b878ccd..e7fe520 100644
--- a/sw/source/core/fields/chpfld.cxx
+++ b/sw/source/core/fields/chpfld.cxx
@@ -34,7 +34,7 @@ namespace
 
 OUString removeControlChars(OUString sIn)
 {
-OUStringBuffer aBuf(sIn);
+OUStringBuffer aBuf(sIn.replace('\n', ' '));
 sal_Int32 nLen = aBuf.getLength();
 for (sal_Int32 i = 0; i  nLen; ++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-2' - sw/source

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

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

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

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

(regression from 44f971506c0ed37928c48e55d8007f24b0c43a5f)

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

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

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


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

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

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

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

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

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

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


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

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

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

fdo#67238: sw: fix table cell Unprotect

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

(regression from 772101649cf16233bbaf0900aa9ebbc915151a95)

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

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


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

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

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

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

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

(regression from f22006dc6ac34a35a060e15466cf6b2d2058617d)

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

diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index 1e66412..9f7d970 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -568,7 +568,7 @@ sal_Bool SwTxtFly::DrawTextOpaque( SwDrawTextInfo rInf )
 }
 
 Point aPos( rInf.GetPos().X(), rInf.GetPos().Y() + rInf.GetAscent() );
-const Point rOld = rInf.GetPos();
+const Point aOldPos(rInf.GetPos());
 rInf.SetPos( aPos );
 
 if( !bOpaque )
@@ -577,7 +577,7 @@ sal_Bool SwTxtFly::DrawTextOpaque( SwDrawTextInfo rInf )
 rInf.GetFont()-_DrawStretchText( rInf );
 else
 rInf.GetFont()-_DrawText( rInf );
-rInf.SetPos( rOld );
+rInf.SetPos(aOldPos);
 return sal_False;
 }
 else if( !aRegion.empty() )
@@ -595,7 +595,7 @@ sal_Bool SwTxtFly::DrawTextOpaque( SwDrawTextInfo rInf )
 rInf.GetFont()-_DrawText( rInf );
 }
 }
-rInf.SetPos( rOld );
+rInf.SetPos(aOldPos);
 return sal_True;
 }
 
diff --git a/sw/source/core/txtnode/fntcap.cxx 
b/sw/source/core/txtnode/fntcap.cxx
index 0c31695..c435eda 100644
--- a/sw/source/core/txtnode/fntcap.cxx
+++ b/sw/source/core/txtnode/fntcap.cxx
@@ -523,9 +523,9 @@ void SwSubFont::DrawStretchCapital( SwDrawTextInfo rInf )
 if( rInf.GetLen() == STRING_LEN )
 rInf.SetLen( rInf.GetText().getLength() );
 
-const Point rOldPos = rInf.GetPos();
+const Point aOldPos = rInf.GetPos();
 const sal_uInt16 nCapWidth = (sal_uInt16)( GetCapitalSize( rInf ).Width() 
);
-rInf.SetPos( rOldPos );
+rInf.SetPos(aOldPos);
 
 rInf.SetDrawSpace( GetUnderline() != UNDERLINE_NONE ||
GetOverline()  != UNDERLINE_NONE ||
diff --git a/sw/source/core/txtnode/swfont.cxx 
b/sw/source/core/txtnode/swfont.cxx
index 2269f24..21c6601 100644
--- a/sw/source/core/txtnode/swfont.cxx
+++ b/sw/source/core/txtnode/swfont.cxx
@@ -1195,12 +1195,12 @@ void SwSubFont::_DrawText( SwDrawTextInfo rInf, const 
sal_Bool bGrey )
 
 SwDigitModeModifier aDigitModeModifier( rInf.GetOut(), 
rInf.GetFont()-GetLanguage() );
 
+const Point aOldPos(rInf.GetPos());
 Point aPos( rInf.GetPos() );
 
 if( GetEscapement() )
 CalcEsc( rInf, aPos );
 
-const Point rOld = rInf.GetPos();
 rInf.SetPos( aPos );
 rInf.SetKern( CheckKerning() + rInf.GetSperren() / 
SPACING_PRECISION_FACTOR );
 
@@ -1300,7 +1300,7 @@ void SwSubFont::_DrawText( SwDrawTextInfo rInf, const 
sal_Bool bGrey )
 rInf.SetLen( nOldLen );
 }
 
-rInf.SetPos( rOld );
+rInf.SetPos(aOldPos);
 }
 
 void SwSubFont::_DrawStretchText( SwDrawTextInfo rInf )
@@ -1325,13 +1325,13 @@ void SwSubFont::_DrawStretchText( SwDrawTextInfo rInf )
 
 rInf.ApplyAutoColor();
 
+const Point aOldPos(rInf.GetPos());
 Point aPos( rInf.GetPos() );
 
 if( GetEscapement() )
 CalcEsc( rInf, aPos );
 
 rInf.SetKern( CheckKerning() + rInf.GetSperren() / 
SPACING_PRECISION_FACTOR );
-const Point rOld = rInf.GetPos();
 rInf.SetPos( aPos );
 
 if( IsCapital() )
@@ -1382,7 +1382,7 @@ void SwSubFont::_DrawStretchText( SwDrawTextInfo rInf )
 rInf.SetLen( nOldLen );
 }
 
-rInf.SetPos( rOld );
+rInf.SetPos(aOldPos);
 }
 
 xub_StrLen SwSubFont::_GetCrsrOfst( SwDrawTextInfo rInf )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-01-20 Thread Michael Stahl
 sw/source/core/crsr/findtxt.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 22183794b50d3d55094e1363755af74a10a4b555
Author: Michael Stahl mst...@redhat.com
Date:   Fri Jan 17 23:09:50 2014 +0100

fdo#73660: sw: fix Find of words containing soft-hyphen

Soft hyphen was not detected if there is no hint (-1).

(regression from ebeff3f074dd94dce4ce6cc55abd0495103684bd)

Change-Id: I09108796a32429a01eff93f797a6de521ab1d08a
(cherry picked from commit 156a0235bd8ff06840cecad1e70a57ffc5b8e7e1)
Reviewed-on: https://gerrit.libreoffice.org/7511
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 796da83..5567cfa 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -89,7 +89,9 @@ lcl_CleanStr(const SwTxtNode rNd, sal_Int32 const nStart, 
sal_Int32 rEnd,
 bNewHint = true;
 }
 // Check if next stop is a soft hyphen.
-else if (-1 != nSoftHyphen  nSoftHyphen  nHintStart  nSoftHyphen 
 nEnd)
+else if (   -1 != nSoftHyphen
+  (-1 == nHintStart || nSoftHyphen  nHintStart)
+  nSoftHyphen  nEnd)
 {
 nStt = nSoftHyphen;
 bNewSoftHyphen = 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-2' - sw/source

2014-01-16 Thread Michael Stahl
 sw/source/core/tox/tox.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 1fd6ebac89a83e6ceecd69f0c6c807d8ee8b5c81
Author: Michael Stahl mst...@redhat.com
Date:   Tue Jan 14 23:58:11 2014 +0100

fdo#73162: sw: un-break index entries that contain text separators

SwFormTokensHelper::SearchNextToken() does some check that the  token
terminator is not inside a pair of TOX_STYLE_DELIMITER; this check was
broken by commit f4fd558ac9d61fe06aa0f56d829916ef9e5ee7b9 and finds a
 outside of TOX_STYLE_DELIMITER bracketing.

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

diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx
index 43be3a5..a8e2f1a 100644
--- a/sw/source/core/tox/tox.cxx
+++ b/sw/source/core/tox/tox.cxx
@@ -823,8 +823,12 @@ OUString SwFormTokensHelper::SearchNextToken( const 
OUString  sPattern,
 }
 else
 {
+// apparently the TOX_STYLE_DELIMITER act as a bracketing for
+// TOKEN_TEXT tokens so that the user can have '' inside the text...
 const sal_Int32 nTextSeparatorFirst = sPattern.indexOf( 
TOX_STYLE_DELIMITER, nStt );
-if( nTextSeparatorFirst=0  
nTextSeparatorFirst+1sPattern.getLength())
+if (nTextSeparatorFirst = 0
+  nTextSeparatorFirst + 1  sPattern.getLength()
+  nTextSeparatorFirst  nEnd)
 {
 const sal_Int32 nTextSeparatorSecond = sPattern.indexOf( 
TOX_STYLE_DELIMITER,
  
nTextSeparatorFirst + 1 );
@@ -832,6 +836,7 @@ OUString SwFormTokensHelper::SearchNextToken( const 
OUString  sPattern,
 if( nEnd  nTextSeparatorSecond )
 nEnd = sPattern.indexOf( '', nTextSeparatorSecond );
 // FIXME: No check to verify that nEnd is still =0?
+assert(nEnd = 0);
 }
 
 ++nEnd;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-01-16 Thread Michael Stahl
 sw/source/ui/index/cnttab.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit c3e7723500275d04177d366b50356807c16e9be1
Author: Michael Stahl mst...@redhat.com
Date:   Thu Jan 16 15:58:12 2014 +0100

fdo#73043: sw: fix Index/TOC Assign Styles dialog

SvTabListBox::GetEntryText(pEntry, 0x) will append 10 tabs to the
returned string, so it will no longer be equal to a style name.

(regression from 77173d8954c370bcaca80b48181c330b759b9517)

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

diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index d38c8ee..db42723 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -728,7 +728,7 @@ SwAddStylesDlg_Impl::SwAddStylesDlg_Impl(Window* pParent,
 if (!aName.isEmpty())
 {
 SvTreeListEntry* pEntry = m_pHeaderTree-First();
-while (pEntry  m_pHeaderTree-GetEntryText(pEntry)!=aName)
+while (pEntry  m_pHeaderTree-GetEntryText(pEntry, 0) != aName)
 {
 pEntry = m_pHeaderTree-Next(pEntry);
 }
@@ -757,7 +757,7 @@ IMPL_LINK_NOARG(SwAddStylesDlg_Impl, OkHdl)
 sal_IntPtr nLevel = (sal_IntPtr)pEntry-GetUserData();
 if(nLevel != USHRT_MAX)
 {
-OUString sName(m_pHeaderTree-GetEntryText(pEntry));
+OUString sName(m_pHeaderTree-GetEntryText(pEntry, 0));
 if(!pStyleArr[nLevel].isEmpty())
 pStyleArr[nLevel] += OUString(TOX_STYLE_DELIMITER);
 pStyleArr[nLevel] += sName;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-01-16 Thread Michael Stahl
 sw/source/core/txtnode/txtedt.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b8c6514b483edfcedb3ce546cdea726b83d418a5
Author: Michael Stahl mst...@redhat.com
Date:   Mon Jan 13 18:36:04 2014 +0100

fdo#72788: sw: fix infinite loop in SwTxtAttr::RstTxtAttr

The increment was erroneously moved into the else branch in commit
c1c5feaff453cfbb23c43f2b423201b883ff048d.

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

diff --git a/sw/source/core/txtnode/txtedt.cxx 
b/sw/source/core/txtnode/txtedt.cxx
index e1eb5c3..ecd75e8 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -613,8 +613,8 @@ void SwTxtNode::RstTxtAttr(
 }
 }
 }
-++i;
 }
+++i;
 }
 
 TryDeleteSwpHints();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

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

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

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

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

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

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


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

2014-01-15 Thread Stephan Bergmann
 sw/source/ui/docvw/edtwin.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3367c68cff05114e0243313f974a0c4f56c39e99
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Jan 15 16:45:40 2014 +0100

String::Len was used in a non-bool context here

...so 79f52d249fe043e6ec54be6ffa0c71a748920394 convert 
sw/source/ui/inc/e*.hxx
from String to OUString should have converted it to call 
OUString::getLength,
not OUString::isEmpty.

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

diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index 5a45f43..2e981c4 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -2396,7 +2396,7 @@ KEYINPUT_CHECKTABLE_INSDEL:
 {
 OUStringBuffer aBuf(m_aInBuffer);
 comphelper::string::padToLength(aBuf,
-!m_aInBuffer.isEmpty() + aKeyEvent.GetRepeat() + 1, 
aCh);
+m_aInBuffer.getLength() + aKeyEvent.GetRepeat() + 1, 
aCh);
 m_aInBuffer = aBuf.makeStringAndClear();
 bFlushCharBuffer = Application::AnyInput( 
VCL_INPUT_KEYBOARD );
 bFlushBuffer = !bFlushCharBuffer;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-01-15 Thread Stephan Bergmann
 sw/source/ui/shells/tabsh.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 97531f23406c810ca9486b6609a394da96d27566
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Jan 15 17:43:21 2014 +0100

Fix brace position

Presumably a typo during conflict resolution for
d02f75a8c36705924ddd6a5921fe3012fafce812 Resolves: #i121420# merge sidebar
feature.

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

diff --git a/sw/source/ui/shells/tabsh.cxx b/sw/source/ui/shells/tabsh.cxx
index 17d7a31..44ddfca 100644
--- a/sw/source/ui/shells/tabsh.cxx
+++ b/sw/source/ui/shells/tabsh.cxx
@@ -1243,7 +1243,7 @@ void SwTableShell::GetState(SfxItemSet rSet)
 case SID_TABLE_VERT_BOTTOM:
 {
 sal_uInt16 nAlign = rSh.GetBoxAlign();
-sal_Bool bSet = nSlot == (SID_TABLE_VERT_NONE  nAlign == 
text::VertOrientation::NONE) ||
+sal_Bool bSet = (nSlot == SID_TABLE_VERT_NONE  nAlign == 
text::VertOrientation::NONE) ||
 (nSlot == SID_TABLE_VERT_CENTER  nAlign == 
text::VertOrientation::CENTER) ||
 (nSlot == SID_TABLE_VERT_BOTTOM  nAlign == 
text::VertOrientation::BOTTOM);
 rSet.Put(SfxBoolItem(nSlot, bSet));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-01-15 Thread Stephan Bergmann
 sw/source/filter/ww8/wrtww8.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 370204f97ff950b6bae9c9d9a91da5ef1baeff10
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Jan 15 18:44:34 2014 +0100

String::Len was used in a non-bool context here

...and apparently erroneously got rewritten as a call to OUString::isEmpty
instead of OUString::getLength in the conflict resolution of
7ec7a9a68b4a9c5600840a34434fc800cda3d815 Fix #120224# Mapping the text 
rotation
in Writer table cell with MSO.

Change-Id: If02687437848917f64b8f92f323979ccb51aaad2
(cherry picked from commit 60af010a98540b4785353b27ccbb545ef72e7791)
Reviewed-on: https://gerrit.libreoffice.org/7450
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com

diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index e6f7ea1..2716a79 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -1993,7 +1993,7 @@ static sal_uInt16 lcl_TCFlags(SwDoc rDoc, const 
SwTableBox * pBox, sal_Int32 nR
 if( pCNd  pCNd-IsTxtNode())
 {
 SfxItemSet aCoreSet(rDoc.GetAttrPool(), RES_CHRATR_ROTATE, 
RES_CHRATR_ROTATE);
-((SwTxtNode*)pCNd)-GetAttr( aCoreSet, 0, 
!((SwTxtNode*)pCNd)-GetTxt().isEmpty());
+((SwTxtNode*)pCNd)-GetAttr( aCoreSet, 0, 
((SwTxtNode*)pCNd)-GetTxt().getLength());
 const SvxCharRotateItem * pRotate = NULL;
 const SfxPoolItem * pRotItem;
 if ( SFX_ITEM_SET == aCoreSet.GetItemState(RES_CHRATR_ROTATE, 
sal_True, pRotItem))
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-01-14 Thread Caolán McNamara
 sw/source/core/view/vnew.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 806d7e4237726bfe75d1c18fb0edbdfec675648a
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Nov 26 10:23:06 2013 +

mbTiledRendering is uninitialized

Change-Id: I98f1d81aa58d013c5f2042e2c4b76c4ebccf7120
(cherry picked from commit 1d648282596ec06fdfd111e29c8328c1f3c07500)
Signed-off-by: Michael Stahl mst...@redhat.com

diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx
index 1efee42..990a5dfb 100644
--- a/sw/source/core/view/vnew.cxx
+++ b/sw/source/core/view/vnew.cxx
@@ -157,6 +157,7 @@ SwViewShell::SwViewShell( SwDoc rDocument, Window *pWindow,
 mbShowHeaderSeparator( false ),
 mbShowFooterSeparator( false ),
 mbHeaderFooterEdit( false ),
+mbTiledRendering(false),
 mpTargetPaintWindow(0), // #i74769#
 mpBufferedOut(0), // #i74769#
 mpDoc( rDocument ),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

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

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

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

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

Thanks a lot mst__ for pointing how to fix this!

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

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


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

2013-12-30 Thread Caolán McNamara
 sw/source/core/inc/frame.hxx  |2 +-
 sw/source/core/layout/layact.cxx  |2 +-
 sw/source/core/layout/pagechg.cxx |   12 +++-
 3 files changed, 13 insertions(+), 3 deletions(-)

New commits:
commit 582d3cb9346e0e1c1c3dc3188cd28976ac24e1bf
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Dec 30 00:47:02 2013 +

valgrind: invalid read on deleted SwPageFrm

VALGRIND=memcheck make CppunitTest_sw_ooxmlimport

==2829== Invalid read of size 2
==2829==at 0x10B9A2CC: SwPageFrm::GetPhyPageNum() const 
(pagefrm.hxx:191)
==2829==by 0x1107A768: SwLayAction::InternalAction() (layact.cxx:573)
==2829==by 0x1107A0B6: SwLayAction::Action() (layact.cxx:448)
==2829==by 0x114E025E: SwViewShell::CalcLayout() (viewsh.cxx:915)
==2829==by 0xFC52E5B: SwModelTestBase::calcLayout() 
(swmodeltestbase.hxx:214)
==2829==by 0xFC54167: SwModelTestBase::load(char const*, char const*) 
(swmodeltestbase.hxx:425)
==2829==by 0xFC52A74: SwModelTestBase::executeImportTest(char const*) 
(swmodeltestbase.hxx:131)
==2829==by 0xFC6B046: testN830205::Import() (ooxmlimport.cxx:1248)
==2829==by 0xFC99A6B: CppUnit::TestCallertestN830205::runTest() 
(TestCaller.h:166)
==2829==by 0x4CAE1D3: CppUnit::TestCaseMethodFunctor::operator()() 
const (TestCase.cpp:32)
==2829==by 0xCF009E2: (anonymous 
namespace)::Prot::protect(CppUnit::Functor const, CppUnit::ProtectorContext 
const) (unobootstrapprotector.cxx:88)
==2829==by 0x4CA630E: 
CppUnit::ProtectorChain::ProtectFunctor::operator()() const 
(ProtectorChain.cpp:20)
==2829==by 0xBB0E535: (anonymous 
namespace)::Prot::protect(CppUnit::Functor const, CppUnit::ProtectorContext 
const) (unoexceptionprotector.cxx:64)
==2829==by 0x4CA630E: 
CppUnit::ProtectorChain::ProtectFunctor::operator()() const 
(ProtectorChain.cpp:20)
==2829==by 0x4C97C83: 
CppUnit::DefaultProtector::protect(CppUnit::Functor const, 
CppUnit::ProtectorContext const) (DefaultProtector.cpp:15)
==2829==by 0x4CA630E: 
CppUnit::ProtectorChain::ProtectFunctor::operator()() const 
(ProtectorChain.cpp:20)
==2829==by 0x4CA61A3: CppUnit::ProtectorChain::protect(CppUnit::Functor 
const, CppUnit::ProtectorContext const) (ProtectorChain.cpp:77)
==2829==by 0x4CBD3B9: CppUnit::TestResult::protect(CppUnit::Functor 
const, CppUnit::Test*, std::string const) (TestResult.cpp:181)
==2829==by 0x4CADCA3: CppUnit::TestCase::run(CppUnit::TestResult*) 
(TestCase.cpp:92)
==2829==by 0x4CAEA3F: 
CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) 
(TestComposite.cpp:64)
==2829==by 0x4CAE8C9: CppUnit::TestComposite::run(CppUnit::TestResult*) 
(TestComposite.cpp:23)
==2829==by 0x4CAEA3F: 
CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) 
(TestComposite.cpp:64)
==2829==by 0x4CAE8C9: CppUnit::TestComposite::run(CppUnit::TestResult*) 
(TestComposite.cpp:23)
==2829==by 0x4CC45A5: 
CppUnit::TestRunner::WrappingSuite::run(CppUnit::TestResult*) 
(TestRunner.cpp:47)
==2829==by 0x4CBD0C3: CppUnit::TestResult::runTest(CppUnit::Test*) 
(TestResult.cpp:148)
==2829==by 0x4CC4803: CppUnit::TestRunner::run(CppUnit::TestResult, 
std::string const) (TestRunner.cpp:96)
==2829==by 0x403F3E: (anonymous 
namespace)::ProtectedFixtureFunctor::run() const (cppunittester.cxx:150)
==2829==by 0x4045C6: sal_main() (cppunittester.cxx:242)
==2829==by 0x40420E: main (cppunittester.cxx:166)
==2829==  Address 0x2b4bbd48 is 312 bytes inside a block of size 320 free'd
==2829==at 0x4A074C4: free (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==2829==by 0x4F386E7: rtl_freeMemory_SYSTEM(void*) 
(alloc_global.cxx:276)
==2829==by 0x4F3899E: rtl_freeMemory (alloc_global.cxx:346)
==2829==by 0x4F37494: rtl_cache_free (alloc_cache.cxx:1231)
==2829==by 0x13D7EF6D: FixedMemPool::Free(void*) (mempool.cxx:48)
==2829==by 0x1106890F: SwPageFrm::operator delete(void*, unsigned long) 
(in /home/caolan/LibreOffice/core/instdir/program/libswlo.so)
==2829==by 0x110A113A: SwPageFrm::~SwPageFrm() (pagechg.cxx:301)
==2829==by 0x110A3713: SwFrm::CheckPageDescs(SwPageFrm*, unsigned char) 
(pagechg.cxx:1122)
==2829==by 0x1107A717: SwLayAction::InternalAction() (layact.cxx:566)
==2829==by 0x1107A0B6: SwLayAction::Action() (layact.cxx:448)
==2829==by 0x114E025E: SwViewShell::CalcLayout() (viewsh.cxx:915)
==2829==by 0xFC52E5B: SwModelTestBase::calcLayout() 
(swmodeltestbase.hxx:214)
==2829==by 0xFC54167: SwModelTestBase::load(char const*, char const*) 
(swmodeltestbase.hxx:425)
==2829==by 0xFC52A74: SwModelTestBase::executeImportTest(char const*) 
(swmodeltestbase.hxx:131)
==2829==by 0xFC6B046: testN830205::Import() (ooxmlimport.cxx:1248)
==2829==by 0xFC99A6B: 

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

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

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

Fix stepping to the next change

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

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

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

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


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

2013-12-27 Thread Caolán McNamara
 sw/source/ui/config/optload.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5f9c2a1f731d9e1e4708bb91b5e71bc0b4cc70e0
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Dec 27 13:49:52 2013 +

use SfxSingleTabDialogBase here now

Change-Id: Ibd5d82f93fb94db3e8d53acc9df05f2459807bb4
(cherry picked from commit d61a27f278e8442d54d52115981b5235f230ac80)

diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx
index 4a6d5b2..1f275dc 100644
--- a/sw/source/ui/config/optload.cxx
+++ b/sw/source/ui/config/optload.cxx
@@ -746,7 +746,7 @@ IMPL_LINK_NOARG(SwCaptionOptPage, ModifyHdl)
 {
 OUString sFldTypeName = m_pCategoryBox-GetText();
 
-SfxNoLayoutSingleTabDialog *pDlg = 
dynamic_castSfxNoLayoutSingleTabDialog*(GetParentDialog());
+SfxSingleTabDialogBase *pDlg = 
dynamic_castSfxSingleTabDialogBase*(GetParentDialog());
 PushButton *pBtn = pDlg ? pDlg-GetOKButton() : NULL;
 if (pBtn)
 pBtn-Enable(!sFldTypeName.isEmpty());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

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

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

fdo#67370: Hyphens are not visible in tagged PDF

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

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

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

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

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


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

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

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

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

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

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

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


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

2013-12-10 Thread Oliver-Rainer Wittmann
 sw/source/core/crsr/swcrsr.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 33cbbd3a3a969b8ffd1e0155d5c84da8e1a2f863
Author: Oliver-Rainer Wittmann o...@apache.org
Date:   Tue Dec 10 15:24:52 2013 +

Related: #i33737# correction: assure the selections does not...

start/end inside a table while end/start of the selection is outside the 
table

(cherry picked from commit 382814ccb30bfe71f093e55e23802447caca235d)

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

Change-Id: Ibcbd9b18538ce04abfae11e75b30d6897a62e268
(cherry picked from commit 3fc6fc2ff7304a0d1bc85bd2e03fb3fbab492c9a)

diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index dcd81fb..d27ebca 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -448,10 +448,9 @@ sal_Bool SwCursor::IsSelOvr( int eFlags )
 }
 }
 
+const SwTableNode* pPtNd = GetPoint()-nNode.GetNode().FindTableNode();
+const SwTableNode* pMrkNd = GetMark()-nNode.GetNode().FindTableNode();
 // both in no or in same table node
-const SwTableNode* pPtNd = pNd-FindTableNode();
-const SwTableNode* pMrkNd = pNd-FindTableNode();
-// beide in keinem oder beide im gleichen TableNode
 if( ( !pMrkNd  !pPtNd ) || pPtNd == pMrkNd )
 return 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-2' - sw/source

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

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

fdo#72488: Broken text when showing visible space

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

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

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

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


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

2013-12-04 Thread Miklos Vajna
 sw/source/filter/ww8/rtfexport.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 8807ba77453962dddeceba28ca3d5ad8633d7090
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Wed Dec 4 10:51:48 2013 +0100

SwRTFWriter: fix string conversion

Regression from 02bfed8a53556badfea637930b05d923cf9465f2 (convert
sw/source/filter/ww8/*.cxx from String to OUString, 2013-10-14), check
for string length before invoking OUString::operator[].

This can be reproduced if copypasting some text inside a Writer doc
from normal text to rectangle shapes inside group shapes.

Change-Id: Ia8f774b27ca63773792e6af913dfe7e493bea4b8
(cherry picked from commit 1da04bd7a8a804cbfb1d01a3102b1b76cc557122)

diff --git a/sw/source/filter/ww8/rtfexport.cxx 
b/sw/source/filter/ww8/rtfexport.cxx
index 05647b9..93a1cf3 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -1178,7 +1178,7 @@ SwRTFWriter::SwRTFWriter( const OUString rFltName, const 
OUString  rBaseURL )
 SAL_INFO(sw.rtf, OSL_THIS_FUNC);
 SetBaseURL( rBaseURL );
 // export outline nodes, only (send outline to clipboard/presentation)
-m_bOutOutlineOnly = 'O' == rFltName[0];
+m_bOutOutlineOnly = (!rFltName.isEmpty()  'O' == rFltName[0]);
 }
 
 SwRTFWriter::~SwRTFWriter()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

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

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

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

Change-Id: I50319fb218518edd23ff8c859c355265595050d6
(cherry picked from commit f141505929c95c97ae4765d7c7221f07e41ef8e7)

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


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

2013-12-03 Thread Michael Stahl
 sw/source/core/doc/docnew.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 3dbe28273f963b1b20312eb27869bb3f5cccae7c
Author: Michael Stahl mst...@redhat.com
Date:   Tue Dec 3 13:43:33 2013 +0100

Revert sw: valgrind complains about uninitialized mbIsPrepareSelAll

Oops, that one is master-only.

This reverts commit eeca244139eec880f0eb0141243de98c3d85be9a.

Change-Id: Ibb65fb17304cbd405096afbbdde7fff11a91c4f6

diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index b9fcfb6..5385509 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -277,7 +277,6 @@ SwDoc::SwDoc()
 mbLinksUpdated( false ), //#i38810#
 mbClipBoard( false ),
 mbColumnSelection( false ),
-mbIsPrepareSelAll(false),
 #ifdef DBG_UTIL
 mbXMLExport(false),
 #endif
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-11-26 Thread Rodolfo Ribeiro Gomes
 sw/source/ui/dbui/mailmergechildwindow.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit aa3297af50b9a197428565bb927cf566a9198435
Author: Rodolfo Ribeiro Gomes rodolf...@gmail.com
Date:   Mon Nov 25 23:34:09 2013 -0200

Mailmerge shows wrong number of emails to be sent

The progress bar is ok, but the text is displayed with the total
number of registers instead of the amount selected to be used.

Change-Id: I81da0e7ba9f193366e12cbf81118e36a43bcaad4
Signed-off-by: Rodolfo Ribeiro Gomes rodolf...@gmail.com
Reviewed-on: https://gerrit.libreoffice.org/6810
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com
(cherry picked from commit eda8111fdf9b1c69935237106a73d1c53c2776e1)

diff --git a/sw/source/ui/dbui/mailmergechildwindow.cxx 
b/sw/source/ui/dbui/mailmergechildwindow.cxx
index 682ab22..c1dc07a 100644
--- a/sw/source/ui/dbui/mailmergechildwindow.cxx
+++ b/sw/source/ui/dbui/mailmergechildwindow.cxx
@@ -648,7 +648,7 @@ void SwSendMailDialog::UpdateTransferStatus()
 {
 OUString sStatus( m_sTransferStatus );
 sStatus = sStatus.replaceFirst(%1, OUString::number(m_nSendCount) );
-sStatus = sStatus.replaceFirst(%2, 
OUString::number(m_pImpl-nDocumentCount));
+sStatus = sStatus.replaceFirst(%2, 
OUString::number(m_pImpl-aDescriptors.size()));
 m_aTransferStatusFT.SetText(sStatus);
 
 sStatus = m_sErrorStatus.replaceFirst(%1, 
OUString::number(m_nErrorCount) );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

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

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

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

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

diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index a2478fb..6317f38 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -141,7 +141,7 @@ namespace {
 {
 bool bRet( false );
 
-if ( rTxtNode.AreListLevelIndentsApplicable() )
+if ( rTxtNode.GetNumRule()  rTxtNode.AreListLevelIndentsApplicable() 
)
 {
 int nListLevel = rTxtNode.GetActualListLevel();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits