[Libreoffice-commits] .: 3 commits - sw/source

2013-01-26 Thread Libreoffice Gerrit user
 sw/source/ui/app/swmodule.cxx|4 ++--
 sw/source/ui/config/barcfg.cxx   |2 +-
 sw/source/ui/config/caption.cxx  |2 +-
 sw/source/ui/dialog/ascfldlg.cxx |6 +++---
 sw/source/ui/fldui/fldfunc.cxx   |   14 +++---
 sw/source/ui/fldui/fldvar.cxx|8 
 sw/source/ui/frmdlg/colex.cxx|6 +++---
 sw/source/ui/frmdlg/column.cxx   |   34 +-
 sw/source/ui/frmdlg/cption.cxx   |6 +++---
 sw/source/ui/frmdlg/frmmgr.cxx   |2 +-
 sw/source/ui/frmdlg/frmpage.cxx  |   38 +++---
 sw/source/ui/inc/ascfldlg.hxx|2 +-
 sw/source/ui/inc/barcfg.hxx  |2 +-
 sw/source/ui/inc/basesh.hxx  |2 +-
 sw/source/ui/inc/bmpwin.hxx  |4 ++--
 sw/source/ui/inc/caption.hxx |6 +++---
 sw/source/ui/inc/cnttab.hxx  |2 +-
 sw/source/ui/inc/colex.hxx   |4 ++--
 sw/source/ui/inc/colmgr.hxx  |4 ++--
 sw/source/ui/inc/column.hxx  |   10 +-
 sw/source/ui/inc/condedit.hxx|7 +++
 sw/source/ui/inc/frmmgr.hxx  |2 +-
 sw/source/ui/inc/frmpage.hxx |2 +-
 sw/source/ui/inc/pggrid.hxx  |2 +-
 sw/source/ui/misc/pggrid.cxx |2 +-
 sw/source/ui/shells/textsh2.cxx  |2 --
 sw/source/ui/utlui/condedit.cxx  |3 +--
 27 files changed, 87 insertions(+), 91 deletions(-)

New commits:
commit 1f531d4f68b41044bdb38f90149b4d81e3024da7
Author: Takeshi Abe t...@fixedpoint.jp
Date:   Sat Jan 26 20:14:11 2013 +0900

sal_Bool to bool

Change-Id: Ie452042fafd4d795b9830f9d8416c568a76b3d8f

