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

2012-04-18 Thread Petr Mladek
 sw/source/core/view/viewsh.cxx |   32 ++--
 1 file changed, 18 insertions(+), 14 deletions(-)

New commits:
commit 43b48f05e5aa3359a0227550b9a5c88851a582d2
Author: Caolán McNamara 
Date:   Sat Apr 14 07:56:45 2012 +0100

optimize: traverse children with WINDOW_FIRSTCHILD/WINDOW_NEXT

Signed-off-by: Petr Mladek 

diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 0413382..f0dd635 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -368,25 +368,29 @@ void ViewShell::ImplEndAction( const sal_Bool bIdleEnd )
 if ( GetWin() )
 {
 Window& rWindow = *(GetWin());
-if(rWindow.IsChildTransparentModeEnabled() && 
rWindow.GetChildCount())
+if (rWindow.IsChildTransparentModeEnabled())
 {
-const Rectangle 
aRectanglePixel(rWindow.LogicToPixel(aRect.SVRect()));
-
-for ( sal_uInt16 a(0); a < 
rWindow.GetChildCount(); a++ )
+Window* pCandidate = rWindow.GetWindow( 
WINDOW_FIRSTCHILD );
+if (pCandidate)
 {
-Window* pCandidate = rWindow.GetChild(a);
+const Rectangle 
aRectanglePixel(rWindow.LogicToPixel(aRect.SVRect()));
 
-if ( pCandidate && 
pCandidate->IsPaintTransparent() )
+while (pCandidate)
 {
-const Rectangle aCandidatePosSizePixel(
-pCandidate->GetPosPixel(),
-
pCandidate->GetSizePixel());
-
-if ( 
aCandidatePosSizePixel.IsOver(aRectanglePixel) )
+if ( pCandidate->IsPaintTransparent() )
 {
-pCandidate->Invalidate( 
INVALIDATE_NOTRANSPARENT|INVALIDATE_CHILDREN );
-pCandidate->Update();
-}
+const Rectangle aCandidatePosSizePixel(
+
pCandidate->GetPosPixel(),
+
pCandidate->GetSizePixel());
+
+if ( 
aCandidatePosSizePixel.IsOver(aRectanglePixel) )
+{
+pCandidate->Invalidate( 
INVALIDATE_NOTRANSPARENT|INVALIDATE_CHILDREN );
+pCandidate->Update();
+}
+}
+
+pCandidate = pCandidate->GetWindow( 
WINDOW_NEXT );
 }
 }
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-04-17 Thread Petr Mladek
 sw/source/core/layout/pagechg.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 2d7ce65af37195343ff74b9e01c60f4b86eb6ebe
Author: Andreas Schierl 
Date:   Mon Jan 30 23:34:56 2012 +0100

ClrContourCache for SwAnchoredDrawObjects (fdo#45376)

call it only for contour wrapped drawing objects

Signed-off-by: Petr Mladek 

diff --git a/sw/source/core/layout/pagechg.cxx 
b/sw/source/core/layout/pagechg.cxx
index 79d7d1b..ef0d1c8 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -39,6 +39,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -2035,6 +2036,10 @@ void lcl_MoveAllLowerObjs( SwFrm* pFrm, const Point& 
rOffset )
 const Point aNewAnchorPos( ( aCurrAnchorPos + rOffset ) );
 pAnchoredDrawObj->DrawObj()->SetAnchorPos( aNewAnchorPos );
 pAnchoredDrawObj->SetLastObjRect( 
pAnchoredDrawObj->GetObjRect().SVRect() );
+
+// clear contour cache
+if ( pAnchoredDrawObj->GetFrmFmt().GetSurround().IsContour() )
+ClrContourCache( pAnchoredDrawObj->GetDrawObj() );
 }
 // #i92511#
 // cache for object rectangle inclusive spaces has to be invalidated.
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-04-17 Thread Miklos Vajna
 sw/source/core/layout/paintfrm.cxx |   67 -
 1 file changed, 67 deletions(-)

New commits:
commit f20c1f3081c98cfb03940318e4ba7ec33f624aec
Author: Michael Stahl 
Date:   Mon Apr 16 16:12:39 2012 +0200

fdo#38635: fix border printing:

Apparently this special case in lcl_PaintLeftRightLine for printer
output devices is no longer necessary with the new drawing layer borders
and causes the vertical border lines to be far too short, leading to
visible gaps in the PDF.
(regression from 0f0896c26fb260d1bbf31d7a886df3f61837f0f2)

(cherry picked from commit 502c93143ef29989692ca3e63e3e6abc255fd53f)

Signed-off-by: Miklos Vajna 

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index 3a93e47..659606f 100755
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -4462,73 +4462,6 @@ void lcl_PaintLeftRightLine( const sal_Bool 
_bLeft,
 if ( _rAttrs.JoinedWithNext( _rFrm ) ) pBottomBorder = NULL;
 }
 
-// OD 06.05.2003 #107169# - adjustments for printer output device
-if ( bPrtOutputDev )
-{
-// substract width of outer top line.
-if ( rBox.GetTop() && (!bCnt || _rAttrs.GetTopLine( _rFrm )) )
-{
-long nDist = ::lcl_AlignHeight( rBox.GetTop()->GetOutWidth() );
-(aRect.*_rRectFn->fnSubTop)( -nDist );
-// OD 19.05.2003 #109667# - If outer top line is hair line, 
calculated
-// top has to be adjusted.
-if ( nDist == 1 )
-{
-if ( _rFrm.IsVertical() )
-{
-// right of border rectangle has to be checked and adjusted
-Point aCompPt( aRect.Right(), 0 );
-Point aRefPt( aCompPt.X() + 1, aCompPt.Y() );
-lcl_CompPxPosAndAdjustPos( *(pGlobalShell->GetOut()),
-  aRefPt, aCompPt,
-  sal_True, -1 );
-aRect.Right( aCompPt.X() );
-}
-else
-{
-// top of border rectangle has to be checked and adjusted
-Point aCompPt( 0, aRect.Top() );
-Point aRefPt( aCompPt.X(), aCompPt.Y() - 1 );
-lcl_CompPxPosAndAdjustPos( *(pGlobalShell->GetOut()),
-  aRefPt, aCompPt,
-  sal_False, +1 );
-aRect.Top( aCompPt.Y() );
-}
-}
-}
-// substract width of outer bottom line.
-if ( rBox.GetBottom() && (!bCnt || _rAttrs.GetBottomLine( _rFrm )) )
-{
-long nDist = ::lcl_AlignHeight( rBox.GetBottom()->GetOutWidth());
-(aRect.*_rRectFn->fnAddBottom)( -nDist );
-// OD 19.05.2003 #109667# - If outer bottom line is hair line, 
calculated
-// top has to be adjusted.
-if ( nDist == 1 )
-{
-if ( _rFrm.IsVertical() )
-{
-// left of border rectangle has to be checked and adjusted
-Point aCompPt( aRect.Left(), 0 );
-Point aRefPt( aCompPt.X() - 1, aCompPt.Y() );
-lcl_CompPxPosAndAdjustPos( *(pGlobalShell->GetOut()),
-  aRefPt, aCompPt,
-  sal_True, +1 );
-aRect.Left( aCompPt.X() );
-}
-else
-{
-// bottom of border rectangle has to be checked and 
adjusted
-Point aCompPt( 0, aRect.Bottom() );
-Point aRefPt( aCompPt.X(), aCompPt.Y() + 1 );
-lcl_CompPxPosAndAdjustPos( *(pGlobalShell->GetOut()),
-  aRefPt, aCompPt,
-  sal_False, -1 );
-aRect.Bottom( aCompPt.Y() );
-}
-}
-}
-}
-
 if ( !pLeftRightBorder->GetInWidth() )
 {
 // OD 06.05.2003 #107169# - add 6th parameter
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-04-05 Thread Caolán McNamara
 sw/source/ui/index/cnttab.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 37c1a9fde189f3010eec7392c44404e403555c52
Author: Ivan Timofeev 
Date:   Wed Apr 4 18:38:07 2012 +0400

fdo#40948: TOC dialog, Entries tab: the right arrow button does not work

regression from 39b8a5f87f55abe53488c9c3c35b65fb0df84cd.
(cherry picked from commit b49f69aee6f48fb9367a2a9548182dcd84eb5296)

Signed-off-by: Caolán McNamara 

diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 30f3a84..cb07f71 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -3419,7 +3419,7 @@ IMPL_LINK(SwTokenWindow, ScrollHdl, ImageButton*, pBtn )
 {
 //move the right neighbor  to the right edge right aligned
 ctrl_reverse_iterator itRight = it;
---it;
+--itRight;
 Control *pRight = *itRight;
 nMove = nSpace - pRight->GetPosPixel().X() - 
pRight->GetSizePixel().Width();
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-03-26 Thread Caolán McNamara
 sw/source/core/edit/edundo.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 4822b5312b61c1b7991ad028c4c43a2d8fce513f
Author: Michael Stahl 
Date:   Thu Mar 22 23:03:05 2012 +0100

fdo#39003: fix autoformat Undo cursors:

SwEditShell::Undo: Because the Undo actions nowadays create new shell
cursors directly (while previously they worked on a SwUndoIter), it is
necessary to remove the shell cursor ring before Pop() because Pop(false)
only restores the current cursor from the stack, not the rest of the ring.
(regression from CWS undoapi, 1ba0c1878116ada5dc4ebdecdb1e0a3da9758547)
(cherry picked from commit f24153cded54954da7f0d80941707715c78e4627)

Signed-off-by: Caolán McNamara 

diff --git a/sw/source/core/edit/edundo.cxx b/sw/source/core/edit/edundo.cxx
index 7b2ae83..118b3f9 100644
--- a/sw/source/core/edit/edundo.cxx
+++ b/sw/source/core/edit/edundo.cxx
@@ -142,6 +142,10 @@ bool SwEditShell::Undo(sal_uInt16 const nCount)
 .getStr());
 }
 
+if (bRestoreCrsr)
+{   // fdo#39003 Pop does not touch the rest of the cursor ring
+KillPams(); // so call this first to get rid of unwanted cursors
+}
 Pop( !bRestoreCrsr );
 
 GetDoc()->SetRedlineMode( eOld );
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-03-24 Thread Miklos Vajna
 sw/source/core/docnode/nodes.cxx |   34 +-
 sw/source/core/txtnode/ndtxt.cxx |6 ++
 2 files changed, 23 insertions(+), 17 deletions(-)

New commits:
commit b8fe125186a6a99f12a22e50d578e4aabd8aac14
Author: Michael Stahl 
Date:   Wed Mar 21 10:25:45 2012 +0100

rhbz#789022: SwNodes: fix inconsistent outline check:

SwNodes::UpdateOutlineNode will add/remove the node from
SwNodes::pOutlineNds depending on IsOutline(), while various SwNodes
methods that move and delete nodes check GetAttrOutlineLevel() != 0,
which may be false even if IsOutline() is true.
(cherry picked from commit 082906e1f4cf58fdfab1a4064e2b7955fcdaeb8a)

Signed-off-by: Miklos Vajna 

diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index 6d0e45b..55c1613 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -173,7 +173,7 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz,
 
 pTxtNode->RemoveFromList();
 
-if ( pTxtNode->GetAttrOutlineLevel() != 0 )//<-end,zhaojianwei
+if (pTxtNode->IsOutline())
 {
 const SwNodePtr pSrch = (SwNodePtr)&rNd;
 pOutlineNds->Remove( pSrch );
@@ -188,8 +188,7 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz,
 
 rTxtNd.AddToList();
 
-if( bInsOutlineIdx &&
-0 != rTxtNd.GetAttrOutlineLevel() )//<-end,zhaojianwei
+if (bInsOutlineIdx && rTxtNd.IsOutline())
 {
 const SwNodePtr pSrch = (SwNodePtr)&rNd;
 pOutlineNds->Insert( pSrch );
@@ -232,9 +231,11 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz,
 {
 SwTxtNode* pTxtNd = (SwTxtNode*)pNd;
 
-// loesche die Gliederungs-Indizies aus dem alten Nodes-Array
-if( 0 != pTxtNd->GetAttrOutlineLevel() )//<-end,zhaojianwei
+// remove outline index from old nodes array
+if (pTxtNd->IsOutline())
+{
 pOutlineNds->Remove( pNd );
+}
 
 // muss die Rule kopiere werden?
 if( pDestDoc )
@@ -269,8 +270,7 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz,
 {
 SwpHints * const pHts = pTxtNd->GetpSwpHints();
 // OultineNodes set the new nodes in the array
-if( bInsOutlineIdx &&
-0 != pTxtNd->GetAttrOutlineLevel() ) //#outline 
level,added by zhaojianwei
+if (bInsOutlineIdx && pTxtNd->IsOutline())
 {
 rNds.pOutlineNds->Insert( pTxtNd );
 }
@@ -537,12 +537,12 @@ sal_Bool SwNodes::_MoveNodes( const SwNodeRange& aRange, 
SwNodes & rNodes,
 if( pTmpNd->IsTxtNode() )
 ((SwTxtNode*)pTmpNd)->RemoveFromList();
 
-// setze bei Start/EndNodes die richtigen 
Indizies
-// loesche die Gliederungs-Indizies aus
-// dem alten Nodes-Array
-if( pCNd->IsTxtNode() && 0 !=
-((SwTxtNode*)pCNd)->GetAttrOutlineLevel() 
)//<-end,by zhaojianwei
+// remove outline index from old nodes array
+if (pCNd->IsTxtNode() &&
+static_cast(pCNd)->IsOutline())
+{
 pOutlineNds->Remove( pCNd );
+}
 else
 pCNd = 0;
 }
@@ -572,7 +572,7 @@ sal_Bool SwNodes::_MoveNodes( const SwNodeRange& aRange, 
SwNodes & rNodes,
 SwNode* pNd = &aMvIdx.GetNode();
 
 const bool bOutlNd = pNd->IsTxtNode() &&
-0 != 
((SwTxtNode*)pNd)->GetAttrOutlineLevel();//<-end,zhaojianwei
+static_cast(pNd)->IsOutline();
 // loesche die Gliederungs-Indizies aus
 // dem alten Nodes-Array
 if( bOutlNd )
@@ -1221,14 +1221,15 @@ void SwNodes::Delete(const SwNodeIndex &rIndex, 
sal_uLong nNodes)
 
 if( pNd->IsTxtNode() )
 {
-if( 0 != ((SwTxtNode*)pNd)->GetAttrOutlineLevel() 
&&//<-end,zhaojianwei
+SwTxtNode *const 
pTxtNode(static_cast(pNd));
+if (pTxtNode->IsOutline() &&
 pOutlineNds->Seek_Entry( pNd, &nIdxPos ))
 {

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

2012-03-22 Thread Miklos Vajna
 sw/source/core/doc/doc.cxx  |1 
 sw/source/core/inc/layouter.hxx |9 
 sw/source/core/layout/layouter.cxx  |   48 
 sw/source/core/layout/objectformattertxtfrm.cxx |6 ---
 sw/source/core/text/txtfly.cxx  |3 -
 5 files changed, 1 insertion(+), 66 deletions(-)

New commits:
commit b4b8f6966d5c2d308874f6213e68ecc620e92777
Author: Cédric Bosdonnat 
Date:   Thu Mar 22 14:52:37 2012 +0100

n#750258: removed strange non-wrapping condition

In the bug file, some text wrapping was badly computed when showing the
document (but not at the first rendering) due to that weird NotToWrap
mecahnism in SwLayouter. Checked the original issue i#40155 that
removing this does hurt.

(cherry picked from commit 8a233f17ae589b33e3b54ef9ebb1fcff41ef6cd7)

Signed-off-by: Miklos Vajna 

diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index d07ef90..5a2f44c 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -1822,7 +1822,6 @@ void SwDoc::ClearSwLayouterEntries()
 {
 SwLayouter::ClearMovedFwdFrms( *this );
 SwLayouter::ClearObjsTmpConsiderWrapInfluence( *this );
-SwLayouter::ClearFrmsNotToWrap( *this );
 // #i65250#
 SwLayouter::ClearMoveBwdLayoutInfo( *this );
 }
diff --git a/sw/source/core/inc/layouter.hxx b/sw/source/core/inc/layouter.hxx
index 135263e..4350b95 100644
--- a/sw/source/core/inc/layouter.hxx
+++ b/sw/source/core/inc/layouter.hxx
@@ -68,9 +68,6 @@ class SwLayouter
 SwMovedFwdFrmsByObjPos* mpMovedFwdFrms;
 // --> #i35911#
 SwObjsMarkedAsTmpConsiderWrapInfluence* mpObjsTmpConsiderWrapInfl;
-// --> #i40155# - data structure to collect frames, which are
-// marked not to wrap around objects.
-std::vector< const SwFrm* > maFrmsNotToWrap;
 
 public:
 // --> #i65250#
@@ -148,12 +145,6 @@ public:
 static void InsertObjForTmpConsiderWrapInfluence(
 const SwDoc& _rDoc,
 SwAnchoredObject& _rAnchoredObj );
-// --> #i40155#
-static void ClearFrmsNotToWrap( const SwDoc& _rDoc );
-static void InsertFrmNotToWrap( const SwDoc& _rDoc,
-const SwFrm& _rFrm );
-static bool FrmNotToWrap( const IDocumentLayoutAccess& _rIDLA,
-  const SwFrm& _rFrm );
 // --> #i65250#
 static bool MoveBwdSuppressed( const SwDoc& p_rDoc,
const SwFlowFrm& p_rFlowFrm,
diff --git a/sw/source/core/layout/layouter.cxx 
b/sw/source/core/layout/layouter.cxx
index 3105bce..5ed1712 100644
--- a/sw/source/core/layout/layouter.cxx
+++ b/sw/source/core/layout/layouter.cxx
@@ -440,54 +440,6 @@ void SwLayouter::InsertObjForTmpConsiderWrapInfluence(
 
 _rDoc.GetLayouter()->mpObjsTmpConsiderWrapInfl->Insert( _rAnchoredObj );
 }
-// #i40155#
-void SwLayouter::ClearFrmsNotToWrap( const SwDoc& _rDoc )
-{
-if ( _rDoc.GetLayouter() )
-{
-const_cast(_rDoc).GetLayouter()->maFrmsNotToWrap.clear();
-}
-}
-
-void SwLayouter::InsertFrmNotToWrap( const SwDoc& _rDoc,
- const SwFrm& _rFrm )
-{
-if ( !_rDoc.GetLayouter() )
-{
-const_cast(_rDoc).SetLayouter( new SwLayouter() );
-}
-
-if ( !SwLayouter::FrmNotToWrap( _rDoc, _rFrm ) )
-{
-const_cast(_rDoc).GetLayouter()->maFrmsNotToWrap.push_back( 
&_rFrm );
-}
-}
-
-bool SwLayouter::FrmNotToWrap( const IDocumentLayoutAccess& _rDLA,
-   const SwFrm& _rFrm )
-{
-const SwLayouter* pLayouter = _rDLA.GetLayouter();
-if ( !pLayouter )
-{
-return false;
-}
-else
-{
-bool bFrmNotToWrap( false );
-std::vector< const SwFrm* >::const_iterator aIter =
-pLayouter->maFrmsNotToWrap.begin();
-for ( ; aIter != pLayouter->maFrmsNotToWrap.end(); ++aIter )
-{
-const SwFrm* pFrm = *(aIter);
-if ( pFrm == &_rFrm )
-{
-bFrmNotToWrap = true;
-break;
-}
-}
-return bFrmNotToWrap;
-}
-}
 
 void LOOPING_LOUIE_LIGHT( bool bCondition, const SwTxtFrm& rTxtFrm )
 {
diff --git a/sw/source/core/layout/objectformattertxtfrm.cxx 
b/sw/source/core/layout/objectformattertxtfrm.cxx
index 3ceb54a..c1d8eb8 100644
--- a/sw/source/core/layout/objectformattertxtfrm.cxx
+++ b/sw/source/core/layout/objectformattertxtfrm.cxx
@@ -296,9 +296,6 @@ bool SwObjectFormatterTxtFrm::DoFormatObj( 
SwAnchoredObject& _rAnchoredObj,
   mrAnchorTxtFrm.GetFollow() &&
   mrAnchorTxtFrm.GetFollow()->GetOfst() == 0 )
 {
-SwLayouter::InsertFrmNotToWrap(
-
*(mrAnchorTxtFrm.FindPageFrm()->GetFmt()->GetDoc()),
-mrAnchor

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

2012-03-22 Thread Caolán McNamara
 sw/source/core/text/txtfly.cxx |   11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

New commits:
commit 347bb1634b10eba577742fe8a7edb4b2dd69265d
Author: Cédric Bosdonnat 
Date:   Thu Mar 22 14:27:43 2012 +0100

Revert "make text wrapping work in headers/footers too (fdo#39155)"

This reverts commit e2a8fb0427e6b33a0fd3873bb7e077a6e5da8ebb. This is a
feature, not a bug and would cause loads of documents to be badly
rendered.

Link to the spec that brough that feature:

http://www.openoffice.org/specs/writer/compatibility/adjust-text-wrapping.sxw

Conflicts:

sw/source/core/text/txtfly.cxx
(cherry picked from commit 2a4e77a6f94d35919237b9db9de184e70943fc13)

Conflicts:

sw/source/core/text/txtfly.cxx

diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index 7a7ddf5..8eb06ca 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -1378,7 +1378,14 @@ SwAnchoredObjList* SwTxtFly::InitAnchoredObjList()
 
 const SwSortedObjs *pSorted = pPage->GetSortedObjs();
 const sal_uInt32 nCount = pSorted ? pSorted->Count() : 0;
-const sal_Bool bWrapAllowed = !SwLayouter::FrmNotToWrap( 
*pCurrFrm->GetTxtNode()->getIDocumentLayoutAccess(), *pCurrFrm );
+// --> #108724# Page header/footer content doesn't have to wrap around
+//  floating screen objects
+const bool bFooterHeader = 0 != pCurrFrm->FindFooterOrHeader();
+const IDocumentSettingAccess* pIDSA = 
pCurrFrm->GetTxtNode()->getIDocumentSettingAccess();
+// #i40155# - check, if frame is marked not to wrap
+const sal_Bool bWrapAllowed = ( 
pIDSA->get(IDocumentSettingAccess::USE_FORMER_TEXT_WRAPPING) ||
+( !pCurrFrm->IsInFtn() && !bFooterHeader ) 
) &&
+  !SwLayouter::FrmNotToWrap( 
*pCurrFrm->GetTxtNode()->getIDocumentLayoutAccess(), *pCurrFrm );
 
 bOn = sal_False;
 
@@ -1390,7 +1397,6 @@ SwAnchoredObjList* SwTxtFly::InitAnchoredObjList()
 // #i28701# - consider complete frame area for new
 // text wrapping
 SwRect aRect;
-const IDocumentSettingAccess* pIDSA = 
pCurrFrm->GetTxtNode()->getIDocumentSettingAccess();
 if ( pIDSA->get(IDocumentSettingAccess::USE_FORMER_TEXT_WRAPPING) )
 {
 aRect = pCurrFrm->Prt();
@@ -1406,7 +1412,6 @@ SwAnchoredObjList* SwTxtFly::InitAnchoredObjList()
 const long nRight = (aRect.*fnRect->fnGetRight)() - 1;
 const long nLeft = (aRect.*fnRect->fnGetLeft)() + 1;
 const sal_Bool bR2L = pCurrFrm->IsRightToLeft();
-const bool bFooterHeader = ( pCurrFrm->FindFooterOrHeader() != NULL );
 
 const IDocumentDrawModelAccess* pIDDMA = 
pCurrFrm->GetTxtNode()->getIDocumentDrawModelAccess();
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-03-12 Thread Miklos Vajna
 sw/source/ui/docvw/edtwin.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e73ae4363b55dd544184be1c938f7103f0e64ee3
Author: Michael Stahl 
Date:   Fri Mar 9 20:30:56 2012 +0100

fdo#45962: fix context menu key yanking cursor out of header/footer

For the "context menu" key VCL synthesizes a cursor position that is the
center of the window, hence likely to be in the document body.
When SwEditWin::Command calls lcl_CheckHeaderFooterClick, it then moves
the document view cursor; prevent that by only calling that for actual
mouse events.  (regression from a6176612ff1a6a142a68964b2c0834d28125fc45)

(cherry picked from commit 87279e0e812bac7f2c17f2758a39bcfd942214af)

Signed-off-by: Miklos Vajna 

diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index 66b8fad..05883ee 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -4737,7 +4737,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
 if (rView.GetPostItMgr()->IsHit(rCEvt.GetMousePosPixel()))
 return;
 
-if ( lcl_CheckHeaderFooterClick( rSh,
+if (rCEvt.IsMouseEvent() && lcl_CheckHeaderFooterClick( rSh,
 PixelToLogic( rCEvt.GetMousePosPixel() ), 1 ) )
 return;
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-03-09 Thread Michael Stahl
 sw/source/filter/ww8/docxattributeoutput.cxx |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 6eea398000f04c68f422ab07353ea4631f4edb5e
Author: Luboš Luňák 
Date:   Mon Jan 9 15:51:10 2012 +0100

fdo#46337: don't use an invalidated iterator

(cherry picked from commit 2df1c40b4b7cb3107a68984db644f10097f04c3c)

Signed-off-by: Michael Stahl 

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index d9f3376..0ea06b7 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -517,7 +517,7 @@ void DocxAttributeOutput::StartRun( const SwRedlineData* 
pRedlineData )
 void DocxAttributeOutput::EndRun()
 {
 // Write field starts
-for ( std::vector::iterator pIt = m_Fields.begin(); pIt != 
m_Fields.end(); ++pIt )
+for ( std::vector::iterator pIt = m_Fields.begin(); pIt != 
m_Fields.end(); )
 {
 // Add the fields starts for all but hyperlinks and TOCs
 if ( pIt->bOpen && pIt->pField )
@@ -528,10 +528,11 @@ void DocxAttributeOutput::EndRun()
 // Unknown fields sould be removed too
 if ( !pIt->bClose || ( pIt->eType == ww::eUNKNOWN ) )
 {
-m_Fields.erase( pIt );
---pIt;
+pIt = m_Fields.erase( pIt );
+continue;
 }
 }
+++pIt;
 }
 
 // write the run properties + the text, already in the correct order
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-02-29 Thread Michael Meeks
 sw/source/ui/config/optdlg.src |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a5d6645a72acd9816793532b61ed9d2ac45158b1
Author: Stefan Knorr (astron) 
Date:   Sat Feb 25 11:56:19 2012 +0100

Writer/Options: Move Comments 10 units up

Signed-off-by: Michael Meeks 

diff --git a/sw/source/ui/config/optdlg.src b/sw/source/ui/config/optdlg.src
index 51c947c..a5e7d17 100644
--- a/sw/source/ui/config/optdlg.src
+++ b/sw/source/ui/config/optdlg.src
@@ -171,7 +171,7 @@ TabPage TP_CONTENT_OPT
 CheckBox CB_POSTIT
 {
 HelpID = "sw:CheckBox:TP_CONTENT_OPT:CB_POSTIT";
-Pos = MAP_APPFONT ( 12 , 103 ) ;
+Pos = MAP_APPFONT ( 12 , 93 ) ;
 Size = MAP_APPFONT ( 108 , 10 ) ;
 Text [ en-US ] = "~Comments" ;
 };
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-02-26 Thread Norbert Thiebaud
 sw/source/core/docnode/ndtbl1.cxx |   11 +++
 1 file changed, 3 insertions(+), 8 deletions(-)

New commits:
commit 4f8094d0489d31563f18fb31bad366be2c19046f
Author: Ivan Timofeev 
Date:   Sun Feb 26 19:09:54 2012 +0400

fdo#46144: "Distributy Columns Evenly" does not work with the selected 
columns

regression from f7303fcac779f99931bfba48e8bfcf9c081af67f:

-SvUShorts aWish( nTmp, nTmp ),
+std::vector aWish( nTmp, nTmp ),
   aMins( nTmp, nTmp );

Signed-off-by: Norbert Thiebaud 

diff --git a/sw/source/core/docnode/ndtbl1.cxx 
b/sw/source/core/docnode/ndtbl1.cxx
index 817b1ac..4524a58 100644
--- a/sw/source/core/docnode/ndtbl1.cxx
+++ b/sw/source/core/docnode/ndtbl1.cxx
@@ -1469,16 +1469,11 @@ void SwDoc::AdjustCellWidth( const SwCursor& rCursor, 
sal_Bool bBalance )
 if ( ! aTabCols.Count() )
 return;
 
-const sal_uInt8 nTmp = (sal_uInt8)Max( sal_uInt16(255), 
sal_uInt16(aTabCols.Count() + 1) );
-std::vector aWish( nTmp, nTmp ),
-  aMins( nTmp, nTmp );
+std::vector aWish(aTabCols.Count() + 1);
+std::vector aMins(aTabCols.Count() + 1);
+
 sal_uInt16 i;
 
-for ( i = 0; i <= aTabCols.Count(); ++i )
-{
-aWish.push_back( 0 );
-aMins.push_back( 0 );
-}
 ::lcl_CalcColValues( aWish, aTabCols, pStart, pEnd, sal_True  );
 
 //Es ist Robuster wenn wir die Min-Werte fuer die ganze Tabelle berechnen.
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-02-22 Thread Petr Mladek
 sw/source/filter/xml/xmltexte.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 8a8eb870b8037801f81c680441d10a1ef95bfb06
Author: Michael Meeks 
Date:   Wed Feb 22 16:05:47 2012 +

fdo#33393 - tentative workaround for autosave image loss

cf. lengthy analysis in the bug, this appears to merit wider testing
for 3.5.1 RC1 and wouldn't be sensible without that, so commit early.

Signed-off-by: Michael Stahl 

diff --git a/sw/source/filter/xml/xmltexte.cxx 
b/sw/source/filter/xml/xmltexte.cxx
index c49ec0d..1610a71 100644
--- a/sw/source/filter/xml/xmltexte.cxx
+++ b/sw/source/filter/xml/xmltexte.cxx
@@ -227,7 +227,9 @@ void SwXMLTextParagraphExport::setTextEmbeddedGraphicURL(
 {
 String aNewURL( RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.Package:") );
 aNewURL += String(rURL);
-pGrfNd->SetNewStreamName( aNewURL );
+
+// This is nonsensical.
+//pGrfNd->SetNewStreamName( aNewURL );
 
 // #i15411# save-as will swap all graphics in; we need to swap
 // them out again, to prevent excessive memory use
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-02-20 Thread Miklos Vajna
 sw/source/core/layout/ftnfrm.cxx |2 +-
 sw/source/core/layout/newfrm.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit a86b99f368bdc5fb9f0461129808b31f5d2e3401
Author: Michael Stahl 
Date:   Sat Feb 18 00:06:33 2012 +0100

fdo#39510: fix yet more layout crashes in ~SwRootFrm:

Call SwRootFrm::RemoveFtns with the proper boolean to also eliminate
EndNotes, and fix a faulty while loop in RemoveFtns that's been preventing
removal of footnotes in certain sections since the dawn of CVS history.
(regression from CWS swlayoutrefactoring, crashes on bugdoc from i#101776)
(cherry picked from commit 962d0500c4debaef43e5f146e47e08c66d851562)

Signed-off-by: Miklos Vajna 

diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx
index 1b4a14e..2d8ca28 100644
--- a/sw/source/core/layout/ftnfrm.cxx
+++ b/sw/source/core/layout/ftnfrm.cxx
@@ -1000,7 +1000,7 @@ void lcl_RemoveFtns( SwFtnBossFrm* pBoss, sal_Bool 
bPageOnly, sal_Bool bEndNotes
 if( pBody && pBody->Lower() )
 {
 SwFrm* pLow = pBody->Lower();
-while( pLow->GetNext() )
+while (pLow)
 {
 if( pLow->IsSctFrm() && ( !pLow->GetNext() ||
 ((SwSectionFrm*)pLow)->IsAnyNoteAtEnd() ) &&
diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index a1675a9..3b6b920 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -610,7 +610,7 @@ SwRootFrm::~SwRootFrm()
 // also searches backwards to find the master of footnotes, they must be
 // considered to be owned by the SwRootFrm and also be destroyed here,
 // before tearing down the (now footnote free) rest of the layout.
-AllRemoveFtns();
+RemoveFtns(0, false, true);
 
 if(pBlink)
 pBlink->FrmDelete( this );
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-02-15 Thread Miklos Vajna
 sw/source/filter/rtf/rtffly.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit a12a832280db27877c30ee177e9a079cd9c2eed9
Author: Cédric Bosdonnat 
Date:   Mon Jun 27 14:46:16 2011 +

n#695479: Remove properties when removing empty fly frame

(cherry picked from commits 4c8307053e3003af6cef5056e36a650f19c8cdb3 and
b208f71ddd19f1419558e7eb8c413d17d7e9f9da)

diff --git a/sw/source/filter/rtf/rtffly.cxx b/sw/source/filter/rtf/rtffly.cxx
index 92a7ca9..b4c6573 100644
--- a/sw/source/filter/rtf/rtffly.cxx
+++ b/sw/source/filter/rtf/rtffly.cxx
@@ -1092,6 +1092,8 @@ void SwRTFParser::ReadFly( int nToken, SfxItemSet* pSet )
 // dann zerstoere den FlySave wieder.
 aFlyArr.DeleteAndDestroy( --nFlyArrCnt );
 
+// Remove the properties that have been parsed before in the paragraph
+GetAttrStack().pop_back();
 }
 else
 {
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-02-14 Thread Tor Lillqvist
 sw/source/ui/docvw/PageBreakWin.cxx |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 66cf06ebdd4eeb95e801de114af06b49119fc7fe
Author: Cédric Bosdonnat 
Date:   Tue Feb 14 14:19:52 2012 +0100

fdo#45748: Don't use empty pages fo computing the page break position

(cherry picked from commit 9baee86cbdec44c657d06f355bdba0537fb12a1a)

Signed-off-by: Tor Lillqvist 

diff --git a/sw/source/ui/docvw/PageBreakWin.cxx 
b/sw/source/ui/docvw/PageBreakWin.cxx
index 0439bc3..f92101c 100644
--- a/sw/source/ui/docvw/PageBreakWin.cxx
+++ b/sw/source/ui/docvw/PageBreakWin.cxx
@@ -333,9 +333,13 @@ void SwPageBreakWin::UpdatePosition( const Point* pEvtPt )
 }
 
 const SwPageFrm* pPageFrm = GetPageFrame();
-const SwFrm* pPrevPage = pPageFrm->GetPrev();
-while ( pPrevPage && ( pPrevPage->Frm().Top( ) == pPageFrm->Frm().Top( ) ) 
)
+const SwFrm* pPrevPage = pPageFrm;
+do
+{
 pPrevPage = pPrevPage->GetPrev();
+}
+while ( pPrevPage && ( ( pPrevPage->Frm().Top( ) == pPageFrm->Frm().Top( ) 
)
+|| static_cast< const SwPageFrm* >( pPrevPage )->IsEmptyPage( 
) ) );
 
 Rectangle aBoundRect = GetEditWin()->LogicToPixel( 
pPageFrm->GetBoundRect().SVRect() );
 Rectangle aFrmRect = GetEditWin()->LogicToPixel( pPageFrm->Frm().SVRect() 
);
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-02-14 Thread Fridrich Strba
 sw/source/core/text/itrform2.cxx |5 ++---
 sw/source/core/text/txttab.cxx   |4 
 2 files changed, 2 insertions(+), 7 deletions(-)

New commits:
commit efae3866d2f3ff23f403d81f58e719a69bf070e9
Author: Cédric Bosdonnat 
Date:   Fri Feb 10 21:57:54 2012 +0100

fdo#45908: Cleaning up the tabs too early can cause loops

Signed-off-by: Fridrich Å trba 

diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 54a7825..9bf93d2 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -1375,9 +1375,8 @@ SwLinePortion *SwTxtFormatter::NewPortion( 
SwTxtFormatInfo &rInf )
 }
 }
 
-// Wenn eine Portion erzeugt wird, obwohl eine RestPortion ansteht,
-// dann haben wir es mit einem Feld zu tun, das sich aufgesplittet
-// hat, weil z.B. ein Tab enthalten ist.
+// if a portion is created despite there being a pending RestPortion,
+// then it is a field which has been split (e.g. because it contains a 
Tab)
 if( pPor && rInf.GetRest() )
 pPor->SetLen( 0 );
 
diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx
index fceddca..8841e39 100644
--- a/sw/source/core/text/txttab.cxx
+++ b/sw/source/core/text/txttab.cxx
@@ -82,10 +82,6 @@ sal_uInt16 SwLineInfo::NumberOfTabStops() const
 SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto 
) const
 {
 SwTabPortion *pTabPor = 0;
-SwTabPortion  *pLastTab = rInf.GetLastTab();
-if( pLastTab && ( pLastTab->IsTabCntPortion() || 
pLastTab->IsTabDecimalPortion() ) )
-if( pLastTab->PostFormat( rInf ) )
-return 0;
 
 xub_Unicode cFill = 0;
 xub_Unicode cDec = 0;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-02-13 Thread Jan Holesovsky
 sw/source/ui/uiview/viewport.cxx |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit 77249060109a68783358af87a2bcdfc4c710d760
Author: Ivan Timofeev 
Date:   Thu Feb 9 21:06:06 2012 +0400

always use the *real* visibility of the SwScrollbar

[this is a follow-up of fdo#30788]

Signed-off-by: Jan Holesovsky 

diff --git a/sw/source/ui/uiview/viewport.cxx b/sw/source/ui/uiview/viewport.cxx
index e4fc725..2ba6b0a 100644
--- a/sw/source/ui/uiview/viewport.cxx
+++ b/sw/source/ui/uiview/viewport.cxx
@@ -838,9 +838,7 @@ void SwView::CalcAndSetBorderPixel( SvBorder &rToFill, 
sal_Bool /*bInner*/ )
 else
 rToFill.Right()  = nTmp;
 }
-//#i32913# in browse mode the visibility of the horizontal scrollbar
-// depends on the content (fixed width tables may require a scrollbar)
-if ( pHScrollbar->IsVisible(pWrtShell->GetViewOptions()->getBrowseMode()) )
+if ( pHScrollbar->IsVisible(sal_True) )
 rToFill.Bottom() = nTmp;
 
 SetBorderPixel( rToFill );
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-02-13 Thread Caolán McNamara
 sw/source/core/layout/paintfrm.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit b7c1826f1babea87835f082a86ff9209fd9e614a
Author: Ivan Timofeev 
Date:   Mon Feb 13 19:34:58 2012 +0400

Header/Footer: don't show in web layout mode
(cherry picked from commit 19d80a257b0e5c9d45985e49f33493f38c5d5f10)

Signed-off-by: Caolán McNamara 

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index f7be549..4de8650 100755
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -3489,6 +3489,7 @@ void SwPageFrm::PaintDecorators( ) const
  !pGlobalShell->GetViewOptions()->IsPDFExport() &&
  !pGlobalShell->IsPreView() &&
  !pGlobalShell->GetViewOptions()->IsReadonly() &&
+ !pGlobalShell->GetViewOptions()->getBrowseMode() &&
  ( pGlobalShell->IsShowHeaderFooterSeparator( Header ) ||
pGlobalShell->IsShowHeaderFooterSeparator( Footer ) ) )
 {
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-02-13 Thread Jan Holesovsky
 sw/source/core/layout/paintfrm.cxx |3 +
 sw/source/ui/docvw/HeaderFooterWin.cxx |   97 +++--
 sw/source/ui/docvw/PageBreakWin.cxx|   46 +++
 sw/source/ui/inc/HeaderFooterWin.hxx   |1 
 4 files changed, 70 insertions(+), 77 deletions(-)

New commits:
commit de03d27c597b1f56d5d68d1a8181e2889dc5b1cb
Author: Cédric Bosdonnat 
Date:   Mon Feb 13 11:20:22 2012 +0100

Header/Footer, Page Break: don't show them in RO mode (fdo#45548)

Signed-off-by: Jan Holesovsky 

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index dced1b7..f7be549 100755
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -3341,6 +3341,7 @@ void SwPageFrm::PaintBreak( ) const
 {
 if ( pGlobalShell->GetOut()->GetOutDevType() != OUTDEV_PRINTER  &&
  !pGlobalShell->GetViewOptions()->IsPDFExport() &&
+ !pGlobalShell->GetViewOptions()->IsReadonly() &&
  !pGlobalShell->IsPreView() )
 {
 const SwFrm* pBodyFrm = Lower();
@@ -3377,6 +3378,7 @@ void SwColumnFrm::PaintBreak( ) const
 {
 if ( pGlobalShell->GetOut()->GetOutDevType() != OUTDEV_PRINTER  &&
  !pGlobalShell->GetViewOptions()->IsPDFExport() &&
+ !pGlobalShell->GetViewOptions()->IsReadonly() &&
  !pGlobalShell->IsPreView() )
 {
 const SwFrm* pBodyFrm = Lower();
@@ -3486,6 +3488,7 @@ void SwPageFrm::PaintDecorators( ) const
 if ( pGlobalShell->GetOut()->GetOutDevType() != OUTDEV_PRINTER &&
  !pGlobalShell->GetViewOptions()->IsPDFExport() &&
  !pGlobalShell->IsPreView() &&
+ !pGlobalShell->GetViewOptions()->IsReadonly() &&
  ( pGlobalShell->IsShowHeaderFooterSeparator( Header ) ||
pGlobalShell->IsShowHeaderFooterSeparator( Footer ) ) )
 {
diff --git a/sw/source/ui/docvw/HeaderFooterWin.cxx 
b/sw/source/ui/docvw/HeaderFooterWin.cxx
index 330c1ff..32e8767 100644
--- a/sw/source/ui/docvw/HeaderFooterWin.cxx
+++ b/sw/source/ui/docvw/HeaderFooterWin.cxx
@@ -148,7 +148,6 @@ SwHeaderFooterWin::SwHeaderFooterWin( SwEditWin* pEditWin, 
const SwPageFrm* pPag
 SwFrameControl( pEditWin, pPageFrm ),
 m_sLabel( ),
 m_bIsHeader( bHeader ),
-m_bReadonly( false ),
 m_pPopupMenu( NULL ),
 m_pLine( NULL ),
 m_bIsAppearing( false ),
@@ -329,57 +328,54 @@ void SwHeaderFooterWin::Paint( const Rectangle& )
 com::sun::star::lang::Locale(),
 aLineColor ) );
 
-// Create the 'plus' or 'arrow' primitive if not readonly
-if ( !m_bReadonly )
-{
-B2DRectangle aSignArea( B2DPoint( aRect.Right() - BUTTON_WIDTH, 0.0 ),
-B2DSize( aRect.Right(), aRect.getHeight() ) );
+// Create the 'plus' or 'arrow' primitive
+B2DRectangle aSignArea( B2DPoint( aRect.Right() - BUTTON_WIDTH, 0.0 ),
+B2DSize( aRect.Right(), aRect.getHeight() ) );
 
-B2DPolygon aSign;
-if ( IsEmptyHeaderFooter( ) )
-{
-// Create the + polygon
-double nLeft = aSignArea.getMinX() + TEXT_PADDING;
-double nRight = aSignArea.getMaxX() - TEXT_PADDING;
-double nHalfW = ( nRight - nLeft ) / 2.0;
-
-double nTop = aSignArea.getCenterY() - nHalfW;
-double nBottom = aSignArea.getCenterY() + nHalfW;
-
-aSign.append( B2DPoint( nLeft, aSignArea.getCenterY() - 1.0 ) );
-aSign.append( B2DPoint( aSignArea.getCenterX() - 1.0, 
aSignArea.getCenterY() - 1.0 ) );
-aSign.append( B2DPoint( aSignArea.getCenterX() - 1.0, nTop ) );
-aSign.append( B2DPoint( aSignArea.getCenterX() + 1.0, nTop ) );
-aSign.append( B2DPoint( aSignArea.getCenterX() + 1.0, 
aSignArea.getCenterY() - 1.0 ) );
-aSign.append( B2DPoint( nRight, aSignArea.getCenterY() - 1.0 ) );
-aSign.append( B2DPoint( nRight, aSignArea.getCenterY() + 1.0 ) );
-aSign.append( B2DPoint( aSignArea.getCenterX() + 1.0, 
aSignArea.getCenterY() + 1.0 ) );
-aSign.append( B2DPoint( aSignArea.getCenterX() + 1.0, nBottom ) );
-aSign.append( B2DPoint( aSignArea.getCenterX() - 1.0, nBottom ) );
-aSign.append( B2DPoint( aSignArea.getCenterX() - 1.0, 
aSignArea.getCenterY() + 1.0  ) );
-aSign.append( B2DPoint( nLeft, aSignArea.getCenterY() + 1.0  ) );
-aSign.setClosed( true );
-}
-else
-{
-// Create the v polygon
-B2DPoint aLeft( aSignArea.getMinX() + TEXT_PADDING, 
aSignArea.getCenterY() );
-B2DPoint aRight( aSignArea.getMaxX() - TEXT_PADDING, 
aSignArea.getCenterY() );
-B2DPoint aBottom( ( aLeft.getX() + aRight.getX() ) / 2.0, 
aLeft.getY() + 4.0 );
-aSign.append( aLeft );
-aSign.append( aRight );
-aSign.append( aBottom );
-  

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

2012-02-13 Thread Cédric Bosdonnat
 sw/source/ui/lingu/olmenu.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0fe67dc40760b4ff7cdc1325bb4e97a3ce259ccb
Author: László Németh 
Date:   Tue Dec 13 21:35:25 2011 +0100

Fix FullCommentURL for grammar checking (local menu)

Signed-off-by: Cédric Bosdonnat 

diff --git a/sw/source/ui/lingu/olmenu.cxx b/sw/source/ui/lingu/olmenu.cxx
index 0e1a7cd..b85dfaa 100644
--- a/sw/source/ui/lingu/olmenu.cxx
+++ b/sw/source/ui/lingu/olmenu.cxx
@@ -589,7 +589,7 @@ aInfo16( SW_RES(IMG_INFO_16) )
 beans::PropertyValues  aProperties = rResult.aErrors[ nErrorInResult 
].aProperties;
 {
 sal_Int32 i = 0;
-while ( !sExplanationLink.isEmpty() && i < aProperties.getLength() )
+while ( sExplanationLink.isEmpty() && i < aProperties.getLength() )
 {
 if ( aProperties[i].Name.equalsAscii( "FullCommentURL" ) )
 {
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-02-08 Thread Michael Stahl
 sw/source/core/fields/reffld.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit cee3e301b4553095b70cf6abff15038b4aae8936
Author: Cédric Bosdonnat 
Date:   Wed Feb 8 14:06:09 2012 +0100

fdo#35669: Update the references even if nothing uses them here

Merge the references with the other document even if there is no field
using them as this may break the sequence and references in other parts
of a master document.
(cherry picked from commit 44f971506c0ed37928c48e55d8007f24b0c43a5f)

Signed-off-by: Michael Stahl 

diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index eca22ba..ddf36b2 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -1074,8 +1074,7 @@ void _RefIdsMap::Check( SwDoc& rDoc, SwDoc& rDestDoc, 
SwGetRefField& rFld,
 
 void SwGetRefFieldType::MergeWithOtherDoc( SwDoc& rDestDoc )
 {
-if( &rDestDoc != pDoc &&
-rDestDoc.GetSysFldType( RES_GETREFFLD )->GetDepends() )
+if( &rDestDoc != pDoc )
 {
 // dann gibt es im DestDoc RefFelder, also muessen im SourceDoc
 // alle RefFelder auf einduetige Ids in beiden Docs umgestellt
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-02-07 Thread Michael Stahl
 sw/source/ui/dialog/wordcountdialog.src |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 862da84672d7251099d996611811de8b43e8bc82
Author: Andras Timar 
Date:   Mon Feb 6 16:02:43 2012 +0100

fdo#45045 fox context sensitive help for Word Count dialog
(cherry picked from commit 5f261a0db51621fbab37cc0f991bc8c9106dda01)

Signed-off-by: Michael Stahl 

diff --git a/sw/source/ui/dialog/wordcountdialog.src 
b/sw/source/ui/dialog/wordcountdialog.src
index 7c4a5f9..1b8b1a1 100644
--- a/sw/source/ui/dialog/wordcountdialog.src
+++ b/sw/source/ui/dialog/wordcountdialog.src
@@ -131,11 +131,13 @@ ModelessDialog DLG_WORDCOUNT
 };
 HelpButton  PB_HELP
 {
+HelpID = HID_DLG_WORDCOUNT ;
 Pos = MAP_APPFONT ( 5 , 114 ) ;
 Size = MAP_APPFONT ( 50 , 15 ) ;
 };
 OKButtonPB_OK
 {
+HelpID = HID_DLG_WORDCOUNT ;
 Pos = MAP_APPFONT ( 115 , 114 ) ;
 Size = MAP_APPFONT ( 50 , 15 ) ;
 DefButton = TRUE ;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-02-07 Thread Stephan Bergmann
 sw/source/core/undo/undobj.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit de998662158e3654ac14469989d27ce963cce935
Author: Michael Stahl 
Date:   Mon Feb 6 22:01:27 2012 +0100

fdo#38745: fix hilariously stupid stack guards:

The UndoRedoRedlineGuards that SwUndo::{Un,Re}doWithContext wants to
put on the stack aren't actually variables, so the destructor gets
invoked before the function call that the guard is supposed to protect.
Regression from CWS undoapi.
(cherry picked from commit 13424b43c25389e303774c3fb2f2beb3e20ceae5)

Signed-off-by: Stephan Bergmann 

diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index f815398..b2a5243 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -249,7 +249,7 @@ void SwUndo::UndoWithContext(SfxUndoContext & rContext)
 dynamic_cast< ::sw::UndoRedoContext * >(& rContext));
 OSL_ASSERT(pContext);
 if (!pContext) { return; }
-UndoRedoRedlineGuard(*pContext, *this);
+UndoRedoRedlineGuard const g(*pContext, *this);
 UndoImpl(*pContext);
 }
 
@@ -259,7 +259,7 @@ void SwUndo::RedoWithContext(SfxUndoContext & rContext)
 dynamic_cast< ::sw::UndoRedoContext * >(& rContext));
 OSL_ASSERT(pContext);
 if (!pContext) { return; }
-UndoRedoRedlineGuard(*pContext, *this);
+UndoRedoRedlineGuard const g(*pContext, *this);
 RedoImpl(*pContext);
 }
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-02-06 Thread Jan Holesovsky
 sw/source/ui/uiview/view.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 994978f537ed61c3aa9ca2ae6b16bb35407ae32c
Author: Michael Stahl 
Date:   Wed Feb 1 15:49:16 2012 +0100

fdo#37024: SwView::SwView: fix BROWSE_MODE setting:

Apparently there is a check in SwDoc::SetAllUniqueFlyNames so that when
frames with certain anchor types are in a document, then SetLoaded()
is never called.  Checking this flag via IsLoaded() here seems
unnecessary.
This problem was introduced with ebc5777548dea42ed966a16c66d879b1485bbfb4,
from CWS swlayoutrefactoring.

Signed-off-by: Lionel Elie Mamane 

diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx
index b3bbf87..e291c19 100644
--- a/sw/source/ui/uiview/view.cxx
+++ b/sw/source/ui/uiview/view.cxx
@@ -835,7 +835,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh 
)
 
 if( !bOldShellWasSrcView && pWebDShell && !bOldShellWasPagePreView )
 aUsrPref.setBrowseMode( sal_True );
-else if( rDoc.IsLoaded() )
+else
 aUsrPref.setBrowseMode( 
rDoc.get(IDocumentSettingAccess::BROWSE_MODE) );
 
 //Fuer den BrowseMode wollen wir keinen Factor uebernehmen.
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-01-31 Thread Petr Mladek
 sw/source/core/layout/paintfrm.cxx |   16 
 1 file changed, 16 insertions(+)

New commits:
commit 52416a69ccb2bc9f6d5de89ff92086ec78d3dd66
Author: Cédric Bosdonnat 
Date:   Tue Jan 31 15:39:54 2012 +0100

fdo#44836: Hide all the page breaks of the pages before the first visible 
one

Signed-off-by: Petr Mladek 

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index 074a54a..dced1b7 100755
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -2850,6 +2850,22 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData 
const*const pPrintData) const
 // #i68597#
 const bool bGridPainting(pSh->GetWin() && pSh->Imp()->HasDrawView() && 
pSh->Imp()->GetDrawView()->IsGridVisible());
 
+// Hide all page break controls before showing them again
+SwWrtShell* pWrtSh = dynamic_cast< SwWrtShell* >( pGlobalShell );
+if ( pWrtSh )
+{
+SwEditWin& rEditWin = pWrtSh->GetView().GetEditWin();
+SwFrameControlsManager& rMngr = rEditWin.GetFrameControlsManager();
+const SwPageFrm* pHiddenPage = pPage;
+while ( pHiddenPage->GetPrev() != NULL )
+{
+pHiddenPage = static_cast< const SwPageFrm* >( 
pHiddenPage->GetPrev() );
+SwFrameControlPtr pControl = rMngr.GetControl( PageBreak, 
pHiddenPage );
+if ( pControl.get() )
+pControl->ShowAll( false );
+}
+}
+
 // #i76669#
 SwViewObjectContactRedirector aSwRedirector( *pSh );
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-01-30 Thread Michael Meeks
 sw/source/filter/ww8/ww8scan.cxx |   18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 6594688df45cb491042470c4ae5289c47192994a
Author: Luboš Luňák 
Date:   Mon Jan 30 19:07:43 2012 +0100

query remaining stream size after seeking, not before (fdo#45255)

Signed-off-by: Michael Meeks 

diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 9ef2ff9..b149478 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -1996,10 +1996,11 @@ WW8PLCFspecial::WW8PLCFspecial(SvStream* pSt, 
sal_uInt32 nFilePos,
 const sal_uInt32 nValidMin=4;
 
 sal_Size nOldPos = pSt->Tell();
-sal_Size nRemainingSize = pSt->remainingSize();
 
-bool bValid = checkSeek(*pSt, nFilePos) && (nRemainingSize >= nValidMin) &&
-(nPLCF >= nValidMin);
+bool bValid = checkSeek(*pSt, nFilePos);
+sal_Size nRemainingSize = pSt->remainingSize();
+if( !(nRemainingSize >= nValidMin && nPLCF >= nValidMin ))
+bValid = false;
 nPLCF = bValid ? std::min(nRemainingSize, static_cast(nPLCF)) : 
nValidMin;
 
 // Pointer auf Pos- u. Struct-Array
@@ -2154,9 +2155,7 @@ WW8PLCF::WW8PLCF(SvStream& rSt, WW8_FC nFilePos, 
sal_Int32 nPLCF, int nStruct,
 void WW8PLCF::ReadPLCF(SvStream& rSt, WW8_FC nFilePos, sal_uInt32 nPLCF)
 {
 sal_Size nOldPos = rSt.Tell();
-sal_Size nRemainingSize = rSt.remainingSize();
-
-bool bValid = checkSeek(rSt, nFilePos) && (nRemainingSize >= nPLCF);
+bool bValid = checkSeek(rSt, nFilePos) && (rSt.remainingSize() >= nPLCF);
 
 if (bValid)
 {
@@ -2335,10 +2334,11 @@ WW8PLCFpcd::WW8PLCFpcd(SvStream* pSt, sal_uInt32 
nFilePos,
 const sal_uInt32 nValidMin=4;
 
 sal_Size nOldPos = pSt->Tell();
-sal_Size nRemainingSize = pSt->remainingSize();
 
-bool bValid = checkSeek(*pSt, nFilePos) && (nRemainingSize >= nValidMin) &&
-(nPLCF >= nValidMin);
+bool bValid = checkSeek(*pSt, nFilePos);
+sal_Size nRemainingSize = pSt->remainingSize();
+if( !(nRemainingSize >= nValidMin && nPLCF >= nValidMin ))
+bValid = false;
 nPLCF = bValid ? std::min(nRemainingSize, static_cast(nPLCF)) : 
nValidMin;
 
 pPLCF_PosArray = new sal_Int32[ ( nPLCF + 3 ) / 4 ];// Pointer auf 
Pos-Array
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-01-26 Thread Cédric Bosdonnat
 sw/source/filter/rtf/swparrtf.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 85fb62b9103428ee83e5b9f9ef7bdcb736e04ff9
Author: Miklos Vajna 
Date:   Wed Jan 25 16:33:25 2012 +0100

fdo#43869 use the old rtf importer for paste

Signed-off-by: Cédric Bosdonnat 

diff --git a/sw/source/filter/rtf/swparrtf.cxx 
b/sw/source/filter/rtf/swparrtf.cxx
index 5378d07..2fc6756 100644
--- a/sw/source/filter/rtf/swparrtf.cxx
+++ b/sw/source/filter/rtf/swparrtf.cxx
@@ -34,6 +34,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -161,6 +162,11 @@ sal_uLong SwRTFReader::Read( SwDoc &rDoc, const String& 
/*rBaseURL*/, SwPaM& /*r
 
 extern "C" SAL_DLLPUBLIC_EXPORT Reader* SAL_CALL ImportRTF()
 {
+// Use the old rtf importer by default for paste, till the new one supports
+// undo stack and PaM.
+SvtMiscOptions aMiscOptions;
+if (!aMiscOptions.IsExperimentalMode())
+return new RtfReader();
 return new SwRTFReader();
 }
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-01-24 Thread Michael Stahl
 sw/source/filter/xml/xmlimp.cxx  |   30 +-
 sw/source/ui/uno/SwXDocumentSettings.cxx |6 ++
 2 files changed, 35 insertions(+), 1 deletion(-)

New commits:
commit 17ccd3cfc9dd86e2911a0a31f6dcbba8d7e7950a
Author: Luboš Luňák 
Date:   Tue Jan 24 16:05:37 2012 +0100

order database properties so that opening it in writer works (bnc#740032)

http://lists.freedesktop.org/archives/libreoffice/2012-January/024380.html
(cherry picked from commit db0f839920c38973f8448df0f74de7c4c95c832c)

Signed-off-by: Michael Stahl 

diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 36643e4..ca700d0 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -1189,6 +1189,13 @@ void SwXMLImport::SetConfigurationSettings(const 
Sequence < PropertyValue > & aC
 
 OUString sRedlineProtectionKey( RTL_CONSTASCII_USTRINGPARAM( 
"RedlineProtectionKey" ) );
 
+const PropertyValue* currentDatabaseDataSource = NULL;
+const PropertyValue* currentDatabaseCommand = NULL;
+const PropertyValue* currentDatabaseCommandType = NULL;
+OUString currentDatabaseDataSourceKey( RTL_CONSTASCII_USTRINGPARAM( 
"CurrentDatabaseDataSource" ));
+OUString currentDatabaseCommandKey( RTL_CONSTASCII_USTRINGPARAM( 
"CurrentDatabaseCommand" ));
+OUString currentDatabaseCommandTypeKey( RTL_CONSTASCII_USTRINGPARAM( 
"CurrentDatabaseCommandType" ));
+
 while( nCount-- )
 {
 if( !bIsUserSetting )
@@ -1213,7 +1220,15 @@ void SwXMLImport::SetConfigurationSettings(const 
Sequence < PropertyValue > & aC
 }
 else
 {
-xProps->setPropertyValue( pValues->Name,
+// HACK: Setting these out of order does not work.
+if( pValues->Name.equals( currentDatabaseDataSourceKey 
))
+currentDatabaseDataSource = pValues;
+else if( pValues->Name.equals( 
currentDatabaseCommandKey ))
+currentDatabaseCommand = pValues;
+else if( pValues->Name.equals( 
currentDatabaseCommandTypeKey ))
+currentDatabaseCommandType = pValues;
+else
+xProps->setPropertyValue( pValues->Name,
   pValues->Value );
 }
 }
@@ -1268,6 +1283,19 @@ void SwXMLImport::SetConfigurationSettings(const 
Sequence < PropertyValue > & aC
 pValues++;
 }
 
+try
+{
+if( currentDatabaseDataSource != NULL )
+xProps->setPropertyValue( currentDatabaseDataSource->Name, 
currentDatabaseDataSource->Value );
+if( currentDatabaseCommand != NULL )
+xProps->setPropertyValue( currentDatabaseCommand->Name, 
currentDatabaseCommand->Value );
+if( currentDatabaseCommandType != NULL )
+xProps->setPropertyValue( currentDatabaseCommandType->Name, 
currentDatabaseCommandType->Value );
+} catch( Exception& )
+{
+OSL_FAIL( "SwXMLImport::SetConfigurationSettings: Exception!" );
+}
+
 // finally, treat the non-default cases
 // introduce boolean, that indicates a document, written by version prior 
SO8.
 const bool bDocumentPriorSO8 = !bConsiderWrapOnObjPos;
diff --git a/sw/source/ui/uno/SwXDocumentSettings.cxx 
b/sw/source/ui/uno/SwXDocumentSettings.cxx
index a56f584..7b4b738 100644
--- a/sw/source/ui/uno/SwXDocumentSettings.cxx
+++ b/sw/source/ui/uno/SwXDocumentSettings.cxx
@@ -470,6 +470,8 @@ void SwXDocumentSettings::_setSingleValue( const 
comphelper::PropertyInfo & rInf
 case HANDLE_CURRENT_DATABASE_COMMAND:
 {
 SwDBData aData = mpDoc->GetDBData();
+SAL_WARN_IF( aData.sDataSource.isEmpty(), "sw.uno",
+"\"CurrentDatabaseCommand\" property possibly set before 
\"CurrentDatabaseDataSource\"" );
 if ( rValue >>= aData.sCommand )
 mpDoc->ChgDBData( aData );
 }
@@ -477,6 +479,10 @@ void SwXDocumentSettings::_setSingleValue( const 
comphelper::PropertyInfo & rInf
 case HANDLE_CURRENT_DATABASE_COMMAND_TYPE:
 {
 SwDBData aData = mpDoc->GetDBData();
+SAL_WARN_IF( aData.sDataSource.isEmpty(), "sw.uno",
+"\"CurrentDatabaseCommandType\" property possibly set before 
\"CurrentDatabaseDataSource\"" );
+SAL_WARN_IF( aData.sCommand.isEmpty(), "sw.uno",
+"\"CurrentDatabaseCommandType\" property possibly set before 
\"CurrentDatabaseCommand\"" );
 if ( rValue >>= aData.nCommandType )
 mpDoc->ChgDBData( aData );
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffic

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

2012-01-09 Thread Cédric Bosdonnat
 sw/source/core/frmedt/fefly1.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 4463a523ae78a9eff1776668825ec6be944c1574
Author: Cédric Bosdonnat 
Date:   Mon Jan 9 18:15:11 2012 +0100

fdo#36681: refresh the layout after inserting a picture

diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index 97c6a5d..473f6f3 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -846,6 +846,12 @@ void SwFEShell::Insert( const String& rGrfName, const 
String& rFltName,
 const Point aPt( GetCrsrDocPos() );
 SwFlyFrm* pFrm = pFmt->GetFrm( &aPt );
 
+// Invalidate the content and layout to refresh the picture anchoring
+// properly
+SwPageFrm* pPageFrm = pFrm->FindPageFrmOfAnchor();
+pPageFrm->InvalidateFlyLayout();
+pPageFrm->InvalidateCntnt();
+
 if( pFrm )
 SelectFlyFrm( *pFrm, sal_True );
 else
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-01-08 Thread Andras Timar
 sw/source/ui/table/tabledlg.src |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit ee61862a385466be28eede2def90674df891fd6e
Author: Andras Timar 
Date:   Sun Jan 8 19:55:22 2012 +0100

UI elements begin with upper case

diff --git a/sw/source/ui/table/tabledlg.src b/sw/source/ui/table/tabledlg.src
index dbaa2a0..ded80e1 100644
--- a/sw/source/ui/table/tabledlg.src
+++ b/sw/source/ui/table/tabledlg.src
@@ -748,8 +748,8 @@ TabPage TP_TABLE_TEXTFLOW
 Border = TRUE;
 StringList [ en-US ] =
 {
- < "horizontal" ; 0; > ;
- < "vertical" ; 2; > ;
+ < "Horizontal" ; 0; > ;
+ < "Vertical" ; 2; > ;
  < "Use superordinate object settings" ; 4; > ;
 };
 };
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-01-06 Thread Cédric Bosdonnat
 sw/source/core/edit/edtox.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 376488f5747cdbcfc4905aa12a531a266303658d
Author: Cédric Bosdonnat 
Date:   Fri Jan 6 10:01:22 2012 +0100

fdo#32726: search for index entries in the whole document, not only the body

diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx
index ba104fc..282becc 100644
--- a/sw/source/core/edit/edtox.cxx
+++ b/sw/source/core/edit/edtox.cxx
@@ -430,7 +430,7 @@ void SwEditShell::ApplyAutoMark()
 // todo/mba: assuming that notes shouldn't be searched
 sal_Bool bSearchInNotes = sal_False;
 sal_uLong nRet = Find( aSearchOpt,  bSearchInNotes, 
DOCPOS_START, DOCPOS_END, bCancel,
-
(FindRanges)(FND_IN_SELALL|FND_IN_BODYONLY),
+
(FindRanges)(FND_IN_SELALL|FND_IN_BODYONLY|FND_IN_OTHER),
 sal_False );
 
 if(nRet)
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-01-05 Thread Cédric Bosdonnat
 sw/source/core/edit/eddel.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 71f9c3a5c108161661d047beb7d63352622a0474
Author: Cédric Bosdonnat 
Date:   Thu Jan 5 17:53:10 2012 +0100

fdo#40250: safer protection check... why using the layout for this?

diff --git a/sw/source/core/edit/eddel.cxx b/sw/source/core/edit/eddel.cxx
index 85d27e4..67deb43 100644
--- a/sw/source/core/edit/eddel.cxx
+++ b/sw/source/core/edit/eddel.cxx
@@ -89,7 +89,7 @@ void SwEditShell::DeleteSel( SwPaM& rPam, sal_Bool* pUndo )
 }
 // geschuetze Boxen ueberspringen !
 if( !pNd->IsCntntNode() ||
-!((SwCntntNode*)pNd)->getLayoutFrm( GetLayout() 
)->IsProtected() )
+!pNd->IsInProtectSect() )
 {
 // alles loeschen
 GetDoc()->DeleteAndJoin( aDelPam );
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-01-04 Thread Cédric Bosdonnat
 sw/source/ui/docvw/DashedLine.cxx  |8 
 sw/source/ui/docvw/HeaderFooterWin.cxx |3 +--
 sw/source/ui/docvw/PageBreakWin.cxx|7 +++
 sw/source/ui/inc/DashedLine.hxx|4 ++--
 4 files changed, 10 insertions(+), 12 deletions(-)

New commits:
commit 3b5a556fe6b1de0e71af2fae554e48b0553e750c
Author: Cédric Bosdonnat 
Date:   Wed Jan 4 15:20:22 2012 +0100

Page Break, Header/Footer: fixed the line color change if config changes

diff --git a/sw/source/ui/docvw/DashedLine.cxx 
b/sw/source/ui/docvw/DashedLine.cxx
index 0470733..3cb66b1 100644
--- a/sw/source/ui/docvw/DashedLine.cxx
+++ b/sw/source/ui/docvw/DashedLine.cxx
@@ -36,9 +36,9 @@
 #include 
 #include 
 
-SwDashedLine::SwDashedLine( Window* pParent, const basegfx::BColor& rColor ) :
+SwDashedLine::SwDashedLine( Window* pParent, Color& ( *pColorFn )() ) :
 FixedLine( pParent, WB_DIALOGCONTROL | WB_HORZ ),
-m_aColor( rColor )
+m_pColorFn( pColorFn )
 {
 }
 
@@ -69,7 +69,7 @@ void SwDashedLine::Paint( const Rectangle& )
 const StyleSettings& rSettings = 
Application::GetSettings().GetStyleSettings();
 
 std::vector< double > aStrokePattern;
-basegfx::BColor aColor = m_aColor;
+basegfx::BColor aColor = m_pColorFn().getBColor();
 if ( rSettings.GetHighContrastMode( ) )
 {
 // Only a solid line in high contrast mode
@@ -103,7 +103,7 @@ void SwDashedLine::Paint( const Rectangle& )
 drawinglayer::primitive2d::PolyPolygonStrokePrimitive2D * pLine =
 new drawinglayer::primitive2d::PolyPolygonStrokePrimitive2D (
 basegfx::B2DPolyPolygon( aPolygon ),
-drawinglayer::attribute::LineAttribute( m_aColor ),
+drawinglayer::attribute::LineAttribute( 
m_pColorFn().getBColor() ),
 drawinglayer::attribute::StrokeAttribute( aStrokePattern ) );
 
 aSeq[ aSeq.getLength() - 1 ] = 
drawinglayer::primitive2d::Primitive2DReference( pLine );
diff --git a/sw/source/ui/docvw/HeaderFooterWin.cxx 
b/sw/source/ui/docvw/HeaderFooterWin.cxx
index df39978..180b975 100644
--- a/sw/source/ui/docvw/HeaderFooterWin.cxx
+++ b/sw/source/ui/docvw/HeaderFooterWin.cxx
@@ -163,8 +163,7 @@ SwHeaderFooterWin::SwHeaderFooterWin( SwEditWin* pEditWin, 
const SwPageFrm* pPag
 SetMapMode( MapMode ( MAP_PIXEL ) );
 
 // Create the line control
-basegfx::BColor aColor = 
SwViewOption::GetHeaderFooterMarkColor().getBColor();
-m_pLine = new SwDashedLine( GetEditWin(), aColor );
+m_pLine = new SwDashedLine( GetEditWin(), 
&SwViewOption::GetHeaderFooterMarkColor );
 m_pLine->SetZOrder( this, WINDOW_ZORDER_BEFOR );
 
 // Create and set the PopupMenu
diff --git a/sw/source/ui/docvw/PageBreakWin.cxx 
b/sw/source/ui/docvw/PageBreakWin.cxx
index 7c1f00e..4799320 100644
--- a/sw/source/ui/docvw/PageBreakWin.cxx
+++ b/sw/source/ui/docvw/PageBreakWin.cxx
@@ -160,8 +160,8 @@ namespace
 SwPageBreakWin* m_pWin;
 
 public:
-SwBreakDashedLine( Window* pParent, const BColor& rColor, 
SwPageBreakWin* pWin ) :
-SwDashedLine( pParent, rColor ),
+SwBreakDashedLine( Window* pParent, Color& ( *pColorFn )(), 
SwPageBreakWin* pWin ) :
+SwDashedLine( pParent, pColorFn ),
 m_pWin( pWin ) {};
 
 virtual void MouseMove( const MouseEvent& rMEvt );
@@ -206,8 +206,7 @@ SwPageBreakWin::SwPageBreakWin( SwEditWin* pEditWin, const 
SwPageFrm* pPageFrm )
 SetMapMode( MapMode ( MAP_PIXEL ) );
 
 // Create the line control
-BColor aColor = SwViewOption::GetPageBreakColor().getBColor();
-m_pLine = new SwBreakDashedLine( GetEditWin(), aColor, this );
+m_pLine = new SwBreakDashedLine( GetEditWin(), 
&SwViewOption::GetPageBreakColor, this );
 
 // Create the popup menu
 m_pPopupMenu = new PopupMenu( SW_RES( MN_PAGEBREAK_BUTTON ) );
diff --git a/sw/source/ui/inc/DashedLine.hxx b/sw/source/ui/inc/DashedLine.hxx
index 671024a..21719ea 100644
--- a/sw/source/ui/inc/DashedLine.hxx
+++ b/sw/source/ui/inc/DashedLine.hxx
@@ -35,10 +35,10 @@
   */
 class SwDashedLine : public FixedLine
 {
-basegfx::BColor m_aColor;
+Color& (*m_pColorFn)();
 
 public:
-SwDashedLine( Window* pParent, const basegfx::BColor& rColor );
+SwDashedLine( Window* pParent, Color& ( *pColorFn )() );
 ~SwDashedLine( );
 
 virtual void Paint( const Rectangle& rRect );
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-01-03 Thread Miklos Vajna
 sw/source/filter/ww8/rtfexportfilter.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 99fccadd08d41e8a4abcc062d075886d4a0910be
Author: Miklos Vajna 
Date:   Tue Jan 3 12:22:45 2012 +0100

fdo#37161 RTF: update layout (if present) before export

(cherry picked from commit 83fbebfea32b27cd722466607aa978244ac53575)

diff --git a/sw/source/filter/ww8/rtfexportfilter.cxx 
b/sw/source/filter/ww8/rtfexportfilter.cxx
index 7c59694..257c43b 100644
--- a/sw/source/filter/ww8/rtfexportfilter.cxx
+++ b/sw/source/filter/ww8/rtfexportfilter.cxx
@@ -31,6 +31,7 @@
 #include 
 
 #include 
+#include 
 #include 
 
 #include 
@@ -72,6 +73,12 @@ sal_Bool RtfExportFilter::filter( const uno::Sequence< 
beans::PropertyValue >& a
 return sal_False;
 }
 
+// fdo#37161 - update layout (if present), for SwWriteTable
+ViewShell* pViewShell = NULL;
+pDoc->GetEditShell(&pViewShell);
+if (pViewShell != NULL)
+pViewShell->CalcLayout();
+
 // get SwPaM*
 // we get SwPaM for the entire document; copy&paste is handled internally, 
not via UNO
 SwPaM aPam( pDoc->GetNodes().GetEndOfContent() );
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2011-12-28 Thread Miklos Vajna
 sw/source/filter/ww8/rtfattributeoutput.cxx |   23 +++
 1 file changed, 15 insertions(+), 8 deletions(-)

New commits:
commit 11b6fd520babd5b0f4fa7242377115f00b6c1c23
Author: Miklos Vajna 
Date:   Wed Dec 28 21:43:22 2011 +0100

fdo#35099 fix RTF export of date field

(cherry picked from commit 4b0dd950b8b79df004238f372fe55993d5ac5981)

diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx 
b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 17b2de3..9ade064 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -1398,14 +1398,19 @@ void RtfAttributeOutput::WriteField_Impl( const 
SwField* pFld, ww::eField /*eTyp
 {
 OSL_TRACE("%s", OSL_THIS_FUNC);
 
-// NEEDSWORK this has beeen tested only with page numbers
-m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_FIELD);
-m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE 
OOO_STRING_SVTOOLS_RTF_FLDINST " ");
-m_aRunText.append(m_rExport.OutString(rFldCmd, 
m_rExport.eCurrentEncoding));
-m_aRunText.append("}{" OOO_STRING_SVTOOLS_RTF_FLDRSLT " ");
+// If there are no field instructions, don't export it as a field.
+bool bHasInstructions = rFldCmd.Len() > 0;
+if (bHasInstructions)
+{
+m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_FIELD);
+m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE 
OOO_STRING_SVTOOLS_RTF_FLDINST " ");
+m_aRunText.append(m_rExport.OutString(rFldCmd, 
m_rExport.eCurrentEncoding));
+m_aRunText.append("}{" OOO_STRING_SVTOOLS_RTF_FLDRSLT " ");
+}
 if (pFld)
 m_aRunText.append(m_rExport.OutString(pFld->ExpandField(true), 
m_rExport.eDefaultEncoding));
-m_aRunText.append("}}");
+if (bHasInstructions)
+m_aRunText.append("}}");
 }
 
 void RtfAttributeOutput::WriteBookmarks_Impl( std::vector< rtl::OUString >& 
rStarts, std::vector< rtl::OUString >& rEnds )
@@ -2933,9 +2938,11 @@ void RtfAttributeOutput::FormatFrameDirection( const 
SvxFrameDirectionItem& rDir
 }
 }
 
-void RtfAttributeOutput::WriteExpand( const SwField* /*pFld*/ )
+void RtfAttributeOutput::WriteExpand( const SwField* pFld )
 {
-OSL_TRACE("TODO: %s", OSL_THIS_FUNC);
+OSL_TRACE("%s", OSL_THIS_FUNC);
+String sCmd;
+m_rExport.OutputField(pFld, ww::eUNKNOWN, sCmd);
 }
 
 void RtfAttributeOutput::RefField( const SwField& /*rFld*/, const String& 
/*rRef*/ )
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2011-12-27 Thread Jan Holesovsky
 sw/source/ui/index/cnttab.src |2 +-
 vcl/source/window/tabdlg.cxx  |7 +++
 2 files changed, 4 insertions(+), 5 deletions(-)

New commits:
commit 114b4806e9233140fc42cba0b174a8f21e323a79
Author: Jan Holesovsky 
Date:   Tue Dec 27 15:41:22 2011 +0100

Thanks to Ivan Timofeev, fix the 'Preview' checkbox in 'Indexes and 
Tables...'

diff --git a/sw/source/ui/index/cnttab.src b/sw/source/ui/index/cnttab.src
index 71f034d..c2ce533 100644
--- a/sw/source/ui/index/cnttab.src
+++ b/sw/source/ui/index/cnttab.src
@@ -106,7 +106,7 @@ TabDialog DLG_MULTI_TOX
 };
 CheckBox CB_SHOWEXAMPLE
 {
-Size = MAP_APPFONT (  200, 10 ) ;
+Size = MAP_APPFONT ( 45, 10 ) ;
 Text [ en-US ] = "Preview";
 };
 Text [ en-US ] = "Insert Index/Table";
diff --git a/vcl/source/window/tabdlg.cxx b/vcl/source/window/tabdlg.cxx
index eaf4a14..9313211 100644
--- a/vcl/source/window/tabdlg.cxx
+++ b/vcl/source/window/tabdlg.cxx
@@ -61,12 +61,11 @@ void TabDialog::ImplPosControls()
 pTabControl = (TabControl*)pChild;
 else if ( pTabControl )
 {
-long nTxtWidth = pChild->GetCtrlTextWidth( pChild->GetText() );
-nTxtWidth += IMPL_EXTRA_BUTTON_WIDTH;
+Size aOptimalSize( pChild->GetOptimalSize( 
WINDOWSIZE_PREFERRED ) );
+long nTxtWidth = aOptimalSize.Width();
 if ( nTxtWidth > aCtrlSize.Width() )
 aCtrlSize.Width() = nTxtWidth;
-long nTxtHeight = pChild->GetTextHeight();
-nTxtHeight += IMPL_EXTRA_BUTTON_HEIGHT;
+long nTxtHeight = aOptimalSize.Height();
 if ( nTxtHeight > aCtrlSize.Height() )
 aCtrlSize.Height() = nTxtHeight;
 nDownCtrl++;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2011-12-27 Thread Jan Holesovsky
 sw/source/ui/index/cnttab.src |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 02870470f069120dc0e65b2cdfef5fd2c426e1e9
Author: Jan Holesovsky 
Date:   Tue Dec 27 13:19:42 2011 +0100

Fix position of the 'evaluate up to level' text and numeric field.

diff --git a/sw/source/ui/index/cnttab.src b/sw/source/ui/index/cnttab.src
index 821a2c7..71f034d 100644
--- a/sw/source/ui/index/cnttab.src
+++ b/sw/source/ui/index/cnttab.src
@@ -196,14 +196,14 @@ TabPage TP_TOX_SELECT
 };
 FixedText   FT_LEVEL
 {
-Pos = MAP_APPFONT ( 130 , 70 ) ;
-Size = MAP_APPFONT ( 60 , 8 ) ;
+Pos = MAP_APPFONT ( 130 , 72 ) ;
+Size = MAP_APPFONT ( 95 , 8 ) ;
 Text [ en-US ] = "Evaluate up to level";
 };
 NumericFieldNF_LEVEL
 {
 HelpID = "sw:NumericField:TP_TOX_SELECT:NF_LEVEL";
-Pos = MAP_APPFONT ( 231 , 72 ) ;
+Pos = MAP_APPFONT ( 231 , 70 ) ;
 Size = MAP_APPFONT ( 20 , 12 ) ;
 Border = TRUE ;
 TabStop = TRUE ;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2011-12-26 Thread Lior Kaplan
 sw/source/ui/index/idxmrk.src |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d3912cccfa4ae18c8d8b14b0bdc9f78b6ed87c54
Author: Lior Kaplan 
Date:   Tue Dec 27 00:08:29 2011 +0200

Remove an unnecessary full stop

diff --git a/sw/source/ui/index/idxmrk.src b/sw/source/ui/index/idxmrk.src
index 31c2ee7..af743fa 100644
--- a/sw/source/ui/index/idxmrk.src
+++ b/sw/source/ui/index/idxmrk.src
@@ -251,7 +251,7 @@ Text [ en-US ] = "Phonetic reading";\
 Pos = MAP_APPFONT ( IDX_COL1 , 90 ) ;  
   \
 Size = MAP_APPFONT ( 140 , 12 ) ;  
 \
 Hide = TRUE;   
 \
-Text [ en-US ] = "~Apply to all similar texts.";\
+Text [ en-US ] = "~Apply to all similar texts";\
 }; 
 \
 CheckBox CB_CASESENSITIVE  
  \
 {  
 \
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2011-12-25 Thread Lior Kaplan
 sw/source/ui/dialog/abstract.src |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 8f034379706ed47fbe9cd4cf079dcd1f8055efb2
Author: Lior Kaplan 
Date:   Sun Dec 25 22:35:23 2011 +0200

Keep abstract dialog terminology aligned

diff --git a/sw/source/ui/dialog/abstract.src b/sw/source/ui/dialog/abstract.src
index 9d318cb..4480f0b 100644
--- a/sw/source/ui/dialog/abstract.src
+++ b/sw/source/ui/dialog/abstract.src
@@ -68,7 +68,7 @@ ModalDialog DLG_INSERT_ABSTRACT
 {
 Pos = MAP_APPFONT ( 12 , 27 ) ;
 Size = MAP_APPFONT ( 120 , 8 ) ;
-Text [ en-US ] = "Subpoints per level" ;
+Text [ en-US ] = "Paragraphs per level" ;
 };
 NumericField NF_PARA
 {
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2011-12-23 Thread Cédric Bosdonnat
 sw/source/core/tox/tox.cxx|4 +++-
 sw/source/ui/index/cnttab.cxx |2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit dfa082d3836d34b19a07b326c46d1e069ed5f50b
Author: Cédric Bosdonnat 
Date:   Fri Dec 23 11:27:26 2011 +0100

Writer: Hyperlinks on ToX have 'Index Link' style by default

diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx
index 002dabf..cc949ed 100644
--- a/sw/source/core/tox/tox.cxx
+++ b/sw/source/core/tox/tox.cxx
@@ -323,7 +323,9 @@ SwForm::SwForm( TOXTypes eTyp ) // #i21237#
 SwFormTokens aTokens;
 if (TOX_CONTENT == eType)
 {
-aTokens.push_back(SwFormToken(TOKEN_LINK_START));
+SwFormToken aLinkStt (TOKEN_LINK_START);
+aLinkStt.sCharStyleName = String(SW_RES(STR_POOLCHR_TOXJUMP));
+aTokens.push_back(aLinkStt);
 aTokens.push_back(SwFormToken(TOKEN_ENTRY_NO));
 aTokens.push_back(SwFormToken(TOKEN_ENTRY_TEXT));
 }
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index cab0b19..dfb2ab5 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -2441,7 +2441,7 @@ IMPL_LINK(SwTOXEntryTabPage, InsertTokenHdl, PushButton*, 
pBtn)
 {
 sText.AssignAscii(SwForm::aFormLinkStt);
 eTokenType = TOKEN_LINK_START;
-sCharStyle = String(SW_RES(STR_POOLCHR_INET_NORMAL));
+sCharStyle = String(SW_RES(STR_POOLCHR_TOXJUMP));
 }
 else if(pBtn == &aTabPB)
 {
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2011-12-22 Thread Jan Holesovsky
 sw/source/ui/docvw/PageBreakWin.cxx |   77 +---
 sw/source/ui/inc/PageBreakWin.hxx   |2 
 vcl/inc/vcl/menubtn.hxx |3 -
 3 files changed, 50 insertions(+), 32 deletions(-)

New commits:
commit e095be2fd4a54d7cd876a6d2f86363a99ddb5ed8
Author: Jan Holesovsky 
Date:   Thu Dec 22 11:59:36 2011 +0100

Improve usability of the Page Break control.

- use the same fade in/out values that we use for headers/footers
- clicking on the line opens the menu too
- clicking outside the menu hides the button
- leaving the line or the button hides the button immediately

diff --git a/sw/source/ui/docvw/PageBreakWin.cxx 
b/sw/source/ui/docvw/PageBreakWin.cxx
index 9279c00..7c1f00e 100644
--- a/sw/source/ui/docvw/PageBreakWin.cxx
+++ b/sw/source/ui/docvw/PageBreakWin.cxx
@@ -68,7 +68,7 @@ using namespace drawinglayer::primitive2d;
 
 namespace
 {
-B2DPolygon lcl_CreatePolygon( B2DRectangle aBounds, bool bMirror )
+static B2DPolygon lcl_CreatePolygon( B2DRectangle aBounds, bool bMirror )
 {
 B2DPolygon aRetval;
 const double nRadius = 1;
@@ -164,17 +164,33 @@ namespace
 SwDashedLine( pParent, rColor ),
 m_pWin( pWin ) {};
 
-
 virtual void MouseMove( const MouseEvent& rMEvt );
+virtual void MouseButtonDown( const MouseEvent& rMEvt );
 };
 
 void SwBreakDashedLine::MouseMove( const MouseEvent& rMEvt )
 {
 if ( rMEvt.IsLeaveWindow() )
-m_pWin->Fade( false );
+{
+// don't fade if we just move to the 'button'
+Rectangle aRect( m_pWin->GetPosPixel(), m_pWin->GetSizePixel() );
+Point aEventPos( GetPosPixel() + rMEvt.GetPosPixel() );
+if ( !aRect.IsInside( aEventPos ) )
+m_pWin->Fade( false );
+}
 else if ( !m_pWin->IsVisible() )
 m_pWin->Fade( true );
 }
+
+void SwBreakDashedLine::MouseButtonDown( const MouseEvent& rMEvt )
+{
+sal_uInt16 nItemId = m_pWin->GetPopupMenu()->Execute( this, 
rMEvt.GetPosPixel() );
+if ( nItemId )
+{
+m_pWin->SetCurItemId( nItemId );
+m_pWin->Select();
+}
+}
 }
 
 SwPageBreakWin::SwPageBreakWin( SwEditWin* pEditWin, const SwPageFrm* pPageFrm 
) :
@@ -195,9 +211,10 @@ SwPageBreakWin::SwPageBreakWin( SwEditWin* pEditWin, const 
SwPageFrm* pPageFrm )
 
 // Create the popup menu
 m_pPopupMenu = new PopupMenu( SW_RES( MN_PAGEBREAK_BUTTON ) );
+m_pPopupMenu->SetDeactivateHdl( LINK( this, SwPageBreakWin, HideHandler ) 
);
 SetPopupMenu( m_pPopupMenu );
 
-m_aFadeTimer.SetTimeout( 500 );
+m_aFadeTimer.SetTimeout( 50 );
 m_aFadeTimer.SetTimeoutHdl( LINK( this, SwPageBreakWin, FadeHandler ) );
 }
 
@@ -383,7 +400,13 @@ void SwPageBreakWin::Select( )
 void SwPageBreakWin::MouseMove( const MouseEvent& rMEvt )
 {
 if ( rMEvt.IsLeaveWindow() )
-Fade( false );
+{
+// don't fade if we just move to the 'line', or the popup menu is open
+Rectangle aRect( m_pLine->GetPosPixel(), m_pLine->GetSizePixel() );
+Point aEventPos( GetPosPixel() + rMEvt.GetPosPixel() );
+if ( !aRect.IsInside( aEventPos ) && !PopupMenu::IsInExecute() )
+Fade( false );
+}
 else if ( !IsVisible() )
 Fade( true );
 }
@@ -457,13 +480,13 @@ void SwPageBreakWin::UpdatePosition( )
 long nRight = std::min( nPgRight + aBtnSize.getWidth() - ARROW_WIDTH / 
2, aVisArea.Right() );
 nBtnLeft = nRight - aBtnSize.getWidth();
 if ( IsVisible() )
-   nLineRight = nBtnLeft - ARROW_WIDTH / 2;
+   nLineRight = nBtnLeft;
 }
 else
 {
 nBtnLeft = std::max( nPgLeft - aBtnSize.Width() + ARROW_WIDTH / 2, 
aVisArea.Left() );
 if ( IsVisible() )
-   nLineLeft = nBtnLeft + aBtnSize.Width( ) + ARROW_WIDTH / 2;
+   nLineLeft = nBtnLeft + aBtnSize.Width();
 }
 
 // Set the button position
@@ -493,22 +516,26 @@ void SwPageBreakWin::SetReadonly( bool bReadonly )
 
 void SwPageBreakWin::Fade( bool bFadeIn )
 {
-if ( !PopupMenu::IsInExecute() )
-{
-m_bIsAppearing = bFadeIn;
-if ( !m_bDestroyed && m_aFadeTimer.IsActive( ) )
-m_aFadeTimer.Stop();
-if ( !m_bDestroyed )
-m_aFadeTimer.Start( );
-}
+m_bIsAppearing = bFadeIn;
+if ( !m_bDestroyed && m_aFadeTimer.IsActive( ) )
+m_aFadeTimer.Stop();
+if ( !m_bDestroyed )
+m_aFadeTimer.Start( );
+}
+
+IMPL_LINK( SwPageBreakWin, HideHandler, void *, EMPTYARG )
+{
+Fade( false );
+
+return 0;
 }
 
 IMPL_LINK( SwPageBreakWin, FadeHandler, Timer *, EMPTYARG )
 {
 if ( m_bIsAppearing && m_nFadeRate > 0 )
-m_nFadeRate -= 10;
+m_nFadeRate -= 25;
 else if ( !m_bIsAppearing && m_nFadeRate < 100 )
-m_nFadeRate += 10;
+m_nFadeRate += 25;
 
 if ( m_nFadeRate != 100 && !IsV

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

2011-12-21 Thread Cédric Bosdonnat
 sw/source/core/layout/paintfrm.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit e09b9a635ee23ce162e1733fc804a2cc182bc25f
Author: Cédric Bosdonnat 
Date:   Wed Dec 21 22:09:46 2011 +0100

Header/Footer,Page Break: fix bad test for printing mode (fdo#43962)

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index c33da28..387d8a3 100755
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -3323,7 +3323,7 @@ drawinglayer::primitive2d::Primitive2DSequence 
lcl_CreateDashedIndicatorPrimitiv
 
 void SwPageFrm::PaintBreak( ) const
 {
-if ( !pGlobalShell->GetViewOptions()->IsPrinting() &&
+if ( pGlobalShell->GetOut()->GetOutDevType() != OUTDEV_PRINTER  &&
  !pGlobalShell->GetViewOptions()->IsPDFExport() &&
  !pGlobalShell->IsPreView() )
 {
@@ -3358,7 +3358,7 @@ void SwPageFrm::PaintBreak( ) const
 
 void SwColumnFrm::PaintBreak( ) const
 {
-if ( !pGlobalShell->GetViewOptions()->IsPrinting() &&
+if ( pGlobalShell->GetOut()->GetOutDevType() != OUTDEV_PRINTER  &&
  !pGlobalShell->GetViewOptions()->IsPDFExport() &&
  !pGlobalShell->IsPreView() )
 {
@@ -3465,7 +3465,7 @@ void SwPageFrm::PaintDecorators( ) const
 {
 SwRect aBodyRect( pBody->Frm() );
 
-if ( !pGlobalShell->GetViewOptions()->IsPrinting() &&
+if ( pGlobalShell->GetOut()->GetOutDevType() != OUTDEV_PRINTER &&
  !pGlobalShell->GetViewOptions()->IsPDFExport() &&
  !pGlobalShell->IsPreView() &&
  pGlobalShell->IsShowHeaderFooterSeparator( ) )
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2011-12-19 Thread Cédric Bosdonnat
 sw/source/core/unocore/unotext.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit a327cd771e18b8677567f576e3bd88b69d2ee200
Author: Noel Power 
Date:   Mon Dec 19 16:11:04 2011 +0100

sw: avoid creating cursor with non-text node text range (fdo#40195)

diff --git a/sw/source/core/unocore/unotext.cxx 
b/sw/source/core/unocore/unotext.cxx
index 28ff73f..820239f 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -2480,6 +2480,9 @@ throw (uno::RuntimeException)
 SwUnoInternalPaM aPam(*GetDoc());
 if (::sw::XTextRangeToSwPaM(aPam, xTextPosition))
 {
+if ( !aPam.GetNode()->GetTxtNode() )
+throw uno::RuntimeException( rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM("Invalid text range") ), uno::Reference< 
uno::XInterface >() );
+
 SwNode& rNode = GetDoc()->GetNodes().GetEndOfContent();
 
 SwStartNode* p1 = aPam.GetNode()->StartOfSectionNode();
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2011-12-19 Thread Cédric Bosdonnat
 sw/source/core/access/acccontext.cxx |   15 +++
 1 file changed, 15 insertions(+)

New commits:
commit 33e1bb84abcb1ba60595a26884f8772249f7416b
Author: Vincent Povirk 
Date:   Mon Dec 19 14:51:18 2011 +0100

sw: Fix cursor accessibility API (fdo#43390)

diff --git a/sw/source/core/access/acccontext.cxx 
b/sw/source/core/access/acccontext.cxx
index 8c38ba1..2949c1e 100644
--- a/sw/source/core/access/acccontext.cxx
+++ b/sw/source/core/access/acccontext.cxx
@@ -40,6 +40,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1359,6 +1360,10 @@ sal_Bool SwAccessibleContext::Select( SwPaM *pPaM, 
SdrObject *pObj,
 if( pFEShell )
 pFEShell->FinishOLEObj();
 
+SwWrtShell* pWrtShell = pCrsrShell->ISA( SwWrtShell )
+? static_cast( pCrsrShell )
+: 0;
+
 sal_Bool bRet = sal_False;
 if( pObj )
 {
@@ -1383,7 +1388,17 @@ sal_Bool SwAccessibleContext::Select( SwPaM *pPaM, 
SdrObject *pObj,
 bCallShowCrsr = sal_True;
 }
 pCrsrShell->KillPams();
+if( pWrtShell && pPaM->HasMark() )
+// We have to do this or SwWrtShell can't figure out that it needs
+// to kill the selection later, when the user moves the cursor.
+pWrtShell->SttSelect();
 pCrsrShell->SetSelection( *pPaM );
+if( pPaM->HasMark() && *pPaM->GetPoint() == *pPaM->GetMark())
+// Setting a "Selection" that starts and ends at the same spot
+// should remove the selection rather than create an empty one, so
+// that we get defined behavior if accessibility sets the cursor
+// later.
+pCrsrShell->ClearMark();
 if( bCallShowCrsr )
 pCrsrShell->ShowCrsr();
 bRet = sal_True;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2011-12-18 Thread Ivan Timofeev
 sw/source/ui/dbui/mmmergepage.src |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 3c6197f501c1b6d59ebb4dabad5a129b62c6f051
Author: Ivan Timofeev 
Date:   Mon Dec 19 09:23:33 2011 +0400

mailmerge: move overlapped controls

diff --git a/sw/source/ui/dbui/mmmergepage.src 
b/sw/source/ui/dbui/mmmergepage.src
index a66480a..93b9390 100644
--- a/sw/source/ui/dbui/mmmergepage.src
+++ b/sw/source/ui/dbui/mmmergepage.src
@@ -69,8 +69,8 @@ TabPage DLG_MM_MERGE_PAGE
 Edit   ED_FIND
 {
 HelpID = "sw:Edit:DLG_MM_MERGE_PAGE:ED_FIND";
-Pos = MAP_APPFONT ( 55 ,114 ) ;
-Size = MAP_APPFONT ( 140 , 12 ) ;
+Pos = MAP_APPFONT ( 65 ,114 ) ;
+Size = MAP_APPFONT ( 130 , 12 ) ;
 Border = TRUE;
 };
 PushButton PB_FIND
@@ -83,21 +83,21 @@ TabPage DLG_MM_MERGE_PAGE
 CheckBox   CB_WHOLEWORDS
 {
 HelpID = "sw:CheckBox:DLG_MM_MERGE_PAGE:CB_WHOLEWORDS";
-Pos = MAP_APPFONT ( 55 , 131 ) ;
+Pos = MAP_APPFONT ( 65 , 131 ) ;
 Size = MAP_APPFONT ( 180 , 10 ) ;
 Text [ en-US ] = "Whole wor~ds only";
 };
 CheckBox   CB_BACKWARDS
 {
 HelpID = "sw:CheckBox:DLG_MM_MERGE_PAGE:CB_BACKWARDS";
-Pos = MAP_APPFONT ( 55 , 144 ) ;
+Pos = MAP_APPFONT ( 65 , 144 ) ;
 Size = MAP_APPFONT ( 180 , 10 ) ;
 Text [ en-US ] = "Back~wards";
 };
 CheckBox   CB_MATCHCASE
 {
 HelpID = "sw:CheckBox:DLG_MM_MERGE_PAGE:CB_MATCHCASE";
-Pos = MAP_APPFONT ( 55 , 157 ) ;
+Pos = MAP_APPFONT ( 65 , 157 ) ;
 Size = MAP_APPFONT ( 180 , 10 ) ;
 Text [ en-US ] = "Ma~tch case";
 };
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2011-12-17 Thread Miklos Vajna
 sw/source/filter/ww8/rtfattributeoutput.cxx |8 ++--
 sw/source/filter/ww8/rtfattributeoutput.hxx |4 
 2 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit ddc7af3e7963d1a625ef939ad0cd9830eb3ddd99
Author: Miklos Vajna 
Date:   Sun Dec 18 02:33:54 2011 +0100

fdo#37498 RTF export: handle url fields without a field result

(cherry picked from commit 6ab183533ef543ea96e15fcc5155321298c758a8)

diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx 
b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 2cd6033..17b2de3 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -460,6 +460,7 @@ bool RtfAttributeOutput::StartURL( const String& rUrl, 
const String& rTarget )
 }
 
 m_aStyles.append("}");
+m_bHadFieldResult = false;
 return true;
 }
 
@@ -468,7 +469,8 @@ bool RtfAttributeOutput::EndURL()
 OSL_TRACE("%s", OSL_THIS_FUNC);
 
 // close the fldrslt group
-m_aRunText.append('}');
+if (m_bHadFieldResult)
+m_aRunText.append('}');
 // close the field group
 m_aRunText.append('}');
 return true;
@@ -2249,6 +2251,7 @@ void RtfAttributeOutput::TextINetFormat( const 
SwFmtINetFmt& rURL )
 const SwTxtINetFmt* pTxtAtr = rURL.GetTxtINetFmt();
 
 m_aStyles.append("{" OOO_STRING_SVTOOLS_RTF_FLDRSLT " ");
+m_bHadFieldResult = true;
 if( pTxtAtr && 0 != ( pFmt = pTxtAtr->GetCharFmt() ))
 {
 sal_uInt16 nStyle = m_rExport.GetId( *pFmt );
@@ -2989,7 +2992,8 @@ RtfAttributeOutput::RtfAttributeOutput( RtfExport 
&rExport )
 m_bBufferSectionBreaks( false ),
 m_bBufferSectionHeaders( false ),
 m_bLastTable( true ),
-m_bWroteCellInfo( false )
+m_bWroteCellInfo( false ),
+m_bHadFieldResult( false )
 {
 OSL_TRACE("%s", OSL_THIS_FUNC);
 }
diff --git a/sw/source/filter/ww8/rtfattributeoutput.hxx 
b/sw/source/filter/ww8/rtfattributeoutput.hxx
index 856b14f..c96de2c 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.hxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.hxx
@@ -529,6 +529,10 @@ private:
  */
 bool m_bWroteCellInfo;
 
+/*
+ * If we had a field result in the URL.
+ */
+bool m_bHadFieldResult;
 public:
 RtfAttributeOutput( RtfExport &rExport );
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2011-12-16 Thread Cédric Bosdonnat
 sw/source/core/layout/paintfrm.cxx |4 
 sw/source/ui/docvw/HeaderFooterWin.cxx |   20 
 sw/source/ui/docvw/PageBreakWin.cxx|   16 ++--
 vcl/source/control/menubtn.cxx |2 ++
 vcl/source/window/floatwin.cxx |8 ++--
 5 files changed, 26 insertions(+), 24 deletions(-)

New commits:
commit 588857a86bcbc85e21b70ca95a9ab0c0b782a996
Author: Cédric Bosdonnat 
Date:   Thu Dec 15 12:02:29 2011 +0100

fdo#43790: RTL PopupMenu position fixes

Fixed the Writer PageBreak and Header/Footer indicator position. It also
fixed the popup menu position in RTL UI for all PopupButton instances.

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index ec104f5..c33da28 100755
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -3470,6 +3470,8 @@ void SwPageFrm::PaintDecorators( ) const
  !pGlobalShell->IsPreView() &&
  pGlobalShell->IsShowHeaderFooterSeparator( ) )
 {
+bool bRtl = Application::GetSettings().GetLayoutRTL();
+
 // Header
 const SwFrm* pHeaderFrm = Lower();
 if ( !pHeaderFrm->IsHeaderFrm() )
@@ -3477,6 +3479,8 @@ void SwPageFrm::PaintDecorators( ) const
 
 const SwRect& rVisArea = pGlobalShell->VisArea();
 long nXOff = std::min( aBodyRect.Right(), rVisArea.Right() );
+if ( bRtl )
+nXOff = std::max( aBodyRect.Left(), rVisArea.Left() );
 
 long nHeaderYOff = aBodyRect.Top();
 Point nOutputOff = rEditWin.LogicToPixel( Point( nXOff, 
nHeaderYOff ) );
diff --git a/sw/source/ui/docvw/HeaderFooterWin.cxx 
b/sw/source/ui/docvw/HeaderFooterWin.cxx
index d3ce419..64e75e4 100644
--- a/sw/source/ui/docvw/HeaderFooterWin.cxx
+++ b/sw/source/ui/docvw/HeaderFooterWin.cxx
@@ -223,6 +223,11 @@ void SwHeaderFooterWin::SetOffset( Point aOffset, long 
nXLineStart, long nXLineE
 Point aBoxPos( aOffset.X() - aBoxSize.Width() - BOX_DISTANCE,
aOffset.Y() - nYFooterOff );
 
+if ( Application::GetSettings().GetLayoutRTL() )
+{
+aBoxPos.setX( aOffset.X() + BOX_DISTANCE );
+}
+
 // Set the position & Size of the window
 SetPosSizePixel( aBoxPos, aBoxSize );
 
@@ -284,8 +289,6 @@ void SwHeaderFooterWin::Paint( const Rectangle& )
 aSeq[1] = Primitive2DReference( new PolygonHairlinePrimitive2D(
 aPolygon, aLineColor ) );
 
-bool bRtl = Application::GetSettings().GetLayoutRTL();
-
 // Create the text primitive
 B2DVector aFontSize;
 FontAttribute aFontAttr = getFontAttributeFromVclFont(
@@ -296,11 +299,7 @@ void SwHeaderFooterWin::Paint( const Rectangle& )
 
 FontMetric aFontMetric = GetFontMetric( GetFont() );
 double nTextOffsetY = aFontMetric.GetHeight() - aFontMetric.GetDescent() + 
TEXT_PADDING;
-double nTextOffsetX = TEXT_PADDING;
-if ( bRtl )
-nTextOffsetX = aRect.GetWidth( ) - aTextRect.GetWidth() - TEXT_PADDING;
-
-Point aTextPos( nTextOffsetX, nTextOffsetY );
+Point aTextPos( TEXT_PADDING, nTextOffsetY );
 
 basegfx::B2DHomMatrix aTextMatrix( createScaleTranslateB2DHomMatrix(
 aFontSize.getX(), aFontSize.getY(),
@@ -317,11 +316,8 @@ void SwHeaderFooterWin::Paint( const Rectangle& )
 // Create the 'plus' or 'arrow' primitive if not readonly
 if ( !m_bReadonly )
 {
-double aSignPosX = aRect.Right() - BUTTON_WIDTH;
-if ( bRtl )
-aSignPosX = aRect.Left();
-B2DRectangle aSignArea( B2DPoint( aSignPosX, 0.0 ),
-B2DSize( aSignPosX + BUTTON_WIDTH, 
aRect.getHeight() ) );
+B2DRectangle aSignArea( B2DPoint( aRect.Right() - BUTTON_WIDTH, 0.0 ),
+B2DSize( aRect.Right(), aRect.getHeight() ) );
 
 B2DPolygon aSign;
 if ( IsEmptyHeaderFooter( ) )
diff --git a/sw/source/ui/docvw/PageBreakWin.cxx 
b/sw/source/ui/docvw/PageBreakWin.cxx
index 2194bd9..9279c00 100644
--- a/sw/source/ui/docvw/PageBreakWin.cxx
+++ b/sw/source/ui/docvw/PageBreakWin.cxx
@@ -68,7 +68,7 @@ using namespace drawinglayer::primitive2d;
 
 namespace
 {
-B2DPolygon lcl_CreatePolygon( B2DRectangle aBounds, bool bShowOnRight )
+B2DPolygon lcl_CreatePolygon( B2DRectangle aBounds, bool bMirror )
 {
 B2DPolygon aRetval;
 const double nRadius = 1;
@@ -144,7 +144,7 @@ namespace
 
 aRetval.setClosed( true );
 
-if ( bShowOnRight )
+if ( bMirror )
 {
 B2DHomMatrix bRotMatrix = createRotateAroundPoint(
 aBounds.getCenterX(), aBounds.getCenterY(), M_PI );
@@ -233,11 +233,13 @@ void SwPageBreakWin::Paint( const Rectangle& )
 }
 
 bool bShowOnRight = ShowOnRight( );
+bool bRtl = Application::GetSettings().GetLayoutRTL();
 
 Primitive2DSequence aSeq( 3 );
 B2DRe

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

2011-12-14 Thread Cédric Bosdonnat
 sw/source/ui/docvw/HeaderFooterWin.cxx |   14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

New commits:
commit e355b05c90d5182ecf97fd5e1f762b5460b7d45c
Author: Cédric Bosdonnat 
Date:   Wed Dec 14 16:31:51 2011 +0100

Header/Footer: RTL display fixes (fdo#43793)

diff --git a/sw/source/ui/docvw/HeaderFooterWin.cxx 
b/sw/source/ui/docvw/HeaderFooterWin.cxx
index d8f6395..d3ce419 100644
--- a/sw/source/ui/docvw/HeaderFooterWin.cxx
+++ b/sw/source/ui/docvw/HeaderFooterWin.cxx
@@ -284,6 +284,8 @@ void SwHeaderFooterWin::Paint( const Rectangle& )
 aSeq[1] = Primitive2DReference( new PolygonHairlinePrimitive2D(
 aPolygon, aLineColor ) );
 
+bool bRtl = Application::GetSettings().GetLayoutRTL();
+
 // Create the text primitive
 B2DVector aFontSize;
 FontAttribute aFontAttr = getFontAttributeFromVclFont(
@@ -294,8 +296,11 @@ void SwHeaderFooterWin::Paint( const Rectangle& )
 
 FontMetric aFontMetric = GetFontMetric( GetFont() );
 double nTextOffsetY = aFontMetric.GetHeight() - aFontMetric.GetDescent() + 
TEXT_PADDING;
+double nTextOffsetX = TEXT_PADDING;
+if ( bRtl )
+nTextOffsetX = aRect.GetWidth( ) - aTextRect.GetWidth() - TEXT_PADDING;
 
-Point aTextPos( TEXT_PADDING, nTextOffsetY );
+Point aTextPos( nTextOffsetX, nTextOffsetY );
 
 basegfx::B2DHomMatrix aTextMatrix( createScaleTranslateB2DHomMatrix(
 aFontSize.getX(), aFontSize.getY(),
@@ -312,8 +317,11 @@ void SwHeaderFooterWin::Paint( const Rectangle& )
 // Create the 'plus' or 'arrow' primitive if not readonly
 if ( !m_bReadonly )
 {
-B2DRectangle aSignArea( B2DPoint( aRect.Right() - BUTTON_WIDTH, 0.0 ),
-B2DSize( aRect.Right(), aRect.getHeight() ) );
+double aSignPosX = aRect.Right() - BUTTON_WIDTH;
+if ( bRtl )
+aSignPosX = aRect.Left();
+B2DRectangle aSignArea( B2DPoint( aSignPosX, 0.0 ),
+B2DSize( aSignPosX + BUTTON_WIDTH, 
aRect.getHeight() ) );
 
 B2DPolygon aSign;
 if ( IsEmptyHeaderFooter( ) )
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2011-12-14 Thread Cédric Bosdonnat
 sw/source/core/layout/trvlfrm.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit c5f868147909111ad235e433d6f8368294080b35
Author: Cédric Bosdonnat 
Date:   Tue Dec 13 17:25:51 2011 +0100

n#676858: Fix selection of background pictures vs text

diff --git a/sw/source/core/layout/trvlfrm.cxx 
b/sw/source/core/layout/trvlfrm.cxx
index 4b54a68..d2c3d4e 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -78,7 +79,8 @@ namespace {
 static_cast(aIter());
 const SwAnchoredObject* pAnchoredObj = GetUserCall( aIter() 
)->GetAnchoredObj( aIter() );
 const SwFmtSurround& rSurround = 
pAnchoredObj->GetFrmFmt().GetSurround();
-bool bInBackground = ( rSurround.GetSurround() == 
SURROUND_THROUGHT );
+const SvxOpaqueItem& rOpaque = 
pAnchoredObj->GetFrmFmt().GetOpaque();
+bool bInBackground = ( rSurround.GetSurround() == 
SURROUND_THROUGHT ) && !rOpaque.GetValue();
 
 bool bBackgroundMatches = ( bInBackground && bSearchBackground ) ||
   ( !bInBackground && !bSearchBackground );
@@ -274,7 +276,7 @@ sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point 
&rPoint,
 }
 
 // TODO Pick up the best approaching selection
-if ( bTextRet && bBackRet && ( nTextSurface < nBackSurface ) )
+if ( bTextRet && bBackRet && ( nTextSurface > nBackSurface ) )
 {
 bRet = bBackRet;
 pPos->nNode = aBackPos.nNode;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2011-12-12 Thread Lubos Lunak
 sw/source/filter/ww8/docxattributeoutput.cxx |   28 ++-
 sw/source/filter/ww8/docxattributeoutput.hxx |   10 +
 2 files changed, 17 insertions(+), 21 deletions(-)

New commits:
commit 5cd2ae45c3da7b018b45ce00153f7ca4791a5d11
Author: Luboš Luňák 
Date:   Mon Dec 12 18:11:17 2011 +0100

fix docx hyperlink writing

This is a rewrite of the fix for fdo#35826, needed for writing
the document from bnc#706138 as docx. The sequence there is
startURL(), runText(), endRun(), endUrl(), startUrl(), runText(), endUrl(), 
endRun(),
so by the second endRun(), it is needed to close both the previous
and current hyperlink run.

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 42a132d..d9f3376 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -516,8 +516,6 @@ void DocxAttributeOutput::StartRun( const SwRedlineData* 
pRedlineData )
 
 void DocxAttributeOutput::EndRun()
 {
-if ( m_nCloseHyperlinkStatus == Detected )
-m_nCloseHyperlinkStatus = EndInThisRun;
 // Write field starts
 for ( std::vector::iterator pIt = m_Fields.begin(); pIt != 
m_Fields.end(); ++pIt )
 {
@@ -543,6 +541,11 @@ void DocxAttributeOutput::EndRun()
 // before "postponed run start")
 m_pSerializer->mark(); // let's call it "actual run start"
 
+if ( m_closeHyperlinkInPreviousRun )
+{
+m_pSerializer->endElementNS( XML_w, XML_hyperlink );
+m_closeHyperlinkInPreviousRun = false;
+}
 // prepend the actual run start
 if ( m_pHyperlinkAttrList )
 {
@@ -551,11 +554,6 @@ void DocxAttributeOutput::EndRun()
 m_pSerializer->startElementNS( XML_w, XML_hyperlink, xAttrList );
 m_pHyperlinkAttrList = NULL;
 }
-if ( m_nCloseHyperlinkStatus == EndInPrevRun)
-{
-m_pSerializer->endElementNS( XML_w, XML_hyperlink );
-m_nCloseHyperlinkStatus = Undetected;
-}
 
 // Write the hyperlink and toc fields starts
 for ( std::vector::iterator pIt = m_Fields.begin(); pIt != 
m_Fields.end(); )
@@ -592,10 +590,10 @@ void DocxAttributeOutput::EndRun()
 EndField_Impl( m_Fields.front( ) );
 m_Fields.erase( m_Fields.begin( ) );
 }
-if ( m_nCloseHyperlinkStatus == EndInThisRun)
+if ( m_closeHyperlinkInThisRun )
 {
 m_pSerializer->endElementNS( XML_w, XML_hyperlink );
-m_nCloseHyperlinkStatus = Undetected;
+m_closeHyperlinkInThisRun = false;
 }
 
 // if there is some redlining in the document, output it
@@ -1043,8 +1041,11 @@ static void impl_WriteRunText( FSHelperPtr pSerializer, 
sal_Int32 nTextToken,
 
 void DocxAttributeOutput::RunText( const String& rText, rtl_TextEncoding 
/*eCharSet*/ )
 {
-if ( m_nCloseHyperlinkStatus == Detected )
-m_nCloseHyperlinkStatus = EndInPrevRun;
+if( m_closeHyperlinkInThisRun )
+{
+m_closeHyperlinkInPreviousRun = true;
+m_closeHyperlinkInThisRun = false;
+}
 OUString aText( rText );
 
 // one text can be split into more blah's by line breaks etc.
@@ -1232,7 +1233,7 @@ bool DocxAttributeOutput::StartURL( const String& rUrl, 
const String& rTarget )
 
 bool DocxAttributeOutput::EndURL()
 {
-m_nCloseHyperlinkStatus = Detected;
+m_closeHyperlinkInThisRun = true;
 return true;
 }
 
@@ -4350,7 +4351,8 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport 
&rExport, FSHelperPtr pSeri
   m_bParagraphOpened( false ),
   m_nColBreakStatus( COLBRK_NONE ),
   m_pParentFrame( NULL ),
-  m_nCloseHyperlinkStatus( Undetected ),
+  m_closeHyperlinkInThisRun( false ),
+  m_closeHyperlinkInPreviousRun( false ),
   m_postponedGraphic( NULL ),
   m_postponedMath( NULL ),
   m_postitFieldsMaxId( 0 )
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx 
b/sw/source/filter/ww8/docxattributeoutput.hxx
index 10ee7cd..79c8b02 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -588,14 +588,8 @@ private:
 
 const sw::Frame *m_pParentFrame;
 // close of hyperlink needed
-enum HyperLinkCloseState
-{
-Undetected = 0,
-Detected,
-EndInPrevRun,
-EndInThisRun
-};
-HyperLinkCloseState m_nCloseHyperlinkStatus;
+bool m_closeHyperlinkInThisRun;
+bool m_closeHyperlinkInPreviousRun;
 
 struct PostponedGraphic
 {
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2011-12-08 Thread Ivan Timofeev
 sw/source/core/crsr/callnk.cxx |2 +-
 sw/source/core/crsr/crsrsh.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 16fbfaaa2da85415944f1a3f3e16f48ee30505f6
Author: Ivan Timofeev 
Date:   Thu Dec 8 22:55:27 2011 +0400

fdo#42147: fix crash

it is not valid to use (type & ND_TEXTNODE) before casting to SwTxtNode,
type of SwCntntNode has the ND_TEXTNODE bit as well, but SwCntntNode is not
derived from SwTxtNode.

diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx
index 66e7f45..a6373da 100644
--- a/sw/source/core/crsr/callnk.cxx
+++ b/sw/source/core/crsr/callnk.cxx
@@ -70,7 +70,7 @@ SwCallLink::SwCallLink( SwCrsrShell & rSh )
 nNdTyp = rNd.GetNodeType();
 bHasSelection = ( *pCrsr->GetPoint() != *pCrsr->GetMark() );
 
-if( ND_TEXTNODE & nNdTyp )
+if( rNd.IsTxtNode() )
 nLeftFrmPos = SwCallLink::getLayoutFrm( rShell.GetLayout(), 
(SwTxtNode&)rNd, nCntnt,
 !rShell.ActionPend() );
 else
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index ca32947..5617665 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -223,7 +223,7 @@ void SwCrsrShell::StartAction()
 nAktCntnt = pCurCrsr->GetPoint()->nContent.GetIndex();
 nAktNdTyp = rNd.GetNodeType();
 bAktSelection = *pCurCrsr->GetPoint() != *pCurCrsr->GetMark();
-if( ND_TEXTNODE & nAktNdTyp )
+if( rNd.IsTxtNode() )
 nLeftFrmPos = SwCallLink::getLayoutFrm( GetLayout(), 
(SwTxtNode&)rNd, nAktCntnt, sal_True );
 else
 nLeftFrmPos = 0;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2011-12-08 Thread Caolán McNamara
 sw/source/filter/ww8/ww8par.cxx |   69 ++--
 1 file changed, 59 insertions(+), 10 deletions(-)

New commits:
commit 7614f8a7781c0d33e86d7a5f0988f4e1f30087aa
Author: Caolán McNamara 
Date:   Thu Dec 8 12:39:07 2011 +

Resolves: fdo#43337 optimize weak-char overriding

When writer would choose the same bias automatically that word
implies or this doc hard-codes, then elide the font-forcing.
(cherry picked from commit 3e6ae8428a2d9da28c392c58bf8b3b15738088ff)

Signed-off-by: Caolán McNamara 

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 4d47144..9923768 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2777,6 +2777,26 @@ namespace
 }
 return nPos;
 }
+
+sal_Int32 lcl_getWriterScriptType(
+const uno::Reference& rBI,
+const rtl::OUString &rString, sal_Int32 nPos)
+{
+sal_Int16 nScript = i18n::ScriptType::WEAK;
+
+if (rString.isEmpty())
+return nScript;
+
+while (nPos >= 0)
+{
+nScript = rBI->getScriptType(rString, nPos);
+if (nScript != i18n::ScriptType::WEAK)
+break;
+--nPos;
+}
+
+return nScript;
+}
 }
 
 //In writer we categorize text into CJK, CTL and "Western" for everything else.
@@ -2817,6 +2837,14 @@ void 
SwWW8ImplReader::emulateMSWordAddTextToParagraph(const rtl::OUString& rAddS
 sal_Int16 nScript = lcl_getScriptType(xBI, rAddString, 0);
 sal_Int32 nLen = rAddString.getLength();
 
+rtl::OUString sParagraphText;
+const SwCntntNode *pCntNd = pPaM->GetCntntNode();
+const SwTxtNode* pNd = pCntNd ? pCntNd->GetTxtNode() : NULL;
+if (pNd)
+sParagraphText = pNd->GetTxt();
+sal_Int32 nParaOffset = sParagraphText.getLength();
+sParagraphText = sParagraphText + rAddString;
+
 sal_Int32 nPos = 0;
 while (nPos < nLen)
 {
@@ -2853,20 +2881,41 @@ void 
SwWW8ImplReader::emulateMSWordAddTextToParagraph(const rtl::OUString& rAddS
 break;
 }
 
-const SvxFontItem *pSourceFont = (const 
SvxFontItem*)GetFmtAttr(nForceFromFontId);
+//Now we know that word would use the nForceFromFontId font for 
this range
+//Try and determine what script writer would assign this range to
+
+sal_Int32 nWriterScript = lcl_getWriterScriptType(xBI, 
sParagraphText,
+nPos + nParaOffset);
+
+bool bWriterWillUseSameFontAsWordAutomatically = false;
+
+if (
+ (nWriterScript == i18n::ScriptType::ASIAN && nForceFromFontId 
== RES_CHRATR_CJK_FONT) ||
+ (nWriterScript == i18n::ScriptType::COMPLEX && 
nForceFromFontId == RES_CHRATR_CTL_FONT) ||
+ (nWriterScript == i18n::ScriptType::LATIN && nForceFromFontId 
== RES_CHRATR_FONT)
+   )
+{
+bWriterWillUseSameFontAsWordAutomatically = true;
+}
 
-for (size_t i = 0; i < SAL_N_ELEMENTS(aIds); ++i)
+//Writer won't use the same font as word, so force the issue
+if (!bWriterWillUseSameFontAsWordAutomatically)
 {
-const SvxFontItem *pDestFont = (const 
SvxFontItem*)GetFmtAttr(aIds[i]);
-aForced[i] = aIds[i] != nForceFromFontId && *pSourceFont != 
*pDestFont;
-if (aForced[i])
+const SvxFontItem *pSourceFont = (const 
SvxFontItem*)GetFmtAttr(nForceFromFontId);
+
+for (size_t i = 0; i < SAL_N_ELEMENTS(aIds); ++i)
 {
-pOverriddenItems[i] =
-(const 
SvxFontItem*)pCtrlStck->GetStackAttr(*pPaM->GetPoint(), aIds[i]);
+const SvxFontItem *pDestFont = (const 
SvxFontItem*)GetFmtAttr(aIds[i]);
+aForced[i] = aIds[i] != nForceFromFontId && *pSourceFont 
!= *pDestFont;
+if (aForced[i])
+{
+pOverriddenItems[i] =
+(const 
SvxFontItem*)pCtrlStck->GetStackAttr(*pPaM->GetPoint(), aIds[i]);
 
-SvxFontItem aForceFont(*pSourceFont);
-aForceFont.SetWhich(aIds[i]);
-pCtrlStck->NewAttr(*pPaM->GetPoint(), aForceFont);
+SvxFontItem aForceFont(*pSourceFont);
+aForceFont.SetWhich(aIds[i]);
+pCtrlStck->NewAttr(*pPaM->GetPoint(), aForceFont);
+}
 }
 }
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2011-12-08 Thread Cédric Bosdonnat
 sw/source/core/fields/reffld.cxx |   13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

New commits:
commit da8d70bcac0276a4ac9dcdd65e90e16211f45dc3
Author: Cédric Bosdonnat 
Date:   Thu Dec 8 12:34:39 2011 +0100

fdo#43521: Don't shown the name of a reference field if it's empty

diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index ff29f49..98111d0 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -276,10 +276,15 @@ String SwGetRefField::Expand() const
 
 String SwGetRefField::GetFieldName() const
 {
-String aStr(GetTyp()->GetName());
-aStr += ' ';
-aStr += sSetRefName;
-return aStr;
+if ( GetTyp()->GetName().Len() > 0 || sSetRefName.Len() > 0 )
+{
+String aStr(GetTyp()->GetName());
+aStr += ' ';
+aStr += sSetRefName;
+return aStr;
+}
+else
+return Expand();
 }
 
 // #i81002# - parameter  added
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2011-12-07 Thread Cédric Bosdonnat
 sw/source/ui/docvw/HeaderFooterWin.cxx |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit f378c85a705be23ddc7523c3122807393d27095a
Author: Cédric Bosdonnat 
Date:   Wed Dec 7 16:09:26 2011 +0100

Header/Footer: update the label as the page style may have changed

diff --git a/sw/source/ui/docvw/HeaderFooterWin.cxx 
b/sw/source/ui/docvw/HeaderFooterWin.cxx
index 076ce17..d8f6395 100644
--- a/sw/source/ui/docvw/HeaderFooterWin.cxx
+++ b/sw/source/ui/docvw/HeaderFooterWin.cxx
@@ -162,13 +162,6 @@ SwHeaderFooterWin::SwHeaderFooterWin( SwEditWin* pEditWin, 
const SwPageFrm* pPag
 // Use pixels for the rest of the drawing
 SetMapMode( MapMode ( MAP_PIXEL ) );
 
-// Compute the text to show
-m_sLabel = ResId::toString( SW_RES( STR_HEADER_TITLE ) );
-if ( !m_bIsHeader )
-m_sLabel = ResId::toString( SW_RES( STR_FOOTER_TITLE ) );
-sal_Int32 nPos = m_sLabel.lastIndexOf( rtl::OUString::createFromAscii( 
"%1" ) );
-m_sLabel = m_sLabel.replaceAt( nPos, 2, 
GetPageFrame()->GetPageDesc()->GetName() );
-
 // Create the line control
 basegfx::BColor aColor = 
SwViewOption::GetHeaderFooterMarkColor().getBColor();
 m_pLine = new SwDashedLine( GetEditWin(), aColor );
@@ -208,6 +201,13 @@ const SwPageFrm* SwHeaderFooterWin::GetPageFrame( )
 
 void SwHeaderFooterWin::SetOffset( Point aOffset, long nXLineStart, long 
nXLineEnd )
 {
+// Compute the text to show
+m_sLabel = ResId::toString( SW_RES( STR_HEADER_TITLE ) );
+if ( !m_bIsHeader )
+m_sLabel = ResId::toString( SW_RES( STR_FOOTER_TITLE ) );
+sal_Int32 nPos = m_sLabel.lastIndexOf( rtl::OUString::createFromAscii( 
"%1" ) );
+m_sLabel = m_sLabel.replaceAt( nPos, 2, 
GetPageFrame()->GetPageDesc()->GetName() );
+
 // Compute the text size and get the box position & size from it
 Rectangle aTextRect;
 GetTextBoundRect( aTextRect, String( m_sLabel ) );
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits