[Libreoffice-commits] .: 49 commits - starmath/source sw/inc sw/source

Jan Holesovsky kendy at kemper.freedesktop.org
Tue May 31 02:04:59 PDT 2011


 starmath/source/parse.cxx                   |   12 +
 sw/inc/fesh.hxx                             |    3 
 sw/inc/rcid.hrc                             |    2 
 sw/inc/section.hxx                          |   23 ++
 sw/source/core/crsr/bookmrk.cxx             |    3 
 sw/source/core/doc/doccomp.cxx              |    6 
 sw/source/core/doc/notxtfrm.cxx             |    6 
 sw/source/core/doc/poolfmt.cxx              |    2 
 sw/source/core/docnode/ndsect.cxx           |    3 
 sw/source/core/docnode/section.cxx          |    6 
 sw/source/core/frmedt/feshview.cxx          |   10 -
 sw/source/core/inc/frmtool.hxx              |    2 
 sw/source/core/inc/pagefrm.hrc              |    6 
 sw/source/core/inc/pagefrm.hxx              |   46 ++---
 sw/source/core/layout/frmtool.cxx           |    8 -
 sw/source/core/layout/layact.cxx            |   83 +++++-----
 sw/source/core/layout/newfrm.cxx            |    3 
 sw/source/core/layout/pagechg.cxx           |   10 -
 sw/source/core/layout/pagefrm.src           |   14 -
 sw/source/core/layout/paintfrm.cxx          |  224 +++++++++++++++++-----------
 sw/source/core/layout/sectfrm.cxx           |    9 -
 sw/source/core/table/swtable.cxx            |   15 +
 sw/source/core/undo/untblk.cxx              |    3 
 sw/source/core/view/pagepreviewlayout.cxx   |    3 
 sw/source/core/view/viewimp.cxx             |    6 
 sw/source/core/view/viewsh.cxx              |   36 +---
 sw/source/filter/basflt/fltini.cxx          |    8 -
 sw/source/filter/rtf/rtffld.cxx             |    3 
 sw/source/filter/ww8/docxexport.cxx         |    2 
 sw/source/filter/ww8/rtfattributeoutput.cxx |   20 +-
 sw/source/filter/ww8/wrtw8nds.cxx           |   10 -
 sw/source/filter/ww8/wrtww8.cxx             |   30 +++
 sw/source/filter/ww8/wrtww8.hxx             |    5 
 sw/source/filter/ww8/wrtww8gr.cxx           |    2 
 sw/source/filter/ww8/ww8atr.cxx             |    6 
 sw/source/filter/xml/xmlimp.cxx             |   10 +
 sw/source/ui/dialog/swabstdlg.cxx           |    3 
 sw/source/ui/frmdlg/column.cxx              |   19 --
 sw/source/ui/frmdlg/column.hrc              |    2 
 sw/source/ui/frmdlg/column.src              |   92 ++++-------
 sw/source/ui/inc/column.hxx                 |    2 
 sw/source/ui/inc/wrtsh.hxx                  |    3 
 sw/source/ui/index/cnttab.cxx               |    2 
 sw/source/ui/wrtsh/wrtsh1.cxx               |   14 +
 44 files changed, 427 insertions(+), 350 deletions(-)

New commits:
commit 36cdca2386777503c30a481d7b3a070b539557ee
Merge: 21a4a73... 654b0a3...
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Tue May 31 10:47:41 2011 +0200

    Merge branch 'master' of git://anongit.freedesktop.org/libreoffice/writer

commit 21a4a73f87a56e4c8222881762183a03516d1578
Merge: c4092e5... 8d9fc1b...
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Tue May 31 10:45:59 2011 +0200

    Merge commit 'libreoffice-3.4.0.2'
    
    Conflicts:
    	sw/inc/viewsh.hxx
    	sw/source/core/layout/paintfrm.cxx
    	sw/source/ui/index/cnttab.cxx
    	sw/source/ui/ribbar/inputwin.cxx

diff --cc sw/source/core/docnode/section.cxx
index ca4b4f2,bda3044..9dd4632
--- a/sw/source/core/docnode/section.cxx
+++ b/sw/source/core/docnode/section.cxx
@@@ -713,9 -715,10 +714,10 @@@ void SwSectionFmt::DelFrms(
      if( pIdx && &GetDoc()->GetNodes() == &pIdx->GetNodes() &&
          0 != (pSectNd = pIdx->GetNode().GetSectionNode() ))
      {
 -        // #147431# : First delete the <SwSectionFrm> of the <SwSectionFmt> instance
 +        // First delete the <SwSectionFrm> of the <SwSectionFmt> instance
          // mba: test iteration as objects are removed in iteration
-         CallSwClientNotify( SfxSimpleHint(SFX_HINT_DYING) );
+         // use hint which allows to specify, if the content shall be saved or not
+         CallSwClientNotify( SwSectionFrmMoveAndDeleteHint( sal_False ) );
   
          // Then delete frames of the nested <SwSectionFmt> instances
          SwIterator<SwSectionFmt,SwSectionFmt> aIter( *this );
diff --cc sw/source/core/layout/paintfrm.cxx
index f3f6f0a,144d2b0..2dffce7
mode 100755,100644..100755
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@@ -2876,31 -2842,23 +2877,22 @@@ SwRootFrm::Paint(SwRect const& rRect, S
      // #i68597#
      const bool bGridPainting(pSh->GetWin() && pSh->Imp()->HasDrawView() && pSh->Imp()->GetDrawView()->IsGridVisible());
  
 -    // --> OD 2008-05-16 #i84659#
 -//    while ( pPage && !::IsShortCut( aRect, pPage->Frm() ) )
 +    // #i76669#
 +    SwViewObjectContactRedirector aSwRedirector( *pSh );
 +
      while ( pPage )
 -    // <--
      {
-         // Paint right shadow in single page mode, or if we're on last page of
-         // the doc, or if ???Lower()??? or if we're on a page with no right
-         // sibling (OnRightPage should be renamed as OnEvenPage since it does
-         // not take reading direction into account)
-         const bool bPaintRightShadow =  !bBookMode || (!pPage->GetNext()) || (pPage == Lower()) || (!bLTR && !pPage->OnRightPage()) || (bLTR && pPage->OnRightPage());
-         // Have a full bottom shadow on side by side pages.
-         // TODO Do not draw full shadow if our sibling hasn't the
-         // same orientation
-         const bool bFullBottomShadow = bBookMode && pPage->GetPrev() &&
-             ((!bLTR && !pPage->OnRightPage()) || (bLTR && pPage->OnRightPage()));
+         const bool bPaintRightShadow =  pPage->IsRightShadowNeeded();
+         const bool bPaintLeftShadow = pPage->IsLeftShadowNeeded();
          const bool bRightSidebar = pPage->SidebarPosition() == sw::sidebarwindows::SIDEBAR_RIGHT;
  
          if ( !pPage->IsEmptyPage() )
          {
              SwRect aPaintRect;
-             SwPageFrm::GetBorderAndShadowBoundRect( pPage->Frm(), pSh, aPaintRect, bRightSidebar );
+             SwPageFrm::GetBorderAndShadowBoundRect( pPage->Frm(), pSh, aPaintRect,
+                 bPaintLeftShadow, bPaintRightShadow, bRightSidebar );
  
              if ( aRect.IsOver( aPaintRect ) )
 -            // <--
              {
                  if ( pSh->GetWin() )
                  {
@@@ -2993,7 -2953,9 +2985,7 @@@
                  if( pSh->GetWin() && pSh->GetDoc()->GetDocShell() &&
                      !pSh->GetDoc()->GetDocShell()->IsInPlaceActive() )
                  {
-                     SwPageFrm::PaintBorderAndShadow( pPage->Frm(), pSh, bPaintRightShadow, bFullBottomShadow, bRightSidebar );
 -                    // OD 12.02.2003 #i9719#, #105645# - use new method
 -                    // <SwPageFrm::PaintBorderAndShadow(..)>.
+                     SwPageFrm::PaintBorderAndShadow( pPage->Frm(), pSh, bPaintLeftShadow, bPaintRightShadow, bRightSidebar );
                      SwPageFrm::PaintNotesSidebar( pPage->Frm(), pSh, pPage->GetPhyPageNum(), bRightSidebar);
                  }
  
@@@ -5324,9 -5286,11 +5314,10 @@@ sal_Bool SwPageFrm::IsLeftShadowNeeded(
      // No shadow in prefs
      if( !SwViewOption::IsShadow() ) return;
  
 -    // --> FME 2004-06-24 #i16816# tagged pdf support
 +    // #i16816# tagged pdf support
      SwTaggedPDFHelper aTaggedPDFHelper( 0, 0, 0, *_pViewShell->GetOut() );
 -    // <--
  
+     static drawinglayer::primitive2d::DiscreteShadow shadowMask( SW_RES( BMP_PAGE_SHADOW_MASK ) );
      static BitmapEx aPageTopRightShadow;
      static BitmapEx aPageBottomRightShadow;
      static BitmapEx aPageBottomLeftShadow;
diff --cc sw/source/core/layout/sectfrm.cxx
index 451c216,6f8bf2f..45283a9
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@@ -2429,10 -2441,13 +2429,13 @@@ void SwSectionFrm::Modify( const SfxPoo
  
  void SwSectionFrm::SwClientNotify( const SwModify& rMod, const SfxHint& rHint )
  {
-     const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
-     if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING && &rMod == GetRegisteredIn() )
+     // #i117863#: The hint needs to indicate whether to keep the SwSectionFrm
+     // content or not.
 -    const SwSectionFrmMoveAndDeleteHint* pHint = 
++    const SwSectionFrmMoveAndDeleteHint* pHint =
+                     dynamic_cast<const SwSectionFrmMoveAndDeleteHint*>(&rHint);
+     if ( pHint && pHint->GetId() == SFX_HINT_DYING && &rMod == GetRegisteredIn() )
      {
-         SwSectionFrm::MoveCntntAndDelete( this, sal_True );
+         SwSectionFrm::MoveCntntAndDelete( this, pHint->IsSaveCntnt() );
      }
  }
  
diff --cc sw/source/filter/ww8/wrtww8gr.cxx
index 7c58068,9da0acc..439d15d
--- a/sw/source/filter/ww8/wrtww8gr.cxx
+++ b/sw/source/filter/ww8/wrtww8gr.cxx
@@@ -496,8 -497,9 +496,8 @@@ void WW8Export::OutGrf(const sw::Frame 
      // Otherwise, an additional paragraph is exported for a graphic, which is
      // forced to be treated as inline, because it's anchored inside another frame.
      if ( !rFrame.IsInline() &&
-          ( ((eAn == FLY_AT_PARA) && ( bWrtWW8 || !bIsInTable )) ||
+          ( ((eAn == FLY_AT_PARA) && ( bWrtWW8 || !IsInTable() )) ||
             (eAn == FLY_AT_PAGE)) )
 -    // <--
      {
          WriteChar( (char)0x0d ); // umgebenden Rahmen mit CR abschliessen
  
diff --cc sw/source/filter/xml/xmlimp.cxx
index c60c875,6f8cf88..03fb9fe
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@@ -1426,17 -1431,18 +1426,27 @@@ void SwXMLImport::SetConfigurationSetti
          xProps->setPropertyValue(
              OUString( RTL_CONSTASCII_USTRINGPARAM("UseOldPrinterMetrics") ), makeAny( true ) );
      }
 -    // <--
 +
 +    // Old LO versions had 66 as the value for small caps percentage, later changed to 80.
 +    // In order to keep backwards compatibility, SmallCapsPercentage66 option is written to .odt
 +    // files, and the default for new documents is 'false'. Files without this option
 +    // are considered to be old files, so set the compatibility option too.
 +    if ( !bSmallCapsPercentage66 )
 +    {
 +        xProps->setPropertyValue(
 +            OUString( RTL_CONSTASCII_USTRINGPARAM("SmallCapsPercentage66") ), makeAny( true ) );
 +    }
  
+     // Old LO versions had 66 as the value for small caps percentage, later changed to 80.
+     // In order to keep backwards compatibility, SmallCapsPercentage66 option is written to .odt
+     // files, and the default for new documents is 'false'. Files without this option
+     // are considered to be old files, so set the compatibility option too.
+     if ( !bSmallCapsPercentage66 )
+     {
+         xProps->setPropertyValue(
+             OUString( RTL_CONSTASCII_USTRINGPARAM("SmallCapsPercentage66") ), makeAny( true ) );
+     }
+ 
      Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY );
      Reference < XText > xText = xTextDoc->getText();
      Reference<XUnoTunnel> xTextTunnel( xText, UNO_QUERY);
diff --cc sw/source/ui/wrtsh/wrtsh1.cxx
index 162fa14,69c2407..5f8d8cf
--- a/sw/source/ui/wrtsh/wrtsh1.cxx
+++ b/sw/source/ui/wrtsh/wrtsh1.cxx
@@@ -745,12 -748,13 +746,13 @@@ void SwWrtShell::CalcAndSetScale( svt::
      SfxInPlaceClient* pCli = GetView().FindIPClient( xObj.GetObject(), &GetView().GetEditWin() );
      if ( !pCli )
      {
-         if ( (embed::EmbedMisc::EMBED_ACTIVATEIMMEDIATELY & nMisc) || bLinkingChart
 -        if ( (embed::EmbedMisc::EMBED_ACTIVATEIMMEDIATELY & nMisc) 
++        if ( (embed::EmbedMisc::EMBED_ACTIVATEIMMEDIATELY & nMisc)
+              || bLinkingChart
              // TODO/LATER: ResizeOnPrinterChange
               //|| SVOBJ_MISCSTATUS_RESIZEONPRINTERCHANGE & xObj->GetMiscStatus()
-              || nMisc & embed::EmbedMisc::EMBED_NEVERRESIZE // non-resizable objects need to be
-                                                             // set the size back by this method
-              )
 -             // --> OD #i117189# - refine condition for non-resizable objects                
++             // --> OD #i117189# - refine condition for non-resizable objects
+              // non-resizable objects need to be set the size back by this method
+              || ( bNoTxtFrmPrtAreaChanged && nMisc & embed::EmbedMisc::EMBED_NEVERRESIZE ) )
          {
              pCli = new SwOleClient( &GetView(), &GetView().GetEditWin(), xObj );
          }
commit 8d9fc1b0029ac554a8d649fce15059a2581c5b0f
Author: Petr Mladek <pmladek at suse.cz>
Date:   Tue May 24 19:29:16 2011 +0200

    Version 3.4.0.2, tag libreoffice-3.4.0.2 (3.4.0-rc2)
commit d08385dd9a75cdf0b970fa4f2ffe4b822d4d5b2b
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date:   Thu May 19 12:40:09 2011 +0200

    fdo#36329: Fix crash reading some documents with fields
    
    The problem came from the unsigned integer positions... Needed to
    prevent the end position to get -1/max value.
    
    Signed-off-by: Petr Mladek <pmladek at suse.cz>
    Signed-off-by: Tor Lillqvist <tlillqvist at novell.com>
    Signed-off-by: Michael Meeks <michael.meeks at novell.com>

diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx
index 0619118..2b2af4f 100644
--- a/sw/source/core/crsr/bookmrk.cxx
+++ b/sw/source/core/crsr/bookmrk.cxx
@@ -84,7 +84,8 @@ namespace
             rStart.nNode.GetNode().GetTxtNode();
         SwTxtNode const*const pEndTxtNode = rEnd.nNode.GetNode().GetTxtNode();
         const sal_Unicode ch_start=pStartTxtNode->GetTxt().GetChar(rStart.nContent.GetIndex());
-        xub_StrLen nEndPos = rEnd == rStart ? rEnd.nContent.GetIndex() : rEnd.nContent.GetIndex() - 1;
+        xub_StrLen nEndPos = ( rEnd == rStart ||  rEnd.nContent.GetIndex() == 0 ) ?
+            rEnd.nContent.GetIndex() : rEnd.nContent.GetIndex() - 1;
         const sal_Unicode ch_end=pEndTxtNode->GetTxt().GetChar( nEndPos );
         SwPaM aStartPaM(rStart);
         SwPaM aEndPaM(rEnd);
commit 55921e4c41cc791fb15c6bfe594c99ca8f678cf4
Author: Jean-Baptiste Faure <jbf.faure at orange.fr>
Date:   Sat May 21 21:37:39 2011 +0200

    give more room to style listbox
    
    Signed-off-by: Andras Timar <atimar at suse.com>
    Signed-off-by: Petr Mladek <pmladek at suse.cz>
    Signed-off-by: Kohei Yoshida <kyoshida at novell.com>

diff --git a/sw/source/ui/frmdlg/column.src b/sw/source/ui/frmdlg/column.src
index 27e28d7..26f69d6 100644
--- a/sw/source/ui/frmdlg/column.src
+++ b/sw/source/ui/frmdlg/column.src
@@ -269,7 +269,7 @@ TabPage TP_COLUMN
     {
         HelpID = "sw:ListBox:TP_COLUMN:LB_STYLE";
         Pos = MAP_APPFONT ( 45 , 154 ) ;
-        Size = MAP_APPFONT ( 35 , 66 ) ;
+        Size = MAP_APPFONT ( 40 , 66 ) ;
         TabStop = TRUE ;
         DropDown = TRUE ;
     };
@@ -284,7 +284,7 @@ TabPage TP_COLUMN
     {
         Border = TRUE ;
         Pos = MAP_APPFONT ( 45 , 170 ) ;
-        Size = MAP_APPFONT ( 35 , 12 ) ;
+        Size = MAP_APPFONT ( 40 , 12 ) ;
         TabStop = TRUE ;
         Spin = TRUE ;
         Repeat = TRUE ;
@@ -298,7 +298,7 @@ TabPage TP_COLUMN
     };
     FixedText FT_COLOR
     {
-        Pos = MAP_APPFONT ( 160 , 156 ) ;
+        Pos = MAP_APPFONT ( 165 , 156 ) ;
         Size = MAP_APPFONT ( 25 , 8 ) ;
         Text [ en-US ] = "~Color" ;
         Left = TRUE ;
@@ -306,7 +306,7 @@ TabPage TP_COLUMN
     ListBox LB_COLOR
     {
         Border = TRUE ;
-        Pos = MAP_APPFONT ( 188 , 154 ) ;
+        Pos = MAP_APPFONT ( 193 , 154 ) ;
         Size = MAP_APPFONT ( 60 , 68 ) ;
         DropDown = TRUE ;
         DDExtraWidth = TRUE ;
@@ -314,7 +314,7 @@ TabPage TP_COLUMN
     };
     FixedText FT_HEIGHT
     {
-        Pos = MAP_APPFONT ( 86 , 156 ) ;
+        Pos = MAP_APPFONT ( 91 , 156 ) ;
         Size = MAP_APPFONT ( 30 , 8 ) ;
         Text [ en-US ] = "H~eight" ;
         Left = TRUE ;
@@ -323,7 +323,7 @@ TabPage TP_COLUMN
     {
         HelpID = "sw:MetricField:TP_COLUMN:ED_HEIGHT";
         Border = TRUE ;
-        Pos = MAP_APPFONT ( 119 , 154 ) ;
+        Pos = MAP_APPFONT ( 124 , 154 ) ;
         Size = MAP_APPFONT ( 35 , 12 ) ;
         TabStop = TRUE ;
         Left = TRUE ;
@@ -339,7 +339,7 @@ TabPage TP_COLUMN
     };
     FixedText FT_POSITION
     {
-        Pos = MAP_APPFONT ( 86 , 172 ) ;
+        Pos = MAP_APPFONT ( 91 , 172 ) ;
         Size = MAP_APPFONT ( 30 , 8 ) ;
         Left = TRUE ;
         Text [ en-US ] = "~Position" ;
@@ -347,7 +347,7 @@ TabPage TP_COLUMN
     ListBox LB_POSITION
     {
         HelpID = "sw:ListBox:TP_COLUMN:LB_POSITION";
-        Pos = MAP_APPFONT ( 119 , 170 ) ;
+        Pos = MAP_APPFONT ( 124 , 170 ) ;
         Size = MAP_APPFONT ( 35 , 40 ) ;
         TabStop = TRUE ;
         DropDown = TRUE ;
@@ -376,7 +376,7 @@ TabPage TP_COLUMN
         HelpID = "sw:ListBox:TP_COLUMN:LB_TEXTDIRECTION";
         Border = TRUE ;
         Pos = MAP_APPFONT ( 75 , 58 ) ;
-        Size = MAP_APPFONT ( 127 , 50 ) ;
+        Size = MAP_APPFONT ( 150 , 50 ) ;
         DropDown = TRUE ;
         Hide = TRUE ;
     StringList [ en-US ] =
commit 28677127296199e9bb59492f87b53de77c26964c
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date:   Fri May 20 19:22:15 2011 +0200

    fdo#37387, reorganized columns dialog to show text direction correctly
    
    Signed-off-by: Andras Timar <atimar at suse.com>
    Signed-off-by: Petr Mladek <pmladek at suse.cz>
    Signed-off-by: Kohei Yoshida <kyoshida at novell.com>

diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx
index 058a622..fc4da4a 100644
--- a/sw/source/ui/frmdlg/column.cxx
+++ b/sw/source/ui/frmdlg/column.cxx
@@ -449,8 +449,6 @@ SwColumnPage::SwColumnPage(Window *pParent, const SfxItemSet &rSet)
     aLinePosLbl(this,       SW_RES(FT_POSITION)),
     aLinePosDLB(this,       SW_RES(LB_POSITION)),
 
-    aVertFL(this,         SW_RES(FL_VERT)),
-    aPropertiesFL(  this,    SW_RES( FL_PROPERTIES    )),
     aTextDirectionFT( this,  SW_RES( FT_TEXTDIRECTION )),
     aTextDirectionLB( this,  SW_RES( LB_TEXTDIRECTION )),
 
@@ -1332,25 +1330,8 @@ void SwColumnPage::SetInSection(sal_Bool bSet)
     if(!SW_MOD()->GetCTLOptions().IsCTLFontEnabled())
         return;
 
-    aVertFL.Show(bSet);
-    aPropertiesFL.Show(bSet);
     aTextDirectionFT.Show(bSet);
     aTextDirectionLB.Show(bSet);
-    if(bSet)
-    {
-        //resize line type FixedLine
-        Point aLtPos = aFLLineType.GetPosPixel();
-        Point aPropPos = aPropertiesFL.GetPosPixel();
-        Size aSz = aFLLineType.GetSizePixel();
-        aSz.Width() = aPropPos.X() - aLtPos.X() - LogicToPixel(Size(8, 8), MAP_APPFONT).Width();
-        aFLLineType.SetSizePixel(aSz);
-    }
-    else
-    {
-        Size aSz = aFLLineType.GetSizePixel();
-        aSz.Width() = LogicToPixel(Size(248, 248), MAP_APPFONT).Width();
-        aFLLineType.SetSizePixel(aSz);
-    }
 }
 
 void ColumnValueSet::UserDraw( const UserDrawEvent& rUDEvt )
diff --git a/sw/source/ui/frmdlg/column.hrc b/sw/source/ui/frmdlg/column.hrc
index a45c68d..906f1b8 100644
--- a/sw/source/ui/frmdlg/column.hrc
+++ b/sw/source/ui/frmdlg/column.hrc
@@ -75,10 +75,8 @@
 #define PB_CANCEL               56
 #define PB_OK                   57
 #define CB_BALANCECOLS			58
-#define FL_PROPERTIES           59
 #define FT_TEXTDIRECTION        60
 #define LB_TEXTDIRECTION        61
-#define FL_VERT                 62
 
 #define FT_LINEWIDTH            63
 #define ED_LINEWIDTH            64
diff --git a/sw/source/ui/frmdlg/column.src b/sw/source/ui/frmdlg/column.src
index 30d96c5..27e28d7 100644
--- a/sw/source/ui/frmdlg/column.src
+++ b/sw/source/ui/frmdlg/column.src
@@ -85,7 +85,7 @@ TabPage TP_COLUMN
     };
     FixedText FT_COLUMN
     {
-        Pos = MAP_APPFONT ( 12 , 70 ) ;
+        Pos = MAP_APPFONT ( 12 , 86 ) ;
         Size = MAP_APPFONT ( 50 , 8 ) ;
         Left = TRUE ;
         Text [ en-US ] = "Column";
@@ -99,28 +99,28 @@ TabPage TP_COLUMN
     {
         HelpID = "sw:ImageButton:TP_COLUMN:BTN_DOWN";
         Disable = TRUE ;
-        Pos = MAP_APPFONT ( 62 , 69 ) ;
+        Pos = MAP_APPFONT ( 62 , 85 ) ;
         Size = MAP_APPFONT ( 10 , 10 ) ;
         TabStop = TRUE ;
         SYMBOL = IMAGEBUTTON_ARROW_LEFT ;
     };
     FixedText FT_1
     {
-        Pos = MAP_APPFONT ( 100 , 71 ) ;
+        Pos = MAP_APPFONT ( 100 , 87 ) ;
         Size = MAP_APPFONT ( 10 , 8 ) ;
         Text = "~1" ;
         Center = TRUE ;
     };
     FixedText FT_2
     {
-        Pos = MAP_APPFONT ( 150 , 71 ) ;
+        Pos = MAP_APPFONT ( 150 , 87 ) ;
         Size = MAP_APPFONT ( 10 , 8 ) ;
         Text = "~2" ;
         Center = TRUE ;
     };
     FixedText FT_3
     {
-        Pos = MAP_APPFONT ( 200 , 71 ) ;
+        Pos = MAP_APPFONT ( 200 , 87 ) ;
         Size = MAP_APPFONT ( 10 , 8 ) ;
         Text = "~3" ;
         Center = TRUE ;
@@ -129,14 +129,14 @@ TabPage TP_COLUMN
     {
         HelpID = "sw:ImageButton:TP_COLUMN:BTN_UP";
         Disable = TRUE ;
-        Pos = MAP_APPFONT ( 238 , 69 ) ;
+        Pos = MAP_APPFONT ( 238 , 85 ) ;
         Size = MAP_APPFONT ( 10 , 10 ) ;
         TabStop = TRUE ;
         SYMBOL = IMAGEBUTTON_ARROW_RIGHT ;
     };
     FixedText FT_WIDTH
     {
-        Pos = MAP_APPFONT ( 12 , 85 ) ;
+        Pos = MAP_APPFONT ( 12 , 101 ) ;
         Size = MAP_APPFONT ( 50 , 8 ) ;
         Left = TRUE ;
         Text [ en-US ] = "Width" ;
@@ -146,7 +146,7 @@ TabPage TP_COLUMN
         HelpID = "sw:MetricField:TP_COLUMN:ED_1";
         Disable = TRUE ;
         Border = TRUE ;
-        Pos = MAP_APPFONT ( 87 , 83 ) ;
+        Pos = MAP_APPFONT ( 87 , 99 ) ;
         Size = MAP_APPFONT ( 36 , 12 ) ;
         TabStop = TRUE ;
         Left = TRUE ;
@@ -165,7 +165,7 @@ TabPage TP_COLUMN
         HelpID = "sw:MetricField:TP_COLUMN:ED_2";
         Disable = TRUE ;
         Border = TRUE ;
-        Pos = MAP_APPFONT ( 137 , 83 ) ;
+        Pos = MAP_APPFONT ( 137 , 99 ) ;
         Size = MAP_APPFONT ( 36 , 12 ) ;
         TabStop = TRUE ;
         Left = TRUE ;
@@ -184,7 +184,7 @@ TabPage TP_COLUMN
         HelpID = "sw:MetricField:TP_COLUMN:ED_3";
         Disable = TRUE ;
         Border = TRUE ;
-        Pos = MAP_APPFONT ( 187 , 83 ) ;
+        Pos = MAP_APPFONT ( 187 , 99 ) ;
         Size = MAP_APPFONT ( 36 , 12 ) ;
         TabStop = TRUE ;
         Left = TRUE ;
@@ -200,7 +200,7 @@ TabPage TP_COLUMN
     };
     FixedText FT_DIST
     {
-        Pos = MAP_APPFONT ( 12 , 101 ) ;
+        Pos = MAP_APPFONT ( 12 , 117 ) ;
         Size = MAP_APPFONT ( 50 , 8 ) ;
         Left = TRUE ;
         Text [ en-US ] = "Spacing" ;
@@ -210,7 +210,7 @@ TabPage TP_COLUMN
         HelpID = "sw:MetricField:TP_COLUMN:ED_DIST1";
         Disable = TRUE ;
         Border = TRUE ;
-        Pos = MAP_APPFONT ( 112 , 99 ) ;
+        Pos = MAP_APPFONT ( 112 , 115 ) ;
         Size = MAP_APPFONT ( 36 , 12 ) ;
         TabStop = TRUE ;
         Left = TRUE ;
@@ -229,7 +229,7 @@ TabPage TP_COLUMN
         HelpID = "sw:MetricField:TP_COLUMN:ED_DIST2";
         Disable = TRUE ;
         Border = TRUE ;
-        Pos = MAP_APPFONT ( 162 , 99 ) ;
+        Pos = MAP_APPFONT ( 162 , 115 ) ;
         Size = MAP_APPFONT ( 36 , 12 ) ;
         TabStop = TRUE ;
         Left = TRUE ;
@@ -246,45 +246,45 @@ TabPage TP_COLUMN
     CheckBox CB_AUTO_WIDTH
     {
         HelpID = "sw:CheckBox:TP_COLUMN:CB_AUTO_WIDTH";
-        Pos = MAP_APPFONT ( 87 , 115 ) ;
+        Pos = MAP_APPFONT ( 87 , 131 ) ;
         Size = MAP_APPFONT ( 100 , 10 ) ;
         Text [ en-US ] = "Auto~Width" ;
         TabStop = TRUE ;
     };
     FixedLine FL_LAYOUT
     {
-        Pos = MAP_APPFONT ( 6 , 58 ) ;
+        Pos = MAP_APPFONT ( 6 , 74 ) ;
         Size = MAP_APPFONT ( 248 , 8 ) ;
         Text [ en-US ] = "Width and spacing";
     };
 
     FixedText FT_STYLE
     {
-        Pos = MAP_APPFONT ( 12 , 140 ) ;
-        Size = MAP_APPFONT ( 35 , 8 ) ;
+        Pos = MAP_APPFONT ( 12 , 156 ) ;
+        Size = MAP_APPFONT ( 30 , 8 ) ;
         Text [ en-US ] = "St~yle" ;
         Left = TRUE ;
     };
     ListBox LB_STYLE
     {
         HelpID = "sw:ListBox:TP_COLUMN:LB_STYLE";
-        Pos = MAP_APPFONT ( 50 , 138 ) ;
-        Size = MAP_APPFONT ( 60 , 66 ) ;
+        Pos = MAP_APPFONT ( 45 , 154 ) ;
+        Size = MAP_APPFONT ( 35 , 66 ) ;
         TabStop = TRUE ;
         DropDown = TRUE ;
     };
     FixedText FT_LINEWIDTH
     {
-        Pos = MAP_APPFONT ( 12 , 156 ) ;
-        Size = MAP_APPFONT ( 35 , 8 ) ;
+        Pos = MAP_APPFONT ( 12 , 172 ) ;
+        Size = MAP_APPFONT ( 30 , 8 ) ;
         Text [ en-US ] = "~Width" ;
         Left = TRUE ;
     };
     MetricField ED_LINEWIDTH
     {
         Border = TRUE ;
-        Pos = MAP_APPFONT ( 50 , 154 ) ;
-        Size = MAP_APPFONT ( 60 , 12 ) ;
+        Pos = MAP_APPFONT ( 45 , 170 ) ;
+        Size = MAP_APPFONT ( 35 , 12 ) ;
         TabStop = TRUE ;
         Spin = TRUE ;
         Repeat = TRUE ;
@@ -298,15 +298,15 @@ TabPage TP_COLUMN
     };
     FixedText FT_COLOR
     {
-        Pos = MAP_APPFONT ( 12 , 172 ) ;
-        Size = MAP_APPFONT ( 35 , 8 ) ;
+        Pos = MAP_APPFONT ( 160 , 156 ) ;
+        Size = MAP_APPFONT ( 25 , 8 ) ;
         Text [ en-US ] = "~Color" ;
         Left = TRUE ;
     };
     ListBox LB_COLOR
     {
         Border = TRUE ;
-        Pos = MAP_APPFONT ( 50 , 170 ) ;
+        Pos = MAP_APPFONT ( 188 , 154 ) ;
         Size = MAP_APPFONT ( 60 , 68 ) ;
         DropDown = TRUE ;
         DDExtraWidth = TRUE ;
@@ -314,8 +314,8 @@ TabPage TP_COLUMN
     };
     FixedText FT_HEIGHT
     {
-        Pos = MAP_APPFONT ( 122 , 140 ) ;
-        Size = MAP_APPFONT ( 35 , 8 ) ;
+        Pos = MAP_APPFONT ( 86 , 156 ) ;
+        Size = MAP_APPFONT ( 30 , 8 ) ;
         Text [ en-US ] = "H~eight" ;
         Left = TRUE ;
     };
@@ -323,8 +323,8 @@ TabPage TP_COLUMN
     {
         HelpID = "sw:MetricField:TP_COLUMN:ED_HEIGHT";
         Border = TRUE ;
-        Pos = MAP_APPFONT ( 160 , 138 ) ;
-        Size = MAP_APPFONT ( 60 , 12 ) ;
+        Pos = MAP_APPFONT ( 119 , 154 ) ;
+        Size = MAP_APPFONT ( 35 , 12 ) ;
         TabStop = TRUE ;
         Left = TRUE ;
         Repeat = TRUE ;
@@ -339,16 +339,16 @@ TabPage TP_COLUMN
     };
     FixedText FT_POSITION
     {
-        Pos = MAP_APPFONT ( 122 , 156 ) ;
-        Size = MAP_APPFONT ( 35 , 8 ) ;
+        Pos = MAP_APPFONT ( 86 , 172 ) ;
+        Size = MAP_APPFONT ( 30 , 8 ) ;
         Left = TRUE ;
         Text [ en-US ] = "~Position" ;
     };
     ListBox LB_POSITION
     {
         HelpID = "sw:ListBox:TP_COLUMN:LB_POSITION";
-        Pos = MAP_APPFONT ( 160 , 154 ) ;
-        Size = MAP_APPFONT ( 60 , 40 ) ;
+        Pos = MAP_APPFONT ( 119 , 170 ) ;
+        Size = MAP_APPFONT ( 35 , 40 ) ;
         TabStop = TRUE ;
         DropDown = TRUE ;
         StringList [ en-US ] =
@@ -360,28 +360,14 @@ TabPage TP_COLUMN
     };
     FixedLine FL_LINETYPE
     {
-        Pos = MAP_APPFONT ( 6 , 127 ) ;
+        Pos = MAP_APPFONT ( 6 , 143 ) ;
         Size = MAP_APPFONT ( 248 , 8 ) ;
         Text [ en-US ] = "Separator line" ;
     };
-    FixedLine  FL_VERT
-    {
-        Pos = MAP_APPFONT ( 116 , 138 ) ;
-        Size = MAP_APPFONT ( 4 , 43 ) ;
-        Hide = TRUE ;
-        Vert = TRUE;
-    };
-    FixedLine   FL_PROPERTIES
-    {
-        Pos = MAP_APPFONT ( 121 , 127 ) ;
-        Size = MAP_APPFONT ( 133 , 8 ) ;
-        Hide = TRUE ;
-        Text [ en-US ] = "Properties";
-    };
     FixedText   FT_TEXTDIRECTION
     {
-        Pos = MAP_APPFONT ( 127 , 138 ) ;
-        Size = MAP_APPFONT ( 127 , 8 ) ;
+        Pos = MAP_APPFONT ( 12 , 60 ) ;
+        Size = MAP_APPFONT ( 60 , 8 ) ;
         Hide = TRUE ;
         Text [ en-US ] = "Text ~direction";
     };
@@ -389,7 +375,7 @@ TabPage TP_COLUMN
     {
         HelpID = "sw:ListBox:TP_COLUMN:LB_TEXTDIRECTION";
         Border = TRUE ;
-        Pos = MAP_APPFONT ( 127 , 149 ) ;
+        Pos = MAP_APPFONT ( 75 , 58 ) ;
         Size = MAP_APPFONT ( 127 , 50 ) ;
         DropDown = TRUE ;
         Hide = TRUE ;
diff --git a/sw/source/ui/inc/column.hxx b/sw/source/ui/inc/column.hxx
index 865e55c..04ca404 100644
--- a/sw/source/ui/inc/column.hxx
+++ b/sw/source/ui/inc/column.hxx
@@ -139,8 +139,6 @@ class SwColumnPage : public SfxTabPage
     FixedText		aLinePosLbl;
     ListBox			aLinePosDLB;
 
-    FixedLine       aVertFL;
-    FixedLine       aPropertiesFL;
     FixedText       aTextDirectionFT;
     ListBox         aTextDirectionLB;
 
commit 74df9fe4af182924c8e8e63865edc8db485c584c
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Fri May 20 14:44:03 2011 +0200

    compatibility option for old size of small caps (bnc#691473)
    
    Version 3.2 had 66 as the small capitals size percentage, later
    changed to 80 (see e.g. http://openoffice.org/bugzilla/show_bug.cgi?id=1526).
    This however can destroy layout of old documents that rely on the old
    size. So for backwards compatibility the old value is used if either
    the .odt document has an option enabled or does not have the option
    at all (meaning it's an older .odt document). There's unfortunately
    a period when the new value was already in effect where this change
    can break those documents :-/.
    
    Signed-off-by: Cedric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
    Signed-off-by: Michael Meeks <michael.meeks at novell.com>
    Signed-off-by: Jan Holesovsky <kendy at suse.cz>

diff --git a/sw/inc/IDocumentSettingAccess.hxx b/sw/inc/IDocumentSettingAccess.hxx
index 266be7f..4e83e72 100644
--- a/sw/inc/IDocumentSettingAccess.hxx
+++ b/sw/inc/IDocumentSettingAccess.hxx
@@ -81,6 +81,7 @@ namespace com { namespace sun { namespace star { namespace i18n { struct Forbidd
          TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST,
      INVERT_BORDER_SPACING,
          COLLAPSE_EMPTY_CELL_PARA,
+         SMALL_CAPS_PERCENTAGE_66,
          // COMPATIBILITY FLAGS END
 
          BROWSE_MODE,
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 4ff6238..72df51d 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -580,6 +580,7 @@ private:
     bool mbInvertBorderSpacing                      : 1;
     bool mbCollapseEmptyCellPara                    : 1;
     bool mbTabAtLeftIndentForParagraphsInList;             // #i89181# - see above
+    bool mbSmallCapsPercentage66;
 
     bool mbLastBrowseMode                           : 1;
 
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index edcbb2d..0086fc9 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -201,6 +201,7 @@ bool SwDoc::get(/*[in]*/ DocumentSettingId id) const
         case TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST: return mbTabAtLeftIndentForParagraphsInList;
         case INVERT_BORDER_SPACING: return mbInvertBorderSpacing;
         case COLLAPSE_EMPTY_CELL_PARA: return mbCollapseEmptyCellPara;
+        case SMALL_CAPS_PERCENTAGE_66: return mbSmallCapsPercentage66;
 
         case BROWSE_MODE: return mbLastBrowseMode; // Attention: normally the ViewShell has to be asked!
         case HTML_MODE: return mbHTMLMode;
@@ -331,6 +332,10 @@ void SwDoc::set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value)
         case COLLAPSE_EMPTY_CELL_PARA:
             mbCollapseEmptyCellPara = value;
             break;
+
+        case SMALL_CAPS_PERCENTAGE_66:
+            mbSmallCapsPercentage66 = value;
+            break;
          // COMPATIBILITY FLAGS END
 
         case BROWSE_MODE: //can be used temporary (load/save) when no ViewShell is avaiable
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 49d4dea..0527ab9 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -356,6 +356,7 @@ SwDoc::SwDoc()
     mbTabAtLeftIndentForParagraphsInList    = false;        // hidden #i89181#
     mbInvertBorderSpacing                   = false;        // hidden
     mbCollapseEmptyCellPara                 = true;        // hidden
+    mbSmallCapsPercentage66                 = false;        // hidden
 
     //
     // COMPATIBILITY FLAGS END
diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx
index bd29634..c26ba79 100644
--- a/sw/source/core/inc/swfont.hxx
+++ b/sw/source/core/inc/swfont.hxx
@@ -58,8 +58,9 @@ class SwSubFont : public SvxFont
     sal_uInt16	 	nOrgHeight;		// Hoehe inkl. Escapement/Proportion
     sal_uInt16	 	nOrgAscent;		// Ascent inkl. Escapement/Proportion
     sal_uInt16		nPropWidth;		// proportional width
+    bool smallCapsPercentage66;
     inline SwSubFont() : aSize(0,0)
-    { pMagic = NULL; nFntIndex = nOrgHeight = nOrgAscent = 0; nPropWidth =100; }
+    { pMagic = NULL; nFntIndex = nOrgHeight = nOrgAscent = 0; nPropWidth =100; smallCapsPercentage66 = false; }
 
     sal_uInt16 CalcEscAscent( const sal_uInt16 nOldAscent ) const;
     sal_uInt16 CalcEscHeight( const sal_uInt16 nOldHeight,
diff --git a/sw/source/core/txtnode/fntcap.cxx b/sw/source/core/txtnode/fntcap.cxx
index 4ee0af6..440e169 100644
--- a/sw/source/core/txtnode/fntcap.cxx
+++ b/sw/source/core/txtnode/fntcap.cxx
@@ -622,8 +622,13 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo )
     else
         pBigFont = pLastFont;
 
-    // Hier entsteht der Kleinbuchstabenfont:
-    aFont.SetProportion( (aFont.GetPropr() * SMALL_CAPS_PERCENTAGE ) / 100L );
+    // Older LO versions had 66 as the small caps percentage size, later changed to 80,
+    // therefore a backwards compatibility option is kept (otherwise layout is changed).
+    // NOTE: There are more uses of SMALL_CAPS_PERCENTAGE in editeng, but it seems they
+    // do not matter for Writer (and if they did it'd be pretty ugly to propagate
+    // the option there).
+    int smallCapsPercentage = smallCapsPercentage66 ? 66 : SMALL_CAPS_PERCENTAGE;
+    aFont.SetProportion( (aFont.GetPropr() * smallCapsPercentage ) / 100L );
     pMagic2 = NULL;
     nIndex2 = 0;
     SwFntAccess *pSmallFontAccess = new SwFntAccess( pMagic2, nIndex2, &aFont,
diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx
index 773d9e5..b0bc6c5 100644
--- a/sw/source/core/txtnode/swfont.cxx
+++ b/sw/source/core/txtnode/swfont.cxx
@@ -560,6 +560,12 @@ SwFont::SwFont( const SwAttrSet* pAttrSet,
         SetVertical( pAttrSet->GetCharRotate().GetValue() );
     else
         SetVertical( 0 );
+    if( pIDocumentSettingAccess && pIDocumentSettingAccess->get( IDocumentSettingAccess::SMALL_CAPS_PERCENTAGE_66 ))
+    {
+        aSub[ SW_LATIN ].smallCapsPercentage66 = true;
+        aSub[ SW_CJK ].smallCapsPercentage66 = true;
+        aSub[ SW_CTL ].smallCapsPercentage66 = true;
+    }
 }
 
 SwSubFont& SwSubFont::operator=( const SwSubFont &rFont )
@@ -571,6 +577,7 @@ SwSubFont& SwSubFont::operator=( const SwSubFont &rFont )
     nOrgAscent = rFont.nOrgAscent;
     nPropWidth = rFont.nPropWidth;
     aSize = rFont.aSize;
+    smallCapsPercentage66 = rFont.smallCapsPercentage66;
     return *this;
 }
 
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 78757d9..6f8cf88 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -1189,6 +1189,7 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
     aSet.insert(String("UpdateFromTemplate", RTL_TEXTENCODING_ASCII_US));
     aSet.insert(String("PrinterIndependentLayout", RTL_TEXTENCODING_ASCII_US));
     aSet.insert(String("PrintEmptyPages", RTL_TEXTENCODING_ASCII_US));
+    aSet.insert(String("SmallCapsPercentage66", RTL_TEXTENCODING_ASCII_US));
 
     sal_Int32 nCount = aConfigProps.getLength();
     const PropertyValue* pValues = aConfigProps.getConstArray();
@@ -1217,6 +1218,7 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
     bool bClipAsCharacterAnchoredWriterFlyFrames( false );
     bool bUnixForceZeroExtLeading = false;
     bool bUseOldPrinterMetrics = false;
+    bool bSmallCapsPercentage66 = false;
 
     OUString sRedlineProtectionKey( RTL_CONSTASCII_USTRINGPARAM( "RedlineProtectionKey" ) );
 
@@ -1284,6 +1286,8 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
                     bUnixForceZeroExtLeading = true;
                 else if( pValues->Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("UseOldPrinterMetrics")) )
                     bUseOldPrinterMetrics = true;
+                else if( pValues->Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("SmallCapsPercentage66")) )
+                    bSmallCapsPercentage66 = true;
             }
             catch( Exception& )
             {
@@ -1429,6 +1433,16 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
     }
     // <--
 
+    // Old LO versions had 66 as the value for small caps percentage, later changed to 80.
+    // In order to keep backwards compatibility, SmallCapsPercentage66 option is written to .odt
+    // files, and the default for new documents is 'false'. Files without this option
+    // are considered to be old files, so set the compatibility option too.
+    if ( !bSmallCapsPercentage66 )
+    {
+        xProps->setPropertyValue(
+            OUString( RTL_CONSTASCII_USTRINGPARAM("SmallCapsPercentage66") ), makeAny( true ) );
+    }
+
     Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY );
     Reference < XText > xText = xTextDoc->getText();
     Reference<XUnoTunnel> xTextTunnel( xText, UNO_QUERY);
diff --git a/sw/source/ui/uno/SwXDocumentSettings.cxx b/sw/source/ui/uno/SwXDocumentSettings.cxx
index 639d0bd..907aaa2 100644
--- a/sw/source/ui/uno/SwXDocumentSettings.cxx
+++ b/sw/source/ui/uno/SwXDocumentSettings.cxx
@@ -122,7 +122,8 @@ enum SwDocumentSettingsPropertyHandles
     HANDLE_MODIFYPASSWORDINFO,
     HANDLE_MATH_BASELINE_ALIGNMENT,
     HANDLE_INVERT_BORDER_SPACING,
-    HANDLE_COLLAPSE_EMPTY_CELL_PARA
+    HANDLE_COLLAPSE_EMPTY_CELL_PARA,
+    HANDLE_SMALL_CAPS_PERCENTAGE_66
 };
 
 MasterPropertySetInfo * lcl_createSettingsInfo()
@@ -180,6 +181,7 @@ MasterPropertySetInfo * lcl_createSettingsInfo()
         { RTL_CONSTASCII_STRINGPARAM("MathBaselineAlignment"), HANDLE_MATH_BASELINE_ALIGNMENT, CPPUTYPE_BOOLEAN, 0, 0},
         { RTL_CONSTASCII_STRINGPARAM("InvertBorderSpacing"), HANDLE_INVERT_BORDER_SPACING, CPPUTYPE_BOOLEAN, 0, 0},
         { RTL_CONSTASCII_STRINGPARAM("CollapseEmptyCellPara"), HANDLE_COLLAPSE_EMPTY_CELL_PARA, CPPUTYPE_BOOLEAN, 0, 0},
+        { RTL_CONSTASCII_STRINGPARAM("SmallCapsPercentage66"), HANDLE_SMALL_CAPS_PERCENTAGE_66, CPPUTYPE_BOOLEAN, 0, 0},
 /*
  * As OS said, we don't have a view when we need to set this, so I have to
  * find another solution before adding them to this property set - MTG
@@ -705,6 +707,12 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
             mpDoc->set(IDocumentSettingAccess::COLLAPSE_EMPTY_CELL_PARA, bTmp);
         }
         break;
+        case HANDLE_SMALL_CAPS_PERCENTAGE_66:
+        {
+            sal_Bool bTmp = *(sal_Bool*)rValue.getValue();
+            mpDoc->set(IDocumentSettingAccess::SMALL_CAPS_PERCENTAGE_66, bTmp);
+        }
+        break;
         default:
             throw UnknownPropertyException();
     }
@@ -1050,6 +1058,12 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf
             rValue.setValue( &bTmp, ::getBooleanCppuType() );
         }
         break;
+        case HANDLE_SMALL_CAPS_PERCENTAGE_66:
+        {
+            sal_Bool bTmp = mpDoc->get( IDocumentSettingAccess::SMALL_CAPS_PERCENTAGE_66 );
+            rValue.setValue( &bTmp, ::getBooleanCppuType() );
+        }
+        break;
         default:
             throw UnknownPropertyException();
     }
commit 83109f433e142fc4e5395331585a068843175030
Author: Noel Power <noel.power at novell.com>
Date:   Wed May 18 16:13:20 2011 +0100

    fix for fdo#36552
    
    fix up exported column widths
    
    Signed-off-by: Tor Lillqvist <tlillqvist at novell.com>
    Signed-off-by: Cedric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
    Signed-off-by: Michael Meeks <michael.meeks at novell.com>

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 74af00c..9fd3150 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1478,6 +1478,8 @@ void DocxAttributeOutput::TableCellProperties( ww8::WW8TableNodeInfoInner::Point
 
     // Cell prefered width
     SwTwips nWidth = GetGridCols( pTableTextNodeInfoInner )->at( pTableTextNodeInfoInner->getCell() );
+    if ( pTableTextNodeInfoInner->getCell() )
+        nWidth = nWidth - GetGridCols( pTableTextNodeInfoInner )->at( pTableTextNodeInfoInner->getCell() - 1 );
     m_pSerializer->singleElementNS( XML_w, XML_tcW,
            FSNS( XML_w, XML_w ), OString::valueOf( sal_Int32( nWidth ) ).getStr( ),
            FSNS( XML_w, XML_type ), "dxa",
@@ -1712,12 +1714,16 @@ void DocxAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t
 
     // Write the table grid infos
     m_pSerializer->startElementNS( XML_w, XML_tblGrid, FSEND );
-
+    sal_Int32 nPrv = 0;
     ww8::GridColsPtr pGridCols = GetGridCols( pTableTextNodeInfoInner );
     for ( ww8::GridCols::const_iterator it = pGridCols->begin(); it != pGridCols->end(); ++it )
+    {
+        sal_Int32 nWidth  =  sal_Int32( *it ) - nPrv;
         m_pSerializer->singleElementNS( XML_w, XML_gridCol,
-               FSNS( XML_w, XML_w ), OString::valueOf( sal_Int32( *it ) ).getStr( ),
+               FSNS( XML_w, XML_w ), OString::valueOf( nWidth ).getStr( ),
                FSEND );
+        nPrv = sal_Int32( *it );
+    }
 
     m_pSerializer->endElementNS( XML_w, XML_tblGrid );
 }
commit 4d18173ac8f272413a6084014a31ddc7f31995b0
Author: Petr Mladek <pmladek at suse.cz>
Date:   Tue May 17 20:49:51 2011 +0200

    Branch libreoffice-3-4-0
    
    This is 'libreoffice-3-4-0' - the stable branch for the 3.4.0 release.
    Only very safe changes, reviewed by three people are allowed.
    
    If you want to commit more complicated fix for the next 3.4.x release,
    please use the 'libreoffice-3-4' branch.
    
    If you want to build something cool, unstable, and risky, use master.
commit cfa57cbec5ece73a54d3153731d5108665b086e7
Author: Petr Mladek <pmladek at suse.cz>
Date:   Tue May 17 19:55:41 2011 +0200

    Version 3.4.0.1, tag libreoffice-3.4.0.1 (3.4.0-rc1)
commit 901ea08e2ef394e06d54fd4a3bd572a7dfe409fa
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date:   Tue May 17 16:30:59 2011 +0200

    fdo#37277: Fixed the ugly undo hack in SwInputWindow
    
    bug introduced by this commit: c3d4c1f2dc11b9ba88bffb54dd518e8c7e11108b
    
    Signed-off-by: Noel Power <noel.power at novell.com>

diff --git a/sw/source/ui/ribbar/inputwin.cxx b/sw/source/ui/ribbar/inputwin.cxx
index a2be684..992aa94 100644
--- a/sw/source/ui/ribbar/inputwin.cxx
+++ b/sw/source/ui/ribbar/inputwin.cxx
@@ -165,6 +165,7 @@ void SwInputWindow::CleanupUglyHackWithUndo()
         {
             SW_MOD()->GetUndoOptions().SetUndoCount(0);
         }
+        m_bResetUndo = sal_False;
     }
 }
 
commit e03712a9c093663895fc6d7c999d574e948ab8dd
Author: Oliver-Rainer Wittmann <od at openoffice.org>
Date:   Mon May 16 13:51:34 2011 +0200

    sw34bf06 #i117711# - correct RTF page margin export
    
    Signed-off-by: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>

diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index c08c704..93412a2 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -2677,24 +2677,24 @@ void RtfAttributeOutput::FormatULSpace( const SvxULSpaceItem& rULSpace )
 
             HdFtDistanceGlue aDistances( *m_rExport.GetCurItemSet() );
 
+            if( aDistances.dyaTop )
+            {
+                m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_MARGTSXN);
+                m_aSectionBreaks.append((sal_Int32)aDistances.dyaTop);
+            }
             if ( aDistances.HasHeader() )
             {
-                if( aDistances.dyaTop )
-                {
-                    m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_MARGTSXN);
-                    m_aSectionBreaks.append((sal_Int32)aDistances.dyaTop);
-                }
                 m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_HEADERY);
                 m_aSectionBreaks.append((sal_Int32)aDistances.dyaHdrTop);
             }
 
+            if( aDistances.dyaBottom )
+            {
+                m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_MARGBSXN);
+                m_aSectionBreaks.append((sal_Int32)aDistances.dyaBottom);
+            }
             if( aDistances.HasFooter() )
             {
-                if( aDistances.dyaBottom )
-                {
-                    m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_MARGBSXN);
-                    m_aSectionBreaks.append((sal_Int32)aDistances.dyaBottom);
-                }
                 m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_FOOTERY);
                 m_aSectionBreaks.append((sal_Int32)aDistances.dyaHdrBottom);
             }
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 901d8fb..63ee393 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -841,8 +841,10 @@ void MSWordExportBase::OutputFormat( const SwFmt& rFmt, bool bPapFmt, bool bChpF
             }
         }
         break;
+    case RES_FRMFMT:
+        break;
     default:
-        OSL_ENSURE( !this, "Was wird hier ausgegeben ??? " );
+        OSL_ENSURE( !this, "Which format is exported here?" );
         break;
     }
 
commit d5885f16f6cbed93d1dc96703a084b9aaf9af32d
Author: Roland Baudin <roland65 at free.fr>
Date:   Mon May 16 12:50:56 2011 +0200

    fdo#33781, use anti-aliasing in metafiles when anchored "as char"
    
    Signed-off-by: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>

diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 4ffc90d..0293d22 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -818,6 +818,12 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
 
     if( pGrfNd )
     {
+        // Fix for bug #33781
+        if (pShell->Imp()->GetDrawView()->IsAntiAliasing())
+        {
+            pOut->SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
+        }
+
         sal_Bool bForceSwap = sal_False, bContinue = sal_True;
         GraphicObject& rGrfObj = pGrfNd->GetGrfObj();
 
commit 5f64fa0976c59fcbb7c199d9dac856f08f99e2a4
Author: Michael Stahl <mst at openoffice.org>
Date:   Fri May 13 17:28:08 2011 +0200

    sw34bf06: doccomp.cxx: fix some resource management problems
    
    Signed-off-by: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>

diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx
index a8f2233..8630801 100644
--- a/sw/source/core/doc/doccomp.cxx
+++ b/sw/source/core/doc/doccomp.cxx
@@ -606,8 +606,8 @@ Compare::MovedData::MovedData( CompareData& rData, sal_Char* pDiscard )
 
 Compare::MovedData::~MovedData()
 {
-    delete pIndex;
-    delete pLineNum;
+    delete [] pIndex;
+    delete [] pLineNum;
 }
 
 // Suche die verschobenen Lines
@@ -626,7 +626,7 @@ Compare::CompareSequence::CompareSequence(
 
 Compare::CompareSequence::~CompareSequence()
 {
-    delete pMemory;
+    delete [] pMemory;
 }
 
 void Compare::CompareSequence::Compare( sal_uLong nStt1, sal_uLong nEnd1,
commit f9c747ad060054494bb7b4ca6e8002615fd669d0
Author: Michael Stahl <mst at openoffice.org>
Date:   Fri May 13 17:25:30 2011 +0200

    sw34bf06: #i117825#: try to reduce collateral damage from #i104949# fix
    
    only ignore text:variable-set fields that are hidden and at start of
    para.
    
    Signed-off-by: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>

diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index 39c8566..854678a 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -2561,6 +2561,7 @@ sal_uLong SwTableBox::IsValidNumTxtNd( sal_Bool bCheckAttr ) const
                 // Flys/Felder/..
                 if( pHts )
                 {
+                    xub_StrLen nNextSetField = 0;
                     for( sal_uInt16 n = 0; n < pHts->Count(); ++n )
                     {
                         const SwTxtAttr* pAttr = (*pHts)[ n ];
@@ -2568,11 +2569,21 @@ sal_uLong SwTableBox::IsValidNumTxtNd( sal_Bool bCheckAttr ) const
                             *pAttr->GetStart() ||
                             *pAttr->GetAnyEnd() < rTxt.Len() )
                         {
-                            if ( pAttr->Which() == RES_TXTATR_FIELD )
+                            if ((*pAttr->GetStart() == nNextSetField) &&
+                                (pAttr->Which() == RES_TXTATR_FIELD))
                             {
+                                // #i104949# hideous hack for report builder:
+                                // it inserts hidden variable-set fields at
+                                // the beginning of para in cell, but they
+                                // should not turn cell into text cell
                                 const SwField* pField = pAttr->GetFld().GetFld();
-                                if ( pField && pField->GetTypeId() == TYP_SETFLD )
+                                if (pField &&
+                                    (pField->GetTypeId() == TYP_SETFLD) &&
+                                    (0 != (static_cast<SwSetExpField const*>
+                                           (pField)->GetSubType() &
+                                        nsSwExtendedSubType::SUB_INVISIBLE)))
                                 {
+                                    nNextSetField = *pAttr->GetStart() + 1;
                                     continue;
                                 }
                             }
commit cc33a4836285f422cbcb29b060e2ad5c1fea849f
Author: Michael Stahl <mst at openoffice.org>
Date:   Fri May 13 17:19:55 2011 +0200

    sw34bf06: #i117867#: SwUndoInserts::RedoImpl: do not use SwUndRng
    
    Signed-off-by: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>

diff --git a/sw/source/core/undo/untblk.cxx b/sw/source/core/undo/untblk.cxx
index 75a6b8e..fb3d146 100644
--- a/sw/source/core/undo/untblk.cxx
+++ b/sw/source/core/undo/untblk.cxx
@@ -34,6 +34,7 @@
 #include <frmfmt.hxx>
 #include <doc.hxx>
 #include <IDocumentUndoRedo.hxx>
+#include <IShellCursorSupplier.hxx>
 #include <docary.hxx>
 #include <swundo.hxx>			// fuer die UndoIds
 #include <pam.hxx>
@@ -270,7 +271,7 @@ void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & rContext)
 void SwUndoInserts::RedoImpl(::sw::UndoRedoContext & rContext)
 {
     // setze noch den Cursor auf den Redo-Bereich
-    SwPaM *const pPam = & AddUndoRedoPaM(rContext);
+    SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
     SwDoc* pDoc = pPam->GetDoc();
     pPam->DeleteMark();
     pPam->GetPoint()->nNode = nSttNode - nNdDiff;
commit 7c36598c27cdb5ceb4076b04bd554bda8c5b0a69
Author: Michael Stahl <mst at openoffice.org>
Date:   Fri May 13 16:58:28 2011 +0200

    sw34bf06: #i117947#: rtf: ignore invalid tokens following field result
    
    Signed-off-by: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>

diff --git a/sw/source/filter/rtf/rtffld.cxx b/sw/source/filter/rtf/rtffld.cxx
index e14fdf2..8d66cad 100644
--- a/sw/source/filter/rtf/rtffld.cxx
+++ b/sw/source/filter/rtf/rtffld.cxx
@@ -1083,6 +1083,9 @@ void SwRTFParser::ReadField()
                                             nsSetAttrMode::SETATTR_DONTEXPAND );
                             pPam->DeleteMark();
 
+                            // #i117947#: insert result only once in case
+                            // field result is followed by invalid tokens
+                            sFieldStr.Erase();
                         }
                         break;
                     }
commit cec2e2a1272d79b138cb190dcca68337b866cde6
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date:   Fri May 13 15:25:01 2011 +0200

    fdo#36826: draw background before borders or borders may be hidden
    
    Signed-off-by: Fridrich Å trba <fridrich.strba at bluewin.ch>

diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 904c2c9..144d2b0 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -5810,13 +5810,12 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
             {
                 SwBorderAttrAccess aAccess( SwFrm::GetCache(), (SwFrm*)pFrm );
                 const SwBorderAttrs &rTmpAttrs = *aAccess.Get();
-                /// OD 06.08.2002 #99657# - paint border before painting background
-                if ( bLowerBorder )
-                    pFrm->PaintBorder( aBorderRect, pPage, rTmpAttrs );
                 if ( ( pFrm->IsLayoutFrm() && bLowerBorder ) ||
                      aFrmRect.IsOver( aRect ) )
                     pFrm->PaintBackground( aRect, pPage, rTmpAttrs, bLowMode,
                                            bLowerBorder );
+                if ( bLowerBorder )
+                    pFrm->PaintBorder( aBorderRect, pPage, rTmpAttrs );
             }
             pFrm = pFrm->GetNext();
         } while ( pFrm && pFrm->GetUpper() == this &&
commit 55a0c66901f701ad13ddd8fd41dbdcb443ca2171
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date:   Wed May 11 14:20:44 2011 +0200

    fix debug build
    
    Signed-off-by: Fridrich Å trba <fridrich.strba at bluewin.ch>

diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 93cbfc3..aaa73ca 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -1568,7 +1568,7 @@ bool SwCntntFrm::CalcLowers( SwLayoutFrm* pLay, const SwLayoutFrm* pDontLeave,
                     }
 
 #if OSL_DEBUG_LEVEL > 1
-                    OSL_FAIL( "LoopControl in SwCntntFrm::CalcLowers" )
+                    OSL_FAIL( "LoopControl in SwCntntFrm::CalcLowers" );
 #endif
                 }
             }
diff --git a/sw/source/core/undo/SwUndoPageDesc.cxx b/sw/source/core/undo/SwUndoPageDesc.cxx
index c8f9b0c..7b0eb6a 100644
--- a/sw/source/core/undo/SwUndoPageDesc.cxx
+++ b/sw/source/core/undo/SwUndoPageDesc.cxx
@@ -64,10 +64,6 @@ void DebugHeaderFooterContent( const SwPageDesc& rPageDesc )
         SwFrmFmt* pHeaderFmt = rHead.GetHeaderFmt();
         if( pHeaderFmt )
         {
-            nHeaderCount = pHeaderFmt->GetClientCount();
-            {
-                int nHeaderCount = 0;
-            }
             const SwFmtCntnt* pCntnt = &pHeaderFmt->GetCntnt();
             if( pCntnt->GetCntntIdx() )
                 nHeaderMaster = pCntnt->GetCntntIdx()->GetIndex();
@@ -77,10 +73,6 @@ void DebugHeaderFooterContent( const SwPageDesc& rPageDesc )
         SwFrmFmt* pLeftHeaderFmt = rLeftHead.GetHeaderFmt();
         if( pLeftHeaderFmt )
         {
-            nLeftHeaderCount = pLeftHeaderFmt->GetClientCount();
-            {
-                int nLeftHeaderCount = 0;
-            }
             const SwFmtCntnt* pLeftCntnt = &pLeftHeaderFmt->GetCntnt();
             if( pLeftCntnt->GetCntntIdx() )
                 nHeaderLeft = pLeftCntnt->GetCntntIdx()->GetIndex();
@@ -93,10 +85,6 @@ void DebugHeaderFooterContent( const SwPageDesc& rPageDesc )
         SwFrmFmt* pFooterFmt = rFoot.GetFooterFmt();
         if( pFooterFmt )
         {
-            nFooterCount = pFooterFmt->GetClientCount();
-            {
-                int nFooterCount = 0;
-            }
             const SwFmtCntnt* pCntnt = &pFooterFmt->GetCntnt();
             if( pCntnt->GetCntntIdx() )
                 nFooterMaster = pCntnt->GetCntntIdx()->GetIndex();
@@ -106,10 +94,6 @@ void DebugHeaderFooterContent( const SwPageDesc& rPageDesc )
         SwFrmFmt* pLeftFooterFmt = rLeftFoot.GetFooterFmt();
         if( pLeftFooterFmt )
         {
-            nLeftFooterCount = pLeftFooterFmt->GetClientCount();
-            {
-                int nLeftFooterCount = 0;
-            }
             const SwFmtCntnt* pLeftCntnt = &pLeftFooterFmt->GetCntnt();
             if( pLeftCntnt->GetCntntIdx() )
                 nFooterLeft = pLeftCntnt->GetCntntIdx()->GetIndex();
commit a6f2e395963747729c0104e17afecf32d7e119c5
Author: Henning Brinkmann <hbrinkm at openoffice.org>
Date:   Fri May 13 16:47:44 2011 +0200

    sw34bf06: #i104384#: problem exporting section breaks in tables
    
    Replace MSWordExportBase::bInTable by MSWordExportBase::IsInTable()
    
    Signed-off-by: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>

diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index 074a128..33312da 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -378,7 +378,7 @@ void DocxExport::OutputEndNode( const SwEndNode& rEndNode )
         if ( rNd.IsEndNode() && rNd.StartOfSectionNode()->IsSectionNode() )
             return;
 
-        if ( !rNd.IsSectionNode() && !bIsInTable ) // No sections in table
+        if ( !rNd.IsSectionNode() && IsInTable() ) // No sections in table
         {
             const SwSectionFmt* pParentFmt = rSect.GetFmt()->GetParent();
             if( !pParentFmt )
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index fff7c63..7808f89 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -1748,7 +1748,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
 
     AttrOutput().StartParagraph( pTextNodeInfo );
 
-    bool bFlyInTable = mpParentFrame && bIsInTable;
+    bool bFlyInTable = mpParentFrame && IsInTable();
 
     if ( !bFlyInTable )
         nStyleBeforeFly = GetId( lcl_getFormatCollection( *this, &rNode ) );
@@ -2021,7 +2021,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
 
     AttrOutput().ParagraphStyle( nStyle );
 
-    if ( mpParentFrame && !bIsInTable )    // Fly-Attrs
+    if ( mpParentFrame && IsInTable() )    // Fly-Attrs
         OutputFormat( mpParentFrame->GetFrmFmt(), false, false, true );
 
     if ( pTextNodeInfo.get() != NULL )
@@ -2419,7 +2419,7 @@ void MSWordExportBase::OutputSectionNode( const SwSectionNode& rSectionNode )
 
     SwNodeIndex aIdx( rSectionNode, 1 );
     const SwNode& rNd = aIdx.GetNode();
-    if ( !rNd.IsSectionNode() && !bIsInTable ) //No sections in table
+    if ( !rNd.IsSectionNode() && !IsInTable() ) //No sections in table
     {
         // Bug 74245 - if the first Node inside the section has an own
         //              PageDesc or PageBreak attribut, then dont write
@@ -2569,7 +2569,7 @@ void WW8AttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFmt, const Point
         if( nStt >= nEnd )      // kein Bereich, also kein gueltiger Node
             return;
 
-        if ( !m_rWW8Export.bIsInTable && rFmt.IsInline() )
+        if ( !m_rWW8Export.IsInTable() && rFmt.IsInline() )
         {
             //Test to see if this textbox contains only a single graphic/ole
             SwTxtNode* pParTxtNode = rAnch.GetCntntAnchor()->nNode.GetNode().GetTxtNode();
@@ -2597,7 +2597,7 @@ void WW8AttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFmt, const Point
 
             m_rWW8Export.mpParentFrame = &rFmt;
             if (
-                 m_rWW8Export.bIsInTable &&
+                m_rWW8Export.IsInTable() &&
                  (FLY_AT_PAGE != rAnch.GetAnchorId()) &&
                  !m_rWW8Export.pDoc->GetNodes()[ nStt ]->IsNoTxtNode()
                )
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 6d8fe00..6cd10cb 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -1776,7 +1776,6 @@ void MSWordExportBase::SaveData( sal_uLong nStt, sal_uLong nEnd )
     aData.eOldAnchorType = eNewAnchorType;
 
     aData.bOldOutTable = bOutTable;
-    aData.bOldIsInTable = bIsInTable;
     aData.bOldFlyFrmAttrs = bOutFlyFrmAttrs;
     aData.bOldStartTOX = bStartTOX;
     aData.bOldInWriteTOX = bInWriteTOX;
@@ -1811,7 +1810,6 @@ void MSWordExportBase::RestoreData()
     pOrigPam = rData.pOldEnd;
 
     bOutTable = rData.bOldOutTable;
-    bIsInTable = rData.bOldIsInTable;
     bOutFlyFrmAttrs = rData.bOldFlyFrmAttrs;
     bStartTOX = rData.bOldStartTOX;
     bInWriteTOX = rData.bOldInWriteTOX;
@@ -2432,7 +2430,7 @@ void WW8Export::SectionBreaksAndFrames( const SwTxtNode& rNode )
     OutputSectionBreaks( rNode.GetpSwAttrSet(), rNode );
 
     // all textframes anchored as character for the winword 7- format
-    if ( !bWrtWW8 && !bIsInTable )
+    if ( !bWrtWW8 && !IsInTable() )
         OutWW6FlyFrmsInCntnt( rNode );
 }
 
@@ -2488,7 +2486,7 @@ void MSWordExportBase::WriteText()
                 ;
             else if ( aIdx.GetNode().IsSectionNode() )
                 ;
-            else if ( !bIsInTable ) //No sections in table
+            else if ( !IsInTable() ) //No sections in table
             {
                 ReplaceCr( (char)0xc ); // Indikator fuer Page/Section-Break
 
@@ -2567,6 +2565,28 @@ void WW8Export::WriteMainText()
 #endif
 }
 
+bool MSWordExportBase::IsInTable() const
+{
+    bool bResult = false;
+
+    if (pCurPam != NULL)
+    {
+        SwNode * pNode = pCurPam->GetNode();
+
+        if (pNode != NULL && mpTableInfo.get() != NULL)
+        {
+            ww8::WW8TableNodeInfo::Pointer_t pTableNodeInfo = mpTableInfo->getTableNodeInfo(pNode);
+
+            if (pTableNodeInfo.get() != NULL && pTableNodeInfo->getDepth() > 0)
+            {
+                bResult = true;
+            }
+        }
+    }
+
+    return bResult;
+}
+
 typedef ww8::WW8Sttb< ww8::WW8Struct >  WW8SttbAssoc;
 
 void WW8Export::WriteFkpPlcUsw()
@@ -2873,7 +2893,7 @@ void MSWordExportBase::ExportDocument( bool bWriteAll )
 
     bStyDef = bBreakBefore = bOutKF =
         bOutFlyFrmAttrs = bOutPageDescs = bOutTable = bOutFirstPage =
-        bIsInTable = bOutGrf = bInWriteEscher = bStartTOX =
+        bOutGrf = bInWriteEscher = bStartTOX =
         bInWriteTOX = false;
 
     bFtnAtTxtEnd = bEndAtTxtEnd = true;
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index a6e8ae6..417d0e0 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -539,8 +539,6 @@ public:
     sal_uInt8 bOutFirstPage : 1;     // write Attrset of FirstPageDesc
     sal_uInt8 bOutTable : 1;         // Tabelle wird ausgegeben
                                 //    ( wird zB bei Flys in Tabelle zurueckgesetzt )
-    sal_uInt8 bIsInTable : 1;        // wird sind innerhalb der Ausgabe einer Tabelle
-                                //    ( wird erst nach der Tabelle zurueckgesetzt )
     sal_uInt8 bOutGrf : 1;           // Grafik wird ausgegeben
     sal_uInt8 bInWriteEscher : 1;    // in write textboxes
     sal_uInt8 bStartTOX : 1;         // true: a TOX is startet
@@ -572,6 +570,9 @@ public:
     /// Iterate through the nodes and call the appropriate OutputNode() on them.
     void WriteText();
 
+    /// Return whether cuurently exported node is in table.
+    bool IsInTable() const;
+
     /// Set the pCurPam appropriately and call WriteText().
     ///
     /// Used to export paragraphs in footnotes/endnotes/etc.
diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx
index 3f07ea8..9da0acc 100644
--- a/sw/source/filter/ww8/wrtww8gr.cxx
+++ b/sw/source/filter/ww8/wrtww8gr.cxx
@@ -497,7 +497,7 @@ void WW8Export::OutGrf(const sw::Frame &rFrame)
     // Otherwise, an additional paragraph is exported for a graphic, which is
     // forced to be treated as inline, because it's anchored inside another frame.
     if ( !rFrame.IsInline() &&
-         ( ((eAn == FLY_AT_PARA) && ( bWrtWW8 || !bIsInTable )) ||
+         ( ((eAn == FLY_AT_PARA) && ( bWrtWW8 || !IsInTable() )) ||
            (eAn == FLY_AT_PAGE)) )
     // <--
     {
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 9448cca..901d8fb 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -1472,7 +1472,7 @@ void WW8AttributeOutput::CharRotate( const SvxCharRotateItem& rRotate )
     if ( !rRotate.GetValue() )
         return;
 
-    if ( m_rWW8Export.bWrtWW8 && !m_rWW8Export.bIsInTable )
+    if ( m_rWW8Export.bWrtWW8 && !m_rWW8Export.IsInTable() )
     {
         // #i36867 In word the text in a table is rotated via the TC or NS_sprm::LN_TTextFlow
         // This means you can only rotate all or none of the text adding NS_sprm::LN_CEastAsianLayout
commit 47f7b6d36ea6059d2cc770f7e752cade18bce345
Author: Oliver-Rainer Wittmann <od at openoffice.org>
Date:   Fri May 13 16:33:26 2011 +0200

    sw34bf06: #i117189# - refine condition for non-resizable objects
    
    Refine condition for non-resizable objects to apply its size back
    via new parameter <bNoTxtFrmPrtAreaChanged>. Otherwise non-resizable
    objects are always reloaded.
    
    Signed-off-by: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>

diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx
index 5cf3e9b..7cd094f 100644
--- a/sw/inc/fesh.hxx
+++ b/sw/inc/fesh.hxx
@@ -410,7 +410,8 @@ public:
     // Else the size is provided via GetCurFlyRect().
     virtual void CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
                                   const SwRect *pFlyPrtRect = 0,
-                                  const SwRect *pFlyFrmRect = 0 ) = 0;
+                                  const SwRect *pFlyFrmRect = 0,
+                                  const bool bNoTxtFrmPrtAreaChanged = false ) = 0;
 
     // Connect objects with ActivateWhenVisible at Paint.
     // Called by notxtfrm::Paint, implemented in wrtsh.
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 2bbdde1..8a9e401 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -889,6 +889,10 @@ SwCntntNotify::~SwCntntNotify()
                  (pNd->GetOLEObj().IsOleRef() ||
                   pNd->IsOLESizeInvalid()) )
             {
+                const bool bNoTxtFrmPrtAreaChanged =
+                        ( aPrt.SSize().Width() != 0 &&
+                          aPrt.SSize().Height() != 0 ) &&
+                        aPrt.SSize() != pCnt->Prt().SSize();
                 OSL_ENSURE( pCnt->IsInFly(), "OLE not in FlyFrm" );
                 SwFlyFrm *pFly = pCnt->FindFlyFrm();
                 svt::EmbeddedObjectRef& xObj = pNd->GetOLEObj().GetObject();
@@ -915,7 +919,9 @@ SwCntntNotify::~SwCntntNotify()
                         // uiview/view.cxx.
                         if ( !pNd->IsOLESizeInvalid() &&
                              !pSh->GetDoc()->IsUpdateExpFld() )
-                            pFESh->CalcAndSetScale( xObj, &pFly->Prt(), &pFly->Frm());
+                            pFESh->CalcAndSetScale( xObj,
+                                                    &pFly->Prt(), &pFly->Frm(),
+                                                    bNoTxtFrmPrtAreaChanged );
                     }
                     pTmp = (ViewShell*)pTmp->GetNext();
                 } while ( pTmp != pSh );
diff --git a/sw/source/ui/inc/wrtsh.hxx b/sw/source/ui/inc/wrtsh.hxx
index 20a06fc..8b1cdf5 100644
--- a/sw/source/ui/inc/wrtsh.hxx
+++ b/sw/source/ui/inc/wrtsh.hxx
@@ -347,7 +347,8 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)();
     virtual void MoveObjectIfActive( svt::EmbeddedObjectRef& xObj, const Point& rOffset );
     virtual void CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
                                   const SwRect *pFlyPrtRect = 0,
-                                  const SwRect *pFlyFrmRect = 0 );
+                                  const SwRect *pFlyFrmRect = 0,
+                                  const bool bNoTxtFrmPrtAreaChanged = false );
     virtual void ConnectObj( svt::EmbeddedObjectRef&  xIPObj, const SwRect &rPrt,
                              const SwRect &rFrm );
 
diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx
index 50d1e42..69c2407 100644
--- a/sw/source/ui/wrtsh/wrtsh1.cxx
+++ b/sw/source/ui/wrtsh/wrtsh1.cxx
@@ -664,8 +664,9 @@ void SwWrtShell::MoveObjectIfActive( svt::EmbeddedObjectRef& xObj, const Point&
 
 
 void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
-                             const SwRect *pFlyPrtRect,
-                             const SwRect *pFlyFrmRect )
+                                  const SwRect *pFlyPrtRect,
+                                  const SwRect *pFlyFrmRect,
+                                  const bool bNoTxtFrmPrtAreaChanged )
 {
     //Einstellen der Skalierung am Client. Diese ergibt sich aus der Differenz
     //zwischen der VisArea des Objektes und der ObjArea.
@@ -747,12 +748,13 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
     SfxInPlaceClient* pCli = GetView().FindIPClient( xObj.GetObject(), &GetView().GetEditWin() );
     if ( !pCli )
     {
-        if ( (embed::EmbedMisc::EMBED_ACTIVATEIMMEDIATELY & nMisc) || bLinkingChart
+        if ( (embed::EmbedMisc::EMBED_ACTIVATEIMMEDIATELY & nMisc) 
+             || bLinkingChart
             // TODO/LATER: ResizeOnPrinterChange
              //|| SVOBJ_MISCSTATUS_RESIZEONPRINTERCHANGE & xObj->GetMiscStatus()
-             || nMisc & embed::EmbedMisc::EMBED_NEVERRESIZE // non-resizable objects need to be
-                                                            // set the size back by this method
-             )
+             // --> OD #i117189# - refine condition for non-resizable objects                
+             // non-resizable objects need to be set the size back by this method
+             || ( bNoTxtFrmPrtAreaChanged && nMisc & embed::EmbedMisc::EMBED_NEVERRESIZE ) )
         {
             pCli = new SwOleClient( &GetView(), &GetView().GetEditWin(), xObj );
         }
commit ca1d46a4dff0e83245abe09cf87764147a8125d9
Author: Oliver-Rainer Wittmann <od at openoffice.org>
Date:   Fri May 13 16:00:26 2011 +0200

    sw34bf06: #i117863# SwFEShell::GetSectionWidth(): correct for-loop conditions
    
    Signed-off-by: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>

diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index 8a8a1c6..ef9becd 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -2804,9 +2804,13 @@ long SwFEShell::GetSectionWidth( SwFmt& rFmt ) const
         while( pSect );
     }
     SwIterator<SwSectionFrm,SwFmt> aIter( rFmt );
-    for ( SwSectionFrm* pSct = aIter.First(); pFrm; pFrm = aIter.Next() )
-            if( !pSct->IsFollow() )
-                return pSct->Frm().Width();
+    for ( SwSectionFrm* pSct = aIter.First(); pSct; pSct = aIter.Next() )
+    {
+        if( !pSct->IsFollow() )
+        {
+            return pSct->Frm().Width();
+        }
+    }
     return 0;
 }
 
commit d3fc7a8f4d0f6f8062eb046f0ccf43b6b06fe639
Author: Oliver-Rainer Wittmann <od at openoffice.org>
Date:   Fri May 13 15:44:49 2011 +0200

    fdo#36524: fix crash when deleting TOX
    
    sw34bf06: #i117863# - use hint which allows to specify, if content is
    saved or not for deletion of <SwFrm> instances triggered from <SwSectionNode>
    resp. <SwSectionFmt> methods
    
    Signed-off-by: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>

diff --git a/sw/inc/section.hxx b/sw/inc/section.hxx
index 4716ca9..678e5df 100644
--- a/sw/inc/section.hxx
+++ b/sw/inc/section.hxx
@@ -36,6 +36,7 @@
 #include <tools/rtti.hxx>
 #include <tools/ref.hxx>
 #include <svl/svarray.hxx>
+#include <svl/smplhint.hxx>
 #include <sfx2/lnkbase.hxx>
 #include <sfx2/Metadatable.hxx>
 
@@ -267,6 +268,28 @@ public:
 
 };
 
+/** Hint used to notify the deletion of SwSectionFrm objects with or without
+    keeping the content of the frame  #i117863#.
+ */
+class SwSectionFrmMoveAndDeleteHint : public SfxSimpleHint
+{
+    public:
+        SwSectionFrmMoveAndDeleteHint( const sal_Bool bSaveCntnt )
+            : SfxSimpleHint( SFX_HINT_DYING )
+            , mbSaveCntnt( bSaveCntnt )
+        {}
+
+        ~SwSectionFrmMoveAndDeleteHint()
+        {}
+
+        sal_Bool IsSaveCntnt() const
+        {
+            return mbSaveCntnt;
+        }
+
+    private:
+        const sal_Bool mbSaveCntnt;
+};
 
 enum SectionSort { SORTSECT_NOT, SORTSECT_NAME, SORTSECT_POS };
 
diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx
index 1a9a64b..daeca26 100644
--- a/sw/source/core/docnode/ndsect.cxx
+++ b/sw/source/core/docnode/ndsect.cxx
@@ -1066,7 +1066,8 @@ SwFrm* SwClearDummies( SwFrm* pFrm )
 SwSectionNode::~SwSectionNode()
 {
     // mba: test if iteration works as clients will be removed in callback
-    m_pSection->GetFmt()->CallSwClientNotify( SfxSimpleHint( SFX_HINT_DYING ) );
+    // use hint which allows to specify, if the content shall be saved or not
+    m_pSection->GetFmt()->CallSwClientNotify( SwSectionFrmMoveAndDeleteHint( sal_True ) );
     SwSectionFmt* pFmt = m_pSection->GetFmt();
     if( pFmt )
     {
diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx
index 3643fb7..bda3044 100644
--- a/sw/source/core/docnode/section.cxx
+++ b/sw/source/core/docnode/section.cxx
@@ -686,7 +686,8 @@ SwSectionFmt::~SwSectionFmt()
                 }
             }
             // mba: test iteration; objects are removed while iterating
-            CallSwClientNotify( SfxSimpleHint(SFX_HINT_DYING) );
+            // use hint which allows to specify, if the content shall be saved or not
+            CallSwClientNotify( SwSectionFrmMoveAndDeleteHint( sal_True ) );
 
             // hebe die Section doch mal auf
             SwNodeRange aRg( *pSectNd, 0, *pSectNd->EndOfSectionNode() );
@@ -716,7 +717,8 @@ void SwSectionFmt::DelFrms()
     {
         // #147431# : First delete the <SwSectionFrm> of the <SwSectionFmt> instance
         // mba: test iteration as objects are removed in iteration
-        CallSwClientNotify( SfxSimpleHint(SFX_HINT_DYING) );
+        // use hint which allows to specify, if the content shall be saved or not
+        CallSwClientNotify( SwSectionFrmMoveAndDeleteHint( sal_False ) );
  
         // Then delete frames of the nested <SwSectionFmt> instances
         SwIterator<SwSectionFmt,SwSectionFmt> aIter( *this );
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index 2eff305..6f8bf2f 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -2441,10 +2441,13 @@ void SwSectionFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
 
 void SwSectionFrm::SwClientNotify( const SwModify& rMod, const SfxHint& rHint )
 {
-    const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
-    if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING && &rMod == GetRegisteredIn() )
+    // #i117863#: The hint needs to indicate whether to keep the SwSectionFrm
+    // content or not.
+    const SwSectionFrmMoveAndDeleteHint* pHint = 
+                    dynamic_cast<const SwSectionFrmMoveAndDeleteHint*>(&rHint);
+    if ( pHint && pHint->GetId() == SFX_HINT_DYING && &rMod == GetRegisteredIn() )
     {
-        SwSectionFrm::MoveCntntAndDelete( this, sal_False );
+        SwSectionFrm::MoveCntntAndDelete( this, pHint->IsSaveCntnt() );
     }
 }
 
commit 07aedcbb2492e2e47167c8e059467ece5f01d383
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date:   Thu May 12 17:08:32 2011 +0200

    fdo#36524: Fixed remaining SwSectionFrm after deleting TOX
    
    false transformed to true restored the SwSectionFrm after deleting it.

diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index 9868d2c..2eff305 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -2444,7 +2444,7 @@ void SwSectionFrm::SwClientNotify( const SwModify& rMod, const SfxHint& rHint )
     const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
     if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING && &rMod == GetRegisteredIn() )
     {
-        SwSectionFrm::MoveCntntAndDelete( this, sal_True );
+        SwSectionFrm::MoveCntntAndDelete( this, sal_False );
     }
 }
 
commit 746fff15ad34616635e09125f6d0656da39a05ad
Author: Tor Lillqvist <tlillqvist at novell.com>
Date:   Thu May 12 17:34:12 2011 +0200

    Assign to iterator the return value of insert(), fixes fdo#36957
    
    Note that the code path through the else branch is likely broken, too.
    
    Signed-off-by: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>

diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index f8de59b..ae7dfad 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -3187,7 +3187,7 @@ void	SwTokenWindow::InsertAtSelection(
         SwFormToken aTmpToken(TOKEN_TEXT);
         SwTOXEdit* pEdit = new SwTOXEdit(&aCtrlParentWin, this, aTmpToken);
 
-        aControlList.insert(iterInsert, pEdit);
+        iterInsert = aControlList.insert(iterInsert, pEdit);
 
         pEdit->SetText(sRight);
         pEdit->SetSizePixel(aControlSize);
commit 63d6ea7efa4d6215b2458e9be4237d9cb9cc7bd9
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date:   Wed May 11 17:31:00 2011 +0200

    fdo#36667: Fixed update of table formulas, missing extraction of pNewVal
    
    Signed-off-by: Fridrich Å trba <fridrich.strba at bluewin.ch>

diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index 0c9e3dd..39c8566 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -2270,6 +2270,8 @@ void SwTableBoxFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
                             GetChgSet()->Get( RES_BOXATR_FORMAT )).GetValue();
                 rSet.GetItemState( RES_BOXATR_FORMULA, sal_False,
                                     (const SfxPoolItem**)&pNewFml );
+                rSet.GetItemState( RES_BOXATR_VALUE, sal_False,
+                                    (const SfxPoolItem**)&pNewVal );
             }
             break;
 
commit bb7fbd06a6999a3604f720a130d81651d73e5e80
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date:   Wed May 11 14:22:53 2011 +0200

    fdo#35805 Revert "write also properties of a text node itself"
    
    This reverts commit 17e60033f28d13b7564bfcbabcc8e03d2a6a021d.
    
    Signed-off-by: Luboš Luňák <l.lunak at suse.cz>

diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 833e12f..fff7c63 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -2328,11 +2328,6 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
         }
     }
 
-    // write attributes of the node itself
-    AttrOutput().StartRunProperties();
-    OutputItemSet( rNode.GetSwAttrSet(), false, true, i18n::ScriptType::LATIN, false);
-    AttrOutput().EndRunProperties( NULL );
-
     AttrOutput().EndParagraphProperties();
 
     AttrOutput().EndParagraph( pTextNodeInfoInner );
commit ed0f8821d6a0bb61e061747d2b0875fd1c346a5e
Author: Noel Power <nopower at novell.com>
Date:   Wed May 11 13:51:16 2011 +0200

    Fix crash when printing comments, fdo#37045.
    
    Signed-off-by: Jan Holesovsky <kendy at suse.cz>

diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index 2f02904..86eefcb 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -609,7 +609,8 @@ SwRootFrm::~SwRootFrm()
     pTurbo = 0;
     if(pBlink)
         pBlink->FrmDelete( this );
-    static_cast<SwFrmFmt*>(GetRegisteredInNonConst())->GetDoc()->DelFrmFmt( static_cast<SwFrmFmt*>(GetRegisteredInNonConst()) );
+    if ( static_cast<SwFrmFmt*>(GetRegisteredInNonConst()) )
+        static_cast<SwFrmFmt*>(GetRegisteredInNonConst())->GetDoc()->DelFrmFmt( static_cast<SwFrmFmt*>(GetRegisteredInNonConst()) );
     delete pDestroy;
     pDestroy = 0;
 
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index f810f2f..3b18c16 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -296,7 +296,7 @@ SwPageFrm::~SwPageFrm()
     //Damit der Zugriff auf zerstoerte Seiten verhindert werden kann.
     if ( !IsEmptyPage() ) //#59184# sollte fuer Leerseiten unnoetig sein.
     {
-        SwDoc *pDoc = GetFmt()->GetDoc();
+        SwDoc *pDoc = GetFmt() ? GetFmt()->GetDoc() : NULL;
         if( pDoc && !pDoc->IsInDtor() )
         {
             ViewShell *pSh = getRootFrm()->GetCurrShell();
@@ -864,7 +864,8 @@ void AdjustSizeChgNotify( SwRootFrm *pRoot )
             if( pRoot == pSh->GetLayout() )
             {
                 pSh->SizeChgNotify();
-                pSh->Imp()->NotifySizeChg( pRoot->Frm().SSize() );
+                if ( pSh->Imp() )
+                    pSh->Imp()->NotifySizeChg( pRoot->Frm().SSize() );
             }
             pSh = (ViewShell*)pSh->GetNext();
         } while ( pSh != pRoot->GetCurrShell() );
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 3917439..f5b67cd 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -918,7 +918,9 @@ void ViewShell::SetFirstVisPageInvalid()
 {
     ViewShell *pSh = this;
     do
-    {	pSh->Imp()->SetFirstVisPageInvalid();
+    {
+        if ( pSh->Imp() )
+            pSh->Imp()->SetFirstVisPageInvalid();
         pSh = (ViewShell*)pSh->GetNext();
 
     } while ( pSh != this );
commit ffe0767829727cd835d2d990e33248a36f4f6d82
Author: Petr Mladek <pmladek at suse.cz>
Date:   Tue May 10 20:01:47 2011 +0200

    Version 3.3.99.5, tag libreoffice-3.3.99.5 (3.4.0-beta5)
commit 93896af9984fb6a3dae981cf2ef9f335cc90f88e
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Tue May 10 16:33:13 2011 +0200

    update SdrPaintView's region when it changes in writer (bnc#683550)
    
    ViewShell::DLPrePaint2() gets a region as an argument, but uses it
    only during the first call, following calls only increment the lock
    counter, so if the region changes, the change doesn't take effect,
    causing redraw problems. So the fix is the replace the lock counter
    with a stack of used regions and update the region as appropriate.

diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index 39df2c9..1767570 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -37,6 +37,7 @@
 #include <ring.hxx>
 #include <swrect.hxx>
 #include <boost/shared_ptr.hpp>// swmod 080115
+#include <stack>
 #include <vcl/mapmod.hxx>
 #include <vcl/print.hxx>
 
@@ -236,7 +237,7 @@ public:
     //////////////////////////////////////////////////////////////////////////////
     // #i72754# set of Pre/PostPaints with lock counter and initial target OutDev
 protected:
-    sal_uInt32				mnPrePostPaintCount;
+    std::stack<Region>			mPrePostPaintRegions; // acts also as a lock counter (empty == not locked)
     OutputDevice*			mpPrePostOutDev;
     MapMode					maPrePostMapMode;
 public:
@@ -248,7 +249,7 @@ public:
 
     virtual void Paint(const Rectangle &rRect);
     sal_Bool IsPaintInProgress() const { return bPaintInProgress; }
-    bool IsDrawingLayerPaintInProgress() const { return 0 != mnPrePostPaintCount; }
+    bool IsDrawingLayerPaintInProgress() const { return !mPrePostPaintRegions.empty(); }
 
     //Benachrichtung, dass sich der sichtbare Bereich geaendert hat.
     //VisArea wird neu gesetzt, anschliessend wird gescrollt.
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 9903f97..3917439 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -98,7 +98,7 @@ using namespace ::com::sun::star;
 
 //////////////////////////////////////////////////////////////////////////////
 // #i72754# 2nd set of Pre/PostPaints
-// This time it uses the lock counter mnPrePostPaintCount to allow only one activation
+// This time it uses the lock counter (mPrePostPaintRegions empty/non-empty) to allow only one activation
 // and deactivation and mpPrePostOutDev to remember the OutDev from the BeginDrawLayers
 // call. That way, all places where paint take place can be handled the same way, even
 // when calling other paint methods. This is the case at the places where SW paints
@@ -116,8 +116,9 @@ void ViewShell::PrePaint()
 
 void ViewShell::DLPrePaint2(const Region& rRegion)
 {
-    if(0L == mnPrePostPaintCount)
+    if(mPrePostPaintRegions.empty())
     {
+        mPrePostPaintRegions.push( rRegion );
         // #i75172# ensure DrawView to use DrawingLayer bufferings
         if ( !HasDrawView() )
             MakeDrawView();
@@ -139,16 +140,29 @@ void ViewShell::DLPrePaint2(const Region& rRegion)
         // remember original paint MapMode for wrapped FlyFrame paints
         maPrePostMapMode = pOut->GetMapMode();
     }
-
-    mnPrePostPaintCount++;
+    else
+    {
+        // region needs to be updated to the given one
+        if( mPrePostPaintRegions.top() != rRegion )
+            Imp()->GetDrawView()->UpdateDrawLayersRegion(mpPrePostOutDev, rRegion);
+        mPrePostPaintRegions.push( rRegion );
+    }
 }
 
 void ViewShell::DLPostPaint2(bool bPaintFormLayer)
 {
-    OSL_ENSURE(mnPrePostPaintCount > 0L, "ViewShell::DLPostPaint2: Pre/PostPaint encapsulation broken (!)");
-    mnPrePostPaintCount--;
+    OSL_ENSURE(!mPrePostPaintRegions.empty(), "ViewShell::DLPostPaint2: Pre/PostPaint encapsulation broken (!)");
 
-    if((0L == mnPrePostPaintCount) && (0 != mpTargetPaintWindow))
+    if( mPrePostPaintRegions.size() > 1 )
+    {
+        Region current = mPrePostPaintRegions.top();
+        mPrePostPaintRegions.pop();
+        if( current != mPrePostPaintRegions.top())
+            Imp()->GetDrawView()->UpdateDrawLayersRegion(mpPrePostOutDev, mPrePostPaintRegions.top());
+        return;
+    }
+    mPrePostPaintRegions.pop(); // clear
+    if(0 != mpTargetPaintWindow)
     {
         // #i74769# restore buffered OutDev
         if(mpTargetPaintWindow->GetPreRenderDevice())
diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx
index cd3c810..5cfb482 100644
--- a/sw/source/core/view/vnew.cxx
+++ b/sw/source/core/view/vnew.cxx
@@ -158,7 +158,6 @@ ViewShell::ViewShell( SwDoc& rDocument, Window *pWindow,
     pDoc( &rDocument ),
     nStartAction( 0 ),
     nLockPaint( 0 ),
-    mnPrePostPaintCount(0L),
     mpPrePostOutDev(0),
     maPrePostMapMode()
 {
@@ -226,7 +225,6 @@ ViewShell::ViewShell( ViewShell& rShell, Window *pWindow,
     pDoc( rShell.GetDoc() ),
     nStartAction( 0 ),
     nLockPaint( 0 ),
-    mnPrePostPaintCount(0L),
     mpPrePostOutDev(0),
     maPrePostMapMode()
 {
commit 66093a5719bddebf115ad2bd305ad80d4a18db4f
Author: Michael Meeks <michael.meeks at novell.com>
Date:   Tue May 10 14:02:26 2011 +0100

    revert commit 5d8a59f64d9d3931e2c9c1ba98f57cd10e0b01c1, fix fdo#36340
    
    old commit: 'Convert std::vector to boost::ptr_vector.'
    this conflated the destruction and removal from list stages which
    have to be separate, so we do not re-enterancy from control
    destructors.

diff --git a/sw/source/ui/inc/swuicnttab.hxx b/sw/source/ui/inc/swuicnttab.hxx
index 9108936..3526989 100644
--- a/sw/source/ui/inc/swuicnttab.hxx
+++ b/sw/source/ui/inc/swuicnttab.hxx
@@ -28,25 +28,27 @@
 #ifndef _SWUI_CNTTAB_HXX
 #define _SWUI_CNTTAB_HXX
 
-#include <boost/ptr_container/ptr_vector.hpp>
-
-#include <tools/resary.hxx>
-#include <sfx2/tabdlg.hxx>
-#include <svtools/svtreebx.hxx>
-#include <svx/checklbx.hxx>
-#include <svx/langbox.hxx>
 #include <svx/stddlg.hxx>
+
 #include <vcl/button.hxx>
+
 #include <vcl/edit.hxx>
-#include <vcl/field.hxx>
+
 #include <vcl/fixed.hxx>
-#include <vcl/lstbox.hxx>
-#include <vcl/menubtn.hxx>
 
-#include <cnttab.hxx>
-#include <toxmgr.hxx>
+#include <vcl/field.hxx>
+#include <vcl/lstbox.hxx>
+#include <sfx2/tabdlg.hxx>
 
 #include "tox.hxx"
+#include <toxmgr.hxx>
+#include <svx/checklbx.hxx>
+#include <tools/resary.hxx>
+#include <svtools/svtreebx.hxx>
+#include <vcl/menubtn.hxx>
+#include <svx/langbox.hxx>
+#include <cnttab.hxx>
+#include <vector>
 
 class SwWrtShell;
 class SwTOXMgr;
@@ -259,16 +261,15 @@ class SwTOXEntryTabPage;
 
 class SwTokenWindow : public Window
 {
-    typedef boost::ptr_vector<Control> TOXControlList;
-    typedef TOXControlList::iterator ctrl_iterator;
-    typedef TOXControlList::const_iterator ctrl_const_iterator;
-    typedef TOXControlList::reverse_iterator ctrl_reverse_iterator;
-    typedef TOXControlList::const_reverse_iterator ctrl_const_reverse_iterator;
+    typedef std::vector<Control*>::iterator ctrl_iterator;
+    typedef std::vector<Control*>::const_iterator ctrl_const_iterator;
+    typedef std::vector<Control*>::reverse_iterator ctrl_reverse_iterator;
+    typedef std::vector<Control*>::const_reverse_iterator ctrl_const_reverse_iterator;
 
     ImageButton 	aLeftScrollWin;
     Window			aCtrlParentWin;
     ImageButton 	aRightScrollWin;
-    TOXControlList	aControlList;
+    std::vector<Control*> 	aControlList;
     SwForm* 		pForm;
     sal_uInt16 			nLevel;
     sal_Bool			bValid;
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index d9b153f..f8de59b 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -111,17 +111,6 @@ static const sal_Unicode aDeliEnd	 = ']'; //fuer die form
 #define IDX_FILE_EXTENSION String::CreateFromAscii( \
                             RTL_CONSTASCII_STRINGPARAM( "*.sdi" ))
 
-static boost::ptr_vector<Control>::iterator FindControl (boost::ptr_vector<Control> &list, Control *ctrl)
-{
-    for (boost::ptr_vector<Control>::iterator it = list.begin(); it != list.end(); ++it)
-    {
-        if ((&(*it)) == ctrl)
-            return it;
-    }
-
-    return list.end();
-}
-
 String lcl_CreateAutoMarkFileDlg( const String& rURL,
                                 const String& rFileString, sal_Bool bOpen )
 {
@@ -2879,6 +2868,13 @@ SwTokenWindow::SwTokenWindow(SwTOXEntryTabPage* pParent, const ResId& rResId) :
 
 SwTokenWindow::~SwTokenWindow()
 {
+    for (ctrl_iterator it = aControlList.begin(); it != aControlList.end(); ++it)
+    {
+        Control* pControl = (*it);
+        pControl->SetGetFocusHdl( Link() );
+        pControl->SetLoseFocusHdl( Link() );
+        delete pControl;
+    }
 }
 
 void	SwTokenWindow::SetForm(SwForm& rForm, sal_uInt16 nL)
@@ -2886,9 +2882,14 @@ void	SwTokenWindow::SetForm(SwForm& rForm, sal_uInt16 nL)
     SetActiveControl(0);
     bValid = sal_True;
 
-    //apply current level settings to the form
     if(pForm)
+    {
+        //apply current level settings to the form
+        for (ctrl_iterator iter = aControlList.begin(); iter != aControlList.end(); ++iter)
+            delete (*iter);
+
         aControlList.clear();
+    }
 
     nLevel = nL;
     pForm = &rForm;
@@ -2986,17 +2987,17 @@ Control*	SwTokenWindow::InsertItem(const String& rText, const SwFormToken& rToke
     Point aControlPos;
 
     if(!aControlList.empty())
-     {
-        ctrl_const_reverse_iterator iterLast = aControlList.rbegin();
+    {
+        Control* pLast = *(aControlList.rbegin());
 
-        aControlSize = iterLast->GetSizePixel();
-        aControlPos = iterLast->GetPosPixel();
+        aControlSize = pLast->GetSizePixel();
+        aControlPos = pLast->GetPosPixel();
         aControlPos.X() += aControlSize.Width();
     }
 
     if(TOKEN_TEXT == rToken.eTokenType)
     {
-        SwTOXEdit *pEdit = new SwTOXEdit(&aCtrlParentWin, this, rToken);
+        SwTOXEdit* pEdit = new SwTOXEdit(&aCtrlParentWin, this, rToken);
         pEdit->SetPosPixel(aControlPos);
 
         aControlList.push_back(pEdit);
@@ -3063,73 +3064,71 @@ void	SwTokenWindow::InsertAtSelection(
         //<insert> LS
         //<insert> LE
         //<insert>
-        bool bPreStartLinkFound = false;
-        bool bPreEndLinkFound = false;
+        sal_Bool bPreStartLinkFound = sal_False;
+        sal_Bool bPreEndLinkFound = sal_False;
 
-        const Control *pExchange = 0;
-        ctrl_const_iterator it = aControlList.begin();
+        const Control* pControl = 0;
+        const Control* pExchange = 0;
 
-        while ( it != aControlList.end())
+        ctrl_const_iterator it = aControlList.begin();
+        for( ; it != aControlList.end() && pActiveCtrl != (*it); ++it )
         {
-            if ((&(*it)) == pActiveCtrl)
-                break;
+            pControl = *it;
 
-            if( WINDOW_EDIT != it->GetType())
+            if( WINDOW_EDIT != pControl->GetType())
             {
                 const SwFormToken& rNewToken =
-                                (reinterpret_cast<const SwTOXButton&>(*it)).GetFormToken();
+                                ((SwTOXButton*)pControl)->GetFormToken();
 
                 if( TOKEN_LINK_START == rNewToken.eTokenType )
                 {
-                    bPreStartLinkFound = true;
+                    bPreStartLinkFound = sal_True;
                     pExchange = 0;
                 }
                 else if(TOKEN_LINK_END == rNewToken.eTokenType)
                 {
                     if( bPreStartLinkFound )
-                        bPreStartLinkFound = false;
+                        bPreStartLinkFound = sal_False;
                     else
                     {
-                        bPreEndLinkFound = false;
-                        pExchange = const_cast<Control*>(&(*it));
+                        bPreEndLinkFound = sal_False;
+                        pExchange = pControl;
                     }
                 }
             }
-
-            ++it;
         }
 
         bool bPostLinkStartFound = false;
 
         if(!bPreStartLinkFound && !bPreEndLinkFound)
         {
-            while(it != aControlList.end())
+            for( ; it != aControlList.end(); ++it )
             {
-                if( (&(*it)) != pActiveCtrl &&
-                    WINDOW_EDIT != it->GetType())
+                pControl = *it;
+
+                if( pControl != pActiveCtrl &&
+                    WINDOW_EDIT != pControl->GetType())
                 {
                     const SwFormToken& rNewToken =
-                                    reinterpret_cast<const SwTOXButton&>(*it).GetFormToken();
+                                    ((SwTOXButton*)pControl)->GetFormToken();
 
                     if( TOKEN_LINK_START == rNewToken.eTokenType )
                     {
                         if(bPostLinkStartFound)
                             break;
-                        bPostLinkStartFound = true;
-                        pExchange = const_cast<Control*>(&(*it));
+                        bPostLinkStartFound = sal_True;
+                        pExchange = pControl;
                     }
                     else if(TOKEN_LINK_END == rNewToken.eTokenType )
                     {
                         if(bPostLinkStartFound)
                         {
-                            bPostLinkStartFound = false;
+                            bPostLinkStartFound = sal_False;
                             pExchange = 0;
                         }
                         break;
                     }
                 }
-
-                ++it;
             }
         }
 
@@ -3142,7 +3141,6 @@ void	SwTokenWindow::InsertAtSelection(
         if(bPostLinkStartFound)
         {
             OSL_ENSURE(pExchange, "no control to exchange?");
-
             if(pExchange)
             {
                 ((SwTOXButton*)pExchange)->SetLinkEnd();
@@ -3164,7 +3162,9 @@ void	SwTokenWindow::InsertAtSelection(
 
     //if the active control is text then insert a new button at the selection
     //else replace the button
-    ctrl_iterator iterActive = FindControl(aControlList,pActiveCtrl);
+    ctrl_iterator iterActive = std::find(aControlList.begin(),
+                                         aControlList.end(), pActiveCtrl);
+
     ctrl_iterator iterInsert = iterActive;
 
     Size aControlSize(GetOutputSizePixel());
@@ -3187,7 +3187,7 @@ void	SwTokenWindow::InsertAtSelection(
         SwFormToken aTmpToken(TOKEN_TEXT);
         SwTOXEdit* pEdit = new SwTOXEdit(&aCtrlParentWin, this, aTmpToken);
 
-        aControlList.insert(iterInsert,pEdit);
+        aControlList.insert(iterInsert, pEdit);
 
         pEdit->SetText(sRight);
         pEdit->SetSizePixel(aControlSize);
@@ -3199,13 +3199,15 @@ void	SwTokenWindow::InsertAtSelection(
     }
     else
     {
-        pActiveCtrl->Hide();
         aControlList.erase(iterActive);
+        pActiveCtrl->Hide();
+        delete pActiveCtrl;
     }
 
     //now the new button
     SwTOXButton* pButton = new SwTOXButton(&aCtrlParentWin, this, aToInsertToken);
-    aControlList.insert(iterInsert,pButton);
+
+    aControlList.insert(iterInsert, pButton);
 
     pButton->SetPrevNextLink(LINK(this, SwTokenWindow, NextItemBtnHdl));
     pButton->SetGetFocusHdl(LINK(this, SwTokenWindow, TbxFocusBtnHdl));
@@ -3237,7 +3239,7 @@ void SwTokenWindow::RemoveControl(SwTOXButton* pDel, sal_Bool bInternalCall )
     if(bInternalCall && TOX_AUTHORITIES == pForm->GetTOXType())
         m_pParent->PreTokenButtonRemoved(pDel->GetFormToken());
 
-    ctrl_iterator it = FindControl(aControlList,pDel);
+    ctrl_iterator it = std::find(aControlList.begin(), aControlList.end(), pDel);
 
     OSL_ENSURE(it != aControlList.end(), "Control does not exist!");
 
@@ -3246,22 +3248,26 @@ void SwTokenWindow::RemoveControl(SwTOXButton* pDel, sal_Bool bInternalCall )
     OSL_ENSURE(it != aControlList.begin() && it != aControlList.end() - 1,
         "Button at first or last position?");
 
-    Control *pLeftCtrl = const_cast<Control*>(&(*(it-1)));
-    Control *pRightCtrl = const_cast<Control*>(&(*(it+1)));
+    ctrl_iterator itLeft = it, itRight = it;
+    --itLeft;
+    ++itRight;
+    Control *pLeftEdit = *itLeft;
+    Control *pRightEdit = *itRight;
 
-    String sTemp(((SwTOXEdit*)pLeftCtrl)->GetText());
-    sTemp += ((SwTOXEdit*)pRightCtrl)->GetText();
-    ((SwTOXEdit*)pLeftCtrl)->SetText(sTemp);
-    ((SwTOXEdit*)pLeftCtrl)->AdjustSize();
+    String sTemp(((SwTOXEdit*)pLeftEdit)->GetText());
+    sTemp += ((SwTOXEdit*)pRightEdit)->GetText();
+    ((SwTOXEdit*)pLeftEdit)->SetText(sTemp);
+    ((SwTOXEdit*)pLeftEdit)->AdjustSize();
 
-    aControlList.erase(it+1);
-    aControlList.erase(it);
+    aControlList.erase(itRight);
+    delete pRightEdit;
 
+    aControlList.erase(it);
     pActiveCtrl->Hide();
+    delete pActiveCtrl;
 
-    SetActiveControl(pLeftCtrl);
+    SetActiveControl(pLeftEdit);
     AdjustPositions();
-
     if(aModifyHdl.IsSet())
         aModifyHdl.Call(0);
 }
@@ -3271,14 +3277,17 @@ void SwTokenWindow::AdjustPositions()
     if(aControlList.size() > 1)
     {
         ctrl_iterator it = aControlList.begin();
+        Control* pCtrl = *it;
+        ++it;
 
-        Point aNextPos = it->GetPosPixel();
-        aNextPos.X() += it->GetSizePixel().Width();
+        Point aNextPos = pCtrl->GetPosPixel();
+        aNextPos.X() += pCtrl->GetSizePixel().Width();
 
-        for (++it; it != aControlList.end(); ++it)
-         {
-            it->SetPosPixel(aNextPos);
-            aNextPos.X() += it->GetSizePixel().Width();
+        for(; it != aControlList.end(); ++it)
+        {
+            pCtrl = *it;
+            pCtrl->SetPosPixel(aNextPos);
+            aNextPos.X() += pCtrl->GetSizePixel().Width();
         }
 
         AdjustScrolling();
@@ -3290,10 +3299,12 @@ void SwTokenWindow::MoveControls(long nOffset)
     // move the complete list
     for (ctrl_iterator it = aControlList.begin(); it != aControlList.end(); ++it)
     {
-        Point aPos = it->GetPosPixel();
+        Control *pCtrl = *it;
+
+        Point aPos = pCtrl->GetPosPixel();
         aPos.X() += nOffset;
 
-        it->SetPosPixel(aPos);
+        pCtrl->SetPosPixel(aPos);
     }
 }
 
@@ -3302,19 +3313,21 @@ void SwTokenWindow::AdjustScrolling()
     if(aControlList.size() > 1)
     {
         //validate scroll buttons
-        ctrl_const_reverse_iterator iterLast = aControlList.rbegin();
-        ctrl_const_iterator iterFirst = aControlList.begin();
+        Control* pFirstCtrl = *(aControlList.begin());
+        Control* pLastCtrl = *(aControlList.rbegin());
 
         long nSpace = aCtrlParentWin.GetSizePixel().Width();
-        long nWidth = iterLast->GetPosPixel().X() - iterFirst->GetPosPixel().X()
-                                                    + iterLast->GetSizePixel().Width();
+        long nWidth = pLastCtrl->GetPosPixel().X() - pFirstCtrl->GetPosPixel().X()
+                                                    + pLastCtrl->GetSizePixel().Width();
         bool bEnable = nWidth > nSpace;
+
         //the active control must be visible
         if(bEnable && pActiveCtrl)
         {
-            long nMove = 0;
             Point aActivePos(pActiveCtrl->GetPosPixel());
 
+            long nMove = 0;
+
             if(aActivePos.X() < 0)
                 nMove = -aActivePos.X();
             else if((aActivePos.X() + pActiveCtrl->GetSizePixel().Width())  > nSpace)
@@ -3323,16 +3336,20 @@ void SwTokenWindow::AdjustScrolling()
             if(nMove)
                 MoveControls(nMove);
 
-            aLeftScrollWin.Enable(iterFirst->GetPosPixel().X() < 0);
-            aRightScrollWin.Enable((iterLast->GetPosPixel().X() + iterLast->GetSizePixel().Width()) > nSpace);
+            aLeftScrollWin.Enable(pFirstCtrl->GetPosPixel().X() < 0);
+
+            aRightScrollWin.Enable((pLastCtrl->GetPosPixel().X() + pLastCtrl->GetSizePixel().Width()) > nSpace);
         }
         else
         {
-            //if the control fits into the space then the first control must be at postion 0
-            long nFirstPos = iterFirst->GetPosPixel().X();
+            if(pFirstCtrl)
+            {
+                //if the control fits into the space then the first control must be at postion 0
+                long nFirstPos = pFirstCtrl->GetPosPixel().X();
 
-            if(nFirstPos != 0)
-                MoveControls(-nFirstPos);
+                if(nFirstPos != 0)
+                    MoveControls(-nFirstPos);
+            }
 
             aRightScrollWin.Enable(false);
             aLeftScrollWin.Enable(false);
@@ -3346,7 +3363,6 @@ IMPL_LINK(SwTokenWindow, ScrollHdl, ImageButton*, pBtn )
         return 0;
 
     const long nSpace = aCtrlParentWin.GetSizePixel().Width();
-
 #if OSL_DEBUG_LEVEL > 1
     //find all start/end positions and print it
     String sMessage(String::CreateFromAscii("Space: "));
@@ -3355,8 +3371,10 @@ IMPL_LINK(SwTokenWindow, ScrollHdl, ImageButton*, pBtn )
 

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list