diff --git a/sw/source/ui/app/swmodule.cxx b/sw/source/ui/app/swmodule.cxx
index 3c61ac7..9d4bc1d 100644
--- a/sw/source/ui/app/swmodule.cxx
+++ b/sw/source/ui/app/swmodule.cxx
@@ -184,8 +184,8 @@ SwModule::SwModule( SfxObjectFactory* pWebFact,
 pModuleConfig = new SwModuleOptions;
 
 // We need them anyways
-pToolbarConfig = new SwToolbarConfigItem( sal_False );
-pWebToolbarConfig = new SwToolbarConfigItem( sal_True );
+pToolbarConfig = new SwToolbarConfigItem( false );
+pWebToolbarConfig = new SwToolbarConfigItem( true );
 
 pStdFontConfig = new SwStdFontConfig;
 
diff --git a/sw/source/ui/config/barcfg.cxx b/sw/source/ui/config/barcfg.cxx
index 12c2515..95da3e4 100644
--- a/sw/source/ui/config/barcfg.cxx
+++ b/sw/source/ui/config/barcfg.cxx
@@ -35,7 +35,7 @@ using namespace com::sun::star::uno;
 #define SEL_TYPE_BEZIER 3
 #define SEL_TYPE_GRAPHIC4
 
-SwToolbarConfigItem::SwToolbarConfigItem( sal_Bool bWeb ) :
+SwToolbarConfigItem::SwToolbarConfigItem( bool bWeb ) :
 ConfigItem(bWeb ? OUString(Office.WriterWeb/ObjectBar) : 
OUString(Office.Writer/ObjectBar),
 CONFIG_MODE_DELAYED_UPDATE|CONFIG_MODE_RELEASE_TREE)
 {
diff --git a/sw/source/ui/config/caption.cxx b/sw/source/ui/config/caption.cxx
index 9fb8b63..44f4b69 100644
--- a/sw/source/ui/config/caption.cxx
+++ b/sw/source/ui/config/caption.cxx
@@ -31,7 +31,7 @@ InsCaptionOpt::InsCaptionOpt(const SwCapObjType eType, const 
SvGlobalName* pOleI
 nPos(1),
 nLevel(0),
 sSeparator( rtl::OUString(: ) ),
-bIgnoreSeqOpts(sal_False),
+bIgnoreSeqOpts(false),
 bCopyAttributes(sal_False)
 {
 if (pOleId)
diff --git a/sw/source/ui/dialog/ascfldlg.cxx b/sw/source/ui/dialog/ascfldlg.cxx
index d7f2fda..5f6ab9a 100644
--- a/sw/source/ui/dialog/ascfldlg.cxx
+++ b/sw/source/ui/dialog/ascfldlg.cxx
@@ -68,7 +68,7 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( Window* pParent, 
SwDocShell rDocSh,
 aCancelPB( this, SW_RES( PB_CANCEL )),
 aHelpPB( this, SW_RES( PB_HELP )),
 sSystemCharSet( SW_RES( STR_SYS_CHARSET )),
-bSaveLineStatus( sal_True )
+bSaveLineStatus( true )
 {
 FreeResource();
 
@@ -387,7 +387,7 @@ IMPL_LINK( SwAsciiFilterDlg, CharSetSelHdl, 
SvxTextEncodingBox*, pBox )
 }
 }
 
-bSaveLineStatus = sal_False;
+bSaveLineStatus = false;
 if( eEnd != (LineEnd)-1 )   // changed?
 {
 if( eOldEnd != eEnd )
@@ -400,7 +400,7 @@ IMPL_LINK( SwAsciiFilterDlg, CharSetSelHdl, 
SvxTextEncodingBox*, pBox )
 aCR_RB.Check( aCR_RB.GetSavedValue() );
 aLF_RB.Check( aLF_RB.GetSavedValue() );
 }
-bSaveLineStatus = sal_True;
+bSaveLineStatus = true;
 
 if( nOldLng != nLng  aFontLB.IsVisible() )
 aLanguageLB.SelectLanguage( nLng );
diff --git a/sw/source/ui/fldui/fldfunc.cxx b/sw/source/ui/fldui/fldfunc.cxx
index 363628f..a631230 100644
--- a/sw/source/ui/fldui/fldfunc.cxx
+++ b/sw/source/ui/fldui/fldfunc.cxx
@@ -79,8 +79,8 @@ SwFldFuncPage::SwFldFuncPage(Window* pParent, const 
SfxItemSet rCoreSet ) :
 sOldValueFT = aValueFT.GetText();
 sOldNameFT = aNameFT.GetText();
 
-aCond1ED.ShowBrackets(sal_False);
-aCond2ED.ShowBrackets(sal_False);
+aCond1ED.ShowBrackets(false);
+aCond2ED.ShowBrackets(false);
 
 }
 
@@ -245,7 +245,7 @@ IMPL_LINK_NOARG(SwFldFuncPage, TypeHdl)
 aListNameFT.Show(bDropDown);
 

[Libreoffice-commits] .: 3 commits - sw/source

2013-01-03 Thread Libreoffice Gerrit user
 sw/source/filter/xml/xmlfmt.cxx   |2 
 sw/source/filter/xml/xmlimp.cxx   |   22 +++---
 sw/source/filter/xml/xmlimp.hxx   |   23 +++---
 sw/source/filter/xml/xmlimpit.cxx |  128 +++---
 sw/source/filter/xml/xmlimpit.hxx |6 -
 sw/source/filter/xml/xmlitemi.cxx |   10 +-
 sw/source/filter/xml/xmlithlp.cxx |   38 +--
 sw/source/filter/xml/xmlithlp.hxx |   26 ++-
 sw/source/filter/xml/xmltexti.cxx |4 -
 sw/source/filter/xml/xmltexti.hxx |4 -
 10 files changed, 126 insertions(+), 137 deletions(-)

New commits:
commit 6a393297ce6d99bbc4edefbf01ab9c5c6f0eff84
Author: Takeshi Abe t...@fixedpoint.jp
Date:   Thu Jan 3 16:51:28 2013 +0900

sal_Bool to bool

Change-Id: I6c04aea3a0bba0308206bb3c9d8435606b7a4d81

diff --git a/sw/source/filter/xml/xmlfmt.cxx b/sw/source/filter/xml/xmlfmt.cxx
index 819c64b..205b046 100644
--- a/sw/source/filter/xml/xmlfmt.cxx
+++ b/sw/source/filter/xml/xmlfmt.cxx
@@ -1068,7 +1068,7 @@ void SwXMLImport::UpdateTxtCollConditions( SwDoc *pDoc )
 }
 }
 
-sal_Bool SwXMLImport::FindAutomaticStyle(
+bool SwXMLImport::FindAutomaticStyle(
 sal_uInt16 nFamily,
 const OUString rName,
 const SfxItemSet **ppItemSet,
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 54726d3..d085eb8 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -419,12 +419,12 @@ SwXMLImport::SwXMLImport(
 pGraphicResolver( 0 ),
 pEmbeddedResolver( 0 ),
 nStyleFamilyMask( SFX_STYLE_FAMILY_ALL ),
-bLoadDoc( sal_True ),
-bInsert( sal_False ),
-bBlock( sal_False ),
-bShowProgress( sal_True ),
-bOrganizerMode( sal_False ),
-bInititedXForms( sal_False ),
+bLoadDoc( true ),
+bInsert( false ),
+bBlock( false ),
+bShowProgress( true ),
+bOrganizerMode( false ),
+bInititedXForms( false ),
 bPreserveRedlineMode( sal_True )
 {
 _InitItemImport();
@@ -442,7 +442,7 @@ SwXMLImport::~SwXMLImport() throw ()
 void SwXMLImport::setTextInsertMode(
  const Reference XTextRange   rInsertPos )
 {
-bInsert = sal_True;
+bInsert = true;
 
 Reference  XText  xText = rInsertPos-getText();
 Reference  XTextCursor  xTextCursor =
@@ -455,17 +455,17 @@ void SwXMLImport::setStyleInsertMode( sal_uInt16 
nFamilies,
 {
 bInsert = !bOverwrite;
 nStyleFamilyMask = nFamilies;
-bLoadDoc = sal_False;
+bLoadDoc = false;
 }
 
 void SwXMLImport::setBlockMode( )
 {
-bBlock = sal_True;
+bBlock = true;
 }
 
 void SwXMLImport::setOrganizerMode( )
 {
-bOrganizerMode = sal_True;
+bOrganizerMode = true;
 }
 
 namespace
@@ -1730,7 +1730,7 @@ void SwXMLImport::initXForms()
 if( ! pDoc-isXForms() )
 pDoc-initXForms( false );
 
-bInititedXForms = sal_True;
+bInititedXForms = true;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/xml/xmlimp.hxx b/sw/source/filter/xml/xmlimp.hxx
index f9da2ae..e77cedd 100644
--- a/sw/source/filter/xml/xmlimp.hxx
+++ b/sw/source/filter/xml/xmlimp.hxx
@@ -68,15 +68,15 @@ class SwXMLImport: public SvXMLImport
 xLateInitSettings;
 
 sal_uInt16  nStyleFamilyMask;// Mask of styles to load
-sal_BoolbLoadDoc : 1;   // Load doc or styles only
-sal_BoolbInsert : 1;// Insert mode. If styles are
+boolbLoadDoc : 1;   // Load doc or styles only
+boolbInsert : 1;// Insert mode. If styles are
 // loaded only sal_False means that
 // existing styles will be
 // overwritten.
-sal_BoolbBlock : 1; // Load text block
-sal_BoolbShowProgress : 1;
-sal_BoolbOrganizerMode : 1;
-sal_BoolbInititedXForms : 1;
+boolbBlock : 1; // Load text block
+boolbShowProgress : 1;
+boolbOrganizerMode : 1;
+boolbInititedXForms : 1;
 sal_BoolbPreserveRedlineMode;
 
 void_InitItemImport();
@@ -153,10 +153,10 @@ public:
 ::com::sun::star::xml::sax::XAttributeList   xAttrList );
 SvXMLImportContext *CreateBodyContentContext( const ::rtl::OUString 
rLocalName );
 sal_uInt16 GetStyleFamilyMask() const { return nStyleFamilyMask; }
-sal_Bool IsInsertMode() const { return bInsert; }
-sal_Bool IsStylesOnlyMode() const { return !bLoadDoc; }
-sal_Bool IsBlockMode() const { return bBlock; }
-sal_Bool IsOrganizerMode() const { return bOrganizerMode; }
+bool IsInsertMode() const { return bInsert; }
+bool IsStylesOnlyMode() const { return !bLoadDoc; }
+bool IsBlockMode() const { return bBlock; }
+bool IsOrganizerMode() const { return 

[Libreoffice-commits] .: 3 commits - sw/source

2012-12-25 Thread Libreoffice Gerrit user
 sw/source/filter/ww1/w1class.cxx   |2 +-
 sw/source/filter/ww1/w1class.hxx   |   18 +-
 sw/source/filter/ww1/w1filter.cxx  |   30 +++---
 sw/source/filter/ww1/w1sprm.cxx|   10 ++
 sw/source/filter/ww8/rtfexport.cxx |6 +++---
 sw/source/filter/ww8/rtfexport.hxx |3 +--
 sw/source/filter/ww8/wrtw8esh.cxx  |4 ++--
 sw/source/filter/ww8/wrtw8nds.cxx  |4 ++--
 sw/source/filter/ww8/ww8par.cxx|6 +++---
 sw/source/filter/ww8/ww8par2.cxx   |2 +-
 10 files changed, 39 insertions(+), 46 deletions(-)

New commits:
commit 7af975da68a51aa640ca6cd239f98ee1f7b9ef45
Author: Takeshi Abe t...@fixedpoint.jp
Date:   Tue Dec 25 22:21:15 2012 +0900

Drop unused variable

Change-Id: Iccfc052323f61f8b5416c7e4c68df3c7aeeb3b1c

diff --git a/sw/source/filter/ww8/rtfexport.hxx 
b/sw/source/filter/ww8/rtfexport.hxx
index 1db1a2d..6cd33ce 100644
--- a/sw/source/filter/ww8/rtfexport.hxx
+++ b/sw/source/filter/ww8/rtfexport.hxx
@@ -152,7 +152,6 @@ public:
 /// This is used by OutputFlyFrame_Impl() to control the written syntax
 bool bRTFFlySyntax;
 
-sal_Bool m_bOutStyleTab : 1;
 SvStream Strm();
 SvStream OutULong( sal_uLong nVal );
 SvStream OutLong( long nVal );
commit 31e7ef32646dee9aea1b455e9f408ec0dc0be54a
Author: Takeshi Abe t...@fixedpoint.jp
Date:   Tue Dec 25 22:20:32 2012 +0900

Nuke unreachable code

Change-Id: Id6db5aafda2f240225e6655ca7d5f594b072be31

diff --git a/sw/source/filter/ww1/w1sprm.cxx b/sw/source/filter/ww1/w1sprm.cxx
index 9534483..0a7b243 100644
--- a/sw/source/filter/ww1/w1sprm.cxx
+++ b/sw/source/filter/ww1/w1sprm.cxx
@@ -321,7 +321,6 @@ void Ww1SingleSprmPDyaLine::Start(
 if(nSpace  0)
 nSpace = -nSpace;
 SvxLineSpacingItem aLSpc( LINE_SPACE_DEFAULT_HEIGHT, 
RES_PARATR_LINESPACING );
-if(sal_True)
 {// MultilineSpace(proportional)
 long n = nSpace * 100 / 240;// W1: 240 = 100%, SW: 100 = 100%
 if(n200)
@@ -329,11 +328,6 @@ void Ww1SingleSprmPDyaLine::Start(
 aLSpc.GetLineSpaceRule() = SVX_LINE_SPACE_AUTO;
 aLSpc.SetPropLineSpace((sal_uInt8)n);
 }
-else
-{// Fixed / Minimum
-aLSpc.SetLineHeight((sal_uInt16)nSpace);
-aLSpc.GetInterLineSpaceRule() = SVX_INTER_LINE_SPACE_OFF;
-}
 rOut  aLSpc;
 }
 
commit 5bfe7ed9e7a3fdb3106ab8d61624ba0136073fb9
Author: Takeshi Abe t...@fixedpoint.jp
Date:   Tue Dec 25 22:17:38 2012 +0900

sal_Bool to bool

Change-Id: I42b4d27101f663a75aa8fc1c13e5ec3f03c8a2da

diff --git a/sw/source/filter/ww1/w1class.cxx b/sw/source/filter/ww1/w1class.cxx
index 28b5435..e39e8d3 100644
--- a/sw/source/filter/ww1/w1class.cxx
+++ b/sw/source/filter/ww1/w1class.cxx
@@ -1188,7 +1188,7 @@ void Ww1Chp::operator++()
 
 // Manager
 Ww1Manager::Ww1Manager(SvStream rStrm, sal_uLong nFieldFlgs)
-: bOK(sal_False), bInTtp(sal_False), bInStyle(sal_False), 
bStopAll(sal_False), aFib(rStrm),
+: bOK(sal_False), bInTtp(false), bInStyle(false), bStopAll(false), 
aFib(rStrm),
 aDop(aFib), aFonts(aFib, nFieldFlgs), aDoc(aFib), pDoc(aDoc),
 ulDocSeek(0), pSeek(ulDocSeek), aFld(aFib), pFld(aFld), aChp(aFib),
 aPap(aFib), aFtn(aFib), aBooks(aFib),
diff --git a/sw/source/filter/ww1/w1class.hxx b/sw/source/filter/ww1/w1class.hxx
index acc52a1..b6cb854 100644
--- a/sw/source/filter/ww1/w1class.hxx
+++ b/sw/source/filter/ww1/w1class.hxx
@@ -1496,9 +1496,9 @@ public:
 class Ww1Manager
 {
 sal_Bool bOK;
-sal_Bool bInTtp;
-sal_Bool bInStyle;
-sal_Bool bStopAll;
+bool bInTtp;
+bool bInStyle;
+bool bStopAll;
 Ww1Fib aFib;
 Ww1Dop aDop;
 Ww1Fonts aFonts;
@@ -1526,12 +1526,12 @@ public:
 sal_Bool GetError() const   { return !bOK; }
 
 // Fuer Tabellen
-void SetInTtp(sal_Bool bSet = sal_True) { bInTtp = bSet; }
-sal_Bool IsInTtp() const{ return bInTtp; }
-void SetInStyle(sal_Bool bSet = sal_True)   { bInStyle = bSet; }
-sal_Bool IsInStyle() const  { return bInStyle; }
-void SetStopAll(sal_Bool bSet = sal_True)   { bStopAll = bSet; }
-sal_Bool IsStopAll() const  { return bStopAll; }
+void SetInTtp(bool bSet = true) { bInTtp = bSet; }
+bool IsInTtp() const{ return bInTtp; }
+void SetInStyle(bool bSet = true)   { bInStyle = bSet; }
+bool IsInStyle() const  { return bInStyle; }
+void SetStopAll(bool bSet = true)   { bStopAll = bSet; }
+bool IsStopAll() const  { return bStopAll; }
 sal_Bool HasInTable();
 sal_Bool HasTtp();
 sal_Bool LastHasTtp();
diff --git a/sw/source/filter/ww1/w1filter.cxx 
b/sw/source/filter/ww1/w1filter.cxx
index bf31f5a..9aa1755 100644
--- a/sw/source/filter/ww1/w1filter.cxx
+++ b/sw/source/filter/ww1/w1filter.cxx
@@ -96,9 +96,9 @@ Ww1Shell operator (Ww1Shell rOut, Ww1Manager This)
 if (!This.Pushed())
 

[Libreoffice-commits] .: 3 commits - sw/source

2012-09-24 Thread Libreoffice Gerrit user
 sw/source/core/docnode/ndtbl.cxx|  247 
 sw/source/core/table/swnewtable.cxx |   34 +++-
 2 files changed, 137 insertions(+), 144 deletions(-)

New commits:
commit 5e21ad82ef769b944927b498a196ec82476e17e8
Author: Michael Stahl mst...@redhat.com
Date:   Mon Sep 24 13:44:50 2012 +0200

de-duplicate SwNodes::TextToTable()

Change-Id: I8a61b67cb5bd1333c05f9a98c7af6e3ed05c8fd0

diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 22e44f5..cc7e88f 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -889,6 +889,112 @@ const SwTable* SwDoc::TextToTable( const 
SwInsertTableOptions rInsTblOpts,
 return pNdTbl;
 }
 
+static void lcl_RemoveBreaks(SwCntntNode  rNode, SwTableFmt *const pTableFmt)
+{
+// delete old layout frames, new ones need to be created...
+rNode.DelFrms();
+
+if (!rNode.IsTxtNode())
+{
+return;
+}
+
+SwTxtNode  rTxtNode = static_castSwTxtNode(rNode);
+// remove PageBreaks/PageDesc/ColBreak
+SfxItemSet const* pSet = rTxtNode.GetpSwAttrSet();
+if (pSet)
+{
+const SfxPoolItem* pItem;
+if (SFX_ITEM_SET == pSet-GetItemState(RES_BREAK, false, pItem))
+{
+if (pTableFmt)
+{
+pTableFmt-SetFmtAttr(*pItem);
+}
+rTxtNode.ResetAttr(RES_BREAK);
+pSet = rTxtNode.GetpSwAttrSet();
+}
+
+if (pSet
+ (SFX_ITEM_SET == pSet-GetItemState(RES_PAGEDESC, false, 
pItem))
+ static_castSwFmtPageDesc const*(pItem)-GetPageDesc())
+{
+if (pTableFmt)
+{
+pTableFmt-SetFmtAttr(*pItem);
+}
+rTxtNode.ResetAttr(RES_PAGEDESC);
+}
+}
+}
+
+static void
+lcl_BalanceTable(SwTable  rTable, size_t const nMaxBoxes,
+SwTableNode  rTblNd, SwTableBoxFmt  rBoxFmt, SwTxtFmtColl  rTxtColl,
+SwUndoTxtToTbl *const pUndo, std::vectorsal_uInt16 *const pPositions)
+{
+// balance lines in table, insert empty boxes so all lines have the size
+for (size_t n = 0; n  rTable.GetTabLines().size(); ++n)
+{
+SwTableLine *const pCurrLine = rTable.GetTabLines()[ n ];
+size_t const nBoxes = pCurrLine-GetTabBoxes().size();
+if (nMaxBoxes != nBoxes)
+{
+rTblNd.GetNodes().InsBoxen(rTblNd, pCurrLine, rBoxFmt, rTxtColl,
+0, nBoxes, nMaxBoxes - nBoxes);
+
+if (pUndo)
+{
+for (size_t i = nBoxes; i  nMaxBoxes; ++i)
+{
+pUndo-AddFillBox( *pCurrLine-GetTabBoxes()[i] );
+}
+}
+
+// if the first line is missing boxes, the width array is useless!
+if (!n  pPositions)
+{
+pPositions-clear();
+}
+}
+}
+}
+
+static void
+lcl_SetTableBoxWidths(SwTable  rTable, size_t const nMaxBoxes,
+SwTableBoxFmt  rBoxFmt, SwDoc  rDoc,
+std::vectorsal_uInt16 *const pPositions)
+{
+if (pPositions  !pPositions-empty())
+{
+SwTableLines rLns = rTable.GetTabLines();
+sal_uInt16 nLastPos = 0;
+for (size_t n = 0; n  pPositions-size(); ++n)
+{
+SwTableBoxFmt *pNewFmt = rDoc.MakeTableBoxFmt();
+pNewFmt-SetFmtAttr(
+SwFmtFrmSize(ATT_VAR_SIZE, (*pPositions)[n] - nLastPos));
+for (size_t nTmpLine = 0; nTmpLine  rLns.size(); ++nTmpLine)
+{
+//JP 24.06.98: have to do an Add here, because the BoxFormat is
+// still needed by the caller
+pNewFmt-Add( rLns[ nTmpLine ]-GetTabBoxes()[ n ] );
+}
+
+nLastPos = (*pPositions)[ n ];
+}
+
+// propagate size upwards from format, so the table gets the right size
+SAL_WARN_IF(rBoxFmt.GetDepends(), sw.core,
+who is still registered in the format?);
+rBoxFmt.SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, nLastPos ));
+}
+else
+{
+rBoxFmt.SetFmtAttr(SwFmtFrmSize(ATT_VAR_SIZE, USHRT_MAX / nMaxBoxes));
+}
+}
+
 SwTableNode* SwNodes::TextToTable( const SwNodeRange rRange, sal_Unicode cCh,
 SwTableFmt* pTblFmt,
 SwTableLineFmt* pLineFmt,
@@ -945,31 +1051,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange 
rRange, sal_Unicode cCh,
 }
 }
 
-// die alten Frames loeschen, es werden neue erzeugt
-pTxtNd-DelFrms();
-
-// PageBreaks/PageDesc/ColBreak rausschmeissen.
-const SfxItemSet* pSet = pTxtNd-GetpSwAttrSet();
-if( pSet )
-{
-const SfxPoolItem* pItem;
-if( SFX_ITEM_SET == pSet-GetItemState( RES_BREAK, sal_False, 
pItem ) )
-{
-if( !nLines )
-

[Libreoffice-commits] .: 3 commits - sw/source

2012-09-19 Thread Libreoffice Gerrit user
 sw/source/core/crsr/crsrsh.cxx |   28 ++--
 sw/source/ui/inc/hyp.hxx   |1 -
 sw/source/ui/lingu/hyp.cxx |9 -
 3 files changed, 14 insertions(+), 24 deletions(-)

New commits:
commit 2855009f8fd1670c804996d64336ce5c3f45b175
Author: Michael Stahl mst...@redhat.com
Date:   Wed Sep 19 21:01:13 2012 +0200

SwCrsrShell::Combine: this can be assert

Change-Id: Ia23804f213f80f4b31f1e31491dfc87d2d49f46a

diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 187095c..64da8ea 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -1987,13 +1987,10 @@ void SwCrsrShell::Combine()
 // rhbz#689053: IsSelOvr must restore the saved stack position, not the
 // current one, because current point + stack mark may be invalid PaM
 SwCrsrSaveState aSaveState(*pCrsrStk);
-if( pCrsrStk-HasMark() ) // only if GetMark was set
-{
-bool const bResult =
-CheckNodesRange( pCrsrStk-GetMark()-nNode, 
pCurCrsr-GetPoint()-nNode, sal_True );
-OSL_ENSURE(bResult, StackCrsr  current Crsr not in same Section.);
-(void) bResult; // non-debug: unused
-}
+// stack cursor  current cursor in same Section?
+assert(!pCrsrStk-HasMark() ||
+CheckNodesRange(pCrsrStk-GetMark()-nNode,
+pCurCrsr-GetPoint()-nNode, true));
 *pCrsrStk-GetPoint() = *pCurCrsr-GetPoint();
 pCrsrStk-GetPtPos() = pCurCrsr-GetPtPos();
 
@@ -2009,7 +2006,9 @@ void SwCrsrShell::Combine()
 if( !pCurCrsr-IsInProtectTable( sal_True ) 
 !pCurCrsr-IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE |
  nsSwCursorSelOverFlags::SELOVER_CHANGEPOS ) )
+{
 UpdateCrsr(); // update current cursor
+}
 }
 
 
commit af4b6c94c68b5f67b931cde8d0acda6ec8b288bb
Author: Michael Stahl mst...@redhat.com
Date:   Wed Sep 19 20:47:48 2012 +0200

rhbz#689053: fix crash following delete at last table cell:

The IsSelOvr() in SwCrsrShell::Combine() detects that the PaM with mark
in the last table cell and point ouside the table is invalid, but
unfortunatley restores the wrong position, which does not actually
correct the PaM; the deletion on the invalid PaM then removes the
last SwTxtNode in the document, which leads to crash later.

Change-Id: Ib2ae0b54e6c15dbe5b6811d8696531bf2022e1a4

diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 96d96b7..187095c 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -1984,26 +1984,27 @@ void SwCrsrShell::Combine()
 return;
 
 SwCallLink aLk( *this ); // watch Crsr-Moves; call Link if needed
-SwCrsrSaveState aSaveState( *pCurCrsr );
+// rhbz#689053: IsSelOvr must restore the saved stack position, not the
+// current one, because current point + stack mark may be invalid PaM
+SwCrsrSaveState aSaveState(*pCrsrStk);
 if( pCrsrStk-HasMark() ) // only if GetMark was set
 {
 bool const bResult =
 CheckNodesRange( pCrsrStk-GetMark()-nNode, 
pCurCrsr-GetPoint()-nNode, sal_True );
 OSL_ENSURE(bResult, StackCrsr  current Crsr not in same Section.);
 (void) bResult; // non-debug: unused
-// copy GetMark
-if( !pCurCrsr-HasMark() )
-pCurCrsr-SetMark();
-*pCurCrsr-GetMark() = *pCrsrStk-GetMark();
-pCurCrsr-GetMkPos() = pCrsrStk-GetMkPos();
 }
+*pCrsrStk-GetPoint() = *pCurCrsr-GetPoint();
+pCrsrStk-GetPtPos() = pCurCrsr-GetPtPos();
 
 SwShellCrsr * pTmp = 0;
 if( pCrsrStk-GetNext() != pCrsrStk )
 {
 pTmp = dynamic_castSwShellCrsr*(pCrsrStk-GetNext());
 }
-delete pCrsrStk;
+delete pCurCrsr;
+pCurCrsr = pCrsrStk;
+pCrsrStk-MoveTo(0); // remove from ring
 pCrsrStk = pTmp;
 if( !pCurCrsr-IsInProtectTable( sal_True ) 
 !pCurCrsr-IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE |
commit b74da58c7e85f92e6ce2d061dd3ced26e12a1dff
Author: Michael Stahl mst...@redhat.com
Date:   Wed Sep 19 20:26:49 2012 +0200

SwHyphWrapper::bShowError is dead

Change-Id: Ia9b8205a3b23fb98bf08d2d53aa82fdeda7785f5

diff --git a/sw/source/ui/inc/hyp.hxx b/sw/source/ui/inc/hyp.hxx
index 96ab150..5ec1106 100644
--- a/sw/source/ui/inc/hyp.hxx
+++ b/sw/source/ui/inc/hyp.hxx
@@ -45,7 +45,6 @@ private:
 sal_uInt16  nPageCount; // page count for progress view
 sal_uInt16  nPageStart; // 1st checked page
 sal_BoolbInSelection : 1; // seperating selected text
-sal_BoolbShowError : 1; // report non existing language
 sal_BoolbAutomatic : 1; // insert seperators without further 
inquiry
 sal_BoolbInfoBox : 1;   // display info-box when ending
 
diff --git a/sw/source/ui/lingu/hyp.cxx b/sw/source/ui/lingu/hyp.cxx
index 13e29bb..1d3cfec 100644
--- 

[Libreoffice-commits] .: 3 commits - sw/source

2012-07-17 Thread Michael Stahl
 sw/source/core/doc/docbm.cxx |9 ++---
 sw/source/core/txtnode/ndtxt.cxx |2 +-
 sw/source/filter/inc/wrtswtbl.hxx|8 
 sw/source/filter/writer/wrtswtbl.cxx |7 ---
 4 files changed, 15 insertions(+), 11 deletions(-)

New commits:
commit 78e8911d25ff33892fd3121b3f0a8df6a6439d72
Author: Michael Stahl mst...@redhat.com
Date:   Tue Jul 17 17:44:05 2012 +0200

SwWriteTable: warning C4389: '==': signed/unsigned mismatch

Change-Id: I58b2f74aef426e880ed7f2867e4cb0bbdff44328

diff --git a/sw/source/filter/inc/wrtswtbl.hxx 
b/sw/source/filter/inc/wrtswtbl.hxx
index fbb62f5..15f87bd 100644
--- a/sw/source/filter/inc/wrtswtbl.hxx
+++ b/sw/source/filter/inc/wrtswtbl.hxx
@@ -292,7 +292,7 @@ protected:
 
 void MergeBorders( const editeng::SvxBorderLine* pBorderLine, sal_Bool 
bTable );
 
-sal_uInt16 MergeBoxBorders( const SwTableBox *pBox, sal_uInt16 nRow, 
sal_uInt16 nCol,
+sal_uInt16 MergeBoxBorders(const SwTableBox *pBox, size_t nRow, size_t 
nCol,
 sal_uInt16 nRowSpan, sal_uInt16 nColSpan,
 sal_uInt16 rTopBorder, sal_uInt16 rBottomBorder 
);
 
@@ -308,16 +308,16 @@ public:
 sal_uInt16 GetRelWidth( sal_uInt16 nCol, sal_uInt16 nColSpan ) const;
 sal_uInt16 GetPrcWidth( sal_uInt16 nCol, sal_uInt16 nColSpan ) const;
 
-long GetAbsHeight( long nRawWidth, sal_uInt16 nRow, sal_uInt16 nRowSpan ) 
const;
-protected:
+long GetAbsHeight(long nRawWidth, size_t nRow, sal_uInt16 nRowSpan) const;
 
+protected:
 long GetLineHeight( const SwTableLine *pLine );
 long GetLineHeight( const SwTableBox *pBox ) const;
 const SvxBrushItem *GetLineBrush( const SwTableBox *pBox,
   SwWriteTableRow *pRow );
 
 sal_uInt16 GetLeftSpace( sal_uInt16 nCol ) const;
-sal_uInt16 GetRightSpace( sal_uInt16 nCol, sal_uInt16 nColSpan ) const;
+sal_uInt16 GetRightSpace(size_t nCol, sal_uInt16 nColSpan) const;
 
 
 public:
diff --git a/sw/source/filter/writer/wrtswtbl.cxx 
b/sw/source/filter/writer/wrtswtbl.cxx
index d52ff11..ef8697c 100644
--- a/sw/source/filter/writer/wrtswtbl.cxx
+++ b/sw/source/filter/writer/wrtswtbl.cxx
@@ -241,7 +241,7 @@ void SwWriteTable::MergeBorders( const SvxBorderLine* 
pBorderLine,
 
 
 sal_uInt16 SwWriteTable::MergeBoxBorders( const SwTableBox *pBox,
-sal_uInt16 nRow, sal_uInt16 nCol,
+size_t const nRow, size_t const nCol,
 sal_uInt16 nRowSpan, sal_uInt16 
nColSpan,
 sal_uInt16 rTopBorder,
 sal_uInt16 rBottomBorder )
@@ -326,7 +326,8 @@ sal_uInt16 SwWriteTable::GetLeftSpace( sal_uInt16 nCol ) 
const
 return nSpace;
 }
 
-sal_uInt16 SwWriteTable::GetRightSpace( sal_uInt16 nCol, sal_uInt16 nColSpan ) 
const
+sal_uInt16
+SwWriteTable::GetRightSpace(size_t const nCol, sal_uInt16 nColSpan) const
 {
 sal_uInt16 nSpace = nCellPadding;
 
@@ -377,7 +378,7 @@ sal_uInt16 SwWriteTable::GetPrcWidth( sal_uInt16 nCol, 
sal_uInt16 nColSpan ) con
GetBaseWidth() );
 }
 
-long SwWriteTable::GetAbsHeight( long nRawHeight, sal_uInt16 nRow,
+long SwWriteTable::GetAbsHeight(long nRawHeight, size_t const nRow,
sal_uInt16 nRowSpan ) const
 {
 nRawHeight -= (2*nCellPadding + nCellSpacing);
commit b8aa2fa9506967e20fd0db0af30de599f91cf10a
Author: Michael Stahl mst...@redhat.com
Date:   Tue Jul 17 17:36:16 2012 +0200

warning C4701: potentially uninitialized local variable used

Change-Id: Id82ecd3bfa7da6740d475ccaeea599529b090fe6

diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 1a710a8..85336a8 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -3107,7 +3107,7 @@ const ModelToViewHelper::ConversionMap*
 {
 const SwTxtAttr* pAttr = (*pSwpHints2)[i];
 bool bReplace = false;
-xub_StrLen nFieldPos;
+xub_StrLen nFieldPos(STRING_NOTFOUND);
 rtl::OUString aExpand;
 switch (pAttr-Which())
 {
commit bcd8f0ce8c5ed677be168085913300b8bab02e75
Author: Michael Stahl mst...@redhat.com
Date:   Tue Jul 17 17:28:13 2012 +0200

docbm.cxx: MSVC wants const_iterators and complains with error C2440

Change-Id: I9dfc01a3405f685437a562e8330b5821864de0da

diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 04074c7..a00e075 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -1418,7 +1418,8 @@ void _SaveCntntIdx(SwDoc* pDoc,
 {
 aSave.SetTypeAndCount( 0x400, 0 );
 const SwUnoCrsrTbl rTbl = pDoc-GetUnoCrsrTbl();
-for( SwUnoCrsrTbl::iterator it = rTbl.begin(); it != rTbl.end(); ++it )
+for (SwUnoCrsrTbl::const_iterator it = rTbl.begin();
+it 

[Libreoffice-commits] .: 3 commits - sw/source

2012-05-29 Thread Ivan Timofeev
 sw/source/ui/uiview/pview.cxx|   77 +--
 sw/source/ui/uiview/viewport.cxx |   24 
 2 files changed, 42 insertions(+), 59 deletions(-)

New commits:
commit bdca5df2644d4653665f7360c24f7757f46dcef0
Author: Ivan Timofeev timofeev@gmail.com
Date:   Tue May 29 18:35:36 2012 +0400

SwPagePreView: fix some scrollbar bugs (still not perfect, just a quick fix)

Change-Id: I4ff31f31bf579ece69e62633b99986d96ca7d857

diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx
index 52814df..ecdc27d 100644
--- a/sw/source/ui/uiview/pview.cxx
+++ b/sw/source/ui/uiview/pview.cxx
@@ -1183,10 +1183,6 @@ void SwPagePreView::Init(const SwViewOption * pPrefs)
 
 if( !bIsModified )
 pESh-ResetModified();
-
-pVScrollbar-ExtendedShow(pPrefs-IsViewVScrollBar());
-pHScrollbar-ExtendedShow(pPrefs-IsViewHScrollBar());
-pScrollFill-Show(pPrefs-IsViewVScrollBar()  
pPrefs-IsViewHScrollBar());
 }
 
 SwPagePreView::SwPagePreView(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh):
@@ -1392,9 +1388,6 @@ void SwPagePreView::OuterResizePixel( const Point rOfst, 
const Size rSize )
 {
 SvBorder aBorder;
 CalcAndSetBorderPixel( aBorder, sal_False );
-ViewResizePixel( aViewWin, rOfst, rSize, aViewWin.GetOutputSizePixel(),
-sal_False, *pVScrollbar,
-*pHScrollbar, pPageUpBtn, pPageDownBtn, 0, 
*pScrollFill );
 
 //EditWin niemals einstellen!
 
@@ -1411,6 +1404,9 @@ void SwPagePreView::OuterResizePixel( const Point rOfst, 
const Size rSize )
 
 SvBorder aBorderNew;
 CalcAndSetBorderPixel( aBorderNew, sal_False );
+ViewResizePixel( aViewWin, rOfst, rSize, aViewWin.GetOutputSizePixel(),
+sal_False, *pVScrollbar,
+*pHScrollbar, pPageUpBtn, pPageDownBtn, 0, 
*pScrollFill );
 }
 
 void SwPagePreView::SetVisArea( const Rectangle rRect, sal_Bool 
bUpdateScrollbar )
@@ -1615,6 +1611,9 @@ void SwPagePreView::ScrollViewSzChg()
 {
 if(!GetViewShell())
 return ;
+
+bool bShowVScrollbar = false, bShowHScrollbar = false;
+
 if(pVScrollbar)
 {
 
if(GetViewShell()-PagePreviewLayout()-DoesPreviewLayoutRowsFitIntoWindow())
@@ -1645,25 +1644,10 @@ void SwPagePreView::ScrollViewSzChg()
 aScrollbarRange.Max() += ( nVisPages - 1 );
 pVScrollbar-SetRange( aScrollbarRange );
 
-if( nVisPages  mnPageCount )
-{
-ShowVScrollbar( sal_True );
-pPageUpBtn-Show( sal_True );
-pPageDownBtn-Show( sal_True );
-}
-else
-{
-ShowVScrollbar( sal_False );
-pPageUpBtn-Show( sal_False );
-pPageDownBtn-Show( sal_False );
-}
+bShowVScrollbar = nVisPages  mnPageCount;
 }
 else //vertical scrolling by pixel
 {
-ShowVScrollbar( sal_True );
-pPageUpBtn-Show( sal_True );
-pPageDownBtn-Show( sal_True );
-
 const Rectangle rDocRect = aViewWin.GetPaintedPreviewDocRect();
 const Size rPreviewSize =
 GetViewShell()-PagePreviewLayout()-GetPrevwDocSize();
@@ -1673,7 +1657,13 @@ void SwPagePreView::ScrollViewSzChg()
 pVScrollbar-SetThumbPos( rDocRect.Top() );
 pVScrollbar-SetLineSize( nVisHeight / 10 );
 pVScrollbar-SetPageSize( nVisHeight / 2 );
+
+bShowVScrollbar = true;
 }
+
+ShowVScrollbar(bShowVScrollbar);
+pPageUpBtn-Show(bShowVScrollbar);
+pPageDownBtn-Show(bShowVScrollbar);
 }
 if(pHScrollbar)
 {
@@ -1686,7 +1676,7 @@ void SwPagePreView::ScrollViewSzChg()
 
 if(rDocRect.GetWidth()  rPreviewSize.Width())
 {
-ShowHScrollbar( sal_True );
+bShowHScrollbar = true;
 
 nVisWidth = rDocRect.GetWidth();
 nThumb = rDocRect.Left();
@@ -1698,9 +1688,10 @@ void SwPagePreView::ScrollViewSzChg()
 pHScrollbar-SetLineSize( nVisWidth / 10 );
 pHScrollbar-SetPageSize( nVisWidth / 2 );
 }
-else
-ShowHScrollbar( sal_False );
+
+ShowHScrollbar(bShowHScrollbar);
 }
+pScrollFill-Show(bShowVScrollbar  bShowHScrollbar);
 }
 
 void SwPagePreView::ScrollDocSzChg()
commit e7f7f4092a337cc98076ff500fb209a7f4dbb6b1
Author: Ivan Timofeev timofeev@gmail.com
Date:   Mon May 28 21:41:51 2012 +0400

these SwScrollbar::IsVisible(false) calls does not make sense to me...

Change-Id: Ic58be239044f75f1ad7f70df45813b59a4610737

diff --git a/sw/source/ui/uiview/viewport.cxx b/sw/source/ui/uiview/viewport.cxx
index 44bd8c4..7acaa98 100644
--- a/sw/source/ui/uiview/viewport.cxx
+++ b/sw/source/ui/uiview/viewport.cxx
@@ -870,13 +870,10 @@ void ViewResizePixel( const Window rRef,
 const sal_Bool bVLineal = pVLineal  pVLineal-IsVisible();
 

[Libreoffice-commits] .: 3 commits - sw/source

2012-05-28 Thread Tor Lillqvist
 sw/source/core/undo/unattr.cxx |   48 +---
 sw/source/core/undo/undel.cxx  |  130 +++---
 sw/source/core/undo/undobj.cxx |  155 ++---
 3 files changed, 153 insertions(+), 180 deletions(-)

New commits:
commit f0c1887fc60b0537172dc07a14f1d59da902b44b
Author: Philipp Riemer ruderphil...@gmail.com
Date:   Sat May 26 14:33:51 2012 +0200

Translate German comments in sw/source/core/undo/undobj.cxx

diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 650ee75..b0a42ff 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -36,7 +36,7 @@
 #include doc.hxx
 #include UndoManager.hxx
 #include docary.hxx
-#include swundo.hxx   // fuer die UndoIds
+#include swundo.hxx
 #include pam.hxx
 #include ndtxt.hxx
 #include UndoCore.hxx
@@ -71,10 +71,7 @@ SV_IMPL_PTRARR( SwRedlineSaveDatas, SwRedlineSaveDataPtr )
 
 
 //
-
-// Diese Klasse speichert den Pam als sal_uInt16's und kann diese wieder zu
-
-// einem PaM zusammensetzen
+// This class saves the Pam as sal_uInt16s and can recompose those into a PaM
 SwUndRng::SwUndRng()
 : nSttNode( 0 ), nEndNode( 0 ), nSttCntnt( 0 ), nEndCntnt( 0 )
 {
@@ -97,7 +94,7 @@ void SwUndRng::SetValues( const SwPaM rPam )
 nEndCntnt = pEnd-nContent.GetIndex();
 }
 else
-// keine Selektion !!
+// no selection !!
 nEndNode = 0, nEndCntnt = STRING_MAXLEN;
 
 nSttNode = pStt-nNode.GetIndex();
@@ -116,12 +113,12 @@ void SwUndRng::SetPaM( SwPaM  rPam, sal_Bool 
bCorrToCntnt ) const
 else
 rPam.GetPoint()-nContent.Assign( 0, 0 );
 
-if( !nEndNode  STRING_MAXLEN == nEndCntnt )   // keine Selection
+if( !nEndNode  STRING_MAXLEN == nEndCntnt )   // no selection
 return ;
 
 rPam.SetMark();
 if( nSttNode == nEndNode  nSttCntnt == nEndCntnt )
-return; // nichts mehr zu tun
+return; // nothing left to do
 
 rPam.GetPoint()-nNode = nEndNode;
 if( (pNd = rPam.GetNode())-IsCntntNode() )
@@ -183,8 +180,7 @@ void SwUndo::RemoveIdxFromRange( SwPaM rPam, sal_Bool 
bMoveNext )
 
 void SwUndo::RemoveIdxRel( sal_uLong nIdx, const SwPosition rPos )
 {
-// nur die Crsr verschieben; die Bookmarks/TOXMarks/.. werden vom
-// entsp. JoinNext/JoinPrev erledigt!
+// Move only the Crsr. Bookmarks/TOXMarks/etc. are done by the 
corresponding JoinNext/JoinPrev
 SwNodeIndex aIdx( rPos.nNode.GetNode().GetNodes(), nIdx );
 ::PaMCorrRel( aIdx, rPos );
 }
@@ -338,15 +334,14 @@ SwUndoSaveCntnt::~SwUndoSaveCntnt()
 delete pHistory;
 }
 
-// wird fuer das Loeschen von Inhalt benoetigt. Fuer das ReDo werden
-// Inhalte in das UndoNodesArray verschoben. Diese Methoden fuegen
-// am Ende eines TextNodes fuer die Attribute einen Trenner ein.
-// Dadurch werden die Attribute nicht expandiert.
-// MoveTo.. verschiebt aus dem NodesArray in das UndoNodesArray
-// MoveFrom..   verschiebt aus dem UndoNodesArray in das NodesArray
+// This is needed when deleting content. For REDO all contents will be 
moved into the
+// UndoNodesArray. These methods add a seperator for the attributes to the 
end of TextNodes.
+// As a result, the attributes will not be expanded.
+// - MoveTo   moves from NodesArray into UndoNodesArray
+// - MoveFrom moves from UndoNodesArray into NodesArray
 
-// 2.8.93:  ist pEndNdIdx angebenen, wird vom Undo/Redo -Ins/DelFly
-//  aufgerufen. Dann soll die gesamte Section verschoben werden.
+// 2.8.93:  If pEndNdIdx is given, Undo/Redo calls -Ins/DelFly.
+//  In that case the whole section should be moved.
 
 void SwUndoSaveCntnt::MoveToUndoNds( SwPaM rPaM, SwNodeIndex* pNodeIdx,
 SwIndex* pCntIdx, sal_uLong* pEndNdIdx, xub_StrLen* 
pEndCntIdx )
@@ -356,7 +351,7 @@ void SwUndoSaveCntnt::MoveToUndoNds( SwPaM rPaM, 
SwNodeIndex* pNodeIdx,
 
 SwNoTxtNode* pCpyNd = rPaM.GetNode()-GetNoTxtNode();
 
-// jetzt kommt das eigentliche Loeschen(Verschieben)
+// here comes the actual delete (move)
 SwNodes  rNds = rDoc.GetUndoManager().GetUndoNodes();
 SwPosition aPos( pEndNdIdx ? rNds.GetEndOfPostIts()
: rNds.GetEndOfExtras() );
@@ -376,7 +371,7 @@ void SwUndoSaveCntnt::MoveToUndoNds( SwPaM rPaM, 
SwNodeIndex* pNodeIdx,
 else
 aPos.nNode.GetNode().GetCntntNode()-MakeEndIndex( aPos.nContent );
 
-// als sal_uInt16 merken; die Indizies verschieben sich !!
+// keep as sal_uInt16; the indices shift!
 sal_uLong nTmpMvNode = aPos.nNode.GetIndex();
 xub_StrLen nTmpMvCntnt = aPos.nContent.GetIndex();
 
@@ -392,17 +387,15 @@ void SwUndoSaveCntnt::MoveToUndoNds( SwPaM rPaM, 
SwNodeIndex* pNodeIdx,
 rDoc.GetNodes().MoveRange( rPaM, aPos, rNds );
 
 SwTxtNode* 

[Libreoffice-commits] .: 3 commits - sw/source

2012-05-28 Thread Tor Lillqvist
 sw/source/core/undo/rolbck.cxx  |   59 ++---
 sw/source/core/undo/undobj1.cxx |   79 +++-
 sw/source/core/undo/unins.cxx   |   51 -
 3 files changed, 93 insertions(+), 96 deletions(-)

New commits:
commit ef195be10b5d987855d14a48a41bdd9c68d1b3a2
Author: Philipp Riemer ruderphil...@gmail.com
Date:   Sat May 26 16:05:52 2012 +0200

Translate German comments in sw/source/core/undo/rolbck.cxx

diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index b0ca37d..d16c951 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -58,12 +58,12 @@
 #include ndtxt.hxx// SwTxtNode
 #include paratr.hxx   //
 #include cellatr.hxx  //
-#include fldbas.hxx   // fuer Felder
-#include pam.hxx  // fuer SwPaM
+#include fldbas.hxx
+#include pam.hxx
 #include swtable.hxx
 #include ndgrf.hxx// SwGrfNode
 #include UndoCore.hxx
-#include IMark.hxx// fuer SwBookmark
+#include IMark.hxx
 #include charfmt.hxx // #i27615#
 #include comcore.hrc
 #include undo.hrc
@@ -90,7 +90,7 @@ SwHistorySetFmt::SwHistorySetFmt( const SfxPoolItem* pFmtHt, 
sal_uLong nNd )
 break;
 case RES_BOXATR_FORMULA:
 {
-//JP 30.07.98: Bug 54295 - Formeln immer im Klartext speichern
+//JP 30.07.98: Bug 54295 - save formulas always in plain text
 SwTblBoxFormula rNew = static_castSwTblBoxFormula(*m_pAttr);
 if ( rNew.IsIntrnlName() )
 {
@@ -214,12 +214,12 @@ SwHistorySetTxt::SwHistorySetTxt( SwTxtAttr* pTxtHt, 
sal_uLong nNodePos )
 , m_nStart( *pTxtHt-GetStart() )
 , m_nEnd( *pTxtHt-GetAnyEnd() )
 {
-// !! Achtung: folgende Attribute erzeugen keine FormatAttribute:
+// Caution: the following attributes generate no format attributes:
 //  - NoLineBreak, NoHypen, Inserted, Deleted
-// Dafuer muessen Sonderbehandlungen gemacht werden !!!
+// These cases must be handled separately !!!
 
-// ein bisschen kompliziert, aber ist Ok so: erst vom default
-// eine Kopie und dann die Werte aus dem Text Attribut zuweisen
+// a little bit complicated but works: first assign a copy of the
+// default value and afterwards the values from text attribute
 sal_uInt16 nWhich = pTxtHt-Which();
 if ( RES_TXTATR_CHARFMT == nWhich )
 {
@@ -442,13 +442,13 @@ SwHistorySetFootnote::SwHistorySetFootnote( SwTxtFtn* 
pTxtFtn, sal_uLong nNodePo
 OSL_ENSURE( pTxtFtn-GetStartNode(),
 SwHistorySetFootnote: Footnote without Section );
 
-// merke die alte NodePos, denn wer weiss was alles in der SaveSection
-// gespeichert (geloescht) wird
+// keep the old NodePos (because who knows what later will be saved/deleted
+// in SaveSection)
 SwDoc* pDoc = const_castSwDoc*(pTxtFtn-GetTxtNode().GetDoc());
 SwNode* pSaveNd = pDoc-GetNodes()[ m_nNodeIndex ];
 
-//Pointer auf StartNode der FtnSection merken und erstmal den Pointer im
-//Attribut zuruecksetzen - Damit werden automatisch die Frms vernichtet.
+// keep pointer to StartNode of FtnSection and reset its attribute for now
+// (as a result, its/all Frms will be deleted automatically)
 SwNodeIndex aSttIdx( *pTxtFtn-GetStartNode() );
 pTxtFtn-SetStartNode( 0, sal_False );
 
@@ -744,10 +744,10 @@ SwHistorySetAttrSet::SwHistorySetAttrSet( const 
SfxItemSet rSet,
 
 case RES_BOXATR_FORMULA:
 {
-//JP 20.04.98: Bug 49502 - wenn eine Formel gesetzt ist, 
nie den
-//  Value mit sichern. Der muss gegebenfalls 
neu
-//  errechnet werden!
-//JP 30.07.98: Bug 54295 - Formeln immer im Klartext 
speichern
+//JP 20.04.98: Bug 49502 - When a formula is set, never 
save
+// the value. It possibly must be recalculated!
+//JP 30.07.98: Bug 54295 - Save formulas always in plain
+// text
 m_OldSet.ClearItem( RES_BOXATR_VALUE );
 
 SwTblBoxFormula rNew =
@@ -1030,7 +1030,6 @@ SwHistory::~SwHistory()
 |*
 |*void SwHistory::Add()
 |*
-|*Beschreibung  Dokument 1.0
 |*
 */
 
@@ -1043,7 +1042,7 @@ void SwHistory::Add( const SfxPoolItem* pOldValue, const 
SfxPoolItem* pNewValue,
 if( (nWhich = POOLATTR_END) || (nWhich == RES_TXTATR_FIELD) )
 return;
 
-// no default Attribute?
+// no default attribute?
 SwHistoryHint * pHt;
 if ( pOldValue  pOldValue != GetDfltAttr( pOldValue-Which() ) )
 {
@@ -1182,7 +1181,6 @@ void SwHistory::Add(const SfxItemSet  rSet, const 
SwCharFmt  rFmt)
 |*
 |*sal_Bool SwHistory::Rollback()
 |*
-|*Beschreibung  Dokument 1.0
 |*
 

[Libreoffice-commits] .: 3 commits - sw/source

2012-04-16 Thread Michael Stahl
 sw/source/core/layout/paintfrm.cxx |  231 ++---
 1 file changed, 142 insertions(+), 89 deletions(-)

New commits:
commit 502c93143ef29989692ca3e63e3e6abc255fd53f
Author: Michael Stahl mst...@redhat.com
Date:   Mon Apr 16 16:12:39 2012 +0200

fdo#38635: fix border printing:

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

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index 1fbe09c..255cf14 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -4595,73 +4595,6 @@ void lcl_PaintLeftRightLine( const sal_Bool 
_bLeft,
 if ( _rAttrs.JoinedWithNext( _rFrm ) ) pBottomBorder = NULL;
 }
 
-// OD 06.05.2003 #107169# - adjustments for printer output device
-if ( bPrtOutputDev )
-{
-// substract width of outer top line.
-if ( rBox.GetTop()  (!bCnt || _rAttrs.GetTopLine( _rFrm )) )
-{
-long nDist = ::lcl_AlignHeight( rBox.GetTop()-GetOutWidth() );
-(aRect.*_rRectFn-fnSubTop)( -nDist );
-// OD 19.05.2003 #109667# - If outer top line is hair line, 
calculated
-// top has to be adjusted.
-if ( nDist == 1 )
-{
-if ( _rFrm.IsVertical() )
-{
-// right of border rectangle has to be checked and adjusted
-Point aCompPt( aRect.Right(), 0 );
-Point aRefPt( aCompPt.X() + 1, aCompPt.Y() );
-lcl_CompPxPosAndAdjustPos( *(pGlobalShell-GetOut()),
-  aRefPt, aCompPt,
-  sal_True, -1 );
-aRect.Right( aCompPt.X() );
-}
-else
-{
-// top of border rectangle has to be checked and adjusted
-Point aCompPt( 0, aRect.Top() );
-Point aRefPt( aCompPt.X(), aCompPt.Y() - 1 );
-lcl_CompPxPosAndAdjustPos( *(pGlobalShell-GetOut()),
-  aRefPt, aCompPt,
-  sal_False, +1 );
-aRect.Top( aCompPt.Y() );
-}
-}
-}
-// substract width of outer bottom line.
-if ( rBox.GetBottom()  (!bCnt || _rAttrs.GetBottomLine( _rFrm )) )
-{
-long nDist = ::lcl_AlignHeight( rBox.GetBottom()-GetOutWidth());
-(aRect.*_rRectFn-fnAddBottom)( -nDist );
-// OD 19.05.2003 #109667# - If outer bottom line is hair line, 
calculated
-// top has to be adjusted.
-if ( nDist == 1 )
-{
-if ( _rFrm.IsVertical() )
-{
-// left of border rectangle has to be checked and adjusted
-Point aCompPt( aRect.Left(), 0 );
-Point aRefPt( aCompPt.X() - 1, aCompPt.Y() );
-lcl_CompPxPosAndAdjustPos( *(pGlobalShell-GetOut()),
-  aRefPt, aCompPt,
-  sal_True, +1 );
-aRect.Left( aCompPt.X() );
-}
-else
-{
-// bottom of border rectangle has to be checked and 
adjusted
-Point aCompPt( 0, aRect.Bottom() );
-Point aRefPt( aCompPt.X(), aCompPt.Y() + 1 );
-lcl_CompPxPosAndAdjustPos( *(pGlobalShell-GetOut()),
-  aRefPt, aCompPt,
-  sal_False, -1 );
-aRect.Bottom( aCompPt.Y() );
-}
-}
-}
-}
-
 if ( !pLeftRightBorder-GetInWidth() )
 {
 // OD 06.05.2003 #107169# - add 6th parameter
commit 0868a0155a2b57daf7b862d120aead0458372b17
Author: Michael Stahl mst...@redhat.com
Date:   Mon Apr 16 16:12:36 2012 +0200

fdo#38215: merge consecutive border lines:

This re-implements the merging that was done by SwLineRects::AddLineRect,
SwLineRect::MakeUnion with the drawing layer border lines.
This is used to merge borders of paragraphs and of tables that have the
separating border-model, which fixes both the tiny dividing gaps
between successive borders in the second bugdoc and the weird subtly
differently rendered successive borders in the first bugdoc.
(regression from 0f0896c26fb260d1bbf31d7a886df3f61837f0f2)

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index 

[Libreoffice-commits] .: 3 commits - sw/source vcl/source

2012-02-22 Thread Michael Stahl
 sw/source/core/doc/doclay.cxx |3 +++
 sw/source/core/docnode/ndcopy.cxx |2 +-
 sw/source/core/unocore/unotext.cxx|6 --
 vcl/source/glyphs/graphite_layout.cxx |2 +-
 4 files changed, 5 insertions(+), 8 deletions(-)

New commits:
commit 91fab30f3b1617024ee2eadf3c7ad1ea84d7f6dd
Author: Michael Stahl mst...@redhat.com
Date:   Wed Feb 22 23:58:04 2012 +0100

fdo#46482: prevent duplication of frames:

SwDoc::MakeFlySection: abuse the SwDoc::mbRedlineMove flag, which
(with the fix for fdo#40599) does exactly what is necessary to prevent
the spurious copies.
Also, remove the ugly hack to work around this problem from
SwXText::convertToTextFrame.

diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index 17264ca..c184135 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -840,8 +840,10 @@ if( GetIDocumentUndoRedo().DoesUndo() )
 SwPaM* pTmp = (SwPaM*)rPam;
 sal_Bool bOldFlag = mbCopyIsMove;
 bool const bOldUndo = GetIDocumentUndoRedo().DoesUndo();
+bool const bOldRedlineMove(IsRedlineMove());
 mbCopyIsMove = sal_True;
 GetIDocumentUndoRedo().DoUndo(false);
+SetRedlineMove(true);
 do {
 if( pTmp-HasMark() 
 *pTmp-GetPoint() != *pTmp-GetMark() )
@@ -850,6 +852,7 @@ if( GetIDocumentUndoRedo().DoesUndo() )
 }
 pTmp = static_castSwPaM*(pTmp-GetNext());
 } while ( rPam != pTmp );
+SetRedlineMove(bOldRedlineMove);
 mbCopyIsMove = bOldFlag;
 GetIDocumentUndoRedo().DoUndo(bOldUndo);
 
diff --git a/sw/source/core/unocore/unotext.cxx 
b/sw/source/core/unocore/unotext.cxx
index 2c25700..c83d243 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -1720,12 +1720,6 @@ throw (lang::IllegalArgumentException, 
uno::RuntimeException)
 SwFmtAnchor aAnchor((*i)-GetAnchor());
 aAnchor.SetAnchor(aMovePam.Start());
 m_pImpl-m_pDoc-SetAttr(aAnchor, *(*i));
-
-// delete the old anchor
-SwSpzFrmFmts* pFrmFmts = 
m_pImpl-m_pDoc-GetSpzFrmFmts();
-// here we rely on that fact that this is a sorted 
list, where the last element is the newly created frame
-SwFrmFmt *pFrmFmt = (*pFrmFmts)[pFrmFmts-Count()-1];
-m_pImpl-m_pDoc-DelLayoutFmt(pFrmFmt);
 }
 }
 }
commit 23e52c207760c596cc2f841ef59f3100c110d591
Author: Michael Stahl mst...@redhat.com
Date:   Wed Feb 22 23:48:57 2012 +0100

fdo#40599 i#112763: fix frame duplication:

SwDoc::CopyFlyInFlyImpl: When called from SwRedline::CopyToSection, do not
copy frames that are anchored at the redline end node by checking
IsRedlineMove(); these frames are not deleted by DelCopyOfSection and were
thus duplicated on every Show/Hide redlines.
(regression from 62ebbb006b4a11974e14dd61d3c453a98336f951 (CWS os131))

diff --git a/sw/source/core/docnode/ndcopy.cxx 
b/sw/source/core/docnode/ndcopy.cxx
index 07bf4a4..2461505 100644
--- a/sw/source/core/docnode/ndcopy.cxx
+++ b/sw/source/core/docnode/ndcopy.cxx
@@ -1431,7 +1431,7 @@ void SwDoc::CopyFlyInFlyImpl( const SwNodeRange rRg,
 bool bAdd = false;
 if( pAPos-nNode  rRg.aEnd )
 bAdd = true;
-if( !bAdd )
+if (!bAdd  !IsRedlineMove()) // fdo#40599: not for redline move
 {
 bool bEmptyNode = false;
 bool bLastNode = false;
commit d066f7e4afb3c9e395932ba7bf8715ad0770bcdd
Author: Michael Stahl mst...@redhat.com
Date:   Wed Feb 22 23:48:52 2012 +0100

vcl: crash in GraphiteLayout::expandOrCondense:

When printing the bugdoc from i#103958:

error: attempt to subscript container with out-of-bounds index 5, but
container only holds 5 elements.

#4  0x7fd37902be5e in GraphiteLayout::expandOrCondense (this=0x35296a8, 
rArgs=...) at vcl/source/glyphs/graphite_layout.cxx:848
#5  0x7fd37902bc54 in GraphiteLayout::AdjustLayout (this=0x35296a8, 
rArgs=...) at vcl/source/glyphs/graphite_layout.cxx:812
#6  0x7fd3790345c8 in GraphiteServerFontLayout::AdjustLayout 
(this=0x3529640, rArgs=...) at vcl/inc/graphite_serverfont.hxx:76
#7  0x7fd378d5c91d in OutputDevice::forceFallbackFontToFit 
(this=0x35022c0, rFallback=..., rFallbackFont=..., rFontSelData=..., 
nFallbackLevel=1, rLayoutArgs=..., rOrigMetric=...) at 
vcl/source/gdi/outdev3.cxx:6094
#8  0x7fd378d5cece in OutputDevice::ImplGlyphFallbackLayout 
(this=0x35022c0, pSalLayout=0x36136c0, rLayoutArgs=...) at 
vcl/source/gdi/outdev3.cxx:6206
#9  

[Libreoffice-commits] .: 3 commits - sw/source

2012-01-06 Thread Jan Holesovsky
 sw/source/ui/docvw/HeaderFooterWin.cxx |   14 +++-
 sw/source/ui/docvw/PageBreakWin.cxx|  108 ++---
 sw/source/ui/inc/HeaderFooterWin.hxx   |1 
 sw/source/ui/inc/PageBreakWin.hxx  |3 
 4 files changed, 37 insertions(+), 89 deletions(-)

New commits:
commit 60c968e9a2ef14aa289e677bd7f40d2c4724fd12
Author: Jan Holesovsky ke...@suse.cz
Date:   Sat Jan 7 04:27:25 2012 +0100

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

diff --git a/sw/source/ui/docvw/PageBreakWin.cxx 
b/sw/source/ui/docvw/PageBreakWin.cxx
index 0edeb61..ff5050b 100644
--- a/sw/source/ui/docvw/PageBreakWin.cxx
+++ b/sw/source/ui/docvw/PageBreakWin.cxx
@@ -83,17 +83,11 @@ namespace
 
 void SwBreakDashedLine::MouseMove( const MouseEvent rMEvt )
 {
-if ( rMEvt.IsLeaveWindow() )
-{
-// don't fade if we just move to the 'button'
-Point aEventPos( GetPosPixel() + rMEvt.GetPosPixel() );
-if ( !m_pWin-Contains( aEventPos ) )
-m_pWin-Fade( false );
-}
+Point aEventPos( GetPosPixel() + rMEvt.GetPosPixel() );
+if ( !m_pWin-Contains( aEventPos ) )
+m_pWin-Fade( false );
 else if ( !m_pWin-IsVisible() )
-{
 m_pWin-Fade( true );
-}
 
 if ( !rMEvt.IsSynthetic() )
 {
@@ -309,13 +303,9 @@ void SwPageBreakWin::Select( )
 
 void SwPageBreakWin::MouseMove( const MouseEvent rMEvt )
 {
-if ( rMEvt.IsLeaveWindow() )
-{
-// don't fade if we just move to the 'line', or the popup menu is open
-Point aEventPos( rMEvt.GetPosPixel() + rMEvt.GetPosPixel() );
-if ( !Contains( aEventPos )  !PopupMenu::IsInExecute() )
-Fade( false );
-}
+Point aEventPos( rMEvt.GetPosPixel() + rMEvt.GetPosPixel() );
+if ( !Contains( aEventPos )  !PopupMenu::IsInExecute() )
+Fade( false );
 else if ( !IsVisible() )
 Fade( true );
 }
commit aa3bfbe776bcefd7e7b143e6843315df6b2a5ecb
Author: Jan Holesovsky ke...@suse.cz
Date:   Sat Jan 7 04:16:44 2012 +0100

Header/Footer, Page Breaks: Delay appearing by 500ms.

The delay was a good idea, just the 1s was too long.

diff --git a/sw/source/ui/docvw/HeaderFooterWin.cxx 
b/sw/source/ui/docvw/HeaderFooterWin.cxx
index ff7d50e..330c1ff 100644
--- a/sw/source/ui/docvw/HeaderFooterWin.cxx
+++ b/sw/source/ui/docvw/HeaderFooterWin.cxx
@@ -153,6 +153,7 @@ SwHeaderFooterWin::SwHeaderFooterWin( SwEditWin* pEditWin, 
const SwPageFrm* pPag
 m_pLine( NULL ),
 m_bIsAppearing( false ),
 m_nFadeRate( 100 ),
+m_nDelayAppearing( 0 ),
 m_aFadeTimer( )
 {
 // Get the font and configure it
@@ -243,6 +244,9 @@ void SwHeaderFooterWin::ShowAll( bool bShow )
 if ( !PopupMenu::IsInExecute() )
 {
 m_bIsAppearing = bShow;
+if ( bShow )
+m_nDelayAppearing = 0;
+
 if ( m_aFadeTimer.IsActive( ) )
 m_aFadeTimer.Stop();
 m_aFadeTimer.Start( );
@@ -516,6 +520,14 @@ void SwHeaderFooterWin::Select( )
 
 IMPL_LINK( SwHeaderFooterWin, FadeHandler, Timer *, EMPTYARG )
 {
+const int TICKS_BEFORE_WE_APPEAR = 10;
+if ( m_bIsAppearing  m_nDelayAppearing  TICKS_BEFORE_WE_APPEAR )
+{
+++m_nDelayAppearing;
+m_aFadeTimer.Start();
+return 0;
+}
+
 if ( m_bIsAppearing  m_nFadeRate  0 )
 m_nFadeRate -= 25;
 else if ( !m_bIsAppearing  m_nFadeRate  100 )
@@ -535,7 +547,7 @@ IMPL_LINK( SwHeaderFooterWin, FadeHandler, Timer *, 
EMPTYARG )
 Invalidate();
 
 if ( IsVisible( )  m_nFadeRate  0  m_nFadeRate  100 )
-m_aFadeTimer.Start();
+m_aFadeTimer.Start();
 
 return 0;
 }
diff --git a/sw/source/ui/docvw/PageBreakWin.cxx 
b/sw/source/ui/docvw/PageBreakWin.cxx
index 0617101..0edeb61 100644
--- a/sw/source/ui/docvw/PageBreakWin.cxx
+++ b/sw/source/ui/docvw/PageBreakWin.cxx
@@ -110,6 +110,7 @@ SwPageBreakWin::SwPageBreakWin( SwEditWin* pEditWin, const 
SwPageFrm* pPageFrm )
 m_pLine( NULL ),
 m_bIsAppearing( false ),
 m_nFadeRate( 100 ),
+m_nDelayAppearing( 0 ),
 m_bDestroyed( false ),
 m_pMousePt( NULL )
 {
@@ -424,6 +425,9 @@ void SwPageBreakWin::SetReadonly( bool bReadonly )
 void SwPageBreakWin::Fade( bool bFadeIn )
 {
 m_bIsAppearing = bFadeIn;
+if ( bFadeIn )
+m_nDelayAppearing = 0;
+
 if ( !m_bDestroyed  m_aFadeTimer.IsActive( ) )
 m_aFadeTimer.Stop();
 if ( !m_bDestroyed )
@@ -439,6 +443,14 @@ IMPL_LINK( SwPageBreakWin, HideHandler, void *, EMPTYARG )
 
 IMPL_LINK( SwPageBreakWin, FadeHandler, Timer *, EMPTYARG )
 {
+const int TICKS_BEFORE_WE_APPEAR = 10;
+if ( m_bIsAppearing  m_nDelayAppearing  TICKS_BEFORE_WE_APPEAR )
+{
+++m_nDelayAppearing;
+m_aFadeTimer.Start();
+return 0;
+}
+
 if ( m_bIsAppearing  m_nFadeRate  0 )
 m_nFadeRate -= 25;
 else if ( !m_bIsAppearing  m_nFadeRate  100 )
diff --git 

[Libreoffice-commits] .: 3 commits - sw/source writerfilter/debug_setup.mk writerfilter/inc writerfilter/source

2011-11-08 Thread Cédric Bosdonnat
 sw/source/core/access/accmap.cxx |1 
 sw/source/core/tox/toxhlp.cxx|1 
 sw/source/core/unocore/unotext.cxx   |8 +
 sw/source/ui/config/optpage.cxx  |2 
 writerfilter/debug_setup.mk  |2 
 writerfilter/inc/resourcemodel/TableManager.hxx  |   64 +++
 writerfilter/source/dmapper/DomainMapperTableHandler.cxx |4 
 writerfilter/source/dmapper/DomainMapper_Impl.cxx|   15 +--
 writerfilter/source/dmapper/DomainMapper_Impl.hxx|2 
 9 files changed, 55 insertions(+), 44 deletions(-)

New commits:
commit 0e26bd20978cbdd7c59368044c2a21b98ffba164
Author: Cédric Bosdonnat cedric.bosdonnat@free.fr
Date:   Tue Nov 8 14:39:31 2011 +0100

writerfilter import, fixed the shapes import

In some cases like an OLE object inside a textbox, the imported document
was empty. This was due to unremoved text context in dmapper.

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index b65cb21..0f90573 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -188,7 +188,7 @@ DomainMapper_Impl::DomainMapper_Impl(
 m_bIsColumnBreakDeferred( false ),
 m_bIsPageBreakDeferred( false ),
 m_bIsInShape( false ),
-m_bShapeContextAdded( false ),
+m_bRemovedLastAnchored( false ),
 m_pLastSectionContext( ),
 m_nCurrentTabStopIndex( 0 ),
 m_sCurrentParaStyleId(),
@@ -928,6 +928,8 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr 
pPropertyMap )
 // this is normal: the shape is already attached
 }
 m_aAnchoredStack.pop( );
+m_aTextAppendStack.pop( );
+m_bRemovedLastAnchored = true;
 }
 
 // Get the end of paragraph character inserted
@@ -1065,10 +1067,10 @@ void DomainMapper_Impl::appendOLE( const 
::rtl::OUString rStreamName, OLEHandle
 // gives a better ( visually ) result
 
xOLEProperties-setPropertyValue(PropertyNameSupplier::GetPropertyNameSupplier().GetName(
 PROP_ANCHOR_TYPE ),  uno::makeAny( text::TextContentAnchorType_AS_CHARACTER ) 
);
 // remove ( if valid ) associated shape ( used for graphic replacement 
)
-if ( m_bShapeContextAdded )
+if ( m_aAnchoredStack.size()  0 )
 {
 if ( lcl_removeShape(  m_xTextDocument, pOLEHandler-getShape(), 
m_aAnchoredStack, m_aTextAppendStack ) )
-m_bShapeContextAdded = false; // ensure PopShapeContext 
processing doesn't pop the append stack
+m_bRemovedLastAnchored = true; // ensure PopShapeContext 
processing doesn't pop the append stack
 }
 
 //
@@ -1080,7 +1082,6 @@ void DomainMapper_Impl::appendOLE( const ::rtl::OUString 
rStreamName, OLEHandle
 (void)rEx;
 OSL_FAIL( Exception in creation of OLE object );
 }
-
 }
 
 
@@ -1373,7 +1374,7 @@ void DomainMapper_Impl::PushShapeContext( const 
uno::Reference drawing::XShape
 {
 // Add the shape to the text append stack
 m_aTextAppendStack.push( uno::Reference text::XTextAppend ( xShape, 
uno::UNO_QUERY_THROW ) );
-m_bShapeContextAdded = true;
+m_bRemovedLastAnchored = false;
 
 // Add the shape to the anchored objects stack
 uno::Reference text::XTextContent  xTxtContent( xShape, 
uno::UNO_QUERY_THROW );
@@ -1418,11 +1419,11 @@ void DomainMapper_Impl::PushShapeContext( const 
uno::Reference drawing::XShape
 
 void DomainMapper_Impl::PopShapeContext()
 {
-if ( m_bShapeContextAdded )
+if ( !m_bRemovedLastAnchored  m_aAnchoredStack.size()  0 )
 {
 RemoveLastParagraph();
 m_aTextAppendStack.pop();
-m_bShapeContextAdded = false;
+m_aAnchoredStack.pop();
 }
 m_bIsInShape = false;
 }
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index b9e9af1..e3b3fa1 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -295,7 +295,7 @@ private:
 bool   
 m_bIsColumnBreakDeferred;
 bool   
 m_bIsPageBreakDeferred;
 bool   
 m_bIsInShape;
-bool   
 m_bShapeContextAdded;
+bool   
 m_bRemovedLastAnchored;
 
 LineNumberSettings 
 

[Libreoffice-commits] .: 3 commits - sw/source unotools/inc unotools/source unusedcode.easy vcl/inc vcl/source

2011-11-02 Thread Caolán McNamara
 sw/source/ui/wrtsh/select.cxx   |   23 ---
 unotools/inc/unotools/lingucfg.hxx  |1 -
 unotools/source/config/lingucfg.cxx |   15 ---
 unusedcode.easy |   36 ++--
 vcl/inc/vcl/button.hxx  |1 -
 vcl/source/control/button.cxx   |6 --
 6 files changed, 50 insertions(+), 32 deletions(-)

New commits:
commit 8fa8a59cad3970bbe68724fbbb93797fb5786c37
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Nov 2 16:03:57 2011 +

update unused list

diff --git a/unusedcode.easy b/unusedcode.easy
index a8cece3..e895bbc 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -487,8 +487,6 @@ ScInputBarGroup::LinkStubImpl_ScrollHdl(void*, void*)
 ScJobSetup::ScJobSetup(SfxPrinter*)
 ScLeftFooterEditPage::GetRanges()
 ScLeftHeaderEditPage::GetRanges()
-ScMacrosTest::testStarBasic()
-ScMacrosTest::testVba()
 ScMatrix::CalcOffset(unsigned long, unsigned long) const
 ScMultiTextWnd::GetLineCount()
 ScMyCellInfo::ScMyCellInfo()
@@ -1269,6 +1267,7 @@ VCLUnoHelper::CreatePointer()
 VCLXDevice::IsCreatedWithToolkit() const
 VCLXPrinterServer::getImplementationId()
 VCLXPrinterServer::getTypes()
+VCLXRadioButton::getFirstActionListener()
 VbaFontBase::getUnderline()
 VbaFontBase::setUnderline(com::sun::star::uno::Any const)
 VbaFoundFilesEnum::SetFileList(com::sun::star::uno::Sequencertl::OUString)
@@ -2136,7 +2135,40 @@ graphite2::TtfUtil::GlyfLookup(unsigned short, void 
const*, void const*, unsigne
 jfw_plugin::VendorBase::createInstance()
 jfw_plugin::VendorBase::getJavaExePaths(int*)
 
jvmaccess::ClassPath::doLoadClass(com::sun::star::uno::Referencecom::sun::star::uno::XComponentContext
 const, void*, rtl::OUString const, rtl::OUString const)
+layout::Box::Box(layout::Context const*, char const*)
+layout::Box::Box(rtl::OUString const, int, bool)
+layout::Box::setProps(com::sun::star::uno::Referencecom::sun::star::awt::XLayoutConstrains,
 bool, bool, int)
+layout::Button::GetButton() const
+layout::Container::ShowAll(bool)
+layout::ControlImpl::GetGetFocusHdl()
+layout::ControlImpl::GetLoseFocusHdl()
+layout::Dialog::GetDialog() const
+layout::Edit::GetEdit() const
+layout::ErrorBox::ErrorBox(Window*, char const*, char const*, char const*, 
rtl::OString const, char const*, char const*)
+layout::ErrorBox::ErrorBox(Window*, long, char const*, char const*, char 
const*, rtl::OString const, char const*, char const*)
+layout::ErrorBox::ErrorBox(Window*, long, rtl::OUString const, rtl::OUString, 
rtl::OUString, rtl::OString const, char const*, char const*)
+layout::ErrorBox::ErrorBox(Window*, rtl::OUString const, rtl::OUString, 
rtl::OUString, rtl::OString const, char const*, char const*)
+layout::InfoBox::InfoBox(Window*, char const*, char const*, char const*, 
rtl::OString const, char const*, char const*)
+layout::InfoBox::InfoBox(Window*, long, char const*, char const*, char const*, 
rtl::OString const, char const*, char const*)
+layout::InfoBox::InfoBox(Window*, long, rtl::OUString const, rtl::OUString, 
rtl::OUString, rtl::OString const, char const*, char const*)
+layout::InfoBox::InfoBox(Window*, rtl::OUString const, rtl::OUString, 
rtl::OUString, rtl::OString const, char const*, char const*)
+layout::ListBox::GetEntry(unsigned short) const
+layout::ListBox::GetEntryPos(String const) const
+layout::ListBox::GetSelectEntryPos(unsigned short) const
+layout::ListBox::SelectEntryPos(unsigned short, bool)
+layout::MetricFormatter::MetricFormatter(layout::FormatterBaseImpl*)
+layout::MetricFormatter::getFormatImpl() const
+layout::NumericFormatter::NumericFormatter(layout::FormatterBaseImpl*)
+layout::NumericFormatter::getFormatImpl() const
+layout::PushButton::Check(bool)
+layout::PushButton::GetPushButton() const
+layout::TabControl::SetCurPageId(unsigned short)
+layout::Table::setProps(com::sun::star::uno::Referencecom::sun::star::awt::XLayoutConstrains,
 bool, bool, int, int)
+layout::Window::CreatePeer(layout::Window*, long, char const*)
+layout::Window::getContext()
+layout::WindowImpl::getProperty(char const*)
 layoutimpl::LayoutRoot::addItem(rtl::OUString const, 
com::sun::star::uno::Referencecom::sun::star::awt::XLayoutConstrains const)
+layoutimpl::VCLXPlugin::SetPlugin(Control*)
 
layoutimpl::VCLXTabControl::AddChild(com::sun::star::uno::Referencecom::sun::star::awt::XLayoutConstrains
 const)
 layoutimpl::WidgetFactory::sfx2CreateWindow(VCLXWindow**, Window*, 
rtl::OUString const, long)
 
layoutimpl::getParent(com::sun::star::uno::Referencecom::sun::star::uno::XInterface)
commit da0bd7a50139b06e14c1917af044b37d10ebaf4f
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Nov 2 16:03:45 2011 +

drop freshly unused methods

diff --git a/unotools/inc/unotools/lingucfg.hxx 
b/unotools/inc/unotools/lingucfg.hxx
index 4ae1020..668cb26 100644
--- a/unotools/inc/unotools/lingucfg.hxx
+++ b/unotools/inc/unotools/lingucfg.hxx
@@ -225,7 +225,6 @@ public:
 std::vector 

[Libreoffice-commits] .: 3 commits - sw/source

2011-10-11 Thread Cédric Bosdonnat
 sw/source/ui/docvw/HeaderFooterWin.cxx |  288 +++--
 sw/source/ui/docvw/PageBreakWin.cxx|   20 +-
 sw/source/ui/inc/HeaderFooterWin.hxx   |6 
 3 files changed, 223 insertions(+), 91 deletions(-)

New commits:
commit f7ffa5f14758fb49ca85b4cea7f705c2d438710e
Author: Cédric Bosdonnat cedric.bosdon...@free.fr
Date:   Wed Oct 12 02:01:03 2011 +0200

Header/Footer: Implemented fade in/out

diff --git a/sw/source/ui/docvw/HeaderFooterWin.cxx 
b/sw/source/ui/docvw/HeaderFooterWin.cxx
index c536fe9..0c0aa00 100644
--- a/sw/source/ui/docvw/HeaderFooterWin.cxx
+++ b/sw/source/ui/docvw/HeaderFooterWin.cxx
@@ -53,6 +53,7 @@
 #include drawinglayer/attribute/fillgradientattribute.hxx
 #include drawinglayer/attribute/fontattribute.hxx
 #include drawinglayer/primitive2d/fillgradientprimitive2d.hxx
+#include drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx
 #include drawinglayer/primitive2d/polygonprimitive2d.hxx
 #include drawinglayer/primitive2d/polypolygonprimitive2d.hxx
 #include drawinglayer/primitive2d/textlayoutdevice.hxx
@@ -149,7 +150,10 @@ SwHeaderFooterWin::SwHeaderFooterWin( SwEditWin* pEditWin, 
const SwPageFrm* pPag
 m_bIsHeader( bHeader ),
 m_bReadonly( false ),
 m_pPopupMenu( NULL ),
-m_pLine( NULL )
+m_pLine( NULL ),
+m_bIsAppearing( false ),
+m_nFadeRate( 100 ),
+m_aFadeTimer( )
 {
 // Get the font and configure it
 Font aFont = GetSettings().GetStyleSettings().GetToolFont();
@@ -186,6 +190,9 @@ SwHeaderFooterWin::SwHeaderFooterWin( SwEditWin* pEditWin, 
const SwPageFrm* pPag
 aText = m_pPopupMenu-GetItemText( FN_HEADERFOOTER_DELETE );
 m_pPopupMenu-SetItemText( FN_HEADERFOOTER_DELETE, aRewriter.Apply( aText 
) );
 SetPopupMenu( m_pPopupMenu );
+
+m_aFadeTimer.SetTimeout( 500 );
+m_aFadeTimer.SetTimeoutHdl( LINK( this, SwHeaderFooterWin, FadeHandler ) );
 }
 
 SwHeaderFooterWin::~SwHeaderFooterWin( )
@@ -229,8 +236,13 @@ void SwHeaderFooterWin::SetOffset( Point aOffset, long 
nXLineStart, long nXLineE
 
 void SwHeaderFooterWin::ShowAll( bool bShow )
 {
-Show( bShow );
-m_pLine-Show( bShow );
+if ( !PopupMenu::IsInExecute() )
+{
+m_bIsAppearing = bShow;
+if ( m_aFadeTimer.IsActive( ) )
+m_aFadeTimer.Stop();
+m_aFadeTimer.Start( );
+}
 }
 
 void SwHeaderFooterWin::Paint( const Rectangle )
@@ -356,8 +368,12 @@ void SwHeaderFooterWin::Paint( const Rectangle )
 *this, aNewViewInfos );
 
 // TODO Ghost it all if needed
+Primitive2DSequence aGhostedSeq( 1 );
+double nFadeRate = double( m_nFadeRate ) / 100.0;
+aGhostedSeq[0] = Primitive2DReference( new ModifiedColorPrimitive2D(
+aSeq, BColorModifier( Color( COL_WHITE ).getBColor(), 1.0 - 
nFadeRate, BCOLORMODIFYMODE_INTERPOLATE ) ) );
 
-pProcessor-process( aSeq );
+pProcessor-process( aGhostedSeq );
 }
 
 bool SwHeaderFooterWin::IsEmptyHeaderFooter( )
@@ -482,4 +498,30 @@ void SwHeaderFooterWin::Select( )
 ExecuteCommand( GetCurItemId() );
 }
 
+IMPL_LINK( SwHeaderFooterWin, FadeHandler, Timer *, EMPTYARG )
+{
+if ( m_bIsAppearing  m_nFadeRate  0 )
+m_nFadeRate -= 10;
+else if ( !m_bIsAppearing  m_nFadeRate  100 )
+m_nFadeRate += 10;
+
+if ( m_nFadeRate != 100  !IsVisible() )
+{
+Show( true );
+m_pLine-Show( true );
+}
+else if ( m_nFadeRate == 100  IsVisible( ) )
+{
+Show( false );
+m_pLine-Show( false );
+}
+else
+Invalidate();
+
+if ( IsVisible( )  m_nFadeRate  0  m_nFadeRate  100 )
+m_aFadeTimer.Start();
+
+return 0;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/docvw/PageBreakWin.cxx 
b/sw/source/ui/docvw/PageBreakWin.cxx
index 8e871e2..b48e450 100644
--- a/sw/source/ui/docvw/PageBreakWin.cxx
+++ b/sw/source/ui/docvw/PageBreakWin.cxx
@@ -376,7 +376,7 @@ void SwPageBreakWin::MouseMove( const MouseEvent rMEvt )
 
 void SwPageBreakWin::Activate( )
 {
-m_aFadeTimer.Stop();
+Fade( true );
 MenuButton::Activate();
 }
 
diff --git a/sw/source/ui/inc/HeaderFooterWin.hxx 
b/sw/source/ui/inc/HeaderFooterWin.hxx
index 5ab8ef5..247678e 100644
--- a/sw/source/ui/inc/HeaderFooterWin.hxx
+++ b/sw/source/ui/inc/HeaderFooterWin.hxx
@@ -44,6 +44,9 @@ class SwHeaderFooterWin : public MenuButton, public 
SwFrameControl
 bool  m_bReadonly;
 PopupMenu*m_pPopupMenu;
 Window*   m_pLine;
+bool  m_bIsAppearing;
+int   m_nFadeRate;
+Timer m_aFadeTimer;
 
 public:
 SwHeaderFooterWin( SwEditWin* pEditWin, const SwPageFrm* pPageFrm, bool 
bHeader );
@@ -64,6 +67,9 @@ public:
 void ExecuteCommand(sal_uInt16 nSlot);
 
 void SetReadonly( bool bReadonly );
+
+private:
+DECL_LINK( FadeHandler, Timer * );
 };
 
 #endif
commit 01e704121ace2d9c732fbf0fad0ef69cd3c39378
Author: Cédric