[Libreoffice-commits] .: Branch 'libreoffice-3-5' - 2 commits - sw/source

2012-04-18 Thread Miklos Vajna
 sw/source/core/layout/paintfrm.cxx |   36 
 1 file changed, 24 insertions(+), 12 deletions(-)

New commits:
commit fe2a1f6bcb72b17d050355377b68e986f17cf1ff
Author: Michael Stahl mst...@redhat.com
Date:   Tue Apr 17 22:30:25 2012 +0200

fdo#38635: sw: fix border corner gaps:

The start and end points of the vertical and adjacent horizontal borders
were apart by 1.5 to 3 twips, leading to small visible gaps in the corners.
This is fixed by using lcl_AlignWidth/lcl_AlignHeight on the border widths,
and by always computing the start/end positions from the outer edge,
which makes the horizontal and vertical start/end points match.
(regression from 0f0896c26fb260d1bbf31d7a886df3f61837f0f2)
(cherry picked from commit b08e9f3023e9ea1ca0926334becac939ca8fdfac)

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

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index 0a451b8..69e32ff 100755
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -4483,8 +4483,13 @@ void lcl_PaintLeftRightLine( const sal_Bool 
_bLeft,
 nExtentOE = lcl_GetExtent( pBottomBorder, NULL );
 }
 
-basegfx::B2DPoint aStart( aRect.Left() + aRect.Width() / 2.0, 
aRect.Top() + lcl_GetLineWidth( pTopBorder ) / 2.0 );
-basegfx::B2DPoint aEnd( aRect.Left() + aRect.Width() / 2.0, 
aRect.Bottom() - lcl_GetLineWidth( pBottomBorder ) / 2.0 );
+double const fStartX( (_bLeft) // fdo#38635: always from outer edge
+? aRect.Left()  + (aRect.Width() / 2.0)
+: aRect.Right() - (aRect.Width() / 2.0));
+basegfx::B2DPoint const aStart(fStartX,
+aRect.Top() + lcl_AlignHeight(lcl_GetLineWidth(pTopBorder))/2.0 );
+basegfx::B2DPoint const aEnd(fStartX,
+aRect.Bottom() - 
lcl_AlignHeight(lcl_GetLineWidth(pBottomBorder))/2.0 );
 
 double nLeftWidth = !_bLeft ? pLeftRightBorder-GetOutWidth() : 
pLeftRightBorder-GetInWidth( );
 double nRightWidth = !_bLeft ? pLeftRightBorder-GetInWidth() : 
pLeftRightBorder-GetOutWidth( );
@@ -4558,8 +4563,15 @@ void lcl_PaintTopBottomLine( const sal_Bool 
_bTop,
 nExtentOE = lcl_GetExtent( NULL, pRightBorder );
 }
 
-basegfx::B2DPoint aStart( aRect.Left() + lcl_GetLineWidth( pLeftBorder 
) / 2.0, aRect.Top() + aRect.Height() / 2.0 );
-basegfx::B2DPoint aEnd( aRect.Right() - lcl_GetLineWidth( pRightBorder 
) / 2.0, aRect.Top() + aRect.Height() / 2.0 );
+double const fStartY( (_bTop) // fdo#38635: always from outer edge
+? aRect.Top()+ (aRect.Height() / 2.0)
+: aRect.Bottom() - (aRect.Height() / 2.0));
+basegfx::B2DPoint const aStart(
+aRect.Left() + lcl_AlignWidth(lcl_GetLineWidth(pLeftBorder))/2.0,
+fStartY );
+basegfx::B2DPoint const aEnd(
+aRect.Right() - lcl_AlignWidth(lcl_GetLineWidth(pRightBorder))/2.0,
+fStartY );
 
 double nLeftWidth = !_bTop ? pTopBottomBorder-GetOutWidth() : 
pTopBottomBorder-GetInWidth( );
 double nRightWidth = !_bTop ? pTopBottomBorder-GetInWidth() : 
pTopBottomBorder-GetOutWidth( );
commit d53367946360483ffbc1bcd5babcfcef795507ce
Author: Michael Stahl mst...@redhat.com
Date:   Sun Apr 15 15:28:50 2012 +0200

sw: create horizontal border lines with start left and end right

(cherry picked from commit 1d5e263a129c56e561ce145bad9749027c583a75)

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

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index 659606f..0a451b8 100755
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -4545,21 +4545,21 @@ void lcl_PaintTopBottomLine( const sal_Bool 
_bTop,
 
 if ( lcl_GetLineWidth( pTopBottomBorder )  0 )
 {
-double nExtentIS = lcl_GetExtent( pRightBorder, NULL );
-double nExtentIE = lcl_GetExtent( pLeftBorder, NULL );
-double nExtentOS = lcl_GetExtent( NULL, pRightBorder );
-double nExtentOE = lcl_GetExtent( NULL, pLeftBorder );
+double nExtentIS = lcl_GetExtent( NULL, pLeftBorder );
+double nExtentIE = lcl_GetExtent( NULL, pRightBorder );
+double nExtentOS = lcl_GetExtent( pLeftBorder, NULL );
+double nExtentOE = lcl_GetExtent( pRightBorder, NULL );
 
 if ( !_bTop )
 {
-nExtentIS = lcl_GetExtent( NULL, pRightBorder );
-nExtentIE = lcl_GetExtent( NULL, pLeftBorder );
-nExtentOS = lcl_GetExtent( pRightBorder, NULL );
-nExtentOE = lcl_GetExtent( pLeftBorder, NULL );
+nExtentIS = lcl_GetExtent( pLeftBorder, NULL );
+nExtentIE = lcl_GetExtent( pRightBorder, NULL );
+nExtentOS = lcl_GetExtent( NULL, pLeftBorder );
+nExtentOE = lcl_GetExtent( NULL, pRightBorder );
  

[Libreoffice-commits] .: Branch 'libreoffice-3-5' - 2 commits - sw/source

2012-03-01 Thread Miklos Vajna
 sw/source/core/inc/frame.hxx  |2 ++
 sw/source/core/inc/layfrm.hxx |4 +++-
 sw/source/core/inc/rootfrm.hxx|2 +-
 sw/source/core/inc/sectfrm.hxx|2 +-
 sw/source/core/layout/newfrm.cxx  |9 -
 sw/source/core/layout/sectfrm.cxx |   13 +
 sw/source/core/layout/ssfrm.cxx   |   22 +++---
 7 files changed, 43 insertions(+), 11 deletions(-)

New commits:
commit 5bfeedfcfd542717f40693524dcb7808f23ab42f
Author: Michael Stahl mst...@redhat.com
Date:   Mon Feb 27 20:43:27 2012 +0100

SwSectionFrm: initialised members are happy members

Valgrind complained about uninitialised use in
SwSectionFrm::_CheckClipping (sectfrm.cxx:).
(cherry picked from commit f430b71c46186b53a6364a60b237c81245f3eabb)

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

diff --git a/sw/source/core/inc/sectfrm.hxx b/sw/source/core/inc/sectfrm.hxx
index bc16e52..c3beb2e 100644
--- a/sw/source/core/inc/sectfrm.hxx
+++ b/sw/source/core/inc/sectfrm.hxx
@@ -71,7 +71,7 @@ protected:
 public:
 SwSectionFrm( SwSection , SwFrm* ); //Inhalt wird nicht 
erzeugt!
 SwSectionFrm( SwSectionFrm , sal_Bool bMaster );//_Nur_ zum Erzeugen von 
Master/Follows
-~SwSectionFrm();
+virtual ~SwSectionFrm();
 
 void Init();
 virtual void  CheckDirection( sal_Bool bVert );
diff --git a/sw/source/core/layout/sectfrm.cxx 
b/sw/source/core/layout/sectfrm.cxx
index 3f2ea28..35d38d1 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -71,10 +71,15 @@ SV_IMPL_PTRARR_SORT( SwDestroyList, SwSectionFrmPtr )
 |*  SwSectionFrm::SwSectionFrm(), ~SwSectionFrm()
 |*
 |*/
-SwSectionFrm::SwSectionFrm( SwSection rSect, SwFrm* pSib ) :
-SwLayoutFrm( rSect.GetFmt(), pSib ),
-SwFlowFrm( (SwFrm)*this ),
-pSection( rSect )
+SwSectionFrm::SwSectionFrm( SwSection rSect, SwFrm* pSib )
+: SwLayoutFrm( rSect.GetFmt(), pSib )
+, SwFlowFrm( static_castSwFrm(*this) )
+, pSection( rSect )
+, bFtnAtEnd(false)
+, bEndnAtEnd(false)
+, bCntntLock(false)
+, bOwnFtnNum(false)
+, bFtnLock(false)
 {
 nType = FRMC_SECTION;
 
commit 8e28ba240ae2f958a67c2502546651bd9aed76cd
Author: Michael Stahl mst...@redhat.com
Date:   Mon Feb 27 20:43:27 2012 +0100

SwRootFrm::~SwRootFrm: refactor:

Since CWS swlayoutrefactoring the SwRootFrms are destroyed with
SwDoc::IsInDtor not set.  This can cause at least reads of freed
SwRootFrm members when executing the dtors of SwRootFrm base class
SwLayoutFrm calling into SwRootFrm::GetPageAtPos.

Prevent this scenario by:
- moving the implementation of SwRootFrm base class dtors to new
  methods SwFrm::Destroy and SwLayoutFrm::Destroy
- calling SwFrm::Destroy and SwLayoutFrm::Destroy explicitly before
  SwRootFrm members are freed
(cherry picked from commit ebb74441790a9852b1a1532d6e025c324666f6fc)

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

diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 7e4a389..34fcb4b 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -401,6 +401,8 @@ protected:
 void ColLock()  { bColLocked = sal_True; }
 void ColUnlock(){ bColLocked = sal_False; }
 
+void Destroy(); // for ~SwRootFrm
+
 // Only used by SwRootFrm Ctor to get 'this' into mpRoot...
 void setRootFrm( SwRootFrm* pRoot ) { mpRoot = pRoot; }
 
diff --git a/sw/source/core/inc/layfrm.hxx b/sw/source/core/inc/layfrm.hxx
index 1144a9d..4c4e4e6 100644
--- a/sw/source/core/inc/layfrm.hxx
+++ b/sw/source/core/inc/layfrm.hxx
@@ -56,6 +56,8 @@ class SwLayoutFrm: public SwFrm
 
 void CopySubtree( const SwLayoutFrm *pDest );
 protected:
+void Destroy(); // for ~SwRootFrm
+
 virtual void Format( const SwBorderAttrs *pAttrs = 0 );
 virtual void MakeAll();
 
@@ -104,7 +106,7 @@ public:
const sal_Bool bDefaultExpand = sal_True ) 
const;
 
 SwLayoutFrm( SwFrmFmt*, SwFrm* );
-~SwLayoutFrm();
+virtual ~SwLayoutFrm();
 
 virtual void Paint( SwRect const,
 SwPrintData const*const pPrintData = NULL ) const;
diff --git a/sw/source/core/inc/rootfrm.hxx b/sw/source/core/inc/rootfrm.hxx
index 788fc55..7e07fae 100644
--- a/sw/source/core/inc/rootfrm.hxx
+++ b/sw/source/core/inc/rootfrm.hxx
@@ -177,7 +177,7 @@ public:
 static sal_Bool HasSameRect( const SwRect rRect );
 
 SwRootFrm( SwFrmFmt*, ViewShell* );
-~SwRootFrm();
+virtual ~SwRootFrm();
 void Init(SwFrmFmt*);
 
 ViewShell *GetCurrShell() const { return pCurrShell; }
diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index 3b6b920..5277d83 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -629,8 +629,15 @@ SwRootFrm::~SwRootFrm()
 

[Libreoffice-commits] .: Branch 'libreoffice-3-5' - 2 commits - sw/source

2012-02-06 Thread Michael Stahl
 sw/source/filter/ww8/rtfattributeoutput.cxx |   14 +-
 sw/source/filter/ww8/rtfattributeoutput.hxx |5 +++
 sw/source/filter/ww8/rtfsdrexport.cxx   |   36 
 sw/source/filter/ww8/rtfsdrexport.hxx   |3 ++
 4 files changed, 51 insertions(+), 7 deletions(-)

New commits:
commit d2e2e3817376787f1804ee808bd37cc99815799a
Author: Michael Stahl mst...@redhat.com
Date:   Mon Feb 6 16:09:49 2012 +0100

RtfSdrExport::StartShape: replace 75
(cherry picked from commit 8411534883e960a8404d24937f813eb20accecdd)

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

diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx 
b/sw/source/filter/ww8/rtfsdrexport.cxx
index 9ba99a4..e78d73c 100644
--- a/sw/source/filter/ww8/rtfsdrexport.cxx
+++ b/sw/source/filter/ww8/rtfsdrexport.cxx
@@ -480,7 +480,7 @@ sal_Int32 RtfSdrExport::StartShape()
 return -1;
 
 m_aShapeProps.insert(std::pairOString,OString(OString(shapeType), 
OString::valueOf(sal_Int32(m_nShapeType;
-if (m_nShapeType == 75)
+if (ESCHER_ShpInst_PictureFrame == m_nShapeType)
 impl_writeGraphic();
 
 m_rAttrOutput.RunText().append('{').append(OOO_STRING_SVTOOLS_RTF_SHP);
commit ec0f75dffbdea7b508f1476fde90d1aeab6afde5
Author: Miklos Vajna vmik...@frugalware.org
Date:   Sun Feb 5 00:24:08 2012 +0100

fdo#42656 fix RTF export of picture frame shape type
(cherry picked from commit 32fa7e9208b2053d2ff7743b88b0c0edacb8a7e7)

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

diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx 
b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 9ade064..b66f84f 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -3139,7 +3139,7 @@ static bool StripMetafileHeader(const sal_uInt8 
*rpGraphicAry, unsigned long r
 return false;
 }
 
-static OString WriteHex(const sal_uInt8* pData, sal_uInt32 nSize, sal_uInt32 
nLimit = 64)
+OString RtfAttributeOutput::WriteHex(const sal_uInt8* pData, sal_uInt32 nSize, 
sal_uInt32 nLimit)
 {
 OStringBuffer aRet;
 
@@ -3160,17 +3160,17 @@ static OString WriteHex(const sal_uInt8* pData, 
sal_uInt32 nSize, sal_uInt32 nLi
 return aRet.makeStringAndClear();
 }
 
-static OString WriteHex(sal_Int32 nNum)
+OString RtfAttributeOutput::WriteHex(sal_Int32 nNum)
 {
-return WriteHex((sal_uInt8*)nNum, sizeof(sal_Int32));
+return RtfAttributeOutput::WriteHex((sal_uInt8*)nNum, sizeof(sal_Int32));
 }
 
-static OString WriteHex(OString sString)
+OString RtfAttributeOutput::WriteHex(OString sString)
 {
 OStringBuffer aRet;
 
 aRet.append(WriteHex(sString.getLength()+1));
-aRet.append(WriteHex((sal_uInt8*)sString.getStr(), sString.getLength()+1));
+aRet.append(RtfAttributeOutput::WriteHex((sal_uInt8*)sString.getStr(), 
sString.getLength()+1));
 
 return aRet.makeStringAndClear();
 }
@@ -3253,7 +3253,7 @@ static OString ExportPICT( const SwFlyFrmFmt* pFlyFrmFmt, 
const Size rOrig, con
 StripMetafileHeader(pGraphicAry, nSize);
 }
 aRet.append(RtfExport::sNewLine);
-aRet.append(WriteHex(pGraphicAry, nSize));
+aRet.append(RtfAttributeOutput::WriteHex(pGraphicAry, nSize));
 aRet.append('}');
 }
 return aRet.makeStringAndClear();
@@ -3286,7 +3286,7 @@ void RtfAttributeOutput::FlyFrameOLEData( SwOLENode 
rOLENode )
 const sal_uInt8* pNativeData = (sal_uInt8*)pStream-GetData();
 m_aRunText.append(WriteHex(nNativeDataSize));
 m_aRunText.append(RtfExport::sNewLine);
-m_aRunText.append(WriteHex(pNativeData, nNativeDataSize, 126));
+m_aRunText.append(RtfAttributeOutput::WriteHex(pNativeData, 
nNativeDataSize, 126));
 m_aRunText.append(RtfExport::sNewLine);
 delete pStream;
 
diff --git a/sw/source/filter/ww8/rtfattributeoutput.hxx 
b/sw/source/filter/ww8/rtfattributeoutput.hxx
index c96de2c..8766c5a 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.hxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.hxx
@@ -561,6 +561,11 @@ public:
 
 /// Font pitch.
 void FontPitchType( FontPitch ePitch ) const;
+
+/// Writes binary data as a hex dump.
+static rtl::OString WriteHex(const sal_uInt8* pData, sal_uInt32 nSize, 
sal_uInt32 nLimit = 64);
+static rtl::OString WriteHex(sal_Int32 nNum);
+static rtl::OString WriteHex(rtl::OString sString);
 };
 
 #endif // _RTFATTRIBUTEOUTPUT_HXX_
diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx 
b/sw/source/filter/ww8/rtfsdrexport.cxx
index badda4e..9ba99a4 100644
--- a/sw/source/filter/ww8/rtfsdrexport.cxx
+++ b/sw/source/filter/ww8/rtfsdrexport.cxx
@@ -29,10 +29,13 @@
 
 #include rtfsdrexport.hxx
 #include rtfattributeoutput.hxx
+#include rtfexportfilter.hxx
 
 #include svtools/rtfkeywd.hxx
 #include editeng/editobj.hxx
 #include svx/svdotext.hxx
+#include svx/unoapi.hxx
+#include vcl/cvtgrf.hxx
 
 using rtl::OString;
 using rtl::OStringBuffer;
@@ -438,6 +441,37 @@ void 

[Libreoffice-commits] .: Branch 'libreoffice-3-5' - 2 commits - sw/source

2012-01-30 Thread Michael Stahl
 sw/source/core/fields/reffld.cxx |   39 ---
 1 file changed, 24 insertions(+), 15 deletions(-)

New commits:
commit 5de902f2b66e64bc4b4755356db3b259c01ddcdd
Author: Cédric Bosdonnat cedric.bosdonnat@free.fr
Date:   Mon Jan 30 11:35:42 2012 +0100

fdo#35669: more robust references merging
(cherry picked from commit 458d56d9b35f2ecb2eea2589737079390b10ee26)

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

diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index c15c542..eca22ba 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -974,11 +974,13 @@ void _RefIdsMap::Init( SwDoc rDoc, SwDoc rDestDoc, 
sal_Bool bField )
 GetFieldIdsFromDoc( rDoc, aDstIds );
 
 // Define the mappings now
-sal_uInt16 nMaxDstId = *aIds.end();
+sal_uInt16 nMaxDstId = -1;
+if ( !aIds.empty() )
+nMaxDstId = *aIds.rbegin();
 
 // Map all the src fields to their value + nMaxDstId
 for ( std::setsal_uInt16::iterator pIt = aDstIds.begin(); pIt != 
aDstIds.end(); ++pIt )
-AddId( nMaxDstId++, *pIt );
+AddId( ++nMaxDstId, *pIt );
 
 // Change the Sequence number of all the SetExp fields in the 
destination document
 SwFieldType* pType = rDoc.GetFldType( RES_SETEXPFLD, aName, false );
commit d3294590d6c15205cc0a176e96ef04f2816079cd
Author: Cédric Bosdonnat cedric.bosdonnat@free.fr
Date:   Thu Jan 26 15:30:01 2012 +0100

fdo#35669: properly merge ref fields in master documents
(cherry picked from commit 5e51960dede5015b862df05b7b16f02884647889)

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

diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index 98111d0..c15c542 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -972,6 +972,26 @@ void _RefIdsMap::Init( SwDoc rDoc, SwDoc rDestDoc, 
sal_Bool bField )
 {
 GetFieldIdsFromDoc( rDestDoc, aIds );
 GetFieldIdsFromDoc( rDoc, aDstIds );
+
+// Define the mappings now
+sal_uInt16 nMaxDstId = *aIds.end();
+
+// Map all the src fields to their value + nMaxDstId
+for ( std::setsal_uInt16::iterator pIt = aDstIds.begin(); pIt != 
aDstIds.end(); ++pIt )
+AddId( nMaxDstId++, *pIt );
+
+// Change the Sequence number of all the SetExp fields in the 
destination document
+SwFieldType* pType = rDoc.GetFldType( RES_SETEXPFLD, aName, false );
+if( pType )
+{
+SwIteratorSwFmtFld,SwFieldType aIter( *pType );
+for( SwFmtFld* pF = aIter.First(); pF; pF = aIter.Next() )
+if( pF-GetTxtFld() )
+{
+sal_uInt16 n = 
((SwSetExpField*)pF-GetFld())-GetSeqNumber( );
+((SwSetExpField*)pF-GetFld())-SetSeqNumber( 
sequencedIds[ n ] );
+}
+}
 }
 else
 {
@@ -1030,21 +1050,8 @@ void _RefIdsMap::Check( SwDoc rDoc, SwDoc rDestDoc, 
SwGetRefField rFld,
 AddId( n, nSeqNo );
 rFld.SetSeqNo( n );
 
-// und noch die Felder oder Fuss-/EndNote auf die neue
-// Id umsetzen
-if( bField )
-{
-SwFieldType* pType = rDoc.GetFldType( RES_SETEXPFLD, aName, 
false );
-if( pType )
-{
-SwIteratorSwFmtFld,SwFieldType aIter( *pType );
-for( SwFmtFld* pF = aIter.First(); pF; pF = aIter.Next() )
-if( pF-GetTxtFld()  nSeqNo ==
-((SwSetExpField*)pF-GetFld())-GetSeqNumber() )
-((SwSetExpField*)pF-GetFld())-SetSeqNumber( n );
-}
-}
-else
+// und noch die Fuss-/EndNote auf die neue Id umsetzen
+if( !bField )
 {
 SwTxtFtn* pFtnIdx;
 for( sal_uInt16 i = 0, nCnt = rDoc.GetFtnIdxs().Count(); i  
nCnt; ++i )
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - 2 commits - sw/source writerfilter/source

2012-01-20 Thread Cédric Bosdonnat
 sw/source/ui/docvw/PageBreakWin.cxx|   22 --
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   19 ---
 2 files changed, 32 insertions(+), 9 deletions(-)

New commits:
commit 23ac66dd14d09acc07868ee75da05073c6a78f44
Author: Miklos Vajna vmik...@frugalware.org
Date:   Fri Jan 20 01:36:25 2012 +0100

Fix RTF import of dotted and word underline

The problem was that these are flags, not toggles.

Signed-off-by: Cédric Bosdonnat cedric.bosdonnat@free.fr

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 82b2a31..62445de 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1455,6 +1455,21 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
 checkUnicode();
 RTFSkipDestination aSkip(*this);
 int nParam = -1;
+int nSprm = -1;
+
+// Map all underline flags to a single sprm.
+switch (nKeyword)
+{
+case RTF_ULD: nSprm = 4; break;
+case RTF_ULW: nSprm = 2; break;
+default: break;
+}
+if (nSprm = 0)
+{
+RTFValue::Pointer_t pValue(new RTFValue(nSprm));
+m_aStates.top().aCharacterSprms-push_back(make_pair(NS_sprm::LN_CKul, 
pValue));
+return 0;
+}
 
 // Indentation
 switch (nKeyword)
@@ -2558,11 +2573,10 @@ int RTFDocumentImpl::dispatchToggle(RTFKeyword 
nKeyword, bool bParam, int nParam
 int nSprm = -1;
 RTFValue::Pointer_t pBoolValue(new RTFValue(!bParam || nParam != 0));
 
-// Map all underline keywords to a single sprm.
+// Map all underline toggles to a single sprm.
 switch (nKeyword)
 {
 case RTF_UL: nSprm = 1; break;
-case RTF_ULD: nSprm = 4; break;
 case RTF_ULDASH: nSprm = 7; break;
 case RTF_ULDASHD: nSprm = 9; break;
 case RTF_ULDASHDD: nSprm = 10; break;
@@ -2576,7 +2590,6 @@ int RTFDocumentImpl::dispatchToggle(RTFKeyword nKeyword, 
bool bParam, int nParam
 case RTF_ULTHDASHDD: nSprm = 26; break;
 case RTF_ULTHLDASH: nSprm = 55; break;
 case RTF_ULULDBWAVE: nSprm = 43; break;
-case RTF_ULW: nSprm = 2; break;
 case RTF_ULWAVE: nSprm = 11; break;
 default: break;
 }
commit 0c8c85ec6ec3a19f86df844b59b2f540d8972186
Author: Cédric Bosdonnat cedric.bosdonnat@free.fr
Date:   Fri Jan 20 15:40:02 2012 +0100

Revert Page Breaks: IsLeaveWindow() is unreliable, we do not need it here.

This reverts commit 1e0de54d88a79c99f0671f608f7de096cb721537. This
commit introduces the button flickering behavior.

diff --git a/sw/source/ui/docvw/PageBreakWin.cxx 
b/sw/source/ui/docvw/PageBreakWin.cxx
index ff5050b..0edeb61 100644
--- a/sw/source/ui/docvw/PageBreakWin.cxx
+++ b/sw/source/ui/docvw/PageBreakWin.cxx
@@ -83,11 +83,17 @@ namespace
 
 void SwBreakDashedLine::MouseMove( const MouseEvent rMEvt )
 {
-Point aEventPos( GetPosPixel() + rMEvt.GetPosPixel() );
-if ( !m_pWin-Contains( aEventPos ) )
-m_pWin-Fade( false );
+if ( rMEvt.IsLeaveWindow() )
+{
+// don't fade if we just move to the 'button'
+Point aEventPos( GetPosPixel() + rMEvt.GetPosPixel() );
+if ( !m_pWin-Contains( aEventPos ) )
+m_pWin-Fade( false );
+}
 else if ( !m_pWin-IsVisible() )
+{
 m_pWin-Fade( true );
+}
 
 if ( !rMEvt.IsSynthetic() )
 {
@@ -303,9 +309,13 @@ void SwPageBreakWin::Select( )
 
 void SwPageBreakWin::MouseMove( const MouseEvent rMEvt )
 {
-Point aEventPos( rMEvt.GetPosPixel() + rMEvt.GetPosPixel() );
-if ( !Contains( aEventPos )  !PopupMenu::IsInExecute() )
-Fade( false );
+if ( rMEvt.IsLeaveWindow() )
+{
+// don't fade if we just move to the 'line', or the popup menu is open
+Point aEventPos( rMEvt.GetPosPixel() + rMEvt.GetPosPixel() );
+if ( !Contains( aEventPos )  !PopupMenu::IsInExecute() )
+Fade( false );
+}
 else if ( !IsVisible() )
 Fade( true );
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - 2 commits - sw/source

2012-01-10 Thread Michael Stahl
 sw/source/ui/inc/navmgr.hxx   |   29 +++---
 sw/source/ui/wrtsh/navmgr.cxx |   87 +-
 sw/source/ui/wrtsh/wrtsh1.cxx |2 
 3 files changed, 62 insertions(+), 56 deletions(-)

New commits:
commit debb4be8886a4c5fd0a714dfd1b53306b836b800
Author: Michael Stahl mst...@redhat.com
Date:   Tue Jan 10 22:07:29 2012 +0100

sw: SwNavigationMgr: don't store SwPositions

Using SwPosition to store the history is an awful ideal as that isn't
corrected when the node it points to is deleted, which could cause
crashes when the user then wants to jump there.
SwUnoCrsr looks like a better fit as it is automatically corrected.
(cherry picked from commit 0e898354fc76339a9a007b30f1ebe123981d0426)

diff --git a/sw/source/ui/inc/navmgr.hxx b/sw/source/ui/inc/navmgr.hxx
index 423c3eb..29b63de 100644
--- a/sw/source/ui/inc/navmgr.hxx
+++ b/sw/source/ui/inc/navmgr.hxx
@@ -29,29 +29,32 @@
 #ifndef SW_NAVMGR_HXX
 #define SW_NAVMGR_HXX
 
+#include vector
+
+#include boost/shared_ptr.hpp
+
 #include swtypes.hxx
-#include pam.hxx
-#include swdllapi.h
 
 class   SwWrtShell;
 struct  SwPosition;
+class SwUnoCrsr;
+
 
 class SwNavigationMgr
 {
 private:
 /*
  * List of entries in the navigation history
- * Each entry is a SwPosition, which represents a position within the 
document
- * SwPosition is given by a node index (SwNodeIndex) which usually 
represents the paragraph the position is in
- * and an index (SwIndex), which represents the position inside this 
paragraph.
- * You can find more on SwPositions at 
http://wiki.services.openoffice.org/wiki/Writer_Core_And_Layout
+ * Entries are SwUnoCrsr because thos gets corrected automatically
+ * when nodes are deleted.
  *
  * The navigation history behaves as a stack, to which items are added 
when we jump to a new position
  * (e.g. click a link, or double click an entry from the navigator).
  * Every use of the back/forward buttons results in moving the stack 
pointer within the navigation history
  */
-std::vectorSwPosition m_entries;
-std::vectorSwPosition::size_type m_nCurrent; /* Current position within 
the navigation history */
+typedef ::std::vector ::boost::shared_ptrSwUnoCrsr  Stack_t;
+Stack_t m_entries;
+Stack_t::size_type m_nCurrent; /* Current position within the navigation 
history */
 SwWrtShell  m_rMyShell; /* The active shell within which the navigation 
occurs */
 
 void GotoSwPosition(const SwPosition rPos);
diff --git a/sw/source/ui/wrtsh/navmgr.cxx b/sw/source/ui/wrtsh/navmgr.cxx
index f2d7460..6ee6222 100644
--- a/sw/source/ui/wrtsh/navmgr.cxx
+++ b/sw/source/ui/wrtsh/navmgr.cxx
@@ -33,6 +33,8 @@
 #include sfx2/viewfrm.hxx
 #include cmdid.h
 #include view.hxx
+#include doc.hxx
+#include unocrsr.hxx
 
 #include com/sun/star/frame/XLayoutManager.hpp
 
@@ -134,7 +136,7 @@ void SwNavigationMgr::goBack()  {
 }
 m_nCurrent--;
 /* Position cursor to appropriate navigation history entry */
-GotoSwPosition(m_entries[m_nCurrent]);
+GotoSwPosition(*m_entries[m_nCurrent]-GetPoint());
 /* Refresh the buttons */
 if (bForwardWasDisabled)
 
m_rMyShell.GetView().GetViewFrame()-GetBindings().Invalidate(FN_NAVIGATION_FORWARD);
@@ -161,7 +163,7 @@ void SwNavigationMgr::goForward() {
  * We have to increment it to go to the next entry
  */
 m_nCurrent++;
-GotoSwPosition(m_entries[m_nCurrent]);
+GotoSwPosition(*m_entries[m_nCurrent]-GetPoint());
 /* Refresh the buttons */
 if (bBackWasDisabled)
 
m_rMyShell.GetView().GetViewFrame()-GetBindings().Invalidate(FN_NAVIGATION_BACK);
@@ -188,30 +190,31 @@ bool SwNavigationMgr::addEntry(const SwPosition rPos) {
 int curr = m_nCurrent; /* Index from which we'll twist the tail. */
 int n = (number_ofm_entries - curr) / 2; /* Number of entries that 
will swap places */
 for (int i = 0; i  n; i++) {
-SwPosition temp = m_entries[curr + i];
-m_entries[curr + i] = m_entries[number_ofm_entries -1 - i];
-m_entries[number_ofm_entries -1 - i] = temp;
+::std::swap(m_entries[curr + i], m_entries[number_ofm_entries -1 - 
i]);
 }
 
-   if (m_entries.back() != rPos)
-   m_entries.push_back(rPos);
-
-
+if (*m_entries.back()-GetPoint() != rPos)
+{
+SwUnoCrsr *const pCursor = 
m_rMyShell.GetDoc()-CreateUnoCrsr(rPos);
+m_entries.push_back(::boost::shared_ptrSwUnoCrsr(pCursor));
+}
 bRet = true;
 }
 else {
-if ( (m_entries.size()  0  m_entries.back() != rPos) || 
(m_entries.size() == 0) ) {
-m_entries.push_back(rPos);
+if ( (m_entries.size()  0  *m_entries.back()-GetPoint() != rPos) 
|| (m_entries.size() == 0) ) {
+SwUnoCrsr *const pCursor =