[Libreoffice-commits] .: sw/inc sw/source
sw/inc/fmtcol.hxx |1 + sw/source/core/inc/flowfrm.hxx |1 + sw/source/core/inc/txtfrm.hxx |1 + 3 files changed, 3 insertions(+) New commits: commit 5191ee9800d53c8ebb6f56222eb81a1e4bce9925 Author: Miklos Vajna vmik...@suse.cz Date: Fri Mar 9 13:08:10 2012 +0100 sw: doxygen comments for SwTxtFmtColl, SwFlowFrm, SwTxtFrm diff --git a/sw/inc/fmtcol.hxx b/sw/inc/fmtcol.hxx index 16db7c6..3451a4b 100644 --- a/sw/inc/fmtcol.hxx +++ b/sw/inc/fmtcol.hxx @@ -57,6 +57,7 @@ private: const SwFmtColl operator=(const SwFmtColl ); }; +/// Represents the style of a paragraph. class SW_DLLPUBLIC SwTxtFmtColl: public SwFmtColl { friend class SwDoc; diff --git a/sw/source/core/inc/flowfrm.hxx b/sw/source/core/inc/flowfrm.hxx index 7104060..c10e7b3 100644 --- a/sw/source/core/inc/flowfrm.hxx +++ b/sw/source/core/inc/flowfrm.hxx @@ -58,6 +58,7 @@ class SwObjectFormatterTxtFrm; void MakeFrms( SwDoc *, const SwNodeIndex , const SwNodeIndex ); +/// Base class for frames that are allowed at page breaks and shall continue on the next page, e.g. paragraphs, tables. class SwFlowFrm { //PrepareMake darf Locken/Unlocken (Robustheit) diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx index c42be69..e8da527 100644 --- a/sw/source/core/inc/txtfrm.hxx +++ b/sw/source/core/inc/txtfrm.hxx @@ -62,6 +62,7 @@ class SwWrongList; #define RUBY_TOP3 #define GRID_CELLS 4 +/// Represents the visualization of a paragraph. class SwTxtFrm: public SwCntntFrm { friend class SwTxtIter; ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sw/inc sw/source
sw/inc/shellio.hxx |3 - sw/source/filter/writer/writer.cxx | 82 + sw/source/filter/ww8/wrtww8.cxx|8 +-- 3 files changed, 27 insertions(+), 66 deletions(-) New commits: commit ad9960ffeb25f31ce4b1f819f909f1eb9ad6d7dd Author: Noel Grandin n...@peralex.com Date: Fri Mar 2 09:18:51 2012 +0200 Convert SvPtrarr usage to std::vector In GetBookmarks and Writer_Impl pFontRemoveLst field. Remove unused field pBkmkArr in Writer_Impl class. Convert SwBookmarkNodeTable to std::multimap, greatly simplifying code. diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx index 68de27e..751f638 100644 --- a/sw/inc/shellio.hxx +++ b/sw/inc/shellio.hxx @@ -47,6 +47,7 @@ #include swtypes.hxx #include docfac.hxx // SwDocFac #include iodetect.hxx +#include IMark.hxx class SfxFilterContainer; class SfxFilter; @@ -463,7 +464,7 @@ public: // Search alle Bookmarks in the range and return it in the Array. sal_uInt16 GetBookmarks( const SwCntntNode rNd, xub_StrLen nStt, xub_StrLen nEnd, -SvPtrarr rArr ); +std::vector const ::sw::mark::IMark* rArr ); // Create new PaM at position. static SwPaM * NewSwPaM(SwDoc rDoc, diff --git a/sw/source/filter/writer/writer.cxx b/sw/source/filter/writer/writer.cxx index d5c19d8..e1c4736 100644 --- a/sw/source/filter/writer/writer.cxx +++ b/sw/source/filter/writer/writer.cxx @@ -28,9 +28,6 @@ #include hintids.hxx -#include svl/svstdarr.hxx -#include tools/table.hxx - #include sot/storage.hxx #include sfx2/docfile.hxx #include svl/urihelper.hxx @@ -53,15 +50,15 @@ using namespace ::com::sun::star; static sal_Char aNToABuf[] = 0; #define NTOABUFLEN (sizeof(aNToABuf)) -DECLARE_TABLE( SwBookmarkNodeTable, SvPtrarr* ) +typedef std::multimapsal_uLong, const ::sw::mark::IMark* SwBookmarkNodeTable; struct Writer_Impl { SvStream * m_pStream; boost::scoped_ptr std::mapString, String pFileNameMap; -SvPtrarr* pFontRemoveLst, *pBkmkArr; -SwBookmarkNodeTable* pBkmkNodePos; +std::vectorconst SvxFontItem* aFontRemoveLst; +SwBookmarkNodeTable aBkmkNodePos; Writer_Impl(); ~Writer_Impl(); @@ -72,59 +69,33 @@ struct Writer_Impl Writer_Impl::Writer_Impl() : m_pStream(0) -, pFontRemoveLst( 0 ) -, pBkmkArr( 0 ), pBkmkNodePos( 0 ) { } Writer_Impl::~Writer_Impl() { -delete pFontRemoveLst; - -if( pBkmkNodePos ) -{ -for( SvPtrarr* p = pBkmkNodePos-First(); p; p = pBkmkNodePos-Next() ) -delete p; -delete pBkmkNodePos; -} } void Writer_Impl::RemoveFontList( SwDoc rDoc ) { -OSL_ENSURE( pFontRemoveLst, wo ist die FontListe? ); -for( sal_uInt16 i = pFontRemoveLst-Count(); i; ) +for( std::vectorconst SvxFontItem*::const_iterator it = aFontRemoveLst.begin(); +it != aFontRemoveLst.end(); ++it ) { -SvxFontItem* pItem = (SvxFontItem*)(*pFontRemoveLst)[ --i ]; -rDoc.GetAttrPool().Remove( *pItem ); +rDoc.GetAttrPool().Remove( **it ); } } void Writer_Impl::InsertBkmk(const ::sw::mark::IMark rBkmk) { -if( !pBkmkNodePos ) -pBkmkNodePos = new SwBookmarkNodeTable; sal_uLong nNd = rBkmk.GetMarkPos().nNode.GetIndex(); -SvPtrarr* pArr = pBkmkNodePos-Get( nNd ); -if( !pArr ) -{ -pArr = new SvPtrarr( 1 ); -pBkmkNodePos-Insert( nNd, pArr ); -} -void* p = (void*)rBkmk; -pArr-Insert( p, pArr-Count() ); +aBkmkNodePos.insert( SwBookmarkNodeTable::value_type( nNd, rBkmk ) ); if(rBkmk.IsExpanded() rBkmk.GetOtherMarkPos().nNode != nNd) { nNd = rBkmk.GetOtherMarkPos().nNode.GetIndex(); -pArr = pBkmkNodePos-Get( nNd ); -if( !pArr ) -{ -pArr = new SvPtrarr( 1 ); -pBkmkNodePos-Insert( nNd, pArr ); -} -pArr-Insert( p, pArr-Count() ); +aBkmkNodePos.insert( SwBookmarkNodeTable::value_type( nNd, rBkmk )); } } @@ -166,10 +137,7 @@ const IDocumentStylePoolAccess* Writer::getIDocumentStylePoolAccess() const { re void Writer::ResetWriter() { -if (m_pImpl-pFontRemoveLst) -{ -m_pImpl-RemoveFontList( *pDoc ); -} +m_pImpl-RemoveFontList( *pDoc ); m_pImpl.reset(new Writer_Impl); if( pCurPam ) @@ -471,13 +439,7 @@ void Writer::_AddFontItem( SfxItemPool rPool, const SvxFontItem rFont ) rPool.Remove( *pItem ); else { -if (!m_pImpl-pFontRemoveLst) -{ -m_pImpl-pFontRemoveLst = new SvPtrarr( 0 ); -} - -void* p = (void*)pItem; -m_pImpl-pFontRemoveLst-Insert( p, m_pImpl-pFontRemoveLst-Count() ); +m_pImpl-aFontRemoveLst.push_back( pItem ); } } @@ -497,44 +459,42 @@ void Writer::CreateBookmarkTbl() // search alle Bookmarks in the range and return it in the Array sal_uInt16
[Libreoffice-commits] .: sw/inc sw/source
sw/inc/doc.hxx |2 - sw/source/core/doc/docfmt.cxx| 48 --- sw/source/ui/dochdl/swdtflvr.cxx |2 - 3 files changed, 32 insertions(+), 20 deletions(-) New commits: commit 15547450bdba10959473c2cb5891f29ad5053b09 Author: Caolán McNamara caol...@redhat.com Date: Mon Feb 27 12:39:06 2012 + Resolves: fdo#46038 don't copy page styles into temporary clipboard doc writer rtf export has a nasty pgdsctbl extension sd rtf import has nasty if its got a table keyword in it its a table logic Classically we never put our styles into the temporary clipboard, so fastest and safest fix is to simply skip putting the page styles into it. diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 580108e..cfe9935 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -1286,7 +1286,7 @@ public: SwGrfFmtColl* CopyGrfColl( const SwGrfFmtColl rColl ); // Replace all styles with those from rSource. -void ReplaceStyles( const SwDoc rSource ); +void ReplaceStyles( const SwDoc rSource, bool bIncludePageStyles = true ); // Replace all property defaults with those from rSource. void ReplaceDefaults( const SwDoc rSource ); diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index 05227ea..01176c9 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -2134,7 +2134,7 @@ void SwDoc::CopyPageDesc( const SwPageDesc rSrcDesc, SwPageDesc rDstDesc, } } -void SwDoc::ReplaceStyles( const SwDoc rSource ) +void SwDoc::ReplaceStyles( const SwDoc rSource, bool bIncludePageStyles ) { ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo()); @@ -2145,26 +2145,38 @@ void SwDoc::ReplaceStyles( const SwDoc rSource ) CopyFmtArr( *rSource.pTxtFmtCollTbl, *pTxtFmtCollTbl, SwDoc::_MakeTxtFmtColl, *pDfltTxtFmtColl ); -// and now the page templates -sal_uInt16 nCnt = rSource.aPageDescs.Count(); -if( nCnt ) -{ -// a different Doc - Number formatter needs to be merged -SwTblNumFmtMerge aTNFM( rSource, *this ); +sal_uInt16 nCnt; -// 1st step: Create all formats (skip the 0th - it's the default!) -while( nCnt ) +//To-Do: +// a) in rtf export don't export our hideous pgdsctbl +// extension to rtf anymore +// b) in sd rtf import (View::InsertData) don't use +// a super-fragile test for mere presence of \trowd to +// indicate import of rtf into a table +// c) then drop use of bIncludePageStyles +if (bIncludePageStyles) +{ +// and now the page templates +nCnt = rSource.aPageDescs.Count(); +if( nCnt ) { -SwPageDesc *pSrc = rSource.aPageDescs[ --nCnt ]; -if( 0 == ::lcl_FindPageDesc( aPageDescs, pSrc-GetName() ) ) -MakePageDesc( pSrc-GetName() ); -} +// a different Doc - Number formatter needs to be merged +SwTblNumFmtMerge aTNFM( rSource, *this ); -// 2nd step: Copy all attributes, set the right parents -for( nCnt = rSource.aPageDescs.Count(); nCnt; ) -{ -SwPageDesc *pSrc = rSource.aPageDescs[ --nCnt ]; -CopyPageDesc( *pSrc, *::lcl_FindPageDesc( aPageDescs, pSrc-GetName() )); +// 1st step: Create all formats (skip the 0th - it's the default!) +while( nCnt ) +{ +SwPageDesc *pSrc = rSource.aPageDescs[ --nCnt ]; +if( 0 == ::lcl_FindPageDesc( aPageDescs, pSrc-GetName() ) ) +MakePageDesc( pSrc-GetName() ); +} + +// 2nd step: Copy all attributes, set the right parents +for( nCnt = rSource.aPageDescs.Count(); nCnt; ) +{ +SwPageDesc *pSrc = rSource.aPageDescs[ --nCnt ]; +CopyPageDesc( *pSrc, *::lcl_FindPageDesc( aPageDescs, pSrc-GetName() )); +} } } diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx index b7be519..adfa4d1 100644 --- a/sw/source/ui/dochdl/swdtflvr.cxx +++ b/sw/source/ui/dochdl/swdtflvr.cxx @@ -379,7 +379,7 @@ namespace //It would probably make most sense here to only insert the styles used //by the selection, e.g. apply SwDoc::IsUsed on styles ? -rDest.ReplaceStyles(rSrc); +rDest.ReplaceStyles(rSrc, false); rSrcWrtShell.Copy(rDest); } ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sw/inc sw/source
sw/inc/format.hxx|1 + sw/inc/frmfmt.hxx|1 + sw/inc/node.hxx | 12 +++- sw/source/core/inc/frame.hxx |7 +++ 4 files changed, 12 insertions(+), 9 deletions(-) New commits: commit 06fa03d6ca0e27468129bfffaacecfd491738309 Author: Miklos Vajna vmik...@suse.cz Date: Fri Feb 17 10:47:49 2012 +0100 sw: second round of doxygen comments diff --git a/sw/inc/format.hxx b/sw/inc/format.hxx index 660a7fe..28b4fac 100644 --- a/sw/inc/format.hxx +++ b/sw/inc/format.hxx @@ -42,6 +42,7 @@ class IDocumentFieldsAccess; class IDocumentChartDataProviderAccess; class SwDoc; +/// Base class for various Writer styles. class SW_DLLPUBLIC SwFmt : public SwModify { String aFmtName; diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx index e06dea9..d0be16d 100644 --- a/sw/inc/frmfmt.hxx +++ b/sw/inc/frmfmt.hxx @@ -44,6 +44,7 @@ class SwRect; class SwContact; class SdrObject; +/// Style of a layout element. class SW_DLLPUBLIC SwFrmFmt: public SwFmt { friend class SwDoc; diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx index f75091a..fa2736c 100644 --- a/sw/inc/node.hxx +++ b/sw/inc/node.hxx @@ -85,9 +85,7 @@ class IDocumentContentOperations; class IDocumentListItems; class SwOLENodes; -// -// class SwNode -// +/// Base class of the Writer document model elements. class SW_DLLPUBLIC SwNode : private BigPtrEntry { @@ -304,9 +302,7 @@ private: SwNode operator= ( const SwNode rNodes ); }; -// -// class SwStartNode -// +/// Starts a section of nodes in the document model. class SwStartNode: public SwNode { friend class SwNode; @@ -340,9 +336,7 @@ private: }; -// -// class SwEndNode -// +/// Ends a section of nodes in the document model. class SwEndNode : public SwNode { friend class SwNodes; diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx index 7e4a389..e61ee3f 100644 --- a/sw/source/core/inc/frame.hxx +++ b/sw/source/core/inc/frame.hxx @@ -250,6 +250,13 @@ enum MakePageType }; +/** + * Base class of the Writer layout elements. + * + * This includes not only fly frames, but everything down to the paragraph + * level: pages, headers, footers, etc. (Inside a paragraph SwLinePortion + * instances are used.) + */ class SwFrm: public SwClient, public SfxBroadcaster { //Der verkappte Frm ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sw/inc sw/source
sw/inc/doc.hxx |1 + sw/inc/index.hxx |1 + sw/inc/ndindex.hxx |1 + sw/inc/ndtxt.hxx |2 +- sw/inc/pam.hxx |2 ++ sw/source/core/inc/hffrm.hxx |2 ++ sw/source/core/inc/pagefrm.hxx |1 + sw/source/core/inc/rootfrm.hxx |1 + 8 files changed, 10 insertions(+), 1 deletion(-) New commits: commit 335b38d831558ce786f726b4b6a014d2a312cf29 Author: Miklos Vajna vmik...@suse.cz Date: Wed Feb 15 11:36:56 2012 +0100 sw: add doxygen comments for some document model / layout classes diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 8fb1c1b..580108e 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -249,6 +249,7 @@ void SetAllScriptItem( SfxItemSet rSet, const SfxPoolItem rItem ); // global function to start grammar checking in the document void StartGrammarChecking( SwDoc rDoc ); +/// Represents the model of a Writer document. class SW_DLLPUBLIC SwDoc : public IInterface, public IDocumentSettingAccess, diff --git a/sw/inc/index.hxx b/sw/inc/index.hxx index 329fcb4..8d183db 100644 --- a/sw/inc/index.hxx +++ b/sw/inc/index.hxx @@ -48,6 +48,7 @@ struct SwPosition; #define INLINE inline #endif +/// Marks a character position inside a document model node. class SW_DLLPUBLIC SwIndex { private: diff --git a/sw/inc/ndindex.hxx b/sw/inc/ndindex.hxx index 566d180..4283408 100644 --- a/sw/inc/ndindex.hxx +++ b/sw/inc/ndindex.hxx @@ -38,6 +38,7 @@ class SwNode; class SwNodes; +/// Marks a node in the document model. class SW_DLLPUBLIC SwNodeIndex { friend void SwNodes::RegisterIndex( SwNodeIndex ); diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx index b412aa4..21e9fb4 100644 --- a/sw/inc/ndtxt.hxx +++ b/sw/inc/ndtxt.hxx @@ -79,7 +79,7 @@ namespace com { namespace sun { namespace star { typedef std::set xub_StrLen SwSoftPageBreakList; -// SwTxtNode +/// SwTxtNode is a paragraph in the document model. class SW_DLLPUBLIC SwTxtNode: public SwCntntNode, public ::sfx2::Metadatable { diff --git a/sw/inc/pam.hxx b/sw/inc/pam.hxx index 53d1486..1ca3905 100644 --- a/sw/inc/pam.hxx +++ b/sw/inc/pam.hxx @@ -53,6 +53,7 @@ namespace utl { class TextSearch; } +/// Marks a position in the document model. struct SW_DLLPUBLIC SwPosition { SwNodeIndex nNode; @@ -157,6 +158,7 @@ extern SwGoInDoc fnGoCntntCellsSkipHidden; void _InitPam(); +/// PaM is Point and Mark: a selection of the document model. class SW_DLLPUBLIC SwPaM : public Ring { SwPosition m_Bound1; diff --git a/sw/source/core/inc/hffrm.hxx b/sw/source/core/inc/hffrm.hxx index dcf9a2b..993da32 100644 --- a/sw/source/core/inc/hffrm.hxx +++ b/sw/source/core/inc/hffrm.hxx @@ -49,6 +49,7 @@ public: virtual void PaintSubsidiaryLines( const SwPageFrm*, const SwRect ) const; }; +/// Header in the document layout, inside a page. class SwHeaderFrm: public SwHeadFootFrm { public: @@ -57,6 +58,7 @@ public: DECL_FIXEDMEMPOOL_NEWDEL(SwHeaderFrm) }; +/// Footer in the document layout, inside a page. class SwFooterFrm: public SwHeadFootFrm { public: diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx index 779c4cd..0091e24 100644 --- a/sw/source/core/inc/pagefrm.hxx +++ b/sw/source/core/inc/pagefrm.hxx @@ -58,6 +58,7 @@ enum SwPageChg CHG_CHGPAGE }; +/// A page of the document layout. class SwPageFrm: public SwFtnBossFrm { friend class SwFrm; diff --git a/sw/source/core/inc/rootfrm.hxx b/sw/source/core/inc/rootfrm.hxx index 788fc55..b8f0f8f 100644 --- a/sw/source/core/inc/rootfrm.hxx +++ b/sw/source/core/inc/rootfrm.hxx @@ -62,6 +62,7 @@ struct SwCrsrMoveState; #include vector +/// The root element of a Writer document layout. class SwRootFrm: public SwLayoutFrm { //Muss das Superfluous temporaer abschalten. ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sw/inc sw/source
sw/inc/SwAppletImpl.hxx| 19 +++ sw/source/filter/html/SwAppletImpl.cxx | 80 - 2 files changed, 49 insertions(+), 50 deletions(-) New commits: commit 0a7126a7673e60490b5da565d1df14248136fcce Author: Takeshi Abe t...@fixedpoint.jp Date: Tue Jan 24 01:45:12 2012 +0900 Replaced String by rtl::OUString diff --git a/sw/inc/SwAppletImpl.hxx b/sw/inc/SwAppletImpl.hxx index 3c936b3..b0c9e8a 100644 --- a/sw/inc/SwAppletImpl.hxx +++ b/sw/inc/SwAppletImpl.hxx @@ -37,7 +37,6 @@ #include com/sun/star/embed/XEmbeddedObject.hpp -#include tools/string.hxx #include sfx2/frmhtml.hxx #include sfx2/frmhtmlw.hxx #include vcl/wrkwin.hxx @@ -55,25 +54,25 @@ class SwApplet_Impl com::sun::star::uno::Reference com::sun::star::embed::XEmbeddedObject xApplet; SvCommandList aCommandList; SfxItemSetaItemSet; -StringsAlt; +::rtl::OUString sAlt; public: -static sal_uInt16 GetOptionType( const String rName, sal_Bool bApplet ); +static sal_uInt16 GetOptionType( const ::rtl::OUString rName, sal_Bool bApplet ); SwApplet_Impl( SfxItemPool rPool, sal_uInt16 nWhich1, sal_uInt16 nWhich2 ); SwApplet_Impl( SfxItemSet rSet ): aItemSet ( rSet) {} ~SwApplet_Impl(); -void CreateApplet( const String rCode, const String rName, - sal_Bool bMayScript, const String rCodeBase, - const String rBaseURL ); +void CreateApplet( const ::rtl::OUString rCode, const ::rtl::OUString rName, + sal_Bool bMayScript, const ::rtl::OUString rCodeBase, + const ::rtl::OUString rBaseURL ); #ifdef SOLAR_JAVA -sal_Bool CreateApplet( const String rBaseURL ); -void AppendParam( const String rName, const String rValue ); +sal_Bool CreateApplet( const ::rtl::OUString rBaseURL ); +void AppendParam( const ::rtl::OUString rName, const ::rtl::OUString rValue ); #endif void FinishApplet(); com::sun::star::uno::Reference com::sun::star::embed::XEmbeddedObject GetApplet() { return xApplet; } SfxItemSet GetItemSet() { return aItemSet; } -const String GetAltText() { return sAlt; } -void SetAltText( const String rAlt ) {sAlt = rAlt;} +const ::rtl::OUString GetAltText() const { return sAlt; } +void SetAltText( const ::rtl::OUString rAlt ) {sAlt = rAlt;} }; #endif diff --git a/sw/source/filter/html/SwAppletImpl.cxx b/sw/source/filter/html/SwAppletImpl.cxx index 520ad8c..23db157 100644 --- a/sw/source/filter/html/SwAppletImpl.cxx +++ b/sw/source/filter/html/SwAppletImpl.cxx @@ -47,76 +47,76 @@ static char const sHTML_O_Object[] = OBJECT; } -sal_uInt16 SwApplet_Impl::GetOptionType( const String rName, sal_Bool bApplet ) +sal_uInt16 SwApplet_Impl::GetOptionType( const ::rtl::OUString rName, sal_Bool bApplet ) { sal_uInt16 nType = bApplet ? SWHTML_OPTTYPE_PARAM : SWHTML_OPTTYPE_TAG; -switch( rName.GetChar(0) ) +switch( rName.toChar() ) { case 'A': case 'a': -if( rName.EqualsIgnoreCaseAscii( OOO_STRING_SVTOOLS_HTML_O_align ) || -rName.EqualsIgnoreCaseAscii( OOO_STRING_SVTOOLS_HTML_O_alt ) ) +if( rName.equalsIgnoreAsciiCaseAscii( OOO_STRING_SVTOOLS_HTML_O_align ) || +rName.equalsIgnoreAsciiCaseAscii( OOO_STRING_SVTOOLS_HTML_O_alt ) ) nType = SWHTML_OPTTYPE_IGNORE; else if( bApplet - (rName.EqualsIgnoreCaseAscii( sHTML_O_archive ) || - rName.EqualsIgnoreCaseAscii( sHTML_O_Archives )) ) + (rName.equalsIgnoreAsciiCaseAscii( sHTML_O_archive ) || + rName.equalsIgnoreAsciiCaseAscii( sHTML_O_Archives )) ) nType = SWHTML_OPTTYPE_TAG; break; case 'C': case 'c': -if( rName.EqualsIgnoreCaseAscii( OOO_STRING_SVTOOLS_HTML_O_class ) || -(bApplet (rName.EqualsIgnoreCaseAscii( OOO_STRING_SVTOOLS_HTML_O_code ) || - rName.EqualsIgnoreCaseAscii( OOO_STRING_SVTOOLS_HTML_O_codebase ))) ) +if( rName.equalsIgnoreAsciiCaseAscii( OOO_STRING_SVTOOLS_HTML_O_class ) || +(bApplet (rName.equalsIgnoreAsciiCaseAscii( OOO_STRING_SVTOOLS_HTML_O_code ) || + rName.equalsIgnoreAsciiCaseAscii( OOO_STRING_SVTOOLS_HTML_O_codebase ))) ) nType = SWHTML_OPTTYPE_IGNORE; break; case 'H': case 'h': -if( rName.EqualsIgnoreCaseAscii( OOO_STRING_SVTOOLS_HTML_O_height ) ) +if( rName.equalsIgnoreAsciiCaseAscii( OOO_STRING_SVTOOLS_HTML_O_height ) ) nType = SWHTML_OPTTYPE_SIZE; -else if( rName.EqualsIgnoreCaseAscii( OOO_STRING_SVTOOLS_HTML_O_hspace ) || -(!bApplet rName.EqualsIgnoreCaseAscii( OOO_STRING_SW_HTML_O_Hidden )) ) +else if( rName.equalsIgnoreAsciiCaseAscii( OOO_STRING_SVTOOLS_HTML_O_hspace ) || +(!bApplet
[Libreoffice-commits] .: sw/inc sw/source
sw/inc/doc.hxx | 12 ++-- sw/source/core/doc/poolfmt.cxx | 17 - 2 files changed, 18 insertions(+), 11 deletions(-) New commits: commit 169f3b47c0ad339c6983de2e19d94627c9e567d3 Author: August Sodora aug...@gmail.com Date: Fri Jan 13 23:48:59 2012 -0500 SvStringsDtor-boost::ptr_vector diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 47b55ec..edf59c3 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -88,6 +88,7 @@ class SwList; #include memory #include boost/scoped_ptr.hpp +#include boost/ptr_container/ptr_vector.hpp namespace editeng { class SvxBorderLine; } @@ -288,7 +289,7 @@ class SW_DLLPUBLIC SwDoc : SwDBDataaDBData;// database descriptor ::com::sun::star::uno::Sequence sal_Int8 aRedlinePasswd; String sTOIAutoMarkURL;// ::com::sun::star::util::URL of table of index AutoMark file -SvStringsDtor aPatternNms; // Array for names of document-templates +boost::ptr_vector boost::nullableString aPatternNms; // Array for names of document-templates com::sun::star::uno::Referencecom::sun::star::container::XNameContainer xXForms;// container with XForms models mutable com::sun::star::uno::Reference com::sun::star::linguistic2::XProofreadingIterator m_xGCIterator; @@ -1300,7 +1301,14 @@ public: sal_uInt16 SetDocPattern( const String rPatternName ); // Return name of document template. Can be 0! -String* GetDocPattern( sal_uInt16 nPos ) const { return aPatternNms[nPos]; } +const String* GetDocPattern( sal_uInt16 nPos ) const +{ +if(nPos = aPatternNms.size()) +return NULL; +if(boost::is_null(aPatternNms.begin() + nPos)) +return NULL; +return (aPatternNms[nPos]); +} // Delete all unreferenced field types. void GCFieldTypes();// impl. in docfld.cxx diff --git a/sw/source/core/doc/poolfmt.cxx b/sw/source/core/doc/poolfmt.cxx index 25fae85..6b5868a 100644 --- a/sw/source/core/doc/poolfmt.cxx +++ b/sw/source/core/doc/poolfmt.cxx @@ -2125,21 +2125,20 @@ sal_uInt16 SwDoc::SetDocPattern( const String rPatternName ) { OSL_ENSURE( rPatternName.Len(), no Document Template name ); -sal_uInt16 nNewPos = aPatternNms.Count(); -for( sal_uInt16 n = 0; n aPatternNms.Count(); ++n ) -if( !aPatternNms[n] ) +size_t nNewPos = aPatternNms.size(); +for(size_t n = 0; n aPatternNms.size(); ++n) +if( boost::is_null(aPatternNms.begin() + n) ) { -if( nNewPos == aPatternNms.Count() ) +if( nNewPos == aPatternNms.size() ) nNewPos = n; } -else if( rPatternName == *aPatternNms[n] ) +else if( rPatternName == aPatternNms[n] ) return n; -if( nNewPos aPatternNms.Count() ) -aPatternNms.Remove( nNewPos ); // Free space again +if( nNewPos aPatternNms.size() ) +aPatternNms.erase(aPatternNms.begin() + nNewPos); // Free space again -String* pNewNm = new String( rPatternName ); -aPatternNms.Insert( pNewNm, nNewPos ); +aPatternNms.insert(aPatternNms.begin() + nNewPos, new String(rPatternName)); SetModified(); return nNewPos; } ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sw/inc sw/source
sw/inc/printdata.hxx | 11 +-- sw/inc/unotxdoc.hxx |3 +-- sw/source/core/view/printdata.cxx | 14 -- sw/source/ui/inc/view.hxx |3 +-- sw/source/ui/uiview/view.cxx | 18 -- sw/source/ui/uno/unotxdoc.cxx | 33 + sw/source/ui/uno/unotxvw.cxx |8 7 files changed, 48 insertions(+), 42 deletions(-) New commits: commit 69aedb82d728422db891ba02f7c25f1873cb1f6b Author: Michael Stahl mst...@redhat.com Date: Wed Dec 21 16:39:22 2011 +0100 sw: fdo#39159 fdo#40482: temp selection print doc: Ensure that the printing temp selection document is not destroyed prematurely by SwXTextView::NotifySelChanged, called via ViewOptionAdjustStop, by retaining the temp doc object shell not at the View but in SwRenderData. Not restoring the view options for selections does not actually work, because having a selection surprisingly does not imply printing a temp document: the preview also uses a selection. (view option regression from cd690d2e72be410058376c416a40ff5d918fb0f7) diff --git a/sw/inc/printdata.hxx b/sw/inc/printdata.hxx index 8d29336..02d56b8 100644 --- a/sw/inc/printdata.hxx +++ b/sw/inc/printdata.hxx @@ -28,10 +28,10 @@ #ifndef SW_PRINTDATA_HXX #define SW_PRINTDATA_HXX - #include sal/types.h #include rtl/ustring.hxx #include vcl/print.hxx +#include sfx2/objsh.hxx #include boost/scoped_ptr.hpp @@ -244,6 +244,10 @@ class SwRenderData rtl::OUString m_aPageRange; +// temp print document -- must live longer than m_pViewOptionAdjust! +// also this is a Lock and not a Ref because Ref does not delete the doc +SfxObjectShellLock m_xTempDocShell; + // the view options to be applied for printing ::boost::scoped_ptrSwViewOptionAdjust_Impl m_pViewOptionAdjust; @@ -266,9 +270,12 @@ public: void CreatePostItData( SwDoc *pDoc, const SwViewOption *pViewOpt, OutputDevice *pOutDev ); void DeletePostItData(); +SfxObjectShellLock const GetTempDocShell() const; +void SetTempDocShell(SfxObjectShellLock const); + bool IsViewOptionAdjust() const { return m_pViewOptionAdjust != 0; } bool NeedNewViewOptionAdjust( const ViewShell ) const; -void ViewOptionAdjustStart( ViewShell rSh, const SwViewOption rViewOptions, bool bIsTmpSelection ); +void ViewOptionAdjustStart( ViewShell rSh, const SwViewOption rViewOptions); void ViewOptionAdjust( SwPrintData const* const pPrtOptions ); void ViewOptionAdjustStop(); diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx index 5d61a9a..42d646f 100644 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -589,10 +589,9 @@ class SwViewOptionAdjust_Impl { ViewShell m_rShell; SwViewOptionm_aOldViewOptions; -bool m_bIsTmpSelection; public: -SwViewOptionAdjust_Impl( ViewShell rSh, const SwViewOption rViewOptions, bool bIsTmpSelection ); +SwViewOptionAdjust_Impl( ViewShell rSh, const SwViewOption rViewOptions ); ~SwViewOptionAdjust_Impl(); void AdjustViewOptions( SwPrintData const* const pPrtOptions ); bool checkShell( const ViewShell rCompare ) const diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx index 47b1fa3..870ecbe 100644 --- a/sw/source/core/view/printdata.cxx +++ b/sw/source/core/view/printdata.cxx @@ -93,20 +93,30 @@ void SwRenderData::DeletePostItData() } } +SfxObjectShellLock const SwRenderData::GetTempDocShell() const +{ +return m_xTempDocShell; +} +void SwRenderData::SetTempDocShell(SfxObjectShellLock const xShell) +{ +m_xTempDocShell = xShell; +} + bool SwRenderData::NeedNewViewOptionAdjust( const ViewShell rCompare ) const { return m_pViewOptionAdjust ? ! m_pViewOptionAdjust-checkShell( rCompare ) : true; } -void SwRenderData::ViewOptionAdjustStart( ViewShell rSh, const SwViewOption rViewOptions, bool bIsTmpSelection ) +void SwRenderData::ViewOptionAdjustStart( +ViewShell rSh, const SwViewOption rViewOptions) { if (m_pViewOptionAdjust) { OSL_FAIL(error: there should be no ViewOptionAdjust active when calling this function ); } m_pViewOptionAdjust.reset( -new SwViewOptionAdjust_Impl( rSh, rViewOptions, bIsTmpSelection )); +new SwViewOptionAdjust_Impl( rSh, rViewOptions )); } diff --git a/sw/source/ui/inc/view.hxx b/sw/source/ui/inc/view.hxx index 4445edf..4f374af 100755 --- a/sw/source/ui/inc/view.hxx +++ b/sw/source/ui/inc/view.hxx @@ -641,8 +641,7 @@ public: void NotifyDBChanged(); -SfxObjectShellLock GetTmpSelectionDoc(); -SfxObjectShellLock GetOrCreateTmpSelectionDoc(); +SfxObjectShellLock CreateTmpSelectionDoc(); voidAddTransferable(SwTransferable rTransferable); diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx index d9489a6..b3bbf87 100644 ---
[Libreoffice-commits] .: sw/inc sw/source
sw/inc/printdata.hxx | 11 +-- sw/inc/unotxdoc.hxx |3 +-- sw/source/core/view/printdata.cxx | 14 -- sw/source/ui/inc/view.hxx |3 +-- sw/source/ui/uiview/view.cxx | 18 -- sw/source/ui/uno/unotxdoc.cxx | 33 + sw/source/ui/uno/unotxvw.cxx |8 7 files changed, 48 insertions(+), 42 deletions(-) New commits: commit 89d2733e16ae6233deea6bef3193bd45c89b854c Author: Michael Stahl mst...@redhat.com Date: Wed Dec 21 16:39:22 2011 +0100 sw: fdo#39159 fdo#40482: temp selection print doc: Ensure that the printing temp selection document is not destroyed prematurely by SwXTextView::NotifySelChanged, called via ViewOptionAdjustStop, by retaining the temp doc object shell not at the View but in SwRenderData. Not restoring the view options for selections does not actually work, because having a selection surprisingly does not imply printing a temp document: the preview also uses a selection. (view option regression from cd690d2e72be410058376c416a40ff5d918fb0f7) diff --git a/sw/inc/printdata.hxx b/sw/inc/printdata.hxx index 8d29336..02d56b8 100644 --- a/sw/inc/printdata.hxx +++ b/sw/inc/printdata.hxx @@ -28,10 +28,10 @@ #ifndef SW_PRINTDATA_HXX #define SW_PRINTDATA_HXX - #include sal/types.h #include rtl/ustring.hxx #include vcl/print.hxx +#include sfx2/objsh.hxx #include boost/scoped_ptr.hpp @@ -244,6 +244,10 @@ class SwRenderData rtl::OUString m_aPageRange; +// temp print document -- must live longer than m_pViewOptionAdjust! +// also this is a Lock and not a Ref because Ref does not delete the doc +SfxObjectShellLock m_xTempDocShell; + // the view options to be applied for printing ::boost::scoped_ptrSwViewOptionAdjust_Impl m_pViewOptionAdjust; @@ -266,9 +270,12 @@ public: void CreatePostItData( SwDoc *pDoc, const SwViewOption *pViewOpt, OutputDevice *pOutDev ); void DeletePostItData(); +SfxObjectShellLock const GetTempDocShell() const; +void SetTempDocShell(SfxObjectShellLock const); + bool IsViewOptionAdjust() const { return m_pViewOptionAdjust != 0; } bool NeedNewViewOptionAdjust( const ViewShell ) const; -void ViewOptionAdjustStart( ViewShell rSh, const SwViewOption rViewOptions, bool bIsTmpSelection ); +void ViewOptionAdjustStart( ViewShell rSh, const SwViewOption rViewOptions); void ViewOptionAdjust( SwPrintData const* const pPrtOptions ); void ViewOptionAdjustStop(); diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx index 5d61a9a..42d646f 100644 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -589,10 +589,9 @@ class SwViewOptionAdjust_Impl { ViewShell m_rShell; SwViewOptionm_aOldViewOptions; -bool m_bIsTmpSelection; public: -SwViewOptionAdjust_Impl( ViewShell rSh, const SwViewOption rViewOptions, bool bIsTmpSelection ); +SwViewOptionAdjust_Impl( ViewShell rSh, const SwViewOption rViewOptions ); ~SwViewOptionAdjust_Impl(); void AdjustViewOptions( SwPrintData const* const pPrtOptions ); bool checkShell( const ViewShell rCompare ) const diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx index 47b1fa3..870ecbe 100644 --- a/sw/source/core/view/printdata.cxx +++ b/sw/source/core/view/printdata.cxx @@ -93,20 +93,30 @@ void SwRenderData::DeletePostItData() } } +SfxObjectShellLock const SwRenderData::GetTempDocShell() const +{ +return m_xTempDocShell; +} +void SwRenderData::SetTempDocShell(SfxObjectShellLock const xShell) +{ +m_xTempDocShell = xShell; +} + bool SwRenderData::NeedNewViewOptionAdjust( const ViewShell rCompare ) const { return m_pViewOptionAdjust ? ! m_pViewOptionAdjust-checkShell( rCompare ) : true; } -void SwRenderData::ViewOptionAdjustStart( ViewShell rSh, const SwViewOption rViewOptions, bool bIsTmpSelection ) +void SwRenderData::ViewOptionAdjustStart( +ViewShell rSh, const SwViewOption rViewOptions) { if (m_pViewOptionAdjust) { OSL_FAIL(error: there should be no ViewOptionAdjust active when calling this function ); } m_pViewOptionAdjust.reset( -new SwViewOptionAdjust_Impl( rSh, rViewOptions, bIsTmpSelection )); +new SwViewOptionAdjust_Impl( rSh, rViewOptions )); } diff --git a/sw/source/ui/inc/view.hxx b/sw/source/ui/inc/view.hxx index 4445edf..4f374af 100755 --- a/sw/source/ui/inc/view.hxx +++ b/sw/source/ui/inc/view.hxx @@ -641,8 +641,7 @@ public: void NotifyDBChanged(); -SfxObjectShellLock GetTmpSelectionDoc(); -SfxObjectShellLock GetOrCreateTmpSelectionDoc(); +SfxObjectShellLock CreateTmpSelectionDoc(); voidAddTransferable(SwTransferable rTransferable); diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx index d9489a6..b3bbf87 100644 ---
[Libreoffice-commits] .: sw/inc sw/source
sw/inc/index.hxx|2 +- sw/source/core/bastyp/index.cxx |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) New commits: commit 5a8fef9b8e3ecc6658c477bdf903fe9e196db596 Author: Stephan Bergmann sberg...@redhat.com Date: Mon Nov 28 10:13:57 2011 +0100 Undo short - xub_StrLen change (fixes warning on Mac OS X). diff --git a/sw/inc/index.hxx b/sw/inc/index.hxx index ec5a980..a671e04 100644 --- a/sw/inc/index.hxx +++ b/sw/inc/index.hxx @@ -67,7 +67,7 @@ private: public: explicit SwIndex(SwIndexReg *const pReg, xub_StrLen const nIdx = 0); SwIndex( const SwIndex ); -SwIndex( const SwIndex , xub_StrLen const nDiff ); +SwIndex( const SwIndex , short nDiff ); ~SwIndex() { Remove(); } INLINE SwIndex operator=( xub_StrLen const ); diff --git a/sw/source/core/bastyp/index.cxx b/sw/source/core/bastyp/index.cxx index 112430f..70b5712 100644 --- a/sw/source/core/bastyp/index.cxx +++ b/sw/source/core/bastyp/index.cxx @@ -46,7 +46,7 @@ SwIndex::SwIndex(SwIndexReg *const pReg, xub_StrLen const nIdx) Init(m_nIndex); } -SwIndex::SwIndex( const SwIndex rIdx, xub_StrLen const nDiff ) +SwIndex::SwIndex( const SwIndex rIdx, short nDiff ) : m_pIndexReg( rIdx.m_pIndexReg ) , m_pNext( 0 ) , m_pPrev( 0 ) ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sw/inc sw/source unusedcode.easy
sw/inc/numrule.hxx |1 - sw/source/core/doc/number.cxx |6 -- sw/source/ui/config/fontcfg.cxx | 28 sw/source/ui/inc/fontcfg.hxx|5 - unusedcode.easy |2 -- 5 files changed, 42 deletions(-) New commits: commit 21352f88caba9dee73d5a87c8e3724d17ac6b428 Author: Cédric Bosdonnat cedric.bosdon...@free.fr Date: Thu Oct 20 16:47:44 2011 +0200 Sw styles cleanup: removed now unused methods diff --git a/sw/inc/numrule.hxx b/sw/inc/numrule.hxx index 4401df3..0f7a3b2 100644 --- a/sw/inc/numrule.hxx +++ b/sw/inc/numrule.hxx @@ -217,7 +217,6 @@ public: static char* GetOutlineRuleName() { return pDefOutlineName; } static sal_uInt16 GetNumIndent( sal_uInt8 nLvl ); -static sal_uInt16 GetBullIndent( sal_uInt8 nLvl ); SwNumRuleType GetRuleType() const { return eRuleType; } void SetRuleType( SwNumRuleType eNew ) { eRuleType = eNew; diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx index 112ffd5..220aa19 100644 --- a/sw/source/core/doc/number.cxx +++ b/sw/source/core/doc/number.cxx @@ -175,12 +175,6 @@ sal_uInt16 SwNumRule::GetNumIndent( sal_uInt8 nLvl ) return aDefNumIndents[ nLvl ]; } -sal_uInt16 SwNumRule::GetBullIndent( sal_uInt8 nLvl ) -{ -OSL_ENSURE( MAXLEVEL nLvl, NumLevel is out of range ); -return aDefNumIndents[ nLvl ]; -} - static void lcl_SetRuleChgd( SwTxtNode rNd, sal_uInt8 nLevel ) { if( rNd.GetActualListLevel() == nLevel ) diff --git a/sw/source/ui/config/fontcfg.cxx b/sw/source/ui/config/fontcfg.cxx index efc3c67..0f4d4c8 100644 --- a/sw/source/ui/config/fontcfg.cxx +++ b/sw/source/ui/config/fontcfg.cxx @@ -292,34 +292,6 @@ sal_Int32 SwStdFontConfig::GetDefaultHeightFor(sal_uInt16 nFontType, LanguageTyp return nRet; } -void SwStdFontConfig::ChangeInt( sal_uInt16 nFontType, sal_Int32 nHeight ) -{ -OSL_ENSURE( nFontType DEF_FONT_COUNT, invalid index in SwStdFontConfig::ChangInt()); -if( nFontType DEF_FONT_COUNT nDefaultFontHeight[nFontType] != nHeight) -{ -SvtLinguOptions aLinguOpt; -SvtLinguConfig().GetOptions( aLinguOpt ); - -sal_Int16 eWestern = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage, ::com::sun::star::i18n::ScriptType::LATIN), - eCJK = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CJK, ::com::sun::star::i18n::ScriptType::ASIAN), - eCTL = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CTL, ::com::sun::star::i18n::ScriptType::COMPLEX); - -// #i92090# default height value sets back to -1 -const sal_Int32 nDefaultHeight = GetDefaultHeightFor(nFontType, lcl_LanguageOfType(nFontType, eWestern, eCJK, eCTL)); -const bool bIsDefaultHeight = nHeight == nDefaultHeight; -if( bIsDefaultHeight nDefaultFontHeight[nFontType] 0 ) -{ -SetModified(); -nDefaultFontHeight[nFontType] = -1; -} -else if( !bIsDefaultHeight nHeight != nDefaultFontHeight[nFontType] ) -{ -SetModified(); -nDefaultFontHeight[nFontType] = nHeight; -} -} -} - sal_Int32 SwStdFontConfig::GetFontHeight( sal_uInt8 nFont, sal_uInt8 nScriptType, LanguageType eLang ) { OSL_ENSURE(nFont + FONT_PER_GROUP * nScriptType DEF_FONT_COUNT, wrong index in SwStdFontConfig::GetFontHeight()); diff --git a/sw/source/ui/inc/fontcfg.hxx b/sw/source/ui/inc/fontcfg.hxx index 5acd526..3570130 100644 --- a/sw/source/ui/inc/fontcfg.hxx +++ b/sw/source/ui/inc/fontcfg.hxx @@ -79,8 +79,6 @@ class SW_DLLPUBLIC SwStdFontConfig : public utl::ConfigItem } } -void ChangeInt( sal_uInt16 nFontType, sal_Int32 nHeight ); - public: SwStdFontConfig(); ~SwStdFontConfig(); @@ -109,9 +107,6 @@ public: void SetFontIndex (const String rSet, sal_uInt8 nFontGroup) {ChangeString(FONT_INDEX + FONT_PER_GROUP * nFontGroup, rSet);} -void SetFontHeight( sal_Int32 nHeight, sal_uInt8 nFont, sal_uInt8 nScriptType ) -{ChangeInt(nFont + FONT_PER_GROUP * nScriptType, nHeight);} - sal_Int32 GetFontHeight( sal_uInt8 nFont, sal_uInt8 nScriptType, LanguageType eLang ); static StringGetDefaultFor(sal_uInt16 nFontType, LanguageType eLang); diff --git a/unusedcode.easy b/unusedcode.easy index f7f28f0..60c838c 100644 --- a/unusedcode.easy +++ b/unusedcode.easy @@ -1175,7 +1175,6 @@ SwLRects::_ForEach(unsigned short, unsigned short, unsigned char (*)(SwLineRect SwLoadOptPage::LinkStubCaptionHdl(void*, void*) SwMailMergeChildWindow::GetChildWindowId() SwModify::GetClientCount() const -SwNumRule::GetBullIndent(unsigned char) SwOutlineNodes::Insert(SwNode* const, unsigned short) SwOutlineNodes::Insert(SwNode* const*, unsigned short) SwOutlineNodes::Insert(SwOutlineNodes const*, unsigned short,
[Libreoffice-commits] .: sw/inc sw/source
sw/inc/cmdid.h |1 sw/inc/editsh.hxx | 17 +++- sw/source/core/edit/edatmisc.cxx| 31 +-- sw/source/core/edit/edattr.cxx | 48 +--- sw/source/core/edit/editsh.cxx |4 +-- sw/source/core/edit/ednumber.cxx| 19 +++--- sw/source/ui/docvw/PageBreakWin.cxx | 34 +++-- sw/source/ui/inc/uiitems.hxx| 16 sw/source/ui/inc/wrtsh.hxx |2 - sw/source/ui/shells/textsh1.cxx | 41 +- sw/source/ui/utlui/uiitems.cxx | 25 ++ sw/source/ui/wrtsh/wrtsh1.cxx |9 +++--- 12 files changed, 167 insertions(+), 80 deletions(-) New commits: commit eb0e2fcf15ed37f56c2334d292bdc1fb054bc287 Author: Cédric Bosdonnat cedric.bosdonnat@free.fr Date: Fri Oct 7 16:55:03 2011 +0200 Page Break: Fixed part of the Edit menu action cursors handling Added an optional SwPaM argument to SID_PARA_DLG action to avoid changing the current cursor before showing the dialog. Set the focus to SwEditWin after the action to continue editing the document. diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h index 97f6e10..fae2a95 100644 --- a/sw/inc/cmdid.h +++ b/sw/inc/cmdid.h @@ -1137,6 +1137,7 @@ included in c-context files, so c++ style stuff will cause problems. #define FN_SHAPE_POSITION_LAYOUT_DIR(FN_PARAM2+24) #define FN_SHAPE_STARTPOSITION_IN_HORI_L2R (FN_PARAM2+25) #define FN_SHAPE_ENDPOSITION_IN_HORI_L2R (FN_PARAM2+26) +#define FN_PARAM_PAM(FN_PARAM2+27) /* Point and Mark */ /* Bereich: Druckoptionen diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx index d1e423f..f821dca 100644 --- a/sw/inc/editsh.hxx +++ b/sw/inc/editsh.hxx @@ -247,10 +247,12 @@ public: // the requested item set as a LR-SPACE item, if corresponding node has not // its own indent attributes and the position-and-space mode of the list // level is SvxNumberFormat::LABEL_ALIGNMENT. +sal_Bool GetPaMAttr( SwPaM* pPaM, SfxItemSet , + const bool bMergeIndentValuesOfNumRule = false ) const; sal_Bool GetCurAttr( SfxItemSet , const bool bMergeIndentValuesOfNumRule = false ) const; void SetAttr( const SfxPoolItem, sal_uInt16 nFlags = 0 ); -void SetAttr( const SfxItemSet, sal_uInt16 nFlags = 0 ); +void SetAttr( const SfxItemSet, sal_uInt16 nFlags = 0, SwPaM* pCrsr = NULL ); // Set attribute as new default attribute in document. void SetDefault( const SfxPoolItem ); @@ -258,7 +260,7 @@ public: // Query default attribute of document. const SfxPoolItem GetDefault( sal_uInt16 nFmtHint ) const; -void ResetAttr( const std::setsal_uInt16 attrs = std::setsal_uInt16() ); +void ResetAttr( const std::setsal_uInt16 attrs = std::setsal_uInt16(), SwPaM* pCrsr = NULL ); void GCAttr(); // Returns the scripttpye of the selection. @@ -296,6 +298,7 @@ public: sal_uInt16 GetTxtFmtCollCount() const; SwTxtFmtColl GetTxtFmtColl( sal_uInt16 nTxtFmtColl) const; SwTxtFmtColl* GetCurTxtFmtColl() const; +SwTxtFmtColl* GetPaMTxtFmtColl( SwPaM* pPaM ) const; // #i62675# // Add 2nd optional parameter bResetListAttrs - see also SwDoc::SetTxtFmtColl(..) @@ -489,11 +492,11 @@ public: void ChgNumRuleFmts( const SwNumRule rRule ); // Set (and query if) a numbering with StartFlag starts at current PointPos. -void SetNumRuleStart( sal_Bool bFlag = sal_True ); -sal_Bool IsNumRuleStart() const; -void SetNodeNumStart( sal_uInt16 nStt ); +void SetNumRuleStart( sal_Bool bFlag = sal_True, SwPaM* pCrsr = NULL ); +sal_Bool IsNumRuleStart( SwPaM* pPaM = NULL ) const; +void SetNodeNumStart( sal_uInt16 nStt, SwPaM* = NULL ); -sal_uInt16 GetNodeNumStart() const; +sal_uInt16 GetNodeNumStart( SwPaM* pPaM = NULL ) const; sal_Bool ReplaceNumRule( const String rOldRule, const String rNewRule ); @@ -760,7 +763,7 @@ public: sal_uInt16 GetINetAttrs( SwGetINetAttrs rArr ); String GetDropTxt( const sal_uInt16 nChars ) const; -void ReplaceDropTxt( const String rStr ); +void ReplaceDropTxt( const String rStr, SwPaM* pPaM = NULL ); // May an outline be moved or copied? // Check whether it's in text body, not in table, and not read-only (move). diff --git a/sw/source/core/edit/edatmisc.cxx b/sw/source/core/edit/edatmisc.cxx index c4ba463..6754314 100644 --- a/sw/source/core/edit/edatmisc.cxx +++ b/sw/source/core/edit/edatmisc.cxx @@ -44,20 +44,22 @@ */ -void SwEditShell::ResetAttr( const std::setsal_uInt16 attrs ) +void SwEditShell::ResetAttr( const std::setsal_uInt16 attrs, SwPaM* pPaM ) { SET_CURR_SHELL( this ); +SwPaM* pCrsr = pPaM ? pPaM : GetCrsr( ); +
[Libreoffice-commits] .: sw/inc sw/source
sw/inc/swundo.hxx |3 +- sw/source/core/undo/undo.hrc|3 +- sw/source/core/undo/undo.src|4 +++ sw/source/ui/docvw/PageBreakWin.cxx | 41 +++- 4 files changed, 48 insertions(+), 3 deletions(-) New commits: commit 9767483eea7800aadd18b4489069ad633ce7a79c Author: Cédric Bosdonnat cedric.bosdonnat@free.fr Date: Tue Oct 4 15:35:41 2011 +0200 Page Break: basic implementation of the popup menu actions Open the paragraph properties dialog on Text Flow tab when clicking on the Edit item. Remove the page break (and add it to the undo stack) when clicking on the Delete item. diff --git a/sw/inc/swundo.hxx b/sw/inc/swundo.hxx index 4a91cff..9e07154 100644 --- a/sw/inc/swundo.hxx +++ b/sw/inc/swundo.hxx @@ -177,7 +177,8 @@ enum SwUndoId UNDO_UI_INSERT_URLBTN, UNDO_UI_INSERT_URLTXT, UNDO_UI_DELETE_INVISIBLECNTNT, -UNDO_UI_REPLACE_STYLE +UNDO_UI_REPLACE_STYLE, +UNDO_UI_DELETE_PAGE_BREAK }; diff --git a/sw/source/core/undo/undo.hrc b/sw/source/core/undo/undo.hrc index 8edccd3..eee3e3c 100644 --- a/sw/source/core/undo/undo.hrc +++ b/sw/source/core/undo/undo.hrc @@ -172,7 +172,8 @@ #define STR_INSERT_URLTXT (UI_UNDO_BEGIN + 11) #define STR_DELETE_INVISIBLECNTNT (UI_UNDO_BEGIN + 12) #define STR_REPLACE_STYLE (UI_UNDO_BEGIN + 13) -#define UI_UNDO_END STR_REPLACE_STYLE +#define STR_DELETE_PAGE_BREAK (UI_UNDO_BEGIN + 14) +#define UI_UNDO_END STR_DELETE_PAGE_BREAK #define UNDO_MORE_STRINGS_BEGIN (UI_UNDO_END + 1) #define STR_OCCURRENCES_OF (UNDO_MORE_STRINGS_BEGIN) diff --git a/sw/source/core/undo/undo.src b/sw/source/core/undo/undo.src index fefa5ef..d1222fe 100644 --- a/sw/source/core/undo/undo.src +++ b/sw/source/core/undo/undo.src @@ -189,6 +189,10 @@ String STR_REPLACE_STYLE { Text [ en-US ] = Replace style: $1 $2 $3 ; }; +String STR_DELETE_PAGE_BREAK +{ +Text [ en-US ] = Delete page break ; +}; String STR_OUTLINE_LR { Text [ en-US ] = Promote/demote outline ; diff --git a/sw/source/ui/docvw/PageBreakWin.cxx b/sw/source/ui/docvw/PageBreakWin.cxx index b9ca0a3..2b70887 100644 --- a/sw/source/ui/docvw/PageBreakWin.cxx +++ b/sw/source/ui/docvw/PageBreakWin.cxx @@ -25,13 +25,19 @@ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable * instead of those above. */ +#include globals.hrc #include popup.hrc #include utlui.hrc +#include cmdid.h +#include cntfrm.hxx #include DashedLine.hxx +#include doc.hxx #include edtwin.hxx +#include IDocumentUndoRedo.hxx #include PageBreakWin.hxx #include pagefrm.hxx +#include view.hxx #include viewopt.hxx #include basegfx/color/bcolortools.hxx @@ -40,6 +46,8 @@ #include basegfx/range/b2drectangle.hxx #include drawinglayer/primitive2d/polygonprimitive2d.hxx #include drawinglayer/primitive2d/polypolygonprimitive2d.hxx +#include editeng/brkitem.hxx +#include sfx2/dispatch.hxx #include svx/sdr/contact/objectcontacttools.hxx #include vcl/decoview.hxx #include vcl/svapp.hxx @@ -232,7 +240,38 @@ void SwPageBreakWin::Paint( const Rectangle ) void SwPageBreakWin::Select( ) { -// TODO Menu item selected... +switch( GetCurItemId( ) ) +{ +case FN_PAGEBREAK_EDIT: +{ +// TODO Handle the break on a table case +SfxUInt16Item aItem( GetEditWin()-GetView().GetPool( ).GetWhich( SID_PARA_DLG ), TP_PARA_EXT ); + GetEditWin()-GetView().GetViewFrame()-GetDispatcher()-Execute( +SID_PARA_DLG, SFX_CALLMODE_SYNCHRON|SFX_CALLMODE_RECORD, aItem, NULL ); +} +break; +case FN_PAGEBREAK_DELETE: +{ +const SwLayoutFrm* pBodyFrm = static_cast const SwLayoutFrm* ( GetPageFrame()-Lower() ); +while ( pBodyFrm !pBodyFrm-IsBodyFrm() ) +pBodyFrm = static_cast const SwLayoutFrm* ( pBodyFrm-GetNext() ); + +if ( pBodyFrm ) +{ +// TODO Handle the break before a table case +SwCntntFrm *pCnt = const_cast SwCntntFrm* ( pBodyFrm-ContainsCntnt() ); +sal_uInt16 nWhich = pCnt-GetAttrSet()-GetPool()-GetWhich( SID_ATTR_PARA_PAGEBREAK ); +SwCntntNode* pNd = pCnt-GetNode(); + +pNd-GetDoc()-GetIDocumentUndoRedo( ).StartUndo( UNDO_UI_DELETE_PAGE_BREAK, NULL ); +SvxFmtBreakItem aNoBreakItem( SVX_BREAK_NONE, nWhich ); +SwPaM aPaM( *pNd ); +pNd-GetDoc()-InsertPoolItem( aPaM, aNoBreakItem, nsSetAttrMode::SETATTR_DEFAULT ); +pNd-GetDoc()-GetIDocumentUndoRedo( ).EndUndo( UNDO_UI_DELETE_PAGE_BREAK, NULL ); +} +} +break; +} } void SwPageBreakWin::UpdatePosition( )