[Libreoffice-commits] core.git: 3 commits - sw/inc sw/source
sw/inc/doc.hxx |7 --- sw/source/core/doc/docnew.cxx | 17 + sw/source/core/doc/doctxm.cxx | 14 +- sw/source/uibase/dbui/dbmgr.cxx | 12 ++-- 4 files changed, 24 insertions(+), 26 deletions(-) New commits: commit 26d34f319ba48216785f7fdbf9e6bfdaf2dc6ad2 Author: Michael StahlDate: Thu Jan 25 15:49:34 2018 +0100 sw: fix some bug in SwTOXBaseSection::UpdatePageNum() Looking at UpdatePageNum_ it's fairly obvious that the 2 vectors aNums and aDescs have to be in sync, but aNums is cleared after each iteration while aDescs is not. Change-Id: I41d8a8df5c4c3ae51aa5ea89c21b01651af5651c diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx index 3202362cbbf2..aa2bee2db1ad 100644 --- a/sw/source/core/doc/doctxm.cxx +++ b/sw/source/core/doc/doctxm.cxx @@ -1548,8 +1548,6 @@ void SwTOXBaseSection::UpdatePageNum() for( SwTOXSortTabBases::size_type nCnt = 0; nCnt < aSortArr.size(); ++nCnt ) { // Loop over all SourceNodes -std::vector aNums; // the PageNumber -std::vector aDescs;// The PageDescriptors matching the PageNumbers // process run in lines SwTOXSortTabBases::size_type nRange = 0; @@ -1572,6 +1570,8 @@ void SwTOXBaseSection::UpdatePageNum() for(SwTOXSortTabBases::size_type nRunInEntry = nCnt; nRunInEntry < nCnt + nRange; ++nRunInEntry) { +std::vector aNums; // the PageNumber +std::vector aDescs; // The PageDescriptors matching the PageNumbers std::vector aMainNums; // contains page numbers of main entries SwTOXSortTabBase* pSortBase = aSortArr[nRunInEntry]; size_t nSize = pSortBase->aTOXSources.size(); @@ -1630,7 +1630,6 @@ void SwTOXBaseSection::UpdatePageNum() UpdatePageNum_( const_cast (pTextNd), aNums, aDescs, , aIntl ); } -aNums.clear(); } } // Delete the mapping array after setting the right PageNumber commit 38af1bb52d3833da7919e61e650fb9ec1bdaf4f7 Author: Michael Stahl Date: Thu Jan 25 15:44:34 2018 +0100 sw: de-pointerise local variable in SwTOXBaseSection::UpdatePageNum() Change-Id: I24fcde19ae94cc5a278da6d88e72ce6a57a64951 diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx index e19316445785..3202362cbbf2 100644 --- a/sw/source/core/doc/doctxm.cxx +++ b/sw/source/core/doc/doctxm.cxx @@ -1550,7 +1550,6 @@ void SwTOXBaseSection::UpdatePageNum() // Loop over all SourceNodes std::vector aNums; // the PageNumber std::vector aDescs;// The PageDescriptors matching the PageNumbers -std::vector *pMainNums = nullptr; // contains page numbers of main entries // process run in lines SwTOXSortTabBases::size_type nRange = 0; @@ -1573,6 +1572,7 @@ void SwTOXBaseSection::UpdatePageNum() for(SwTOXSortTabBases::size_type nRunInEntry = nCnt; nRunInEntry < nCnt + nRange; ++nRunInEntry) { +std::vector aMainNums; // contains page numbers of main entries SwTOXSortTabBase* pSortBase = aSortArr[nRunInEntry]; size_t nSize = pSortBase->aTOXSources.size(); for (size_t j = 0; j < nSize; ++j) @@ -1616,9 +1616,7 @@ void SwTOXBaseSection::UpdatePageNum() if(TOX_SORT_INDEX == pSortBase->GetType() && rTOXSource.bMainEntry) { -if(!pMainNums) -pMainNums = new std::vector; -pMainNums->push_back(nPage); +aMainNums.push_back(nPage); } } } @@ -1629,10 +1627,9 @@ void SwTOXBaseSection::UpdatePageNum() const SwTextNode* pTextNd = pBase->pTOXNd->GetTextNode(); OSL_ENSURE( pTextNd, "no TextNode, wrong TOC" ); -UpdatePageNum_( const_cast (pTextNd), aNums, aDescs, pMainNums, +UpdatePageNum_( const_cast (pTextNd), aNums, aDescs, , aIntl ); } -DELETEZ(pMainNums); aNums.clear(); } } commit 7dbe76266cb4250701aaee043933ccb21e5f6564 Author: Michael Stahl Date: Thu Jan 25 15:43:19 2018 +0100 sw: convert SwDoc::mpDBManager to unique_ptr Very odd things are happening in dbmgr.cxx to override this member, so add a 2nd member that points to the DBManager that is actually used. Change-Id: If5d4ea1e4951a0406fddcb71302c53ee7b37a34e diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 726471e1dea6..aa7ee77406cf 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -283,7 +283,8 @@ class
[Libreoffice-commits] core.git: 3 commits - sw/inc sw/source
sw/inc/editsh.hxx |4 sw/inc/strings.hrc|7 sw/source/core/edit/edfcol.cxx| 267 ++ sw/source/core/edit/edws.cxx |9 - sw/source/core/txtnode/ndtxt.cxx |6 sw/source/core/txtnode/thints.cxx | 18 ++ 6 files changed, 254 insertions(+), 57 deletions(-) New commits: commit af694659763de9a787e018df5ba4debd4976cd03 Author: Ashod NakashianDate: Fri Aug 25 20:47:58 2017 -0400 sw: remove signature metadata on deleting signature field Change-Id: I1f82b2d59889c1ba84d91880df13d12d3e5b796c Reviewed-on: https://gerrit.libreoffice.org/41594 Tested-by: Jenkins Reviewed-by: Ashod Nakashian diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index b6586595a32e..ae8720ba674e 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -76,6 +76,9 @@ #include #include +#include +#include + #ifdef DBG_UTIL #define CHECK Check(true); #define CHECK_NOTMERGED Check(false); @@ -1191,7 +1194,22 @@ void SwTextNode::DestroyAttr( SwTextAttr* pAttr ) case RES_TXTATR_META: case RES_TXTATR_METAFIELD: +{ +auto pTextMeta = static_txtattr_cast (pAttr); +SwFormatMeta & rFormatMeta( static_cast(pTextMeta->GetAttr()) ); +if (::sw::Meta* pMeta = rFormatMeta.GetMeta()) +{ +if (SwDocShell* pDocSh = pDoc->GetDocShell()) +{ +static const OUString metaNS("urn:bails"); +const css::uno::Reference xSubject(pMeta->MakeUnoObject(), uno::UNO_QUERY); +uno::Reference xModel = pDocSh->GetBaseModel(); +SwRDFHelper::clearStatements(xModel, metaNS, xSubject); +} +} + static_txtattr_cast (pAttr)->ChgTextNode(nullptr); +} break; default: commit 2c3dfd9d3bafc6ad84d750c7bec935b5b164e7f7 Author: Ashod Nakashian Date: Fri Aug 25 20:47:30 2017 -0400 sw: invalidate paragraph signature on edit Change-Id: I7267b1492f2eff043058a9322286f742338a2335 Reviewed-on: https://gerrit.libreoffice.org/41593 Tested-by: Jenkins Reviewed-by: Ashod Nakashian diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 8391a652df2f..8031dd2fe8b0 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -1211,6 +1211,12 @@ void SwTextNode::Update( if (pSortedObjs) pSortedObjs->UpdateAll(); +// Update the paragraph signatures. +if (SwEditShell* pEditShell = GetDoc()->GetEditShell()) +{ +pEditShell->ValidateParagraphSignatures(false); +} + // Inform LOK clients about change in position of redlines (if any) if (comphelper::LibreOfficeKit::isActive()) { commit 3eb31b506a2860eba3a578333a6486ee2a518c1a Author: Ashod Nakashian Date: Fri Aug 25 20:46:33 2017 -0400 sw: sign paragraphs and validate Change-Id: I917ad1460c89183eec38d50de8a0de2d76239ea6 Reviewed-on: https://gerrit.libreoffice.org/41592 Tested-by: Jenkins Reviewed-by: Ashod Nakashian diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx index 411c8eed3921..f8d40ddcd0ba 100644 --- a/sw/inc/editsh.hxx +++ b/sw/inc/editsh.hxx @@ -374,6 +374,9 @@ public: /// Sign the paragraph at the cursor. void SignParagraph(SwPaM* pPaM); +/// Validate paragraph signatures, if any, at the cursor. +void ValidateParagraphSignatures(bool updateDontRemove); + void Insert2(SwField const &, const bool bForceExpandHints); void UpdateFields( SwField & ); ///< One single field. @@ -969,6 +972,7 @@ private: * the existing nb-space will be removed. Bear this in mind if that problem * arises. */ bool m_bNbspRunNext;///< NO-BREAK SPACE state flag passed to and maintained by SvxAutoCorrect::DoAutoCorrect() +bool m_bIsValidatingParagraphSignature; ///< Prevent nested calls of ValidateParagraphSignatures. }; inline const sfx2::LinkManager& SwEditShell::GetLinkManager() const diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc index 9c42670f24e0..9e77c736bdd8 100644 --- a/sw/inc/strings.hrc +++ b/sw/inc/strings.hrc @@ -1337,6 +1337,13 @@ #define STR_MENU_UP NC_("STR_MENU_UP", "~Upwards") #define STR_MENU_DOWN NC_("STR_MENU_DOWN", "Do~wnwards") +/* +Description: Paragraph Signature + */ +#define STR_VALID
[Libreoffice-commits] core.git: 3 commits - sw/inc sw/source
sw/inc/IDocumentFieldsAccess.hxx|3 - sw/inc/doc.hxx |1 sw/inc/docary.hxx |6 +- sw/source/core/doc/docfmt.cxx |2 sw/source/core/fields/dbfld.cxx |7 +-- sw/source/core/fields/fldbas.cxx|6 +- sw/source/filter/ww8/ww8toolbar.cxx | 80 ++-- 7 files changed, 54 insertions(+), 51 deletions(-) New commits: commit de9106a511ed9c202423e3c3a9754feb4f969364 Author: Caolán McNamaraDate: Tue May 2 15:28:11 2017 +0100 Revert "SwFieldTypes can just be a std::vector typedef" This reverts commit 5eaad8eb1d46b6f85605c5ac210e8b1397b18b22. cause it now leaks as the ~SwVectorModifyBase base deletes the entries Change-Id: I02374f4b439b9cf3e8f331aa9c6892b4418f37f0 diff --git a/sw/inc/IDocumentFieldsAccess.hxx b/sw/inc/IDocumentFieldsAccess.hxx index 7d999d955a29..c78e5a249b3b 100644 --- a/sw/inc/IDocumentFieldsAccess.hxx +++ b/sw/inc/IDocumentFieldsAccess.hxx @@ -22,10 +22,9 @@ #include #include -#include +class SwFieldTypes; class SwFieldType; -typedef std::vector SwFieldTypes; class SfxPoolItem; struct SwPosition; class SwDocUpdateField; diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index d1e1073cd522..61d57940d2f9 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -88,6 +88,7 @@ class SwEditShell; class SwFieldType; class SwField; class SwTextField; +class SwFieldTypes; class SwFlyFrameFormat; class SwFormatsBase; class SwFormat; diff --git a/sw/inc/docary.hxx b/sw/inc/docary.hxx index 8e0131516a11..255bc8127ff7 100644 --- a/sw/inc/docary.hxx +++ b/sw/inc/docary.hxx @@ -295,8 +295,10 @@ public: void dumpAsXml(struct _xmlTextWriter* pWriter) const; }; -typedef std::vector SwFieldTypes; -void dumpAsXml(struct _xmlTextWriter* pWriter, SwFieldTypes const &); +class SwFieldTypes : public SwVectorModifyBase { +public: +void dumpAsXml(struct _xmlTextWriter* pWriter) const; +}; typedef std::vector SwTOXTypes; diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index 0e27f6140fb8..5dff133d929f 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -1940,7 +1940,7 @@ void SwDoc::dumpAsXml(xmlTextWriterPtr pWriter) const maDBData.dumpAsXml(pWriter); mpMarkManager->dumpAsXml(pWriter); m_pUndoManager->dumpAsXml(pWriter); -::dumpAsXml(pWriter, *getIDocumentFieldsAccess().GetFieldTypes()); +getIDocumentFieldsAccess().GetFieldTypes()->dumpAsXml(pWriter); mpTextFormatCollTable->dumpAsXml(pWriter); mpCharFormatTable->dumpAsXml(pWriter); mpFrameFormatTable->dumpAsXml(pWriter, "frmFormatTable"); diff --git a/sw/source/core/fields/dbfld.cxx b/sw/source/core/fields/dbfld.cxx index 151dfe79c507..e6724c228c7b 100644 --- a/sw/source/core/fields/dbfld.cxx +++ b/sw/source/core/fields/dbfld.cxx @@ -90,12 +90,11 @@ void SwDBFieldType::ReleaseRef() if (--nRefCnt <= 0) { -auto pFieldTypes = GetDoc()->getIDocumentFieldsAccess().GetFieldTypes(); -auto it = std::find(pFieldTypes->begin(), pFieldTypes->end(), this); +size_t nPos = GetDoc()->getIDocumentFieldsAccess().GetFieldTypes()->GetPos(this); -if (it != pFieldTypes->end()) +if (nPos != SIZE_MAX) { -GetDoc()->getIDocumentFieldsAccess().RemoveFieldType(it - pFieldTypes->begin()); +GetDoc()->getIDocumentFieldsAccess().RemoveFieldType(nPos); delete this; } } diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx index 27627dddee55..4dcb10a43843 100644 --- a/sw/source/core/fields/fldbas.cxx +++ b/sw/source/core/fields/fldbas.cxx @@ -155,11 +155,13 @@ bool SwFieldType::PutValue( const uno::Any& , sal_uInt16 ) return false; } -void dumpAsXml(xmlTextWriterPtr pWriter, SwFieldTypes const & rTypes) +void SwFieldTypes::dumpAsXml(xmlTextWriterPtr pWriter) const { xmlTextWriterStartElement(pWriter, BAD_CAST("SwFieldTypes")); -for (auto pCurType : rTypes) +sal_uInt16 nCount = size(); +for (sal_uInt16 nType = 0; nType < nCount; ++nType) { +const SwFieldType *pCurType = (*this)[nType]; SwIterator aIter(*pCurType); for (const SwFormatField* pFormatField = aIter.First(); pFormatField; pFormatField = aIter.Next()) pFormatField->dumpAsXml(pWriter); commit 4778f39ece4b41625b876e5e7673893e1e011a62 Author: Caolán McNamara Date: Tue May 2 15:17:58 2017 +0100 ofz fix leak Change-Id: I237f19f237e6b78f98798352c1f881b0d27a6a9e diff --git a/sw/source/filter/ww8/ww8toolbar.cxx b/sw/source/filter/ww8/ww8toolbar.cxx index 86663ea36ede..b269f013da52 100644 --- a/sw/source/filter/ww8/ww8toolbar.cxx +++ b/sw/source/filter/ww8/ww8toolbar.cxx @@ -825,48 +825,48 @@ Tcg255::~Tcg255() bool
[Libreoffice-commits] core.git: 3 commits - sw/inc sw/source vcl/source xmlhelp/source
sw/inc/accmap.hxx |7 ++- sw/source/core/access/accdoc.cxx|2 +- sw/source/core/access/accmap.cxx|4 +++- sw/source/core/unocore/unotext.cxx |2 +- sw/source/uibase/app/swdll.cxx |7 --- sw/source/uibase/app/swdllimpl.hxx |3 +++ vcl/source/gdi/svgdata.cxx |6 ++ vcl/source/window/builder.cxx |5 - xmlhelp/source/cxxhelp/provider/inputstream.cxx |5 ++--- 9 files changed, 22 insertions(+), 19 deletions(-) New commits: commit 9bc5d4cdf010091406091875e6c45d975ebc9708 Author: Caolán McNamaraDate: Sat Feb 25 14:49:14 2017 + re org things a little to quieten coverity warnings Change-Id: I3bf0840f6428ee8cefd424a486cc2f5fcfda290f diff --git a/sw/inc/accmap.hxx b/sw/inc/accmap.hxx index 05240c9..814b210 100644 --- a/sw/inc/accmap.hxx +++ b/sw/inc/accmap.hxx @@ -119,7 +119,10 @@ class SwAccessibleMap : public ::accessibility::IAccessibleViewForwarder, //mpSelectedFrameMap contains the old selected objects. SwAccessibleContextMap_Impl *mpSeletedFrameMap; -//IvalidateShapeInParaSelection() method is responsible for the updating the selected states of the objects. + +OUString maDocName; + +//InvalidateShapeInParaSelection() method is responsible for the updating the selected states of the objects. void InvalidateShapeInParaSelection(); void InvalidateRelationSet_( const SwFrame* pFrame, bool bFrom ); @@ -261,6 +264,8 @@ public: void FireEvents(); +const OUString& GetDocName() const { return maDocName; } + // IAccessibleViewForwarder virtual Rectangle GetVisibleArea() const override; diff --git a/sw/source/core/access/accdoc.cxx b/sw/source/core/access/accdoc.cxx index 9e5f0e0..94131d5 100644 --- a/sw/source/core/access/accdoc.cxx +++ b/sw/source/core/access/accdoc.cxx @@ -338,7 +338,7 @@ SwAccessibleDocument::SwAccessibleDocument ( SwAccessibleMap* pInitMap ) : SwAccessibleDocumentBase( pInitMap ), maSelectionHelper( *this ) { -SetName( GetResource( STR_ACCESS_DOC_NAME ) ); +SetName(pInitMap->GetDocName()); vcl::Window *pWin = pInitMap->GetShell()->GetWin(); if( pWin ) { diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index 3c48470..d47e20d 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -1641,7 +1642,8 @@ SwAccessibleMap::SwAccessibleMap( SwViewShell *pSh ) : mpVSh( pSh ), mpPreview( nullptr ), mbShapeSelected( false ), -mpSeletedFrameMap(nullptr) +mpSeletedFrameMap(nullptr), +maDocName(SwAccessibleContext::GetResource(STR_ACCESS_DOC_NAME)) { pSh->GetLayout()->AddAccessibleShell(); } diff --git a/sw/source/uibase/app/swdll.cxx b/sw/source/uibase/app/swdll.cxx index 609b4ad..549df9b 100644 --- a/sw/source/uibase/app/swdll.cxx +++ b/sw/source/uibase/app/swdll.cxx @@ -80,6 +80,7 @@ namespace SwGlobals } SwDLL::SwDLL() +: m_pAutoCorrCfg(nullptr) { if ( SfxApplication::GetModule(SfxToolsModule::Writer) )// Module already active return; @@ -146,16 +147,16 @@ SwDLL::SwDLL() SvxAutoCorrCfg& rACfg = SvxAutoCorrCfg::Get(); const SvxAutoCorrect* pOld = rACfg.GetAutoCorrect(); rACfg.SetAutoCorrect(new SwAutoCorrect( *pOld )); +m_pAutoCorrCfg = } } SwDLL::~SwDLL() { -if (!utl::ConfigManager::IsAvoidConfig()) +if (m_pAutoCorrCfg) { // fdo#86494 SwAutoCorrect must be deleted before FinitCore -SvxAutoCorrCfg& rACfg = SvxAutoCorrCfg::Get(); -rACfg.SetAutoCorrect(nullptr); // delete SwAutoCorrect before exit handlers +m_pAutoCorrCfg->SetAutoCorrect(nullptr); // delete SwAutoCorrect before exit handlers } // Pool has to be deleted before statics are diff --git a/sw/source/uibase/app/swdllimpl.hxx b/sw/source/uibase/app/swdllimpl.hxx index 57a34be..8f6707f 100644 --- a/sw/source/uibase/app/swdllimpl.hxx +++ b/sw/source/uibase/app/swdllimpl.hxx @@ -16,6 +16,8 @@ namespace sw { class Filters; } +class SvxAutoCorrCfg; + class SwDLL { public: @@ -33,6 +35,7 @@ private: SwDLL& operator=(SwDLL const&) = delete; std::unique_ptr< sw::Filters > filters_; +SvxAutoCorrCfg *m_pAutoCorrCfg; }; #endif diff --git a/vcl/source/gdi/svgdata.cxx b/vcl/source/gdi/svgdata.cxx index 155844f..27abb60d 100644 --- a/vcl/source/gdi/svgdata.cxx +++ b/vcl/source/gdi/svgdata.cxx @@ -44,10 +44,9 @@ BitmapEx convertPrimitive2DSequenceToBitmapEx( { // create replacement graphic from maSequence // create XPrimitive2DRenderer -uno::Reference< uno::XComponentContext > xContext(::comphelper::getProcessComponentContext()); - try {
[Libreoffice-commits] core.git: 3 commits - sw/inc sw/source
sw/inc/unocoll.hxx | 245 ++-- sw/source/core/doc/textboxhelper.cxx |2 sw/source/core/inc/unofield.hxx |7 sw/source/core/unocore/unocoll.cxx | 608 +++ sw/source/core/unocore/unofield.cxx | 479 sw/source/core/unocore/unoidx.cxx| 14 sw/source/core/unocore/unotext.cxx |2 sw/source/ui/dbui/mmaddressblockpage.cxx | 39 + sw/source/ui/dbui/mmaddressblockpage.hxx | 20 - sw/source/ui/frmdlg/frmpage.cxx | 259 ++--- sw/source/uibase/uno/unotxdoc.cxx|4 11 files changed, 851 insertions(+), 828 deletions(-) New commits: commit 9b0b3d40a2566af279204fa5991f35475fc8210c Author: Noel GrandinDate: Wed Aug 31 12:59:27 2016 +0200 convert LB_ constants to typed_flags Change-Id: I2293b0120bff73f51ed7ea4d12d5ef3eb1bcba81 diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index 7f90f17..e400ce7 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -76,93 +76,100 @@ using namespace ::sfx2; #define SwFPos SvxSwFramePosString -struct FrameMap +struct StringIdPair_Impl { -SvxSwFramePosString::StringId eStrId; -SvxSwFramePosString::StringId eMirrorStrId; -sal_Int16 nAlign; -sal_uLong nLBRelations; +SvxSwFramePosString::StringId eHori; +SvxSwFramePosString::StringId eVert; }; +#define MAX_PERCENT_WIDTH 254L +#define MAX_PERCENT_HEIGHT 254L + +enum class LB { +NONE= 0xL, +Frame = 0x0001L, // text region of the paragraph +PrintArea = 0x0002L, // text region of the paragraph + indentions +VertFrame = 0x0004L, // vertical text region of the paragraph +VertPrintArea = 0x0008L, // vertical text region of the paragraph + indentions +RelFrameLeft= 0x0010L, // left paragraph edge +RelFrameRight = 0x0020L, // right paragraph edge + +RelPageLeft = 0x0040L, // left page edge +RelPageRight= 0x0080L, // right page edge +RelPageFrame= 0x0100L, // whole page +RelPagePrintArea= 0x0200L, // text region of the page + +FlyRelPageLeft = 0x0400L, // left frame edge +FlyRelPageRight = 0x0800L, // right frame edge +FlyRelPageFrame = 0x1000L, // whole frame +FlyRelPagePrintArea = 0x2000L, // inside of the frame + +RelBase = 0x0001L, // character alignment Base +RelChar = 0x0002L, // character alignment Character +RelRow = 0x0004L, // character alignment Row + +FlyVertFrame= 0x0010L, // vertical entire frame +FlyVertPrintArea= 0x0020L, // vertical frame text area + +VertLine= 0x0040L, // vertical text line +}; +namespace o3tl { +template<> struct typed_flags : is_typed_flags {}; +} + struct RelationMap { SvxSwFramePosString::StringId eStrId; SvxSwFramePosString::StringId eMirrorStrId; -sal_uLong nLBRelation; +LB nLBRelation; sal_Int16 nRelation; }; -struct StringIdPair_Impl +struct FrameMap { -SvxSwFramePosString::StringId eHori; -SvxSwFramePosString::StringId eVert; +SvxSwFramePosString::StringId eStrId; +SvxSwFramePosString::StringId eMirrorStrId; +sal_Int16 nAlign; +LB nLBRelations; }; -#define MAX_PERCENT_WIDTH 254L -#define MAX_PERCENT_HEIGHT 254L - -#define LB_FRAME0x0001L // text region of the paragraph -#define LB_PRTAREA 0x0002L // text region of the paragraph + indentions -#define LB_VERT_FRAME 0x0004L // vertical text region of the paragraph -#define LB_VERT_PRTAREA 0x0008L // vertical text region of the paragraph + indentions -#define LB_REL_FRM_LEFT 0x0010L // left paragraph edge -#define LB_REL_FRM_RIGHT0x0020L // right paragraph edge - -#define LB_REL_PG_LEFT 0x0040L // left page edge -#define LB_REL_PG_RIGHT 0x0080L// right page edge -#define LB_REL_PG_FRAME 0x0100L // whole page -#define LB_REL_PG_PRTAREA 0x0200L// text region of the page - -#define LB_FLY_REL_PG_LEFT 0x0400L// left frame edge -#define LB_FLY_REL_PG_RIGHT 0x0800L// right frame edge -#define LB_FLY_REL_PG_FRAME 0x1000L// whole frame -#define LB_FLY_REL_PG_PRTAREA 0x2000L// inside of the frame - -#define LB_REL_BASE 0x0001L // character alignment Base -#define LB_REL_CHAR 0x0002L // character alignment Character -#define LB_REL_ROW 0x0004L // character alignment Row - -#define LB_FLY_VERT_FRAME 0x0010L // vertical entire frame -#define LB_FLY_VERT_PRTAREA
[Libreoffice-commits] core.git: 3 commits - sw/inc sw/source
sw/inc/crsrsh.hxx|6 +++--- sw/inc/fesh.hxx |4 ++-- sw/source/core/access/acccontext.cxx | 23 ++- sw/source/core/access/accmap.cxx | 10 +- sw/source/core/crsr/crsrsh.cxx |4 ++-- sw/source/core/frmedt/fecopy.cxx |2 +- sw/source/core/frmedt/fews.cxx |8 sw/source/core/layout/layact.cxx |4 ++-- sw/source/uibase/uiview/view1.cxx|4 ++-- sw/source/uibase/uiview/view2.cxx|6 +++--- 10 files changed, 46 insertions(+), 25 deletions(-) New commits: commit d0b09f41efe938e94a84e783c9ff5742edcbfba8 Author: Michael StahlDate: Tue Feb 23 20:59:30 2016 +0100 sw: related: tdf#58624 convert to assert() in ~SwAccessibleMap() With the restored Dispose() calls from previous commit these don't trigger on every scrolled document now. Change-Id: I93694352adadc2c3a034be949d4930de51ec80e9 diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index 7ea16d4..aa00caa 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -1700,8 +1700,8 @@ SwAccessibleMap::~SwAccessibleMap() { osl::MutexGuard aGuard( maMutex ); #if OSL_DEBUG_LEVEL > 0 -OSL_ENSURE( !mpFrameMap || mpFrameMap->empty(), -"Frame map should be empty after disposing the root frame" ); +assert((!mpFrameMap || mpFrameMap->empty()) && +"Frame map should be empty after disposing the root frame"); if( mpFrameMap ) { SwAccessibleContextMap_Impl::iterator aIter = mpFrameMap->begin(); @@ -1717,8 +1717,8 @@ SwAccessibleMap::~SwAccessibleMap() ++aIter; } } -OSL_ENSURE( !mpShapeMap || mpShapeMap->empty(), -"Object map should be empty after disposing the root frame" ); +assert((!mpShapeMap || mpShapeMap->empty()) && +"Object map should be empty after disposing the root frame"); if( mpShapeMap ) { SwAccessibleShapeMap_Impl::iterator aIter = mpShapeMap->begin(); @@ -1751,7 +1751,7 @@ SwAccessibleMap::~SwAccessibleMap() { osl::MutexGuard aGuard( maEventMutex ); #if OSL_DEBUG_LEVEL > 0 -OSL_ENSURE( !(mpEvents || mpEventMap), "pending events" ); +assert(!(mpEvents || mpEventMap)); if( mpEvents ) { SwAccessibleEventList_Impl::iterator aIter = mpEvents->begin(); commit b299aa7c64adc2de86c367888e6ccb73c4b31bc2 Author: Michael Stahl Date: Thu Feb 25 23:24:53 2016 +0100 sw: restore some Dispose calls in a11y code These were removed by commit a5c4ddcf8ed5344d9bceeffd7431cd6895a407ca but the assertions inevitably triggered by their removal in the ~SwAccessibleMap about "Frame map should be empty after disposing the root frame" were left intact, which (along the total lack of any stated reason) casts some doubt on how well thought out that change was. Basically SwAccessibleMap had the invariant that only visible frames had a valid SwAccessible in the mpFrameMap, and when the frames scrolled out of view their SwAccessible was disposed. Let's try to restore this invariant. The dispose removal has caused crashes in the past too, see commit 104ed86c382b73505b477bf3024982dd27823023. Change-Id: I4b3e7264ce76a8c6e551d68f6bc231982970dfdd diff --git a/sw/source/core/access/acccontext.cxx b/sw/source/core/access/acccontext.cxx index 0e42527..86d34cd 100644 --- a/sw/source/core/access/acccontext.cxx +++ b/sw/source/core/access/acccontext.cxx @@ -240,6 +240,11 @@ void SwAccessibleContext::ChildrenScrolled( const SwFrame *pFrame, xAccImpl->ViewForwarderChanged( ::accessibility::IAccessibleViewForwarderListener::VISIBLE_AREA, GetMap() ); +// this DisposeShape call was removed by +// IAccessibility2 implementation +// without giving any reason why +DisposeShape( rLower.GetDrawObject(), + xAccImpl.get() ); } break; // coverity[dead_error_begin] - following conditions exist to avoid compiler warning @@ -347,6 +352,11 @@ void SwAccessibleContext::ScrolledOut( const SwRect& rOldVisArea ) // It might be that the child is freshly created just to send // the child event. In this case no listener will exist. FireStateChangedEvent( AccessibleStateType::SHOWING, false ); + +// this Dispose call was removed by IAccessibility2 implementation +// without giving any reason why - without it we get stale +// entries
[Libreoffice-commits] core.git: 3 commits - sw/inc sw/source
sw/inc/rdfhelper.hxx |2 sw/source/core/doc/rdfhelper.cxx |4 + sw/source/filter/basflt/fltshell.cxx | 77 ++- sw/source/filter/inc/fltshell.hxx| 19 sw/source/filter/ww8/ww8par.cxx | 36 +++- sw/source/filter/ww8/ww8par.hxx |2 sw/source/filter/ww8/ww8par5.cxx |7 +-- 7 files changed, 141 insertions(+), 6 deletions(-) New commits: commit 0b7ef6957193edd7c4adfe76872df8ec2754f6f2 Author: Miklos VajnaDate: Wed Dec 9 12:33:36 2015 +0100 sw: handle RDF mark in SwFltControlStack::SetAttrInDoc() Change-Id: I13e510e305c4aa24c37b1c25b4c3116ef3f06a8a diff --git a/sw/inc/rdfhelper.hxx b/sw/inc/rdfhelper.hxx index d9787cb..edee106 100644 --- a/sw/inc/rdfhelper.hxx +++ b/sw/inc/rdfhelper.hxx @@ -24,6 +24,8 @@ class SW_DLLPUBLIC SwRDFHelper public: /// Gets all (rTextNode, key, value) statements in RDF graphs of type rType. static std::map getTextNodeStatements(const OUString& rType, SwTextNode& rTextNode); +/// Add an (rTextNode, key, value) statement in the graph of type rType -- or if it does not exist, create a graph at rPath first. +static void addTextNodeStatement(const OUString& rType, const OUString& rPath, SwTextNode& rTextNode, const OUString& rKey, const OUString& rValue); }; #endif // INCLUDED_SW_INC_RDFHELPER_HXX diff --git a/sw/source/core/doc/rdfhelper.cxx b/sw/source/core/doc/rdfhelper.cxx index f476bf7..25acac9 100644 --- a/sw/source/core/doc/rdfhelper.cxx +++ b/sw/source/core/doc/rdfhelper.cxx @@ -48,4 +48,8 @@ std::map SwRDFHelper::getTextNodeStatements(const OUString& return aRet; } +void SwRDFHelper::addTextNodeStatement(const OUString& /*rType*/, const OUString& /*rPath*/, SwTextNode& /*rTextNode*/, const OUString& /*rKey*/, const OUString& /*rValue*/) +{ +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx index 37aad9f..6c37888 100644 --- a/sw/source/filter/basflt/fltshell.cxx +++ b/sw/source/filter/basflt/fltshell.cxx @@ -64,6 +64,7 @@ #include #include #include +#include using namespace com::sun::star; @@ -80,6 +81,14 @@ static SwContentNode* GetContentNode(SwDoc* pDoc, SwNodeIndex& rIdx, bool bNext) return pCNd; } +static OUString lcl_getTypePath(const OUString& rType) +{ +OUString aRet; +if (rType == "urn:tscp:names:baf:1.1") +aRet = "tscp/baf.rdf"; +return aRet; +} + // Stack entry for all text attributes SwFltStackEntry::SwFltStackEntry(const SwPosition& rStartPos, SfxPoolItem* pHt) : m_aMkPos(rStartPos) @@ -614,7 +623,25 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos, { if (MakeBookRegionOrPoint(rEntry, pDoc, aRegion, true)) { -// TODO handle RDF mark +SwFltRDFMark* pMark = static_cast (rEntry.pAttr); +if (aRegion.GetNode().IsTextNode()) +{ +SwTextNode& rTextNode = *aRegion.GetNode().GetTextNode(); + +for (const std::pair & rAttribute : pMark->GetAttributes()) +{ +sal_Int32 nIndex = rAttribute.first.indexOf('#'); +if (nIndex == -1) +continue; + +OUString aTypeNS = rAttribute.first.copy(0, nIndex); +OUString aMetadataFilePath = lcl_getTypePath(aTypeNS); +if (aMetadataFilePath.isEmpty()) +continue; + +SwRDFHelper::addTextNodeStatement(aTypeNS, aMetadataFilePath, rTextNode, rAttribute.first, rAttribute.second); +} +} } else SAL_WARN("sw", "failed to make book region or point"); diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 2cc0743..05a109b 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -253,7 +253,7 @@ long SwWW8ImplReader::Read_FactoidBook(WW8PLCFManResult*) SwFltRDFMark aMark; aMark.SetHandle(pFactoidBook->getHandle()); GetSmartTagInfo(aMark); -m_pReffedStck->NewAttr(*m_pPaM->GetPoint(), CntUInt16Item(RES_FLTR_RDFMARK, pFactoidBook->getHandle())); +m_pReffedStck->NewAttr(*m_pPaM->GetPoint(), aMark); } } return 0; commit 97824ec98932284c7668fec90630b5d474266609 Author: Miklos Vajna Date: Wed Dec 9 10:49:17 2015 +0100 SwWW8ImplReader::GetSmartTagInfo: read from SmartTagData With this, SwWW8ImplReader::Read_FactoidBook() gets exactly the matching key/value strings for the smart-tag bookmark, so now only SwFltControlStack
[Libreoffice-commits] core.git: 3 commits - sw/inc sw/source
sw/inc/hintids.hxx |1 sw/source/filter/basflt/fltshell.cxx | 14 ++- sw/source/filter/ww8/ww8par.hxx |1 sw/source/filter/ww8/ww8par5.cxx | 12 ++ sw/source/filter/ww8/ww8par6.cxx |3 sw/source/filter/ww8/ww8scan.cxx | 141 ++- sw/source/filter/ww8/ww8scan.hxx | 39 - 7 files changed, 204 insertions(+), 7 deletions(-) New commits: commit ab94f468a2b2b1b9e2a621e33f9175171caec252 Author: Miklos VajnaDate: Tue Dec 8 09:26:00 2015 +0100 DOC import: handle smart tags via RES_FLTR_RDFMARK The idea is that a subset of the smart tags will be mapped to RDF statements, as done already in the DOCX importer. Change-Id: I46e0dad37a3905fe591cba0f710156f27be05ff4 diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx index 0d2fb99..0b18e4b 100644 --- a/sw/source/filter/ww8/ww8par.hxx +++ b/sw/source/filter/ww8/ww8par.hxx @@ -1701,6 +1701,7 @@ public: // really private, but can only be done public long Read_Book(WW8PLCFManResult*); long Read_And(WW8PLCFManResult* pRes); long Read_AtnBook(WW8PLCFManResult*); +long Read_FactoidBook(WW8PLCFManResult*); // attributes diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 77960c9..18747c3 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -242,6 +242,18 @@ long SwWW8ImplReader::Read_AtnBook(WW8PLCFManResult*) return 0; } +long SwWW8ImplReader::Read_FactoidBook(WW8PLCFManResult*) +{ +if (WW8PLCFx_FactoidBook* pFactoidBook = m_pPlcxMan->GetFactoidBook()) +{ +if (pFactoidBook->getIsEnd()) +m_pReffedStck->SetAttr(*m_pPaM->GetPoint(), RES_FLTR_RDFMARK, true, pFactoidBook->getHandle()); +else +m_pReffedStck->NewAttr(*m_pPaM->GetPoint(), CntUInt16Item(RES_FLTR_RDFMARK, pFactoidBook->getHandle())); +} +return 0; +} + //general help methods to separate parameters /// translate FieldParameter names into the system character set and diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index 79ecd45..2a9da61 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -5033,7 +5033,8 @@ long SwWW8ImplReader::ImportExtSprm(WW8PLCFManResult* pRes) /* 2 (258) */ ::Read_Field, // Feld /* 3 (259) */ ::Read_Book, // Bookmark /* 4 (260) */ ::Read_And, // Annotation -/* 5 (261) */ ::Read_AtnBook // Annotationmark +/* 5 (261) */ ::Read_AtnBook, // Annotationmark +/* 6 (262) */ ::Read_FactoidBook // Smart tag bookmark }; if( pRes->nSprmId < 280 ) commit f30ea8d91ca8e2f938632755d3bdfbd2e181e006 Author: Miklos Vajna Date: Tue Dec 8 09:14:11 2015 +0100 DOC import: tokenize PlcfBkfFactoid and PlcfBklFactoid So that later SwWW8ImplReader can read these smart tag position structures in a way similar to bookmarks. Change-Id: I0e1dc30d48bbb6641a82d777f6569f59dd922e16 diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index 491adec..aac1f2c 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -1703,6 +1703,7 @@ WW8ScannerBase::WW8ScannerBase( SvStream* pSt, SvStream* pTableSt, pBook = new WW8PLCFx_Book(pTableSt, *pWwFib); pAtnBook = new WW8PLCFx_AtnBook(pTableSt, *pWwFib); +pFactoidBook = new WW8PLCFx_FactoidBook(pTableSt, *pWwFib); } WW8ScannerBase::~WW8ScannerBase() @@ -4339,6 +4340,138 @@ bool WW8PLCFx_AtnBook::getIsEnd() const return m_bIsEnd; } +WW8PLCFx_FactoidBook::WW8PLCFx_FactoidBook(SvStream* pTableSt, const WW8Fib& rFib) +: WW8PLCFx(rFib.GetFIBVersion(), /*bSprm=*/false), +m_bIsEnd(false) +{ +if (!rFib.fcPlcfBkfFactoid || !rFib.lcbPlcfBkfFactoid || !rFib.fcPlcfBklFactoid || !rFib.lcbPlcfBklFactoid) +{ +m_pBook[0] = m_pBook[1] = nullptr; +m_nIMax = 0; +} +else +{ +m_pBook[0] = new WW8PLCFspecial(pTableSt, rFib.fcPlcfBkfFactoid, rFib.lcbPlcfBkfFactoid, 6); +m_pBook[1] = new WW8PLCFspecial(pTableSt, rFib.fcPlcfBklFactoid, rFib.lcbPlcfBklFactoid, 4); + +m_nIMax = m_pBook[0]->GetIMax(); +if (m_pBook[1]->GetIMax() < m_nIMax) +m_nIMax = m_pBook[1]->GetIMax(); +} +} + +WW8PLCFx_FactoidBook::~WW8PLCFx_FactoidBook() +{ +delete m_pBook[1]; +delete m_pBook[0]; +} + +sal_uInt32 WW8PLCFx_FactoidBook::GetIdx() const +{ +return m_nIMax ? m_pBook[0]->GetIdx() : 0; +} + +void WW8PLCFx_FactoidBook::SetIdx(sal_uLong nI) +{ +if (m_nIMax) +m_pBook[0]->SetIdx(nI); +} + +sal_uLong WW8PLCFx_FactoidBook::GetIdx2() const +{ +if (m_nIMax) +return m_pBook[1]->GetIdx() | (m_bIsEnd ? 0x8000 : 0); +else +return 0; +} + +void
[Libreoffice-commits] core.git: 3 commits - sw/inc sw/source
sw/inc/calbck.hxx|8 ++- sw/source/core/attr/calbck.cxx | 44 +++ sw/source/core/table/swtable.cxx |2 - 3 files changed, 22 insertions(+), 32 deletions(-) New commits: commit 938cd22ae87d7098143a0e18e1e348479cdf69e9 Author: Bjoern MichaelsenDate: Tue Nov 10 22:50:47 2015 +0100 remove b_mInDocDTOR flag altogether Change-Id: I09ca56854f23fe1fc452648042990bee29082f88 diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx index f718507..dcd6dc9 100644 --- a/sw/inc/calbck.hxx +++ b/sw/inc/calbck.hxx @@ -149,7 +149,6 @@ class SW_DLLPUBLIC SwModify: public SwClient sw::WriterListener* m_pWriterListeners;// the start of the linked list of clients bool m_bModifyLocked : 1; // don't broadcast changes now bool m_bLockClientList : 1; // may be set when this instance notifies its clients -bool m_bInDocDTOR : 1;// workaround for problems when a lot of objects are destroyed bool m_bInCache : 1; bool m_bInSwFntCache : 1; @@ -162,10 +161,10 @@ class SW_DLLPUBLIC SwModify: public SwClient SwModify =(const SwModify&) = delete; public: SwModify() -: SwClient(nullptr), m_pWriterListeners(nullptr), m_bModifyLocked(false), m_bLockClientList(false), m_bInDocDTOR(false), m_bInCache(false), m_bInSwFntCache(false) +: SwClient(nullptr), m_pWriterListeners(nullptr), m_bModifyLocked(false), m_bLockClientList(false), m_bInCache(false), m_bInSwFntCache(false) {} explicit SwModify( SwModify* pToRegisterIn ) -: SwClient(pToRegisterIn), m_pWriterListeners(nullptr), m_bModifyLocked(false), m_bLockClientList(false), m_bInDocDTOR(false), m_bInCache(false), m_bInSwFntCache(false) +: SwClient(pToRegisterIn), m_pWriterListeners(nullptr), m_bModifyLocked(false), m_bLockClientList(false), m_bInCache(false), m_bInSwFntCache(false) {} // broadcasting: send notifications to all clients diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx index 51a188c..d7ec7cd 100644 --- a/sw/source/core/attr/calbck.cxx +++ b/sw/source/core/attr/calbck.cxx @@ -77,13 +77,13 @@ void SwClient::Modify(SfxPoolItem const*const pOldValue, SfxPoolItem const*const void SwModify::SetInDocDTOR() { -m_bInDocDTOR = true; // If the document gets destroyed anyway, just tell clients to // forget me so that they don't try to get removed from my list // later when they also get destroyed SwIterator aIter(*this); for(SwClient* pClient = aIter.First(); pClient; pClient = aIter.Next()) pClient->pRegisteredIn = nullptr; +m_pWriterListeners = nullptr; } SwModify::~SwModify() @@ -97,8 +97,6 @@ SwModify::~SwModify() if ( IsInSwFntCache() ) pSwFontCache->Delete( this ); -if(m_bInDocDTOR) -return; // notify all clients that they shall remove themselves SwPtrMsgPoolItem aDyObject( RES_OBJECTDYING, this ); NotifyClients( , ); @@ -203,9 +201,6 @@ void SwModify::Add( SwClient* pDepend ) SwClient* SwModify::Remove( SwClient* pDepend ) { -if(m_bInDocDTOR) -return nullptr; - DBG_TESTSOLARMUTEX(); assert(pDepend->pRegisteredIn == this); commit f93a2e530d94c4ef73e234b8cc5d3dd79977a8c8 Author: Bjoern Michaelsen Date: Tue Nov 10 22:12:59 2015 +0100 reduce branch depth in SwModify dtor Change-Id: I82046cfc191425dc830125944214293b5b9197f9 diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx index b56575d..f718507 100644 --- a/sw/inc/calbck.hxx +++ b/sw/inc/calbck.hxx @@ -192,7 +192,7 @@ public: void UnlockModify() { m_bModifyLocked = false; } void SetInCache( bool bNew ){ m_bInCache = bNew; } void SetInSwFntCache( bool bNew ) { m_bInSwFntCache = bNew; } -void SetInDocDTOR() { m_bInDocDTOR = true; } +void SetInDocDTOR(); bool IsModifyLocked() const { return m_bModifyLocked; } bool IsInCache() const { return m_bInCache; } bool IsInSwFntCache() const { return m_bInSwFntCache; } diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx index fb6654e..51a188c 100644 --- a/sw/source/core/attr/calbck.cxx +++ b/sw/source/core/attr/calbck.cxx @@ -75,6 +75,17 @@ void SwClient::Modify(SfxPoolItem const*const pOldValue, SfxPoolItem const*const CheckRegistration( pOldValue, pNewValue ); } +void SwModify::SetInDocDTOR() +{ +m_bInDocDTOR = true; +// If the document gets destroyed anyway, just tell clients to +// forget me so that they don't try to get removed from my list +// later when they also get destroyed +SwIterator aIter(*this); +for(SwClient* pClient = aIter.First(); pClient; pClient = aIter.Next()) +pClient->pRegisteredIn = nullptr; +} +
[Libreoffice-commits] core.git: 3 commits - sw/inc sw/source
sw/inc/swtable.hxx | 60 - sw/inc/unostyle.hxx | 38 ++--- sw/source/core/doc/tblrwcl.cxx | 94 +++--- sw/source/core/fields/ddetbl.cxx| 14 +- sw/source/core/table/swnewtable.cxx | 64 - sw/source/core/table/swtable.cxx| 60 - sw/source/core/unocore/unostyle.cxx | 232 ++-- 7 files changed, 281 insertions(+), 281 deletions(-) New commits: commit 90cbb22f3fdb1302fac6a707adb9741508aa2f55 Author: Miklos VajnaDate: Mon Oct 19 09:17:09 2015 +0200 sw: prefix members of SwTable Change-Id: Ie2aaa35047c9c11d5030d8ba83f87061e82f5d3a diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx index 86ebd8c..bf492dd 100644 --- a/sw/inc/swtable.hxx +++ b/sw/inc/swtable.hxx @@ -94,36 +94,36 @@ class SW_DLLPUBLIC SwTable: public SwClient //Client of FrameFormat. { protected: -SwTableLines aLines; +SwTableLines m_aLines; SwTableSortBoxes m_TabSortContentBoxes; -tools::SvRef refObj; // In case DataServer -> pointer is set. +tools::SvRef m_xRefObj; // In case DataServer -> pointer is set. -SwHTMLTableLayout *pHTMLLayout; +SwHTMLTableLayout *m_pHTMLLayout; // Usually, the table node of a SwTable can be accessed by getting a box // out of m_TabSortContentBoxes, which know their SwStartNode. But in some rare // cases, we need to know the table node of a SwTable, before the table // boxes have been build (SwTableNode::MakeCopy with tables in tables). -SwTableNode* pTableNode; +SwTableNode* m_pTableNode; // Should that be adjustable for every table? -TableChgMode eTableChgMode; +TableChgMode m_eTableChgMode; -sal_uInt16 nGrfsThatResize;// Count of Grfs that initiate a resize of table +sal_uInt16 m_nGraphicsThatResize;// Count of Grfs that initiate a resize of table // at HTML-import. -sal_uInt16 nRowsToRepeat; // Number of rows to repeat on every page. +sal_uInt16 m_nRowsToRepeat; // Number of rows to repeat on every page. /// Name of the table style to be applied on this table. OUString maTableStyleName; -boolbModifyLocked :1; -boolbNewModel :1; // false: old SubTableModel; true: new RowSpanModel +boolm_bModifyLocked :1; +boolm_bNewModel :1; // false: old SubTableModel; true: new RowSpanModel #ifdef DBG_UTIL /// This is set by functions (like Merge()) to forbid a late model change. bool m_bDontChangeModel; #endif -bool IsModifyLocked(){ return bModifyLocked;} +bool IsModifyLocked(){ return m_bModifyLocked;} virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) override; @@ -164,18 +164,18 @@ private: public: -SwHTMLTableLayout *GetHTMLTableLayout() { return pHTMLLayout; } -const SwHTMLTableLayout *GetHTMLTableLayout() const { return pHTMLLayout; } +SwHTMLTableLayout *GetHTMLTableLayout() { return m_pHTMLLayout; } +const SwHTMLTableLayout *GetHTMLTableLayout() const { return m_pHTMLLayout; } void SetHTMLTableLayout( SwHTMLTableLayout *p );//Change of property! -sal_uInt16 IncGrfsThatResize() { return ++nGrfsThatResize; } -sal_uInt16 DecGrfsThatResize() { return nGrfsThatResize ? --nGrfsThatResize : 0; } +sal_uInt16 IncGrfsThatResize() { return ++m_nGraphicsThatResize; } +sal_uInt16 DecGrfsThatResize() { return m_nGraphicsThatResize ? --m_nGraphicsThatResize : 0; } -void LockModify() { bModifyLocked = true; } // Must be used always -void UnlockModify() { bModifyLocked = false;} // in pairs! +void LockModify() { m_bModifyLocked = true; } // Must be used always +void UnlockModify() { m_bModifyLocked = false;} // in pairs! -void SetTableModel( bool bNew ){ bNewModel = bNew; } -bool IsNewModel() const { return bNewModel; } +void SetTableModel( bool bNew ){ m_bNewModel = bNew; } +bool IsNewModel() const { return m_bNewModel; } /// Return the table style name of this table. OUString GetTableStyleName() const { return maTableStyleName; } @@ -183,14 +183,14 @@ public: /// Set the new table style name for this table. void SetTableStyleName(const OUString& rName) { maTableStyleName = rName; } -sal_uInt16 GetRowsToRepeat() const { return std::min( (sal_uInt16)GetTabLines().size(), nRowsToRepeat ); } -sal_uInt16 _GetRowsToRepeat() const { return nRowsToRepeat; } -void SetRowsToRepeat( sal_uInt16 nNumOfRows ) { nRowsToRepeat = nNumOfRows; } +sal_uInt16 GetRowsToRepeat() const { return std::min( (sal_uInt16)GetTabLines().size(), m_nRowsToRepeat ); } +sal_uInt16 _GetRowsToRepeat() const { return m_nRowsToRepeat; } +void SetRowsToRepeat( sal_uInt16 nNumOfRows ) { m_nRowsToRepeat = nNumOfRows; } bool
[Libreoffice-commits] core.git: 3 commits - sw/inc sw/source
sw/inc/doc.hxx | 12 - sw/inc/fesh.hxx |9 ++- sw/inc/swtable.hxx | 20 sw/inc/tblafmt.hxx |7 ++ sw/source/core/doc/docnew.cxx |2 sw/source/core/doc/tblafmt.cxx | 23 - sw/source/core/doc/tblrwcl.cxx |9 +++ sw/source/core/docnode/ndtbl.cxx| 85 +--- sw/source/core/docnode/ndtbl1.cxx |2 sw/source/core/frmedt/fetab.cxx | 33 +++-- sw/source/core/table/swtable.cxx| 10 ++-- sw/source/ui/dbui/dbinsdlg.cxx |2 sw/source/ui/table/tautofmt.cxx |2 sw/source/uibase/shells/textsh1.cxx |4 + 14 files changed, 169 insertions(+), 51 deletions(-) New commits: commit 09fc6fef2d03ca8558dd6f0eec45d61ceb282cb5 Author: Jan HolesovskyDate: Sat Sep 26 23:54:22 2015 +0200 sw table styles: Direct formatting takes precedence over table style. Make sure we don't reset the direct formatting with the table style when updating. Change-Id: I07b4a687fd0403bd80d73732a66101b967398507 diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 51631a3..f338348 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -1255,8 +1255,9 @@ public: void SetRowsToRepeat( SwTable , sal_uInt16 nSet ); -// AutoFormat for table/table selection. -bool SetTableAutoFormat( const SwSelBoxes& rBoxes, const SwTableAutoFormat& rNew ); +/// AutoFormat for table/table selection. +/// @param bResetDirect Reset direct formatting that might be applied to the cells. +bool SetTableAutoFormat(const SwSelBoxes& rBoxes, const SwTableAutoFormat& rNew, bool bResetDirect = false); // Query attributes. bool GetTableAutoFormat( const SwSelBoxes& rBoxes, SwTableAutoFormat& rGet ); diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx index a4829e8..47fe673 100644 --- a/sw/inc/fesh.hxx +++ b/sw/inc/fesh.hxx @@ -725,7 +725,8 @@ public: /// Update the direct formatting according to the current table style. /// @param pTableNode Table node to update. When nullptr, current cursor position is used. -bool UpdateTableStyleFormatting(SwTableNode *pTableNode = nullptr); +/// @param bResetDirect Reset direct formatting that might be applied to the cells. +bool UpdateTableStyleFormatting(SwTableNode *pTableNode = nullptr, bool bResetDirect = false); bool GetTableAutoFormat( SwTableAutoFormat& rGet ); diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx index 5f645e3..14e31c8 100644 --- a/sw/inc/swtable.hxx +++ b/sw/inc/swtable.hxx @@ -397,6 +397,9 @@ class SW_DLLPUBLIC SwTableBox: public SwClient //Client of FrameFormat. SwTableLine *pUpper; SwTableBox_Impl* pImpl; +/// Do we contain any direct formatting? +bool mbDirectFormatting; + // In case Format contains formulas/values already, // a new one must be created for the new box. static SwTableBoxFormat* CheckBoxFormat( SwTableBoxFormat* ); @@ -404,7 +407,7 @@ class SW_DLLPUBLIC SwTableBox: public SwClient //Client of FrameFormat. public: TYPEINFO_OVERRIDE(); -SwTableBox() : pSttNd(0), pUpper(0), pImpl(0) {} +SwTableBox() : pSttNd(0), pUpper(0), pImpl(0), mbDirectFormatting(false) {} SwTableBox( SwTableBoxFormat*, sal_uInt16 nLines, SwTableLine *pUp = 0 ); SwTableBox( SwTableBoxFormat*, const SwStartNode&, SwTableLine *pUp = 0 ); @@ -421,6 +424,12 @@ public: SwFrameFormat* GetFrameFormat() { return static_cast (GetRegisteredIn()); } SwFrameFormat* GetFrameFormat() const { return const_cast (static_cast(GetRegisteredIn())); } +/// Set that this table box contains formatting that is not set by the table style. +void SetDirectFormatting(bool bDirect) { mbDirectFormatting = bDirect; } + +/// Do we contain any direct formatting (ie. something not affected by the table style)? +bool HasDirectFormatting() const { return mbDirectFormatting; } + // Creates its own FrameFormat if more boxes depend on it. SwFrameFormat* ClaimFrameFormat(); void ChgFrameFormat( SwTableBoxFormat *pNewFormat ); diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index 5d3499b..3911d84 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -3669,19 +3669,19 @@ struct _SetAFormatTabPara }; // Forward declare so that the Lines and Boxes can use recursion -static bool lcl_SetAFormatBox(_FndBox &, _SetAFormatTabPara *pSetPara); -static bool lcl_SetAFormatLine(_FndLine &, _SetAFormatTabPara *pPara); +static bool lcl_SetAFormatBox(_FndBox &, _SetAFormatTabPara *pSetPara, bool bResetDirect); +static bool lcl_SetAFormatLine(_FndLine &, _SetAFormatTabPara *pPara, bool bResetDirect); -static bool lcl_SetAFormatLine(_FndLine & rLine, _SetAFormatTabPara *pPara) +static bool lcl_SetAFormatLine(_FndLine & rLine,
[Libreoffice-commits] core.git: 3 commits - sw/inc sw/source
sw/inc/pch/precompiled_sw.hxx |1 - sw/source/core/access/accmap.cxx |3 +-- sw/source/core/doc/docbm.cxx | 15 +++ sw/source/core/txtnode/fmtatr2.cxx |3 +-- sw/source/core/unocore/unoobj2.cxx |1 - 5 files changed, 9 insertions(+), 14 deletions(-) New commits: commit 056066dfdb4e4a91aa742028f6a9c06eedeaa537 Author: Michael Stahl mst...@redhat.com Date: Wed Jul 8 12:58:11 2015 +0200 sw: remove boost::bind from accmap.cxx Change-Id: I9953cd58e4e285f655f11afccc1d6ee535f85d7e diff --git a/sw/inc/pch/precompiled_sw.hxx b/sw/inc/pch/precompiled_sw.hxx index f14d1c9..576c721 100644 --- a/sw/inc/pch/precompiled_sw.hxx +++ b/sw/inc/pch/precompiled_sw.hxx @@ -43,7 +43,6 @@ #include basic/sbx.hxx #include basic/sbxobj.hxx #include basic/sbxvar.hxx -#include boost/bind.hpp #include boost/function.hpp #include boost/make_shared.hpp #include boost/noncopyable.hpp diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index e682292..6a0883f 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -71,7 +71,6 @@ #include dflyobj.hxx #include prevwpage.hxx #include calbck.hxx -#include boost/bind.hpp using namespace ::com::sun::star; using namespace ::com::sun::star::accessibility; @@ -3092,7 +3091,7 @@ void SwAccessibleMap::FireEvents() mpEvents-SetFiring(); mpEvents-MoveInvalidXAccToEnd(); ::std::for_each(mpEvents-begin(), mpEvents-end(), -boost::bind(SwAccessibleMap::FireEvent, this, _1)); +[this] (SwAccessibleEvent_Impl const rEvent) { this-FireEvent(rEvent); } ); delete mpEventMap; mpEventMap = nullptr; commit 1dca84e374898185851b5a90595a8b5b741431ad Author: Michael Stahl mst...@redhat.com Date: Wed Jul 8 12:53:45 2015 +0200 sw: remove boost::bind from docbm.cxx Change-Id: I3e91817c5113a391668ef0f35d6b8df4702f9715 diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index 930312c..060c32f 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -19,7 +19,6 @@ #include MarkManager.hxx #include bookmrk.hxx -#include boost/bind.hpp #include boost/function.hpp #include cntfrm.hxx #include crossrefbookmark.hxx @@ -168,7 +167,7 @@ namespace rMarks.begin(), pCandidatesEnd, back_inserter(vCandidates), -boost::bind( ::std::logical_notbool(), boost::bind( IMark::EndsBefore, _1, rPos ) ) ); +[] (IDocumentMarkAccess::pMark_t const rpMark) { return !rpMark-EndsBefore(rPos); } ); // no candidate left = we are in front of the first mark or there are none if(vCandidates.empty()) return NULL; // return the highest (last) candidate using mark end ordering @@ -269,7 +268,7 @@ namespace return find_if( ppMarksBegin, ppMarksEnd, -boost::bind(OUString::equals, boost::bind(IMark::GetName, _1), rName)); +[] (IDocumentMarkAccess::pMark_t const rpMark) { return rpMark-GetName() == rName; } ); } #if 0 @@ -960,7 +959,7 @@ namespace sw { namespace mark find_if( pMarkLow, pMarkHigh, -boost::bind( ::std::equal_toconst IMark*(), boost::bind(boost::shared_ptrIMark::get, _1), pMark ) ); +[] (pMark_t const rpMark) { return rpMark.get() == pMark; } ); if(pMarkFound != pMarkHigh) deleteMark(pMarkFound); } @@ -1015,8 +1014,8 @@ namespace sw { namespace mark { const_iterator_t pFieldmark = find_if( m_vFieldmarks.begin(), -m_vFieldmarks.end( ), -boost::bind(IMark::IsCoveringPosition, _1, rPos)); +m_vFieldmarks.end(), +[] (pMark_t const rpMark) { return rpMark-IsCoveringPosition(rPos); } ); if(pFieldmark == m_vFieldmarks.end()) return NULL; return dynamic_castIFieldmark*(pFieldmark-get()); } @@ -1081,8 +1080,8 @@ namespace sw { namespace mark { const_iterator_t pAnnotationMark = find_if( m_vAnnotationMarks.begin(), -m_vAnnotationMarks.end( ), -boost::bind(IMark::IsCoveringPosition, _1, rPos)); +m_vAnnotationMarks.end(), +[] (pMark_t const rpMark) { return rpMark-IsCoveringPosition(rPos); } ); if (pAnnotationMark == m_vAnnotationMarks.end()) return NULL; return pAnnotationMark-get(); commit 84806f306114a038b4d5cc4eb6f34b90fbe71f9d Author: Michael Stahl mst...@redhat.com Date: Wed Jul 8 12:46:37 2015 +0200 sw: remove boost::bind from fmtatr2.cxx Change-Id: I4924251babfcea9a87e7e688c904264dd80f9359 diff --git a/sw/source/core/txtnode/fmtatr2.cxx b/sw/source/core/txtnode/fmtatr2.cxx index 90a45b9..dcd698e 100644 --- a/sw/source/core/txtnode/fmtatr2.cxx +++
[Libreoffice-commits] core.git: 3 commits - sw/inc sw/source
sw/inc/viewsh.hxx |6 ++ sw/source/core/doc/notxtfrm.cxx| 21 ++--- sw/source/core/draw/dflyobj.cxx|2 +- sw/source/core/inc/cellfrm.hxx |2 +- sw/source/core/inc/flyfrm.hxx |2 +- sw/source/core/inc/frame.hxx |2 +- sw/source/core/inc/layfrm.hxx |2 +- sw/source/core/inc/notxtfrm.hxx|2 +- sw/source/core/inc/rootfrm.hxx |2 +- sw/source/core/inc/tabfrm.hxx |2 +- sw/source/core/inc/txtfrm.hxx |2 +- sw/source/core/layout/paintfrm.cxx | 22 +++--- sw/source/core/layout/unusedf.cxx |2 +- sw/source/core/text/frmpaint.cxx |2 +- sw/source/core/text/porfly.cxx |2 +- sw/source/core/view/viewpg.cxx |2 +- sw/source/core/view/viewsh.cxx | 20 +++- sw/source/core/view/vnew.cxx |2 ++ sw/source/core/view/vprint.cxx |4 ++-- sw/source/uibase/docvw/edtwin2.cxx |4 20 files changed, 63 insertions(+), 42 deletions(-) New commits: commit f2c84d410cf6df3bb3725d2495e3b6b60b2cf17b Author: Miklos Vajna vmik...@collabora.co.uk Date: Wed Jun 24 11:38:34 2015 +0200 sw: add SwViewShell::mbOutputToWindow So that we can know if the output is a virtual device that will end up on the screen (due to double buffering) or a real virtual device. Change-Id: I1e8eeddfb19c374363b98786c26836e1f3236e7f diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx index e2ea4b5..9e77272 100644 --- a/sw/inc/viewsh.hxx +++ b/sw/inc/viewsh.hxx @@ -192,6 +192,9 @@ protected: bool mbInLibreOfficeKitCallback; +/// The virtual device we paint to will end up on the screen. +bool mbOutputToWindow; + public: TYPEINFO(); @@ -580,6 +583,9 @@ public: /// Are we doing tiled rendering? bool isTiledRendering() const; +void setOutputToWindow(bool bOutputToWindow); +bool isOutputToWindow() const; + }; // manages global ShellPointer diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index 5327ea3..aa2975b 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -935,7 +935,7 @@ void SwNoTextFrm::PaintPicture( vcl::RenderContext* pOut, const SwRect rGrfArea pVout = 0; OSL_ENSURE( OUTDEV_VIRDEV != pOut-GetOutDevType() || -pShell-GetViewOptions()-IsPDFExport(), +pShell-GetViewOptions()-IsPDFExport() || pShell-isOutputToWindow(), pOut should not be a virtual device ); pGrfNd-StartGraphicAnimation(pOut, aAlignedGrfArea.Pos(), diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index 739c898..5d66750 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -139,6 +139,16 @@ bool SwViewShell::isTiledRendering() const return getIDocumentDrawModelAccess()-GetDrawModel()-isTiledRendering(); } +void SwViewShell::setOutputToWindow(bool bOutputToWindow) +{ +mbOutputToWindow = bOutputToWindow; +} + +bool SwViewShell::isOutputToWindow() const +{ +return mbOutputToWindow; +} + static void lcl_PaintTransparentFormControls(SwViewShell rShell, SwRect const rRect) { diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx index 81333b4..2e8ed74 100644 --- a/sw/source/core/view/vnew.cxx +++ b/sw/source/core/view/vnew.cxx @@ -170,6 +170,7 @@ SwViewShell::SwViewShell( SwDoc rDocument, vcl::Window *pWindow, mnLockPaint( 0 ), mbSelectAll(false), mbInLibreOfficeKitCallback(false), +mbOutputToWindow(false), mpPrePostOutDev(0), // #i72754# maPrePostMapMode() { @@ -246,6 +247,7 @@ SwViewShell::SwViewShell( SwViewShell rShell, vcl::Window *pWindow, mnLockPaint( 0 ), mbSelectAll(false), mbInLibreOfficeKitCallback(false), +mbOutputToWindow(false), mpPrePostOutDev(0), // #i72754# maPrePostMapMode() { diff --git a/sw/source/uibase/docvw/edtwin2.cxx b/sw/source/uibase/docvw/edtwin2.cxx index fc38db6..dd78039 100644 --- a/sw/source/uibase/docvw/edtwin2.cxx +++ b/sw/source/uibase/docvw/edtwin2.cxx @@ -467,7 +467,11 @@ void SwEditWin::Paint(vcl::RenderContext rRenderContext, const Rectangle rRect GetView().GetVisArea().GetHeight() = 0 ) Invalidate( rRect ); else +{ +pWrtShell-setOutputToWindow(true); pWrtShell-Paint(rRenderContext, rRect); +pWrtShell-setOutputToWindow(false); +} if( bPaintShadowCrsr ) m_pShadCrsr-Paint(); commit cc9e9219cb897fa1a84916feb13720020fd20b12 Author: Miklos Vajna vmik...@collabora.co.uk Date: Wed Jun 24 10:59:34 2015 +0200 SwNoTextFrm::Paint: stop using SwViewShell::GetOut() Change-Id: Id7a975cff09066bd796a7fbdee63393266c1843e diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index 729e950..5327ea3
[Libreoffice-commits] core.git: 3 commits - sw/inc sw/source
sw/inc/IDocumentDrawModelAccess.hxx |5 ++ sw/source/core/crsr/findtxt.cxx | 26 -- sw/source/core/doc/DocumentDrawModelManager.cxx | 59 sw/source/core/inc/DocumentDrawModelManager.hxx |2 sw/source/uibase/inc/view.hxx |2 sw/source/uibase/uiview/viewdraw.cxx|7 ++ 6 files changed, 96 insertions(+), 5 deletions(-) New commits: commit bdc1824ea7acfa2fe9d71cdbe57882acce155577 Author: Miklos Vajna vmik...@collabora.co.uk Date: Tue May 19 17:20:10 2015 +0200 SwPaM::Find: search in shapes anchored to the range Change-Id: I028f95029deaebddcacf2730d429ad53abbc79fa diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx index 200d02b..ba7dcbd 100644 --- a/sw/source/core/crsr/findtxt.cxx +++ b/sw/source/core/crsr/findtxt.cxx @@ -37,6 +37,7 @@ #include doc.hxx #include IDocumentUndoRedo.hxx #include IDocumentState.hxx +#include IDocumentDrawModelAccess.hxx #include pamtyp.hxx #include ndtxt.hxx #include swundo.hxx @@ -244,7 +245,8 @@ bool SwPaM::Find( const SearchOptions rSearchOpt, bool bSearchInNotes , utl::Te { if( pNode-IsTxtNode() ) { -sal_Int32 nTxtLen = pNode-GetTxtNode()-GetTxt().getLength(); +SwTxtNode rTxtNode = *pNode-GetTxtNode(); +sal_Int32 nTxtLen = rTxtNode.GetTxt().getLength(); sal_Int32 nEnd; if( rNdIdx == pPam-GetMark()-nNode ) nEnd = pPam-GetMark()-nContent.GetIndex(); @@ -256,7 +258,7 @@ bool SwPaM::Find( const SearchOptions rSearchOpt, bool bSearchInNotes , utl::Te // if there are SwPostItFields inside our current node text, we // split the text into separate pieces and search for text inside // the pieces as well as inside the fields -const SwpHints *pHts = pNode-GetTxtNode()-GetpSwpHints(); +const SwpHints *pHts = rTxtNode.GetpSwpHints(); // count PostItFields by looping over all fields sal_Int32 aNumberPostits = 0; @@ -295,14 +297,15 @@ bool SwPaM::Find( const SearchOptions rSearchOpt, bool bSearchInNotes , utl::Te SwViewShell *const pWrtShell = (pDocShell) ? pDocShell-GetEditShell() : 0; SwPostItMgr *const pPostItMgr = (pWrtShell) ? pWrtShell-GetPostItMgr() : 0; +SvxSearchItem aSearchItem(SID_SEARCH_ITEM); +aSearchItem.SetSearchOptions(rSearchOpt); +aSearchItem.SetBackward(!bSrchForward); + // If there is an active text edit, then search there. if (SdrView* pSdrView = pWrtShell-GetDrawView()) { if (pSdrView-GetTextEditObject()) { -SvxSearchItem aSearchItem(SID_SEARCH_ITEM); -aSearchItem.SetSearchOptions(rSearchOpt); -aSearchItem.SetBackward(!bSrchForward); sal_uInt16 nResult = pSdrView-GetTextEditOutlinerView()-StartSearchAndReplace(aSearchItem); if (!nResult) { @@ -318,6 +321,19 @@ bool SwPaM::Find( const SearchOptions rSearchOpt, bool bSearchInNotes , utl::Te } } +// If there are any shapes anchored to this node, search there. +SwPaM aPaM(pNode-GetDoc()-GetNodes().GetEndOfContent()); +aPaM.GetPoint()-nNode = rTxtNode; + aPaM.GetPoint()-nContent.Assign(aPaM.GetPoint()-nNode.GetNode().GetTxtNode(), nStart); +aPaM.SetMark(); +aPaM.GetMark()-nNode = rTxtNode.GetIndex() + 1; + aPaM.GetMark()-nContent.Assign(aPaM.GetMark()-nNode.GetNode().GetTxtNode(), 0); +if (pNode-GetDoc()-getIDocumentDrawModelAccess().Search(aPaM, aSearchItem)) +{ +bFound = true; +break; +} + sal_Int32 aStart = 0; // do we need to finish a note? if (pPostItMgr pPostItMgr-HasActiveSidebarWin()) commit b97fb340b23e1b6a48c5c95c8d42e9f10ece1748 Author: Miklos Vajna vmik...@collabora.co.uk Date: Tue May 19 17:19:14 2015 +0200 Add sw::DocumentDrawModelManager::Search() Change-Id: Idcbbb9e049f0fbc5d6503b86fd506df9fb2ad3c5 diff --git a/sw/inc/IDocumentDrawModelAccess.hxx b/sw/inc/IDocumentDrawModelAccess.hxx index 7cf0b86..a8b5ba2 100644 --- a/sw/inc/IDocumentDrawModelAccess.hxx +++ b/sw/inc/IDocumentDrawModelAccess.hxx @@ -23,7 +23,9 @@ #include svx/svdtypes.hxx class SwDrawModel; +class SwPaM; class SdrPageView; +class SvxSearchItem; class IDocumentDrawModelAccess { @@ -89,6 +91,9 @@ public: */ virtual SdrLayerID GetInvisibleLayerIdByVisibleOne( const SdrLayerID _nVisibleLayerId ) = 0; +/// Searches text in shapes anchored inside rPaM. +virtual bool Search(const SwPaM rPaM, const SvxSearchItem rSearchItem) = 0; + protected: virtual
[Libreoffice-commits] core.git: 3 commits - sw/inc sw/source
sw/inc/calbck.hxx | 40 +--- sw/inc/switerator.hxx |2 -- sw/source/core/attr/calbck.cxx | 31 +-- 3 files changed, 26 insertions(+), 47 deletions(-) New commits: commit e3167924fd28c8b854f23139dbf49f53e6282ef7 Author: Bjoern Michaelsen bjoern.michael...@canonical.com Date: Sun Mar 15 04:50:32 2015 +0100 make SwClientIter::GoStart/GoEnd private Change-Id: I0c0f84d110e8ea4f84404a8ca17d0c982c9200c4 diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx index 7fc2e6d..2141653 100644 --- a/sw/inc/calbck.hxx +++ b/sw/inc/calbck.hxx @@ -243,10 +243,8 @@ protected: class SwClientIter SAL_FINAL : public sw::RingSwClientIter { -friend SwClient* SwModify::Remove(SwClient*); /// for pointer adjustments -friend void SwModify::Add(SwClient*); /// for pointer adjustments +friend class SwModify; templatetypename E, typename S friend class SwIterator; /// for typed interation -friend void SwModify::ModifyBroadcast( const SfxPoolItem*, const SfxPoolItem*, TypeId); /// for typed iteration const SwModify m_rRoot; @@ -259,6 +257,22 @@ class SwClientIter SAL_FINAL : public sw::RingSwClientIter SwClient* m_pPosition; SwClient* GetLeftOfPos() { return static_castSwClient*(m_pPosition-m_pLeft); } SwClient* GetRighOfPos() { return static_castSwClient*(m_pPosition-m_pRight); } +SwClient* GoStart() +{ +if((m_pPosition = const_castSwClient*(m_rRoot.GetDepends( +while( m_pPosition-m_pLeft ) +m_pPosition = static_castSwClient*(m_pPosition-m_pLeft); +return m_pCurrent = m_pPosition; +} +SwClient* GoEnd() +{ +if(!m_pPosition) +m_pPosition = const_castSwClient*(m_rRoot.GetDepends()); +if(m_pPosition) +while( m_pPosition-m_pRight ) +m_pPosition = static_castSwClient*(m_pPosition-m_pRight); +return m_pCurrent = m_pPosition; +} static SW_DLLPUBLIC SwClientIter* our_pClientIters; @@ -286,22 +300,6 @@ public: m_pPosition = static_castSwClient*(m_pPosition-m_pRight); return m_pCurrent = m_pPosition; } -SwClient* GoStart() -{ -if((m_pPosition = const_castSwClient*(m_rRoot.GetDepends( -while( m_pPosition-m_pLeft ) -m_pPosition = static_castSwClient*(m_pPosition-m_pLeft); -return m_pCurrent = m_pPosition; -} -SwClient* GoEnd() -{ -if(!m_pPosition) -m_pPosition = const_castSwClient*(m_rRoot.GetDepends()); -if(m_pPosition) -while( m_pPosition-m_pRight ) -m_pPosition = static_castSwClient*(m_pPosition-m_pRight); -return m_pCurrent = m_pPosition; -} // returns the current SwClient object, wether it is still a client or not SwClient operator*() const commit a21948bddfefa8554fb2d468616ec1bfda128e9d Author: Bjoern Michaelsen bjoern.michael...@canonical.com Date: Sun Mar 15 04:49:36 2015 +0100 refactor iteration Change-Id: Ifc2e190fa54e2e1e8992ae7e4e3ff15465b6db3d diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx index 636ee94..0ea5389 100644 --- a/sw/source/core/attr/calbck.cxx +++ b/sw/source/core/attr/calbck.cxx @@ -75,12 +75,8 @@ SwModify::~SwModify() // forget me so that they don't try to get removed from my list // later when they also get destroyed SwClientIter aIter( *this ); -SwClient* p = aIter.GoStart(); -while ( p ) -{ -p-pRegisteredIn = nullptr; -p = ++aIter; -} +for(aIter.GoStart(); aIter; ++aIter) +aIter-pRegisteredIn = nullptr; } else { @@ -136,22 +132,13 @@ void SwModify::NotifyClients( const SfxPoolItem* pOldValue, const SfxPoolItem* p bool SwModify::GetInfo( SfxPoolItem rInfo ) const { -bool bRet = true; // means: continue with next - -if( pRoot ) -{ -SwClientIter aIter( *(SwModify*)this ); - -SwClient* pLast = aIter.GoStart(); -if( pLast ) -{ -while( ( bRet = pLast-GetInfo( rInfo ) ) - nullptr != ( pLast = ++aIter ) ) -; -} -} - -return bRet; +if(!pRoot) +return true; +SwClientIter aIter( *const_castSwModify*(this) ); +for(aIter.GoStart(); aIter; ++aIter) +if(!aIter-GetInfo( rInfo )) +return false; +return true; } void SwModify::Add( SwClient* pDepend ) commit 3b4e5fd012be12478fed5c55f53cfd9cc4747a0e Author: Bjoern Michaelsen bjoern.michael...@canonical.com Date: Sun Mar 15 02:45:08 2015 +0100 get rid of SearchType - lets hope nobody counts on ModifyBroadcast having persistent sideeffects Change-Id: Ie85feb71732c4a81fba22db8cf62ec7fe30d0cfa diff --git
[Libreoffice-commits] core.git: 3 commits - sw/inc sw/source
sw/inc/IDocumentContentOperations.hxx |1 sw/inc/IDocumentMarkAccess.hxx |4 +- sw/source/core/access/accnotexthyperlink.hxx |2 - sw/source/core/access/accpara.cxx |2 - sw/source/core/crsr/annotationmark.cxx |7 +--- sw/source/core/doc/docbm.cxx |4 +- sw/source/core/fields/expfld.cxx |2 - sw/source/core/frmedt/fefly1.cxx |3 + sw/source/core/frmedt/feshview.cxx | 14 ++-- sw/source/core/inc/MarkManager.hxx |4 +- sw/source/core/inc/annotationmark.hxx |2 - sw/source/core/inc/wrong.hxx |4 +- sw/source/core/text/wrong.cxx |4 +- sw/source/core/unocore/unotextmarkup.cxx |2 - sw/source/filter/ww8/docxattributeoutput.cxx | 40 - sw/source/filter/ww8/ww8par5.cxx |7 +--- sw/source/uibase/misc/glosdoc.cxx | 10 +++--- sw/source/uibase/sidebar/PageMarginControl.cxx | 20 ++-- sw/source/uibase/sidebar/SwPanelFactory.cxx|4 +- sw/source/uibase/uiview/view2.cxx |2 - sw/source/uibase/utlui/navipi.cxx |2 - sw/source/uibase/wrtsh/wrtsh2.cxx |2 - 22 files changed, 74 insertions(+), 68 deletions(-) New commits: commit 15faeb4f9f111f7ea8d04fd64b3d065971cd4570 Author: Caolán McNamara caol...@redhat.com Date: Thu Jan 22 17:03:22 2015 + Resolves: fdo#87760 if we can't anchor at hidden text then... anchor to the page instead Change-Id: Ib7931fdd1c70e809ec442aeac125879980e20ec9 diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index 6923a71..b75bdae 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -1585,12 +1585,20 @@ bool SwFEShell::ImpEndCreate() GetLayout()-GetCrsrOfst( aPos, aPoint, aState ); // do not set in ReadnOnly-content -if( aPos.nNode.GetNode().IsProtect() ) +if (aPos.nNode.GetNode().IsProtect()) +{ // then only page bound. Or should we // search the next not-readonly position? bAtPage = true; +} -pAnch = aPos.nNode.GetNode().GetCntntNode()-getLayoutFrm( GetLayout(), aPoint, 0, false ); +SwCntntNode* pCNode = aPos.nNode.GetNode().GetCntntNode(); +pAnch = pCNode ? pCNode-getLayoutFrm( GetLayout(), aPoint, 0, false ) : NULL; +if (!pAnch) +{ +// Hidden content. Anchor to the page instead +bAtPage = true; +} if( !bAtPage ) { @@ -1636,7 +1644,7 @@ bool SwFEShell::ImpEndCreate() if( bAtPage ) { -pPage = pAnch-FindPageFrm(); +pPage = pAnch ? pAnch-FindPageFrm() : GetLayout()-GetPageAtPos(aPoint); aAnch.SetType( FLY_AT_PAGE ); aAnch.SetPageNum( pPage-GetPhyPageNum() ); commit ef3b6fa0cf3e4f2c7b29e9373a8afc8c2c7c7ca0 Author: Caolán McNamara caol...@redhat.com Date: Thu Jan 22 16:35:03 2015 + Related: fdo#87760 don't crash on searching for a place to put the anchor 1 press return in an empty writer doc a few times 2 insert a stock 2x2 table 4 enter A1 and change format-character to hidden A1 3 draw a rectangle above A1 so it'll get anchored to paragraph above table 5 draw rectangle anchor into A1 Change-Id: I2b0631908843150fae48f7e387a98e91cf90423d diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index 4426640..bdae991 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -430,7 +430,8 @@ Point SwFEShell::FindAnchorPos( const Point rAbsPos, bool bMoveIt ) if ( nAnchorId != FLY_AT_CHAR || !PosInsideInputFld( aPos ) ) { -pTxtFrm = aPos.nNode.GetNode().GetCntntNode()-getLayoutFrm( GetLayout(), 0, aPos, false ); +SwCntntNode* pCNode = aPos.nNode.GetNode().GetCntntNode(); +pTxtFrm = pCNode ? pCNode-getLayoutFrm(GetLayout(), 0, aPos, false) : NULL; } } const SwFrm *pNewAnch = NULL; commit 6d32df43353a083a1cd9cc90022b64205a5adaa7 Author: Caolán McNamara caol...@redhat.com Date: Thu Jan 22 16:07:54 2015 + ::rtl::OUString-OUString Change-Id: I68654a5fa4cbb7403c00b103e2be5929ccb516a2 diff --git a/sw/inc/IDocumentContentOperations.hxx b/sw/inc/IDocumentContentOperations.hxx index dbdcd72..2f956c6 100644 --- a/sw/inc/IDocumentContentOperations.hxx +++ b/sw/inc/IDocumentContentOperations.hxx @@ -22,7 +22,6 @@ #include sal/types.h #include rtl/ustring.hxx -using rtl::OUString; class SwPaM; struct SwPosition; diff --git a/sw/inc/IDocumentMarkAccess.hxx b/sw/inc/IDocumentMarkAccess.hxx index e7500fe..07af670 100644 --- a/sw/inc/IDocumentMarkAccess.hxx +++
[Libreoffice-commits] core.git: 3 commits - sw/inc sw/source
sw/inc/calbck.hxx|8 --- sw/inc/ring.hxx | 17 +++ sw/source/core/attr/calbck.cxx | 34 ++- sw/source/core/unocore/unotextmarkup.cxx |4 --- 4 files changed, 34 insertions(+), 29 deletions(-) New commits: commit 526e746c3a95ee1dfbdf222e61d28ccc5be3cc98 Author: Bjoern Michaelsen bjoern.michael...@canonical.com Date: Fri Dec 5 20:07:27 2014 +0100 ugly preliminary hack for keeping ggc 4.6 happy Change-Id: I41d605b5acbb54969d6b2cb68f06583983ee0d4b diff --git a/sw/inc/ring.hxx b/sw/inc/ring.hxx index 913d62a..b751733 100644 --- a/sw/inc/ring.hxx +++ b/sw/inc/ring.hxx @@ -27,6 +27,13 @@ #include boost/iterator/iterator_facade.hpp #include boost/intrusive/circular_list_algorithms.hpp +#if defined(__GNUC__) (__GNUC__ == 4) (__GNUC_MINOR__ 7) +// gcc 4.6 backwards compat hack, remove ASAP when we drop support +class SwPaM; +class SwViewShell; +class _SaveMergeRedlines; +#endif + namespace sw { template typename value_type class RingContainer; @@ -101,8 +108,18 @@ namespace sw static node_ptr get_previous(const_node_ptr n) { return const_castnode_ptr(static_castconst_node_ptr(n))-GetPrevInRing(); }; static void set_previous(node_ptr n, node_ptr previous) { n-pPrev = previous; }; }; +#if defined(__GNUC__) (__GNUC__ == 4) (__GNUC_MINOR__ 7) +// gcc 4.6 backwards compat hack, remove ASAP when we drop support +friend class sw::RingContainerSwPaM; +friend class sw::RingContainerconst SwPaM; +friend class sw::RingContainerSwViewShell; +friend class sw::RingContainerconst SwViewShell; +friend class sw::RingContainer_SaveMergeRedlines; +friend class sw::RingContainerconst _SaveMergeRedlines; +#else friend ring_container; friend const_ring_container; +#endif friend typename ring_container::iterator; friend typename ring_container::const_iterator; friend typename const_ring_container::iterator; commit 6cd053ebf2289fda4c5abd523db493d570ebb1c3 Author: Bjoern Michaelsen bjoern.michael...@canonical.com Date: Fri Dec 5 17:51:56 2014 +0100 since touching this: sprinkle in some nullptr Change-Id: I8a229e020acddfda2e7c69fc7faf24d1c338c879 diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx index a1193f7..a06bba2 100644 --- a/sw/source/core/attr/calbck.cxx +++ b/sw/source/core/attr/calbck.cxx @@ -23,12 +23,12 @@ #include swcache.hxx #include swfntcch.hxx -static SwClientIter* pClientIters = 0; +static SwClientIter* pClientIters = nullptr; TYPEINIT0( SwClient ); SwClient::SwClient( SwModify* pToRegisterIn ) -: pLeft( 0 ), pRight( 0 ), pRegisteredIn( 0 ) +: pLeft( nullptr ), pRight( nullptr ), pRegisteredIn( nullptr ) { if(pToRegisterIn) // connect to SwModify @@ -81,7 +81,7 @@ bool SwClient::GetInfo( SfxPoolItem ) const } SwModify::SwModify() -: SwClient(0), pRoot(0) +: SwClient(nullptr), pRoot(nullptr) { bModifyLocked = false; bLockClientList = false; @@ -91,7 +91,7 @@ SwModify::SwModify() } SwModify::SwModify( SwModify* pToRegisterIn ) -: SwClient( pToRegisterIn ), pRoot( 0 ) +: SwClient( pToRegisterIn ), pRoot( nullptr ) { bModifyLocked = false; bLockClientList = false; @@ -122,7 +122,7 @@ SwModify::~SwModify() SwClient* p = aIter.GoStart(); while ( p ) { -p-pRegisteredIn = 0; +p-pRegisteredIn = nullptr; p = ++aIter; } } @@ -195,7 +195,7 @@ bool SwModify::GetInfo( SfxPoolItem rInfo ) const if( pLast ) { while( ( bRet = pLast-GetInfo( rInfo ) ) - 0 != ( pLast = ++aIter ) ) + nullptr != ( pLast = ++aIter ) ) ; } } @@ -218,15 +218,15 @@ void SwModify::Add( SwClient* pDepend ) } #endif // deregister new client in case it is already registered elsewhere -if( pDepend-pRegisteredIn != 0 ) +if( pDepend-pRegisteredIn != nullptr ) pDepend-pRegisteredIn-Remove( pDepend ); if( !pRoot ) { // first client added pRoot = pDepend; -pRoot-pLeft = 0; -pRoot-pRight = 0; +pRoot-pLeft = nullptr; +pRoot-pRight = nullptr; } else { @@ -246,7 +246,7 @@ void SwModify::Add( SwClient* pDepend ) SwClient* SwModify::Remove( SwClient* pDepend ) { if ( bInDocDTOR ) -return 0; +return nullptr; if( pDepend-pRegisteredIn == this ) { @@ -275,8 +275,8 @@ SwClient* SwModify::Remove( SwClient* pDepend ) pTmp = pTmp-pNxtIter; } -pDepend-pLeft = 0; -pDepend-pRight =
[Libreoffice-commits] core.git: 3 commits - sw/inc sw/source
sw/inc/ndtxt.hxx |4 +++- sw/inc/node.hxx |2 +- sw/source/core/docnode/node.cxx | 23 +-- sw/source/core/docnode/nodes.cxx |2 +- sw/source/core/txtnode/ndtxt.cxx | 20 5 files changed, 30 insertions(+), 21 deletions(-) New commits: commit b75e052d31ec8854cad3bda7d372dcfcd50c9609 Author: Stephan Bergmann sberg...@redhat.com Date: Wed Aug 6 18:06:20 2014 +0200 Call SwTxtNode-specific part of DelFrms while SwTxtNode is still SwTxtNode ...when SwCntntNode::DelFrms is called from ~SwTxtNode - ~SwCntntNode. * SwCntntNode::DelFrms now needs a flag to distinguish calls from inside ~SwCntntNode from other calls. bIsDisposeAccTable happens to already serve that purpose, so I reused it, but that may be a bad idea from a semantic point of view? * ~SwTxtNode is careful to mimic old behavior and only calls DelFrms_TxtNodePart if GetDepends() is true; no idea whether that's really necessary, though. * Shifting the work done by DelFrms_TxtNodePart from within ~SwCntntNode to before ~SwTxtNode calls ~SwCntntNode hopefully has no negative consequences. Change-Id: I1532b4cfef7fbf9ba82e64b919a08cbefa335421 diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx index dfefc47..a46e8bc 100644 --- a/sw/inc/ndtxt.hxx +++ b/sw/inc/ndtxt.hxx @@ -72,7 +72,7 @@ typedef std::set sal_Int32 SwSoftPageBreakList; /// SwTxtNode is a paragraph in the document model. class SW_DLLPUBLIC SwTxtNode: public SwCntntNode, public ::sfx2::Metadatable { - +friend class SwCntntNode; /// For creating the first TextNode. friend class SwDoc; /// CTOR and AppendTxtNode() friend class SwNodes; @@ -181,6 +181,8 @@ class SW_DLLPUBLIC SwTxtNode: public SwCntntNode, public ::sfx2::Metadatable const SwTxtInputFld* GetOverlappingInputFld( const SwTxtAttr rTxtAttr ) const; +void DelFrms_TxtNodePart(); + public: bool IsWordCountDirty() const; bool IsWrongDirty() const; diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index 9338608..e7c8c6b 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -1284,19 +1284,9 @@ void SwCntntNode::DelFrms( bool bIsDisposeAccTable ) delete pFrm; } -if( IsTxtNode() ) +if( bIsDisposeAccTable IsTxtNode() ) { -((SwTxtNode*)this)-SetWrong( NULL ); -((SwTxtNode*)this)-SetWrongDirty( true ); - -((SwTxtNode*)this)-SetGrammarCheck( NULL ); -((SwTxtNode*)this)-SetGrammarCheckDirty( true ); - -((SwTxtNode*)this)-SetSmartTags( NULL ); -((SwTxtNode*)this)-SetSmartTagDirty( true ); - -((SwTxtNode*)this)-SetWordCountDirty( true ); -((SwTxtNode*)this)-SetAutoCompleteWordDirty( true ); +static_castSwTxtNode *(this)-DelFrms_TxtNodePart(); } } diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index b9c0821..8489f7c 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -262,6 +262,11 @@ SwTxtNode::~SwTxtNode() RemoveFromList(); InitSwParaStatistics( false ); + +if (GetDepends()) +{ +DelFrms_TxtNodePart(); +} } void SwTxtNode::FileLoadedInitHints() @@ -1309,6 +1314,21 @@ const SwTxtInputFld* SwTxtNode::GetOverlappingInputFld( const SwTxtAttr rTxtAtt return pTxtInputFld; } +void SwTxtNode::DelFrms_TxtNodePart() +{ +SetWrong( NULL ); +SetWrongDirty( true ); + +SetGrammarCheck( NULL ); +SetGrammarCheckDirty( true ); + +SetSmartTags( NULL ); +SetSmartTagDirty( true ); + +SetWordCountDirty( true ); +SetAutoCompleteWordDirty( true ); +} + SwTxtFld* SwTxtNode::GetFldTxtAttrAt( const sal_Int32 nIndex, const bool bIncludeInputFldAtStart ) const commit 48c90eb75f4610480be28ecad48953143c7f297a Author: Stephan Bergmann sberg...@redhat.com Date: Wed Aug 6 17:36:25 2014 +0200 SwCntntNode::DelFrms already checks for GetDepends() Change-Id: I9f7ccd372a570dc4dea98983c51419dce83f8be8 diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index 1628967..9338608 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -912,8 +912,7 @@ SwCntntNode::~SwCntntNode() { // The base class SwClient of SwFrm excludes itself from the dependency list! // Thus, we need to delete all Frames in the dependency list. -if( GetDepends() ) -DelFrms(false); +DelFrms(false); delete pCondColl; commit 02e462f5b15ff5ca00992349fdbc79689ccb3863 Author: Stephan Bergmann sberg...@redhat.com Date: Wed Aug 6 17:35:26 2014 +0200 Remove unused bNeedDel parameter to SwCntntNode::DelFrms Change-Id: Iedc5e8caafda868db853fdf328fbdc99bbf28e20 diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx index 4de9d18..d58da5c 100644 --- a/sw/inc/node.hxx
[Libreoffice-commits] core.git: 3 commits - sw/inc sw/source
sw/inc/cmdid.h |1 sw/inc/unoprnms.hxx | 104 ++-- sw/source/core/unocore/unostyle.cxx | 49 3 files changed, 53 insertions(+), 101 deletions(-) New commits: commit 7a361dc2aa02b7518c83ba5ca5d3c687c3de6cff Author: Michael Stahl mst...@redhat.com Date: Wed Jul 2 17:20:28 2014 +0200 sw: SwXAutoStyle::mpSet is read-only ... because it is an alias to the item set that is stored in the core auto-style cache, which must _not_ be modified. So remove the implementation of SwXAutoStyle::setPropertiesToDefault(). (regression from commit 7d9bb549d498d6beed2c4050c402d09643febdfa) Change-Id: If529862d14a1c1e700ac898964560f386bf488f8 diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 4c13a5c..8e75c49 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -4869,56 +4869,9 @@ void SwXAutoStyle::setAllPropertiesToDefault( ) } void SwXAutoStyle::setPropertiesToDefault( -const uno::Sequence OUString rPropertyNames ) +const uno::Sequence OUString /*rPropertyNames*/ ) throw (beans::UnknownPropertyException, uno::RuntimeException, std::exception) { -if( !mpSet.get() ) -{ -throw uno::RuntimeException(); -} - -const bool bTakeCareOfDrawingLayerFillStyle(IStyleAccess::AUTO_STYLE_PARA == meFamily); - -if(!bTakeCareOfDrawingLayerFillStyle) -{ -return; -} - -// support DrawingLayer FillStyle slots from here on -SolarMutexGuard aGuard; -const OUString* pNames = rPropertyNames.getConstArray(); -sal_Int8 nPropSetId = PROPERTY_MAP_CHAR_AUTO_STYLE; - -switch(meFamily) -{ -case IStyleAccess::AUTO_STYLE_CHAR : nPropSetId = PROPERTY_MAP_CHAR_AUTO_STYLE; break; -case IStyleAccess::AUTO_STYLE_RUBY : nPropSetId = PROPERTY_MAP_RUBY_AUTO_STYLE; break; -case IStyleAccess::AUTO_STYLE_PARA : nPropSetId = PROPERTY_MAP_PARA_AUTO_STYLE; break; -default: ; -} - -const SfxItemPropertySet* pPropSet = aSwMapProvider.GetPropertySet(nPropSetId); -const SfxItemPropertyMap rMap = pPropSet-getPropertyMap(); - -for(sal_Int32 i = 0; i rPropertyNames.getLength(); i++) -{ -const OUString rPropName = pNames[i]; -const SfxItemPropertySimpleEntry* pEntry = rMap.getByName(rPropName); - -if(!pEntry) -{ -throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( Unknown property: ) ) + rPropName, static_cast cppu::OWeakObject * ( this ) ); -} - -switch(pEntry-nWID) -{ -case OWN_ATTR_FILLBMP_MODE: -{ -mpSet-ClearItem(XATTR_FILLBMP_STRETCH); -mpSet-ClearItem(XATTR_FILLBMP_TILE); -} -} -} } uno::Sequence uno::Any SwXAutoStyle::getPropertyDefaults( commit 79677440c88b269c7fef53b3c43f30e357050402 Author: Michael Stahl mst...@redhat.com Date: Wed Jul 2 17:17:46 2014 +0200 sw: clean up over-abstracted string constants Grepping for a property name should find something. Change-Id: I908d514d5dcfd16951ebbb0157a6af9646e6db53 diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx index 1974304..863b5ce 100644 --- a/sw/inc/unoprnms.hxx +++ b/sw/inc/unoprnms.hxx @@ -663,59 +663,59 @@ #define UNO_NAME_SW_FILLTRANSPARENCEGRADIENTNAME UNO_NAME_FILLTRANSPARENCEGRADIENTNAME #define UNO_NAME_SW_FILLCOLOR_2 UNO_NAME_FILLCOLOR_2 -#define UNO_NAME_HEADER_FILLBMP_LOGICAL_SIZE Header UNO_NAME_FILLBMP_LOGICAL_SIZE -#define UNO_NAME_HEADER_FILLBMP_OFFSET_X Header UNO_NAME_FILLBMP_OFFSET_X -#define UNO_NAME_HEADER_FILLBMP_OFFSET_Y Header UNO_NAME_FILLBMP_OFFSET_Y -#define UNO_NAME_HEADER_FILLBMP_POSITION_OFFSET_X Header UNO_NAME_FILLBMP_POSITION_OFFSET_X -#define UNO_NAME_HEADER_FILLBMP_POSITION_OFFSET_Y Header UNO_NAME_FILLBMP_POSITION_OFFSET_Y -#define UNO_NAME_HEADER_FILLBMP_RECTANGLE_POINT Header UNO_NAME_FILLBMP_RECTANGLE_POINT -#define UNO_NAME_HEADER_FILLBMP_SIZE_X Header UNO_NAME_FILLBMP_SIZE_X -#define UNO_NAME_HEADER_FILLBMP_SIZE_Y Header UNO_NAME_FILLBMP_SIZE_Y -#define UNO_NAME_HEADER_FILLBMP_STRETCH Header UNO_NAME_FILLBMP_STRETCH -#define UNO_NAME_HEADER_FILLBMP_TILE Header UNO_NAME_FILLBMP_TILE -#define UNO_NAME_HEADER_FILLBMP_MODE Header UNO_NAME_FILLBMP_MODE -#define UNO_NAME_HEADER_FILLCOLOR Header UNO_NAME_FILLCOLOR -#define UNO_NAME_HEADER_FILLBACKGROUND Header UNO_NAME_FILLBACKGROUND -#define UNO_NAME_HEADER_FILLBITMAP Header UNO_NAME_FILLBITMAP -#define UNO_NAME_HEADER_FILLBITMAPNAME Header UNO_NAME_FILLBITMAPNAME -#define UNO_NAME_HEADER_FILLBITMAPURL Header UNO_NAME_FILLBITMAPURL -#define UNO_NAME_HEADER_FILLGRADIENTSTEPCOUNT Header UNO_NAME_FILLGRADIENTSTEPCOUNT -#define UNO_NAME_HEADER_FILLGRADIENT Header UNO_NAME_FILLGRADIENT -#define UNO_NAME_HEADER_FILLGRADIENTNAME
[Libreoffice-commits] core.git: 3 commits - sw/inc sw/source
sw/inc/doc.hxx |6 ++ sw/source/core/attr/swatrset.cxx|6 ++ sw/source/core/doc/docdesc.cxx | 34 +- sw/source/core/doc/docfmt.cxx |5 ++--- sw/source/core/doc/docnew.cxx | 10 ++ sw/source/core/doc/poolfmt.cxx |4 +--- sw/source/core/frmedt/fedesc.cxx|2 +- sw/source/core/unocore/unostyle.cxx |5 ++--- sw/source/core/view/vprint.cxx |2 +- sw/source/filter/ww1/fltshell.cxx |8 +++- sw/source/filter/ww8/rtfexport.cxx |3 +-- sw/source/filter/ww8/ww8par.cxx |3 +-- sw/source/filter/xml/xmlfmt.cxx |2 +- sw/source/uibase/app/docstyle.cxx | 22 +- sw/source/uibase/dbui/dbmgr.cxx | 11 +-- 15 files changed, 42 insertions(+), 81 deletions(-) New commits: commit e7441f2e19dbfbc28438badb59d107f0e3068390 Author: Jan Holesovsky ke...@collabora.com Date: Tue Jun 24 19:40:25 2014 +0200 pagedesc: We have DelPageDesc() that takes OUString as param directly. Change-Id: I616f89716a6e337c647cfb880a4e675cd1b65993 diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx index fa169f2..1ca2960 100644 --- a/sw/source/uibase/app/docstyle.cxx +++ b/sw/source/uibase/app/docstyle.cxx @@ -2301,9 +2301,7 @@ void SwDocStyleSheetPool::Remove( SfxStyleSheetBase* pStyle) break; case SFX_STYLE_FAMILY_PAGE : { -sal_uInt16 nPos; -if (rDoc.FindPageDesc(sName, nPos)) -rDoc.DelPageDesc(nPos); +rDoc.DelPageDesc(sName); } break; commit c1be76ec98cb465e07df961843134147100beaa9 Author: Jan Holesovsky ke...@collabora.com Date: Tue Jun 24 17:32:28 2014 +0200 pagedesc: Consolidate FindPageDescByName() and FindPageDesc(). Change-Id: I18d570509cd3f3b65a19a12a9df0b1d5db901d04 diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 95eda38..75eac11 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -1170,8 +1170,7 @@ public: sal_uInt16 GetPageDescCnt() const { return maPageDescs.size(); } const SwPageDesc GetPageDesc( const sal_uInt16 i ) const { return *maPageDescs[i]; } SwPageDesc GetPageDesc( sal_uInt16 i ) { return *maPageDescs[i]; } -SwPageDesc* FindPageDescByName( const OUString rName, -sal_uInt16* pPos = 0 ) const; +SwPageDesc* FindPageDesc(const OUString rName, sal_uInt16* pPos = NULL) const; /** Copy the complete PageDesc - beyond document and deep! Optionally copying of PoolFmtId, -HlpId can be prevented. */ @@ -1192,7 +1191,6 @@ public: SwPageDesc * GetPageDesc( const OUString rName ); void ChgPageDesc( const OUString rName, const SwPageDesc ); void ChgPageDesc( sal_uInt16 i, const SwPageDesc ); -bool FindPageDesc( const OUString rName, sal_uInt16 * pFound ); void DelPageDesc( const OUString rName, bool bBroadcast = false); void DelPageDesc( sal_uInt16 i, bool bBroadcast = false ); void PreDelPageDesc(SwPageDesc * pDel); diff --git a/sw/source/core/attr/swatrset.cxx b/sw/source/core/attr/swatrset.cxx index 37cbe3b..6d2eef2 100644 --- a/sw/source/core/attr/swatrset.cxx +++ b/sw/source/core/attr/swatrset.cxx @@ -386,8 +386,7 @@ void SwAttrSet::CopyToModify( SwModify rMod ) const { SfxItemSet aTmpSet( *this ); -SwPageDesc* pDstPgDesc = pDstDoc-FindPageDescByName( -pPgDesc-GetName() ); +SwPageDesc* pDstPgDesc = pDstDoc-FindPageDesc(pPgDesc-GetName()); if( !pDstPgDesc ) { pDstPgDesc = pDstDoc-MakePageDesc(pPgDesc-GetName()); diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx index 63174e0..108dae5 100644 --- a/sw/source/core/doc/docdesc.cxx +++ b/sw/source/core/doc/docdesc.cxx @@ -632,9 +632,9 @@ SwPageDesc* SwDoc::MakePageDesc(const OUString rName, const SwPageDesc *pCpy, return pNew; } -SwPageDesc* SwDoc::FindPageDescByName( const OUString rName, sal_uInt16* pPos ) const +SwPageDesc* SwDoc::FindPageDesc(const OUString rName, sal_uInt16* pPos) const { -SwPageDesc* pRet = 0; +SwPageDesc* pRet = NULL; if( pPos ) *pPos = USHRT_MAX; for( sal_uInt16 n = 0, nEnd = maPageDescs.size(); n nEnd; ++n ) @@ -774,33 +774,9 @@ IMPL_LINK( SwDoc, DoUpdateModifiedOLE, Timer *, ) return 0; } -bool SwDoc::FindPageDesc( const OUString rName, sal_uInt16 * pFound) -{ -bool bResult = false; -sal_uInt16 nI; -for (nI = 0; nI maPageDescs.size(); nI++) -{ -if (maPageDescs[nI]-GetName() == rName) -{ -*pFound = nI; -bResult = true; -break; -} -} - -return bResult; -} - SwPageDesc * SwDoc::GetPageDesc( const OUString rName ) { -SwPageDesc * aResult = NULL; - -sal_uInt16 nI; - -if
[Libreoffice-commits] core.git: 3 commits - sw/inc sw/source writerfilter/source
sw/inc/pagedesc.hxx |1 + sw/source/core/doc/docdesc.cxx|2 +- sw/source/core/unocore/unostyle.cxx | 18 +- writerfilter/source/ooxml/OOXMLFastContextHandler.cxx |6 +++--- writerfilter/source/ooxml/OOXMLFastContextHandler.hxx |2 +- 5 files changed, 15 insertions(+), 14 deletions(-) New commits: commit 295b97b2a654e00ac5a8e6a3545284fa583fce78 Author: Michael Meeks michael.me...@collabora.com Date: Fri Jun 20 13:50:32 2014 +0100 fdo#76260 - Switch from vector to std::stack. std::stack uses std::deque which is extremely expensive for this case. This change saves 43bn of 98bn cycles spent in createFastChildContext. Change-Id: I63919a9826563171f128e09d7206ac6cfdde336f diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx index cc20804..b89a5cf 100644 --- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx +++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx @@ -179,7 +179,7 @@ bool OOXMLFastContextHandler::prepareMceContext(Token_t nElement, const uno::Ref m_bDiscardChildren = false; aState.m_bTookChoice = m_bTookChoice; m_bTookChoice = false; -m_aSavedAlternateStates.push(aState); +m_aSavedAlternateStates.push_back(aState); } break; case OOXML_Choice: @@ -241,8 +241,8 @@ throw (uno::RuntimeException, xml::sax::SAXException, std::exception) m_bDiscardChildren = false; else if (Element == (NS_mce | OOXML_AlternateContent)) { -SavedAlternateState aState(m_aSavedAlternateStates.top()); -m_aSavedAlternateStates.pop(); +SavedAlternateState aState(m_aSavedAlternateStates.back()); +m_aSavedAlternateStates.pop_back(); m_bDiscardChildren = aState.m_bDiscardChildren; m_bTookChoice = aState.m_bTookChoice; } diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx index 053985d..88b1b80 100644 --- a/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx +++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx @@ -290,7 +290,7 @@ private: uno::Reference uno::XComponentContext m_xContext; bool m_bDiscardChildren; bool m_bTookChoice; /// Did we take the Choice or want Fallback instead? -std::stackSavedAlternateState m_aSavedAlternateStates; +std::vectorSavedAlternateState m_aSavedAlternateStates; static sal_uInt32 mnInstanceCount; commit 9e5e9dd1b276043d2e9f45c01d72b2e89d8abdf2 Author: Michael Meeks michael.me...@collabora.com Date: Thu Jun 19 22:34:55 2014 +0100 fdo#76260 - a better approach for getting element names. Don't do lots more work than we need to to build the list of names. It appears that the [] operator does a lot of apparently un-necessary work. Change-Id: Id603fb4e717dc7130468465493edccfe51d384c7 diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index c3e94f9..5e2ba64 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -70,6 +70,7 @@ #include comphelper/servicehelper.hxx #include cppuhelper/supportsservice.hxx +#include comphelper/sequenceasvector.hxx // #include unobrushitemhelper.hxx @@ -788,23 +789,22 @@ uno::Any SwXStyleFamily::getByName(const OUString rName) uno::Sequence OUString SwXStyleFamily::getElementNames(void) throw( uno::RuntimeException, std::exception ) { SolarMutexGuard aGuard; -uno::Sequence OUString aRet; +comphelper::SequenceAsVector OUString aRet; if(pBasePool) { -SfxStyleSheetIteratorPtr pIterator = pBasePool-CreateIterator(eFamily, SFXSTYLEBIT_ALL); -const sal_uInt16 nCount = pIterator-Count(); -aRet.realloc(nCount); -OUString* pArray = aRet.getArray(); +SfxStyleSheetIteratorPtr pIt = pBasePool-CreateIterator(eFamily, SFXSTYLEBIT_ALL); OUString aString; -for(sal_uInt16 i = 0; i nCount; i++) +for (SfxStyleSheetBase* pStyle = pIt-First(); pStyle; pStyle = pIt-Next()) { -SwStyleNameMapper::FillProgName((*pIterator)[i]-GetName(), aString, lcl_GetSwEnumFromSfxEnum ( eFamily ), true ); -pArray[i] = aString; +SwStyleNameMapper::FillProgName(pStyle-GetName(), aString, +lcl_GetSwEnumFromSfxEnum ( eFamily ), true); +aRet.push_back(aString); } } else throw uno::RuntimeException(); -return aRet; + +return aRet.getAsConstList(); } sal_Bool SwXStyleFamily::hasByName(const OUString rName) throw( uno::RuntimeException, std::exception ) commit 78378af1d404baf78f42930a29dbf8eae22bbe80 Author: Michael Meeks
[Libreoffice-commits] core.git: 3 commits - sw/inc sw/source
sw/inc/textboxhelper.hxx | 17 ++ sw/source/core/doc/doclay.cxx|9 - sw/source/core/doc/textboxhelper.cxx | 58 +++ sw/source/core/docnode/ndcopy.cxx| 28 +++- 4 files changed, 87 insertions(+), 25 deletions(-) New commits: commit da22fb668d21d20432232034cd54af509ded1bbf Author: Miklos Vajna vmik...@collabora.co.uk Date: Fri Jun 13 10:32:46 2014 +0200 SwTextBoxHelper::syncProperty: handle FN_TEXT_RANGE The TextRange property of a shape is its anchor position: if that's adjusted, then also set the textbox's RES_ANCHOR to the new position. Without this, e.g. shapes anchored in headers have their textboxes anchored in the body text, CppunitTest_sw_ooxmlexport's testfdo78420 is a reproducer. Change-Id: I83ed09875c3f0360c581c331507ad2b9d05ffb3a diff --git a/sw/source/core/doc/textboxhelper.cxx b/sw/source/core/doc/textboxhelper.cxx index eac7e57..06bc0e0 100644 --- a/sw/source/core/doc/textboxhelper.cxx +++ b/sw/source/core/doc/textboxhelper.cxx @@ -10,6 +10,7 @@ #include textboxhelper.hxx #include frmfmt.hxx #include fmtcntnt.hxx +#include fmtanchr.hxx #include doc.hxx #include docsh.hxx #include docary.hxx @@ -19,6 +20,7 @@ #include unotextbodyhf.hxx #include unotextrange.hxx #include unomid.h +#include cmdid.h #include unoprnms.hxx #include dflyobj.hxx #include mvsave.hxx @@ -336,6 +338,19 @@ void SwTextBoxHelper::syncProperty(SwFrmFmt* pShape, sal_uInt16 nWID, sal_uInt8 break; } break; +case FN_TEXT_RANGE: +{ +uno::Referencetext::XTextRange xRange; +rValue = xRange; +SwUnoInternalPaM aInternalPaM(*pFmt-GetDoc()); +if (sw::XTextRangeToSwPaM(aInternalPaM, xRange)) +{ +SwFmtAnchor aAnchor(pFmt-GetAnchor()); +aAnchor.SetAnchor(aInternalPaM.Start()); +pFmt-SetFmtAttr(aAnchor); +} +} +break; } if (!aPropertyName.isEmpty()) commit 02f2d886c897a286b875f9053052061fe0b357fd Author: Miklos Vajna vmik...@collabora.co.uk Date: Fri Jun 13 09:29:12 2014 +0200 SwDoc::CopyFlyInFlyImpl: factor out textbox code into SwTextBoxHelper Also, let the new SwTextBoxHelper::restoreLinks() restore also the RES_CNTNT of the *old* draw formats, not only the link between the new draw and fly formats. This allows properly preserving the link between draw and fly formats, when they are in the header (and so copied in and out variously). Change-Id: I101ff06533e2ea27abea8bed171ed69c9649ebe8 diff --git a/sw/inc/textboxhelper.hxx b/sw/inc/textboxhelper.hxx index 2bb791f..50024e1 100644 --- a/sw/inc/textboxhelper.hxx +++ b/sw/inc/textboxhelper.hxx @@ -11,6 +11,9 @@ #define INCLUDED_SW_INC_TEXTBOXHELPER_HXX #include list +#include map +#include set +#include vector #include com/sun/star/drawing/XShape.hpp #include com/sun/star/uno/Any.h @@ -21,8 +24,11 @@ class SdrPage; class SwFrmFmt; +class SwFrmFmts; +class SwFmtCntnt; class SwDoc; class Rectangle; +class _ZSortFly; /** * A TextBox is a TextFrame, that is tied to a drawinglayer shape. @@ -33,6 +39,10 @@ class Rectangle; class SW_DLLPUBLIC SwTextBoxHelper { public: +/// Maps a draw format to a fly format. +typedef std::mapconst SwFrmFmt*, const SwFrmFmt* SavedLink; +/// Maps a draw format to content. +typedef std::mapconst SwFrmFmt*, SwFmtCntnt SavedContent; /// Create a TextBox for a shape. static void create(SwFrmFmt* pShape); /// Destroy a TextBox for a shape. @@ -57,6 +67,13 @@ public: static sal_Int32 getCount(SdrPage* pPage, std::listSwFrmFmt* rTextBoxes); /// Get a shape by index, excluding TextBoxes. static css::uno::Any getByIndex(SdrPage* pPage, sal_Int32 nIndex, std::listSwFrmFmt* rTextBoxes) throw(css::lang::IndexOutOfBoundsException); + +/// Saves the current shape - textbox links in a map, so they can be restored later. +static void saveLinks(const SwFrmFmts rFormats, std::mapconst SwFrmFmt*, const SwFrmFmt* rLinks); +/// Reset the shape - textbox link on the shape, and save it to the map, so it can be restored later. +static void resetLink(SwFrmFmt* pShape, std::mapconst SwFrmFmt*, SwFmtCntnt rOldContent); +/// Undo the effect of saveLinks() + individual resetLink() calls. +static void restoreLinks(std::set_ZSortFly rOld, std::vectorSwFrmFmt* rNew, SavedLink rSavedLinks, SavedContent rResetContent); }; #endif // INCLUDED_SW_INC_TEXTBOXHELPER_HXX diff --git a/sw/source/core/doc/textboxhelper.cxx b/sw/source/core/doc/textboxhelper.cxx index 598d4b8..eac7e57 100644 --- a/sw/source/core/doc/textboxhelper.cxx +++ b/sw/source/core/doc/textboxhelper.cxx @@ -21,6 +21,7 @@ #include unomid.h #include unoprnms.hxx #include
[Libreoffice-commits] core.git: 3 commits - sw/inc sw/source writerfilter/source
sw/inc/fmtornt.hxx | 24 ++-- sw/source/core/docnode/swbaslnk.cxx |2 sw/source/core/layout/atrfrm.cxx | 28 ++--- writerfilter/source/ooxml/checkmodel.xsl | 155 --- 4 files changed, 27 insertions(+), 182 deletions(-) New commits: commit 35a01cb86ae0e91fb4aea1f99ed9158af2b2b202 Author: Miklos Vajna vmik...@collabora.co.uk Date: Sat May 31 21:18:12 2014 +0200 coverity#1078573 Unchecked dynamic_cast Change-Id: I59d179b2b9ad19de1be2bae517201be038f32c33 diff --git a/sw/source/core/docnode/swbaslnk.cxx b/sw/source/core/docnode/swbaslnk.cxx index 8c2bafe..df2476c 100644 --- a/sw/source/core/docnode/swbaslnk.cxx +++ b/sw/source/core/docnode/swbaslnk.cxx @@ -130,7 +130,7 @@ static void lcl_CallModify( SwGrfNode rGrfNd, SfxPoolItem rItem ) if( pCntntNode-IsGrfNode() ) { -SwGrfNode* pSwGrfNode = dynamic_cast SwGrfNode* (pCntntNode); +SwGrfNode* pSwGrfNode = pCntntNode-GetGrfNode(); OSL_ENSURE(pSwGrfNode, Error, pSwGrfNode expected when node answers IsGrfNode() with true (!)); const GraphicObject rGrfObj = pSwGrfNode-GetGrfObj(); commit 6dcc46af5a47cef1f6e52835f3e8ebd17a0be234 Author: Miklos Vajna vmik...@collabora.co.uk Date: Sat May 31 21:16:26 2014 +0200 SwFmtVertOrient: rename member variables missing their prefixes Change-Id: I83922fa1abe7830b12fcd811c9391ae8fff853c9 diff --git a/sw/inc/fmtornt.hxx b/sw/inc/fmtornt.hxx index 2e7e01b..bd97bad 100644 --- a/sw/inc/fmtornt.hxx +++ b/sw/inc/fmtornt.hxx @@ -32,9 +32,9 @@ class IntlWrapper; class SW_DLLPUBLIC SwFmtVertOrient: public SfxPoolItem { -SwTwips nYPos; /// Contains *always* the current RelPos. -sal_Int16 eOrient; -sal_Int16 eRelation; +SwTwips m_nYPos; /// Contains *always* the current RelPos. +sal_Int16 m_eOrient; +sal_Int16 m_eRelation; public: TYPEINFO_OVERRIDE(); SwFmtVertOrient( SwTwips nY = 0, sal_Int16 eVert = com::sun::star::text::VertOrientation::NONE, @@ -55,13 +55,13 @@ public: SvStream Store(SvStream rStream, sal_uInt16 itemVersion) const SAL_OVERRIDE; SfxPoolItem* Create(SvStream rStream, sal_uInt16 itemVersion) const SAL_OVERRIDE; -sal_Int16 GetVertOrient() const { return eOrient; } -sal_Int16 GetRelationOrient() const { return eRelation; } -void SetVertOrient( sal_Int16 eNew ) { eOrient = eNew; } -void SetRelationOrient( sal_Int16 eNew ) { eRelation = eNew; } +sal_Int16 GetVertOrient() const { return m_eOrient; } +sal_Int16 GetRelationOrient() const { return m_eRelation; } +void SetVertOrient( sal_Int16 eNew ) { m_eOrient = eNew; } +void SetRelationOrient( sal_Int16 eNew ) { m_eRelation = eNew; } -SwTwips GetPos() const { return nYPos; } -voidSetPos( SwTwips nNew ) { nYPos = nNew; } +SwTwips GetPos() const { return m_nYPos; } +voidSetPos( SwTwips nNew ) { m_nYPos = nNew; } }; class SW_DLLPUBLIC SwFmtHoriOrient: public SfxPoolItem @@ -101,9 +101,9 @@ public: inline SwFmtVertOrient SwFmtVertOrient::operator=( const SwFmtVertOrient rCpy ) { -nYPos = rCpy.GetPos(); -eOrient = rCpy.GetVertOrient(); -eRelation = rCpy.GetRelationOrient(); +m_nYPos = rCpy.GetPos(); +m_eOrient = rCpy.GetVertOrient(); +m_eRelation = rCpy.GetRelationOrient(); return *this; } inline SwFmtHoriOrient SwFmtHoriOrient::operator=( const SwFmtHoriOrient rCpy ) diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index aa40d45..fa5a4d0 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -1199,11 +1199,11 @@ bool SwFmtSurround::PutValue( const uno::Any rVal, sal_uInt8 nMemberId ) SvStream SwFmtVertOrient::Store(SvStream rStream, sal_uInt16 /*version*/) const { #if SAL_TYPES_SIZEOFLONG == 8 -rStream.WriteInt64(nYPos); +rStream.WriteInt64(m_nYPos); #else -rStream.WriteInt32(nYPos); +rStream.WriteInt32(m_nYPos); #endif -rStream.WriteInt16( eOrient ).WriteInt16( eRelation ); +rStream.WriteInt16( m_eOrient ).WriteInt16( m_eRelation ); return rStream; } @@ -1230,22 +1230,22 @@ SfxPoolItem* SwFmtVertOrient::Create(SvStream rStream, sal_uInt16 /*itemVersion SwFmtVertOrient::SwFmtVertOrient( SwTwips nY, sal_Int16 eVert, sal_Int16 eRel ) : SfxPoolItem( RES_VERT_ORIENT ), -nYPos( nY ), -eOrient( eVert ), -eRelation( eRel ) +m_nYPos( nY ), +m_eOrient( eVert ), +m_eRelation( eRel ) {} bool SwFmtVertOrient::operator==( const SfxPoolItem rAttr ) const { OSL_ENSURE( SfxPoolItem::operator==( rAttr ), not the same attributes ); -return ( nYPos == ((SwFmtVertOrient)rAttr).nYPos - eOrient == ((SwFmtVertOrient)rAttr).eOrient - eRelation == ((SwFmtVertOrient)rAttr).eRelation ); +return ( m_nYPos ==
[Libreoffice-commits] core.git: 3 commits - sw/inc sw/source
sw/inc/textboxhelper.hxx |3 +++ sw/source/core/doc/textboxhelper.cxx | 17 - sw/source/core/docnode/nodedump.cxx |1 + sw/source/core/text/porfly.cxx | 30 ++ 4 files changed, 46 insertions(+), 5 deletions(-) New commits: commit 9fa68f05e1678a0d3d941611fe9616b7191b1f03 Author: Miklos Vajna vmik...@collabora.co.uk Date: Wed May 28 15:39:33 2014 +0200 SwFlyCntPortion::SetBase: adjust position of the textbox if necessary In case of inline shapes, it's not possible to just copy the AnchorType property of the shape to the textbox, as we want the textbox at the expected position, not inline. OTOH, an inline shape has an implicit position, so we can't position its textbox at import-time. Solve the problem by setting the position of the textbox as we create the layout of the inline shape. Change-Id: I425ff5e0760858ebcbe457ed0ce9e4977ae8bc74 diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx index 5fb22df..d848bc1 100644 --- a/sw/source/core/text/porfly.cxx +++ b/sw/source/core/text/porfly.cxx @@ -24,6 +24,7 @@ #include rootfrm.hxx #include frmfmt.hxx #include viewsh.hxx +#include textboxhelper.hxx #include vcl/outdev.hxx #include editeng/lrspitem.hxx @@ -351,6 +352,35 @@ void SwFlyCntPortion::SetBase( const SwTxtFrm rFrm, const Point rBase, aObjPositioning.CalcPosition(); } +SwFrmFmt* pShape = FindFrmFmt(pSdrObj); +const SwFmtAnchor rAnchor(pShape-GetAnchor()); +if (rAnchor.GetAnchorId() == FLY_AS_CHAR) +{ +// This is an inline draw shape, see if it has a textbox. +SwFrmFmt* pTextBox = SwTextBoxHelper::findTextBox(pShape); +if (pTextBox) +{ +// It has, so look up its text rectangle, and adjust the position +// of the textbox accordingly. +Rectangle aTextRectangle = SwTextBoxHelper::getTextRectangle(pShape); + +SwFmtHoriOrient aHori(pTextBox-GetHoriOrient()); +aHori.SetHoriOrient(css::text::HoriOrientation::NONE); +sal_Int32 nLeft = aTextRectangle.getX() - rFrm.Frm().Left(); +aHori.SetPos(nLeft); + +SwFmtVertOrient aVert(pTextBox-GetVertOrient()); +aVert.SetVertOrient(css::text::VertOrientation::NONE); +sal_Int32 nTop = aTextRectangle.getY() - rFrm.Frm().Top() - nFlyAsc; +aVert.SetPos(nTop); + +pTextBox-LockModify(); +pTextBox-SetFmtAttr(aHori); +pTextBox-SetFmtAttr(aVert); +pTextBox-UnlockModify(); +} +} + SetAlign( aObjPositioning.GetLineAlignment() ); aRef = aObjPositioning.GetAnchorPos(); commit 31c4c834b84d3cadcba43eeaa9a6da7debb63de0 Author: Miklos Vajna vmik...@collabora.co.uk Date: Wed May 28 15:35:33 2014 +0200 SwTextBoxHelper: extract getTextRectangle() from syncProperty() Change-Id: I6265247593571ffba4cbda7f87bdde1e943aff51 diff --git a/sw/inc/textboxhelper.hxx b/sw/inc/textboxhelper.hxx index 28f8d71..747e729 100644 --- a/sw/inc/textboxhelper.hxx +++ b/sw/inc/textboxhelper.hxx @@ -19,6 +19,7 @@ class SdrPage; class SwFrmFmt; class SwDoc; +class Rectangle; /** * A TextBox is a TextFrame, that is tied to a drawinglayer shape. @@ -39,6 +40,8 @@ public: static void syncProperty(SwFrmFmt* pShape, sal_uInt16 nWID, sal_uInt8 nMemberID, const OUString rPropertyName, const css::uno::Any rValue); /// If we have an associated TextFrame, then return that. static SwFrmFmt* findTextBox(SwFrmFmt* pShape); +/// Return the textbox rectangle of a draw shape (absolute values, in twips). +static Rectangle getTextRectangle(SwFrmFmt* pShape); /// Look up TextFrames in a document, which are in fact TextBoxes. static std::listSwFrmFmt* findTextBoxes(const SwDoc* pDoc); diff --git a/sw/source/core/doc/textboxhelper.cxx b/sw/source/core/doc/textboxhelper.cxx index 3e64261..7735de5 100644 --- a/sw/source/core/doc/textboxhelper.cxx +++ b/sw/source/core/doc/textboxhelper.cxx @@ -192,6 +192,16 @@ uno::Any SwTextBoxHelper::queryInterface(SwFrmFmt* pShape, const uno::Type rTyp return aRet; } +Rectangle SwTextBoxHelper::getTextRectangle(SwFrmFmt* pShape) +{ +Rectangle aRet; +aRet.SetEmpty(); +SdrObjCustomShape* pCustomShape = dynamic_castSdrObjCustomShape*(pShape-FindRealSdrObject()); +if (pCustomShape) +pCustomShape-GetTextBounds(aRet); +return aRet; +} + void SwTextBoxHelper::syncProperty(SwFrmFmt* pShape, sal_uInt16 nWID, sal_uInt8 nMemberId, const OUString rPropertyName, const css::uno::Any rValue) { // No shape yet? Then nothing to do, initial properties are set by create(). @@ -260,12 +270,9 @@ void SwTextBoxHelper::syncProperty(SwFrmFmt* pShape, sal_uInt16 nWID, sal_uInt8 // Position/size should be the text position/size, not the shape one as-is. if (bAdjustX ||
[Libreoffice-commits] core.git: 3 commits - sw/inc sw/source writerfilter/source
sw/inc/fmtflcnt.hxx |6 sw/source/core/doc/docbm.cxx| 22 writerfilter/source/ooxml/dummyannotate.xsl | 833 3 files changed, 19 insertions(+), 842 deletions(-) New commits: commit 2013d184f1cf5928fa4a919d1521c1ae7b053796 Author: Miklos Vajna vmik...@collabora.co.uk Date: Mon May 26 17:08:54 2014 +0200 coverity#1158084 Unchecked dynamic_cast Change-Id: Ia800e45166b0206377fa9e138c4e444e476e3863 diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index dc54734..5aa68f1 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -1906,19 +1906,25 @@ void _RestoreCntntIdx(std::vectorsal_uLong rSaveArr, case 0x8000: { MarkBase* pMark = dynamic_castMarkBase*(pMarkAccess-getAllMarksBegin()[aSave.GetCount()].get()); -SwPosition aNewPos(pMark-GetMarkPos()); -aNewPos.nNode = rNd; -aNewPos.nContent.Assign(pCNd, std::min(aSave.GetContent(), nLen)); -pMark-SetMarkPos(aNewPos); +if (pMark) +{ +SwPosition aNewPos(pMark-GetMarkPos()); +aNewPos.nNode = rNd; +aNewPos.nContent.Assign(pCNd, std::min(aSave.GetContent(), nLen)); +pMark-SetMarkPos(aNewPos); +} } break; case 0x8001: { MarkBase* pMark = dynamic_castMarkBase*(pMarkAccess-getAllMarksBegin()[aSave.GetCount()].get()); -SwPosition aNewPos(pMark-GetOtherMarkPos()); -aNewPos.nNode = rNd; -aNewPos.nContent.Assign(pCNd, std::min(aSave.GetContent(), nLen)); -pMark-SetOtherMarkPos(aNewPos); +if (pMark) +{ +SwPosition aNewPos(pMark-GetOtherMarkPos()); +aNewPos.nNode = rNd; +aNewPos.nContent.Assign(pCNd, std::min(aSave.GetContent(), nLen)); +pMark-SetOtherMarkPos(aNewPos); +} } break; case 0x1001: commit 785dd5a3a79383d86d1b5de4f1d7acdf3913322d Author: Miklos Vajna vmik...@collabora.co.uk Date: Mon May 26 17:05:35 2014 +0200 writerfilter: remove unused dummyannotate.xsl Change-Id: Ie922a7114040ad7a1e3a96d57beb36e48bdf2e34 diff --git a/writerfilter/source/ooxml/dummyannotate.xsl b/writerfilter/source/ooxml/dummyannotate.xsl deleted file mode 100644 index c4d1dd8..000 --- a/writerfilter/source/ooxml/dummyannotate.xsl +++ /dev/null @@ -1,833 +0,0 @@ -!-- - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the License); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . --- -xsl:stylesheet -version=1.0 -xmlns:xsl=http://www.w3.org/1999/XSL/Transform; -xmlns:rng=http://relaxng.org/ns/structure/1.0; -xml:space=default xml:indent=true - xsl:output method=xml / - - xsl:template match=rng:define mode=dummydoc -xsl:processing-instruction name=mso-applicationprogid=Word.Document/xsl:processing-instruction -pkg:package xmlns:pkg=http://schemas.microsoft.com/office/2006/xmlPackage; - pkg:part pkg:name=/_rels/.rels pkg:contentType=application/vnd.openxmlformats-package.relationships+xml pkg:padding=512 -pkg:xmlData - Relationships xmlns=http://schemas.openxmlformats.org/package/2006/relationships; -Relationship Id=rId3 Type=http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties; Target=docProps/app.xml/ -Relationship Id=rId2 Type=http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties; Target=docProps/core.xml/ -Relationship Id=rId1 Type=http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument; Target=word/document.xml/ - /Relationships -/pkg:xmlData - /pkg:part - pkg:part pkg:name=/word/_rels/document.xml.rels pkg:contentType=application/vnd.openxmlformats-package.relationships+xml pkg:padding=256 -pkg:xmlData - Relationships xmlns=http://schemas.openxmlformats.org/package/2006/relationships; -Relationship Id=rId3
[Libreoffice-commits] core.git: 3 commits - sw/inc sw/source unusedcode.easy
sw/inc/accmap.hxx|1 - sw/source/core/access/accmap.cxx | 18 -- sw/source/core/doc/acmplwrd.cxx |5 ++--- sw/source/filter/ww8/rtfstringbuffer.cxx | 10 +- unusedcode.easy |1 - 5 files changed, 7 insertions(+), 28 deletions(-) New commits: commit ea1a038fe31217b43723b517facc5ac51d6b6959 Author: Miklos Vajna vmik...@collabora.co.uk Date: Wed May 7 21:37:38 2014 +0200 sw: fix indentation in rtfstringbuffer Change-Id: Ie1029a03e614aceaeda10a762183cb06e93c1639 diff --git a/sw/source/filter/ww8/rtfstringbuffer.cxx b/sw/source/filter/ww8/rtfstringbuffer.cxx index 1d652db..16535f7 100644 --- a/sw/source/filter/ww8/rtfstringbuffer.cxx +++ b/sw/source/filter/ww8/rtfstringbuffer.cxx @@ -11,22 +11,22 @@ RtfStringBufferValue::RtfStringBufferValue() : m_aBuffer(), -m_pFlyFrmFmt(0), -m_pGrfNode(0) + m_pFlyFrmFmt(0), + m_pGrfNode(0) { } RtfStringBufferValue::RtfStringBufferValue(const SwFlyFrmFmt* pFlyFrmFmt, const SwGrfNode* pGrfNode) : m_aBuffer(), -m_pFlyFrmFmt(pFlyFrmFmt), -m_pGrfNode(pGrfNode) + m_pFlyFrmFmt(pFlyFrmFmt), + m_pGrfNode(pGrfNode) { } void RtfStringBufferValue::makeStringAndClear(RtfAttributeOutput* pAttributeOutput) { if (!isGraphic()) -pAttributeOutput-m_rExport.Strm().WriteCharPtr( m_aBuffer.makeStringAndClear().getStr() ); + pAttributeOutput-m_rExport.Strm().WriteCharPtr(m_aBuffer.makeStringAndClear().getStr()); else pAttributeOutput-FlyFrameGraphic(m_pFlyFrmFmt, m_pGrfNode); } commit c3239f45ddd09937c86724213e34f2046a74ff88 Author: Miklos Vajna vmik...@collabora.co.uk Date: Wed May 7 21:36:32 2014 +0200 coverity#735892 Unchecked dynamic_cast Change-Id: I0624dd7d50cc82ddfe76ce5d8219b2fa1c10f002 diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx index 08b4e3d..2dcd890 100644 --- a/sw/source/core/doc/acmplwrd.cxx +++ b/sw/source/core/doc/acmplwrd.cxx @@ -417,9 +417,8 @@ void SwAutoCompleteWord::DocumentDying(const SwDoc rDoc) const bool bDelete = !pACorr-GetSwFlags().bAutoCmpltKeepList; for (size_t nPos = m_WordList.size(); nPos; nPos--) { -SwAutoCompleteString *const pCurrent = -dynamic_castSwAutoCompleteString*(m_WordList[nPos - 1]); -if(pCurrent-RemoveDocument(rDoc) bDelete) +SwAutoCompleteString *const pCurrent = dynamic_castSwAutoCompleteString*(m_WordList[nPos - 1]); +if(pCurrent pCurrent-RemoveDocument(rDoc) bDelete) { m_WordList.erase(nPos - 1); SwAutoCompleteStringPtrDeque::iterator it = std::find( aLRULst.begin(), aLRULst.end(), pCurrent ); commit 6e2103585e2c01104314fbcf2a7257e7df224b2b Author: Miklos Vajna vmik...@collabora.co.uk Date: Wed May 7 20:43:04 2014 +0200 unused SwAccessibleMap::FireSectionChangeEvent Change-Id: Iabf50f68d06684d36eaf5793251361ccd771ae8d diff --git a/sw/inc/accmap.hxx b/sw/inc/accmap.hxx index 20a04ef..aacfcc0 100644 --- a/sw/inc/accmap.hxx +++ b/sw/inc/accmap.hxx @@ -208,7 +208,6 @@ public: void InvalidateCursorPosition( const SwFrm *pFrm ); void InvalidateFocus(); void FirePageChangeEvent(sal_uInt16 nOldPage, sal_uInt16 nNewPage); -void FireSectionChangeEvent(sal_uInt16 nOldSection, sal_uInt16 nNewSection); void FireColumnChangeEvent(sal_uInt16 nOldColumn, sal_uInt16 nNewColumn); void SetCursorContext( const ::rtl::Reference SwAccessibleContext rCursorContext ); diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index d6b949a..dee4126 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -2770,24 +2770,6 @@ void SwAccessibleMap::FirePageChangeEvent(sal_uInt16 nOldPage, sal_uInt16 nNewPa } } -void SwAccessibleMap::FireSectionChangeEvent(sal_uInt16 nOldSection, sal_uInt16 nNewSection) -{ -uno::ReferenceXAccessible xAcc = GetDocumentView( ); -if ( xAcc.is() ) -{ -SwAccessibleDocumentBase *pAcc = -static_cast SwAccessibleDocumentBase * ( xAcc.get() ); -if (pAcc) -{ -AccessibleEventObject aEvent; -aEvent.EventId = AccessibleEventId::SECTION_CHANGED; -aEvent.OldValue = nOldSection; -aEvent.NewValue = nNewSection; -pAcc-FireAccessibleEvent( aEvent ); - -} -} -} void SwAccessibleMap::FireColumnChangeEvent(sal_uInt16 nOldColumn, sal_uInt16 nNewColumn) { uno::ReferenceXAccessible xAcc = GetDocumentView( ); diff --git a/unusedcode.easy b/unusedcode.easy index 3dd021b..b19d035 100644 --- a/unusedcode.easy +++ b/unusedcode.easy @@ -80,7 +80,6 @@ SvxUnoTextBase::SvxUnoTextBase() SwAccessibleField::SwAccessibleField(SwField*, SwAccessibleParagraph*, short) SwAccessibleMap::FireColumnChangeEvent(unsigned
[Libreoffice-commits] core.git: 3 commits - sw/inc sw/source
sw/inc/tgrditem.hxx | 77 ++- sw/source/core/inc/pagefrm.hxx | 11 +- sw/source/core/layout/atrfrm.cxx| 141 +++- sw/source/core/layout/flowfrm.cxx |2 sw/source/core/layout/pagechg.cxx | 28 ++- sw/source/core/layout/paintfrm.cxx |4 - sw/source/core/text/frmpaint.cxx|2 sw/source/core/text/guess.cxx |3 sw/source/core/text/itrcrsr.cxx |3 sw/source/core/text/itrform2.cxx| 20 ++--- sw/source/core/text/itrpaint.cxx|2 sw/source/core/text/itrtxt.cxx |2 sw/source/core/text/pormulti.cxx|7 + sw/source/core/text/porrst.cxx |2 sw/source/core/text/txtfrm.cxx |4 - sw/source/core/txtnode/fntcache.cxx | 32 16 files changed, 190 insertions(+), 150 deletions(-) New commits: commit 955fd65a75c971b23ff552bbe627d3fd30aac907 Author: Michael Stahl mst...@redhat.com Date: Fri Mar 7 16:49:52 2014 +0100 sw: remove that GETGRID abomination Change-Id: Ib2299dae7c1aab2d9af992930c29381a1027141b diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx index 67e3e50..1b6c1bf 100644 --- a/sw/source/core/inc/pagefrm.hxx +++ b/sw/source/core/inc/pagefrm.hxx @@ -430,13 +430,12 @@ inline sal_Bool SwPageFrm::IsInvalidFly() const return bInvalidFlyLayout || bInvalidFlyCntnt; } -#define GETGRID( pPage ) const SwTextGridItem *pGrid = NULL; \ - {if( pPage pPage-HasGrid() GRID_NONE==(pGrid=(SwTextGridItem*)pPage-\ - GetPageDesc()-GetMaster().GetFmtAttr(RES_TEXTGRID))-GetGridType() ) \ -pGrid = NULL;} -#define GETGRIDWIDTH( pGrid , pDoc ) pDoc-IsSquaredPageMode() ? \ -pGrid-GetBaseHeight(): pGrid-GetBaseWidth() +class SwTextGridItem; + +SwTextGridItem const* GetGridItem(SwPageFrm const*const); + +sal_uInt16 GetGridWidth(SwTextGridItem const, SwDoc const); #endif // INCLUDED_SW_SOURCE_CORE_INC_PAGEFRM_HXX diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index cdb913d..bbab257 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -1506,7 +1506,7 @@ SwTwips SwFlowFrm::_GetUpperSpaceAmountConsideredForPageGrid( if ( m_rThis.IsInDocBody() m_rThis.GetAttrSet()-GetParaGrid().GetValue() ) { const SwPageFrm* pPageFrm = m_rThis.FindPageFrm(); -GETGRID( pPageFrm ) +SwTextGridItem const*const pGrid(GetGridItem(pPageFrm)); if( pGrid ) { const SwFrm* pBodyFrm = pPageFrm-FindBodyCont(); diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index 8e99d9e..b809700 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -113,7 +113,8 @@ void SwBodyFrm::Format( const SwBorderAttrs * ) bool bNoGrid = true; if( GetUpper()-IsPageFrm() ((SwPageFrm*)GetUpper())-HasGrid() ) { -GETGRID( ((SwPageFrm*)GetUpper()) ) +SwTextGridItem const*const pGrid( +GetGridItem(static_castSwPageFrm*(GetUpper(; if( pGrid ) { bNoGrid = false; @@ -125,7 +126,7 @@ void SwBodyFrm::Format( const SwBorderAttrs * ) { //for textgrid refactor SwDoc *pDoc = GetFmt()-GetDoc(); -nBorder = nSize % (GETGRIDWIDTH(pGrid, pDoc)); +nBorder = nSize % (GetGridWidth(*pGrid, *pDoc)); nSize -= nBorder; nBorder /= 2; } @@ -174,7 +175,7 @@ SwPageFrm::SwPageFrm( SwFrmFmt *pFmt, SwFrm* pSib, SwPageDesc *pPgDsc ) : if( pDesc ) { bHasGrid = sal_True; -GETGRID( this ) +SwTextGridItem const*const pGrid(GetGridItem(this)); if( !pGrid ) bHasGrid = sal_False; } @@ -281,7 +282,7 @@ void SwPageFrm::CheckGrid( sal_Bool bInvalidate ) { sal_Bool bOld = bHasGrid; bHasGrid = sal_True; -GETGRID( this ) +SwTextGridItem const*const pGrid(GetGridItem(this)); bHasGrid = 0 != pGrid; if( bInvalidate || bOld != bHasGrid ) { @@ -2279,4 +2280,23 @@ bool SwPageFrm::IsOverHeaderFooterArea( const Point rPt, FrameControlType rCon return false; } +SwTextGridItem const* GetGridItem(SwPageFrm const*const pPage) +{ +if (pPage pPage-HasGrid()) +{ +SwTextGridItem const rGridItem( +pPage-GetPageDesc()-GetMaster().GetTextGrid()); +if (GRID_NONE != rGridItem.GetGridType()) +{ +return rGridItem; +} +} +return 0; +} + +sal_uInt16 GetGridWidth(SwTextGridItem const rG, SwDoc const rDoc) +{ +return (rDoc.IsSquaredPageMode()) ? rG.GetBaseHeight() : rG.GetBaseWidth(); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index b090ae1..097a025 100644 --- a/sw/source/core/layout/paintfrm.cxx +++
[Libreoffice-commits] core.git: 3 commits - sw/inc sw/source vcl/source
sw/inc/IDocumentMarkAccess.hxx |2 sw/inc/undobj.hxx |2 sw/source/core/bastyp/index.cxx |7 ++- sw/source/core/crsr/bookmrk.cxx | 69 sw/source/core/doc/docbm.cxx| 69 +--- sw/source/core/inc/MarkManager.hxx |2 sw/source/core/inc/bookmrk.hxx |4 + sw/source/core/inc/crossrefbookmark.hxx |1 sw/source/core/txtnode/ndtxt.cxx|6 ++ sw/source/core/undo/undobj.cxx | 32 +- sw/source/core/undo/unredln.cxx |6 +- vcl/source/app/settings.cxx |8 +-- 12 files changed, 147 insertions(+), 61 deletions(-) New commits: commit b229d16cd94d31eb8cad043b54d2d421cf92ef70 Author: Oliver-Rainer Wittmann o...@apache.org Date: Tue Mar 4 14:02:37 2014 + Related: #i123480# correct the previous made refactoring (cherry picked from commit aa46680dd96539848bf8bef0293e2a614172515d) Conflicts: sw/source/core/undo/undobj.cxx Change-Id: I4689d5fe02ab2c814e15a1c11ebd3ad11d6e56c8 diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx index 1dcd5ca..39e3fe0 100644 --- a/sw/inc/undobj.hxx +++ b/sw/inc/undobj.hxx @@ -115,7 +115,7 @@ public: // Save and set Redline data. static bool FillSaveData( const SwPaM rRange, SwRedlineSaveDatas rSData, - bool bDelRange = true ); + bool bDelRange = true, bool bCopyNext = true ); static bool FillSaveDataForFmt( const SwPaM , SwRedlineSaveDatas ); static void SetSaveData( SwDoc rDoc, const SwRedlineSaveDatas rSData ); static bool HasHiddenRedlines( const SwRedlineSaveDatas rSData ); diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx index 2e75e42..e22fe52 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -46,7 +46,9 @@ public: SwComparePosition eCmpPos, const SwPosition rSttPos, const SwPosition rEndPos, -SwRangeRedline rRedl ); +SwRangeRedline rRedl, +sal_Bool bCopyNext ); + ~SwRedlineSaveData(); void RedlineToDoc( SwPaM rPam ); @@ -847,7 +849,7 @@ void SwUndoSaveSection::SaveSection( } pRedlSaveData = new SwRedlineSaveDatas; -if( !SwUndo::FillSaveData( aPam, *pRedlSaveData, true )) +if( !SwUndo::FillSaveData( aPam, *pRedlSaveData, true, true )) delete pRedlSaveData, pRedlSaveData = 0; nStartPos = rRange.aStart.GetIndex(); @@ -912,9 +914,10 @@ SwRedlineSaveData::SwRedlineSaveData( SwComparePosition eCmpPos, const SwPosition rSttPos, const SwPosition rEndPos, -SwRangeRedline rRedl ) +SwRangeRedline rRedl, +sal_Bool bCopyNext ) : SwUndRng( rRedl ) -, SwRedlineData( rRedl.GetRedlineData(), true ) +, SwRedlineData( rRedl.GetRedlineData(), bCopyNext ) { assert( POS_OUTSIDE == eCmpPos || !rRedl.GetContentIdx() ); // Redline with Content @@ -925,6 +928,7 @@ SwRedlineSaveData::SwRedlineSaveData( nEndNode = rEndPos.nNode.GetIndex(); nEndCntnt = rEndPos.nContent.GetIndex(); break; + case POS_OVERLAP_BEHIND:// Pos1 overlaps Pos2 at the end nSttNode = rSttPos.nNode.GetIndex(); nSttCntnt = rSttPos.nContent.GetIndex(); @@ -996,7 +1000,8 @@ void SwRedlineSaveData::RedlineToDoc( SwPaM rPam ) bool SwUndo::FillSaveData( const SwPaM rRange, SwRedlineSaveDatas rSData, -bool bDelRange ) +bool bDelRange, +bool bCopyNext ) { rSData.DeleteAndDestroyAll(); @@ -1009,6 +1014,7 @@ bool SwUndo::FillSaveData( for ( ; n rTbl.size(); ++n ) { SwRangeRedline* pRedl = rTbl[n]; + const SwComparePosition eCmpPos = ComparePosition( *pStt, *pEnd, *pRedl-Start(), *pRedl-End() ); if ( eCmpPos != POS_BEFORE @@ -1016,12 +1022,14 @@ bool SwUndo::FillSaveData( eCmpPos != POS_COLLIDE_END eCmpPos != POS_COLLIDE_START ) { -pNewData = new SwRedlineSaveData( eCmpPos, *pStt, *pEnd, *pRedl ); +pNewData = new SwRedlineSaveData( eCmpPos, *pStt, *pEnd, *pRedl, bCopyNext ); rSData.push_back( pNewData ); } } if( !rSData.empty() bDelRange ) +{ rRange.GetDoc()-DeleteRedline( rRange, false, USHRT_MAX ); +} return !rSData.empty(); } @@ -1041,12 +1049,13 @@ bool SwUndo::FillSaveDataForFmt( SwRangeRedline* pRedl = rTbl[n]; if ( nsRedlineType_t::REDLINE_FORMAT == pRedl-GetType() ) { -const SwPosition *pRStt = pRedl-Start(), *pREnd = pRedl-End(); - -SwComparePosition eCmpPos = ComparePosition( *pStt, *pEnd, *pRStt, *pREnd ); -if ( POS_BEFORE != eCmpPos POS_BEHIND != eCmpPos POS_COLLIDE_END != eCmpPos POS_COLLIDE_START != eCmpPos ) +const SwComparePosition eCmpPos
[Libreoffice-commits] core.git: 3 commits - sw/inc sw/source
sw/inc/fmtfsize.hxx |3 +++ sw/inc/unomid.h |1 + sw/inc/unoprnms.hxx |1 + sw/source/core/layout/atrfrm.cxx | 16 ++-- sw/source/core/layout/fly.cxx |9 +++-- sw/source/core/unocore/unomap.cxx |2 ++ 6 files changed, 28 insertions(+), 4 deletions(-) New commits: commit 7c7fdf3e97bbf2301f9938082d4d44162f4ec3c0 Author: Miklos Vajna vmik...@collabora.co.uk Date: Wed Jan 29 11:43:43 2014 +0100 swpagerelsize: take care of GetHeightPercentRelation() in SwFlyFrm::CalcRel Layout part, height. Change-Id: Iee239e1a39dd495ee965ac45325a0f7087fdcdfa diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index 8f42605..1aa75a5 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -2487,7 +2487,8 @@ Size SwFlyFrm::CalcRel( const SwFmtFrmSize rSz ) const // When size is a relative to page size, ignore size of SwBodyFrm. if (rSz.GetWidthPercentRelation() != text::RelOrientation::PAGE_FRAME) nRelWidth = std::min( nRelWidth, pRel-Prt().Width() ); -nRelHeight = std::min( nRelHeight, pRel-Prt().Height() ); +if (rSz.GetHeightPercentRelation() != text::RelOrientation::PAGE_FRAME) +nRelHeight = std::min( nRelHeight, pRel-Prt().Height() ); if( !pRel-IsPageFrm() ) { const SwPageFrm* pPage = FindPageFrm(); @@ -2498,7 +2499,11 @@ Size SwFlyFrm::CalcRel( const SwFmtFrmSize rSz ) const nRelWidth = std::min( nRelWidth, pPage-Frm().Width() ); else nRelWidth = std::min( nRelWidth, pPage-Prt().Width() ); -nRelHeight = std::min( nRelHeight, pPage-Prt().Height() ); +if (rSz.GetWidthPercentRelation() == text::RelOrientation::PAGE_FRAME) +// Ignore margins of pPage. +nRelHeight = std::min( nRelHeight, pPage-Frm().Height() ); +else +nRelHeight = std::min( nRelHeight, pPage-Prt().Height() ); } } commit 9941687ff16d3a4b393563006ca4bdee5409fdbb Author: Miklos Vajna vmik...@collabora.co.uk Date: Wed Jan 29 11:18:15 2014 +0100 swpagerelsize: implement RelativeHeightRelation UNO property for SwXFrame UNO API, height. Change-Id: Ie61fb7f6de42b9dfb8b8f6f0982239d1c30f84ab diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx index d0db5b0..369d3d3 100644 --- a/sw/inc/unoprnms.hxx +++ b/sw/inc/unoprnms.hxx @@ -211,6 +211,7 @@ #define UNO_NAME_RELATIVE_WIDTH RelativeWidth #define UNO_NAME_RELATIVE_WIDTH_RELATION RelativeWidthRelation #define UNO_NAME_RELATIVE_HEIGHT RelativeHeight +#define UNO_NAME_RELATIVE_HEIGHT_RELATION RelativeHeightRelation #define UNO_NAME_REPEAT_HEADLINE RepeatHeadline #define UNO_NAME_SEARCH_STYLES SearchStyles #define UNO_NAME_SEARCH_BACKWARDS SearchBackwards diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx index 0f69154..a8b15f5 100644 --- a/sw/source/core/unocore/unomap.cxx +++ b/sw/source/core/unocore/unomap.cxx @@ -371,6 +371,7 @@ SwUnoPropertyMapProvider::~SwUnoPropertyMapProvider() { OUString(UNO_NAME_POSITION_PROTECTED), RES_PROTECT, cppu::UnoTypebool::get(), PROPERTY_NONE, MID_PROTECT_POSITION}, \ { OUString(UNO_NAME_PRINT), RES_PRINT, cppu::UnoTypebool::get(), PROPERTY_NONE, 0}, \ { OUString(UNO_NAME_RELATIVE_HEIGHT), RES_FRM_SIZE, cppu::UnoTypesal_Int16::get() , PROPERTY_NONE, MID_FRMSIZE_REL_HEIGHT },\ +{ OUString(UNO_NAME_RELATIVE_HEIGHT_RELATION), RES_FRM_SIZE, cppu::UnoTypesal_Int16::get() ,PROPERTY_NONE, MID_FRMSIZE_REL_HEIGHT_RELATION }, \ { OUString(UNO_NAME_RELATIVE_WIDTH), RES_FRM_SIZE, cppu::UnoTypesal_Int16::get() , PROPERTY_NONE, MID_FRMSIZE_REL_WIDTH }, \ { OUString(UNO_NAME_RELATIVE_WIDTH_RELATION), RES_FRM_SIZE, cppu::UnoTypesal_Int16::get() , PROPERTY_NONE, MID_FRMSIZE_REL_WIDTH_RELATION }, \ { OUString(UNO_NAME_SHADOW_FORMAT), RES_SHADOW, cppu::UnoTypecss::table::ShadowFormat::get(), PROPERTY_NONE, CONVERT_TWIPS}, \ @@ -828,6 +829,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s { OUString(UNO_NAME_WIDTH), RES_FRM_SIZE, cppu::UnoTypesal_Int32::get() , PROPERTY_NONE, MID_FRMSIZE_WIDTH|CONVERT_TWIPS }, { OUString(UNO_NAME_HEIGHT), RES_FRM_SIZE, cppu::UnoTypesal_Int32::get() , PROPERTY_NONE, MID_FRMSIZE_HEIGHT|CONVERT_TWIPS }, { OUString(UNO_NAME_RELATIVE_HEIGHT), RES_FRM_SIZE, cppu::UnoTypesal_Int16::get() , PROPERTY_NONE,
[Libreoffice-commits] core.git: 3 commits - sw/inc sw/source
sw/inc/fmtfsize.hxx |3 +++ sw/inc/unomid.h |1 + sw/inc/unoprnms.hxx |1 + sw/source/core/layout/atrfrm.cxx | 14 +- sw/source/core/layout/fly.cxx | 12 ++-- sw/source/core/unocore/unomap.cxx |2 ++ 6 files changed, 30 insertions(+), 3 deletions(-) New commits: commit f71dc0ec8372208318199ede36bc93de38d6c216 Author: Miklos Vajna vmik...@collabora.co.uk Date: Tue Jan 28 16:36:44 2014 +0100 swpagerelsize: take care of Sz.GetWidthPercentRelation() in SwFlyFrm::CalcRel This allows two type of relative sizes: relative to margin (default, what we had before) and relative to the entire page. Change-Id: I1625f072365e418352f3d507764e03484bb812be diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index bccf60b..26550da 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -2482,14 +2482,22 @@ Size SwFlyFrm::CalcRel( const SwFmtFrmSize rSz ) const if ( nDiff 0 ) nRelHeight -= nDiff; } -nRelWidth = std::min( nRelWidth, pRel-Prt().Width() ); + +// At the moment only the == PAGE_FRAME and != PAGE_FRAME cases are handled. +// When size is a relative to page size, ignore size of SwBodyFrm. +if (rSz.GetWidthPercentRelation() != text::RelOrientation::PAGE_FRAME) +nRelWidth = std::min( nRelWidth, pRel-Prt().Width() ); nRelHeight = std::min( nRelHeight, pRel-Prt().Height() ); if( !pRel-IsPageFrm() ) { const SwPageFrm* pPage = FindPageFrm(); if( pPage ) { -nRelWidth = std::min( nRelWidth, pPage-Prt().Width() ); +if (rSz.GetWidthPercentRelation() == text::RelOrientation::PAGE_FRAME) +// Ignore margins of pPage. +nRelWidth = std::min( nRelWidth, pPage-Frm().Width() ); +else +nRelWidth = std::min( nRelWidth, pPage-Prt().Width() ); nRelHeight = std::min( nRelHeight, pPage-Prt().Height() ); } } commit b7b57bbce3f3b171f3a85a8d93ab29f0d9a049cf Author: Miklos Vajna vmik...@collabora.co.uk Date: Tue Jan 28 15:26:47 2014 +0100 swpagerelsize: implement RelativeWidthRelation UNO property for SwXFrame Which exposes SwFmtFrmSize::eWidthPercentRelation. Do not document yet, will be done if layout/filters/UI confirms that the data structure is suitable. Change-Id: Ic4eac3356452f4bedf9809ff5678e299b7339053 diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx index 0065f12..d0db5b0 100644 --- a/sw/inc/unoprnms.hxx +++ b/sw/inc/unoprnms.hxx @@ -209,6 +209,7 @@ #define UNO_NAME_PRINT_PAPER_FROM_SETUP PrintPaperFromSetup #define UNO_NAME_REGISTER_MODE_ACTIVE RegisterModeActive #define UNO_NAME_RELATIVE_WIDTH RelativeWidth +#define UNO_NAME_RELATIVE_WIDTH_RELATION RelativeWidthRelation #define UNO_NAME_RELATIVE_HEIGHT RelativeHeight #define UNO_NAME_REPEAT_HEADLINE RepeatHeadline #define UNO_NAME_SEARCH_STYLES SearchStyles diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx index 6617e7e..0f69154 100644 --- a/sw/source/core/unocore/unomap.cxx +++ b/sw/source/core/unocore/unomap.cxx @@ -372,6 +372,7 @@ SwUnoPropertyMapProvider::~SwUnoPropertyMapProvider() { OUString(UNO_NAME_PRINT), RES_PRINT, cppu::UnoTypebool::get(), PROPERTY_NONE, 0}, \ { OUString(UNO_NAME_RELATIVE_HEIGHT), RES_FRM_SIZE, cppu::UnoTypesal_Int16::get() , PROPERTY_NONE, MID_FRMSIZE_REL_HEIGHT },\ { OUString(UNO_NAME_RELATIVE_WIDTH), RES_FRM_SIZE, cppu::UnoTypesal_Int16::get() , PROPERTY_NONE, MID_FRMSIZE_REL_WIDTH }, \ +{ OUString(UNO_NAME_RELATIVE_WIDTH_RELATION), RES_FRM_SIZE, cppu::UnoTypesal_Int16::get() , PROPERTY_NONE, MID_FRMSIZE_REL_WIDTH_RELATION }, \ { OUString(UNO_NAME_SHADOW_FORMAT), RES_SHADOW, cppu::UnoTypecss::table::ShadowFormat::get(), PROPERTY_NONE, CONVERT_TWIPS}, \ { OUString(UNO_NAME_SHADOW_TRANSPARENCE), RES_SHADOW, cppu::UnoTypesal_Int16::get(), PROPERTY_NONE, MID_SHADOW_TRANSPARENCE}, \ { OUString(UNO_NAME_IMAGE_MAP), RES_URL, cppu::UnoTypecss::container::XIndexContainer::get(), PROPERTY_NONE, MID_URL_CLIENTMAP}, \ @@ -828,6 +829,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s { OUString(UNO_NAME_HEIGHT), RES_FRM_SIZE, cppu::UnoTypesal_Int32::get() , PROPERTY_NONE, MID_FRMSIZE_HEIGHT|CONVERT_TWIPS }, { OUString(UNO_NAME_RELATIVE_HEIGHT), RES_FRM_SIZE, cppu::UnoTypesal_Int16::get() , PROPERTY_NONE, MID_FRMSIZE_REL_HEIGHT },
[Libreoffice-commits] core.git: 3 commits - sw/inc sw/source sysui/desktop
sw/inc/shellres.hxx |3 ++- sw/source/core/draw/dpage.cxx|6 +++--- sw/source/ui/docvw/SidebarTxtControl.cxx |6 +++--- sw/source/ui/docvw/edtwin.cxx|2 +- sw/source/ui/docvw/edtwin2.cxx |8 sw/source/ui/utlui/initui.cxx|5 +++-- sw/source/ui/utlui/initui.hrc|7 --- sw/source/ui/utlui/initui.src|9 ++--- sysui/desktop/menus/base.desktop |2 +- sysui/desktop/menus/calc.desktop |2 +- sysui/desktop/menus/draw.desktop |2 +- sysui/desktop/menus/impress.desktop |2 +- sysui/desktop/menus/math.desktop |2 +- sysui/desktop/menus/writer.desktop |2 +- 14 files changed, 32 insertions(+), 26 deletions(-) New commits: commit f3167bd7d33fbc1e93f0728ab06b6d67fc1956bd Author: Caolán McNamara caol...@redhat.com Date: Thu Oct 24 10:34:13 2013 +0100 Related: fdo#70571 say [ctrl+]click to follow link as opposed to hyperlink. Be more generic and consistent across both ctrl+click and click modes. Change-Id: I673ed59fc9f3408a0c4534c6490d9bbc3598bc08 diff --git a/sw/inc/shellres.hxx b/sw/inc/shellres.hxx index 85d5d95..0538045 100644 --- a/sw/inc/shellres.hxx +++ b/sw/inc/shellres.hxx @@ -64,7 +64,8 @@ struct SW_DLLPUBLIC ShellResource : public Resource OUStringaTOXTablesName; OUStringaTOXAuthoritiesName; -OUStringaHyperlinkClick; +OUStringaLinkCtrlClick; +OUStringaLinkClick; std::vectorOUString aDocInfoLst; diff --git a/sw/source/core/draw/dpage.cxx b/sw/source/core/draw/dpage.cxx index 9f18b52..5e73e87 100644 --- a/sw/source/core/draw/dpage.cxx +++ b/sw/source/core/draw/dpage.cxx @@ -182,9 +182,9 @@ sal_Bool SwDPage::RequestHelp( Window* pWindow, SdrView* pView, bExecHyperlinks = !aSecOpts.IsOptionSet( SvtSecurityOptions::E_CTRLCLICK_HYPERLINK ); if ( !bExecHyperlinks ) -{ -sTxt = ViewShell::GetShellRes()-aHyperlinkClick + : + sTxt; -} +sTxt = ViewShell::GetShellRes()-aLinkCtrlClick + : + sTxt; +else +sTxt = ViewShell::GetShellRes()-aLinkClick + : + sTxt; } diff --git a/sw/source/ui/docvw/SidebarTxtControl.cxx b/sw/source/ui/docvw/SidebarTxtControl.cxx index ffed69a..27bc246 100644 --- a/sw/source/ui/docvw/SidebarTxtControl.cxx +++ b/sw/source/ui/docvw/SidebarTxtControl.cxx @@ -241,9 +241,9 @@ void SidebarTxtControl::MouseMove( const MouseEvent rMEvt ) OUString sURL( pURL-GetURL() ); SvtSecurityOptions aSecOpts; if ( aSecOpts.IsOptionSet( SvtSecurityOptions::E_CTRLCLICK_HYPERLINK) ) -{ -sURL = ViewShell::GetShellRes()-aHyperlinkClick + : + sURL; -} +sURL = ViewShell::GetShellRes()-aLinkCtrlClick + : + sURL; +else +sURL = ViewShell::GetShellRes()-aLinkClick + : + sURL; Help::ShowQuickHelp( this,PixelToLogic(Rectangle(GetPosPixel(),Size(50,10))),sURL); } } diff --git a/sw/source/ui/docvw/edtwin2.cxx b/sw/source/ui/docvw/edtwin2.cxx index b6e7d23..879d1af 100644 --- a/sw/source/ui/docvw/edtwin2.cxx +++ b/sw/source/ui/docvw/edtwin2.cxx @@ -217,11 +217,11 @@ void SwEditWin::RequestHelp(const HelpEvent rEvt) SvtSecurityOptions aSecOpts; bExecHyperlinks = !aSecOpts.IsOptionSet( SvtSecurityOptions::E_CTRLCLICK_HYPERLINK ); +sTxt = : + sTxt; if ( !bExecHyperlinks ) -{ -sTxt = : + sTxt; -sTxt = ViewShell::GetShellRes()-aHyperlinkClick + sTxt; -} +sTxt = ViewShell::GetShellRes()-aLinkCtrlClick + sTxt; +else +sTxt = ViewShell::GetShellRes()-aLinkClick + sTxt; } break; } diff --git a/sw/source/ui/utlui/initui.cxx b/sw/source/ui/utlui/initui.cxx index d3f3f96..78312ff 100644 --- a/sw/source/ui/utlui/initui.cxx +++ b/sw/source/ui/utlui/initui.cxx @@ -204,7 +204,8 @@ ShellResource::ShellResource() aTOXObjectsName(SW_RES(STR_TOX_OBJ)), aTOXTablesName( SW_RES(STR_TOX_TBL)), aTOXAuthoritiesName(SW_RES(STR_TOX_AUTH)), -aHyperlinkClick(SW_RESSTR(STR_HYPERLINK_CLICK)), +aLinkCtrlClick(SW_RESSTR(STR_LINK_CTRL_CLICK)), +aLinkClick(SW_RESSTR(STR_LINK_CLICK)), pAutoFmtNameLst(0), sPageDescFirstName( SW_RES(STR_PAGEDESC_FIRSTNAME)), sPageDescFollowName(SW_RES(STR_PAGEDESC_FOLLOWNAME)), @@ -217,7 +218,7 @@ ShellResource::ShellResource() OUString aModStr( aModifiedCode.GetName() );
[Libreoffice-commits] core.git: 3 commits - sw/inc sw/source writerfilter/source
sw/inc/format.hxx |1 sw/source/core/attr/format.cxx |3 - sw/source/filter/ww8/docxattributeoutput.cxx| 25 -- sw/source/filter/ww8/wrtw8sty.cxx | 58 sw/source/filter/ww8/wrtww8.hxx |9 +++ writerfilter/source/dmapper/StyleSheetTable.cxx | 24 ++--- 6 files changed, 92 insertions(+), 28 deletions(-) New commits: commit e47c7970a43d95a65f2a6d6942777314aea41bba Author: Jan Holesovsky ke...@collabora.com Date: Wed Sep 18 12:19:45 2013 +0200 DOCX styles: Generate the styleIds similar ways as MSO does. Makes the id's nicer than the styleXY. Change-Id: Ica0da1404578f834a79f940bf31c93d25f842e7f diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index f005500..dc317ca 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -1280,11 +1280,12 @@ void DocxAttributeOutput::StartRuby( const SwTxtNode rNode, xub_StrLen nPos, co StartRunProperties( ); SwWW8AttrIter aAttrIt( m_rExport, rNode ); aAttrIt.OutAttr( nPos, true ); + sal_uInt16 nStyle = m_rExport.GetId( *rRuby.GetTxtRuby()-GetCharFmt() ); -OString aStyleId( style ); -aStyleId += OString::number( nStyle ); +OString aStyleId(m_rExport.pStyles-GetStyleId(nStyle)); m_pSerializer-singleElementNS( XML_w, XML_rStyle, FSNS( XML_w, XML_val ), aStyleId.getStr(), FSEND ); + EndRunProperties( NULL ); RunText( rRuby.GetText( ) ); EndRun( ); @@ -1531,8 +1532,7 @@ void DocxAttributeOutput::FormatDrop( const SwTxtNode /*rNode*/, const SwFmtDro void DocxAttributeOutput::ParagraphStyle( sal_uInt16 nStyle ) { -OString aStyleId( style ); -aStyleId += OString::number( nStyle ); +OString aStyleId(m_rExport.pStyles-GetStyleId(nStyle)); m_pSerializer-singleElementNS( XML_w, XML_pStyle, FSNS( XML_w, XML_val ), aStyleId.getStr(), FSEND ); } @@ -3249,11 +3249,9 @@ oox::drawingml::DrawingML DocxAttributeOutput::GetDrawingML() void DocxAttributeOutput::StartStyle( const String rName, bool bPapFmt, sal_uInt16 nBase, sal_uInt16 nNext, sal_uInt16 /*nWwId*/, sal_uInt16 nId, bool bAutoUpdate ) { -OString aStyle( style ); - m_pSerializer-startElementNS( XML_w, XML_style, FSNS( XML_w, XML_type ), bPapFmt? paragraph: character, // FIXME is this correct? -FSNS( XML_w, XML_styleId ), OString( aStyle + OString::number( nId ) ).getStr(), +FSNS( XML_w, XML_styleId ), m_rExport.pStyles-GetStyleId(nId).getStr(), FSEND ); m_pSerializer-singleElementNS( XML_w, XML_name, @@ -3263,12 +3261,12 @@ void DocxAttributeOutput::StartStyle( const String rName, bool bPapFmt, if ( nBase != 0x0FFF ) { m_pSerializer-singleElementNS( XML_w, XML_basedOn, -FSNS( XML_w, XML_val ), OString( aStyle + OString::number( nBase ) ).getStr(), +FSNS( XML_w, XML_val ), m_rExport.pStyles-GetStyleId(nBase).getStr(), FSEND ); } m_pSerializer-singleElementNS( XML_w, XML_next, -FSNS( XML_w, XML_val ), OString( aStyle + OString::number( nNext ) ).getStr(), +FSNS( XML_w, XML_val ), m_rExport.pStyles-GetStyleId(nNext).getStr(), FSEND ); if ( bAutoUpdate ) @@ -4336,16 +4334,14 @@ void DocxAttributeOutput::TextINetFormat( const SwFmtINetFmt rLink ) const SwTxtINetFmt* pINetFmt = rLink.GetTxtINetFmt(); const SwCharFmt* pCharFmt = pINetFmt-GetCharFmt(); -OString aStyleId( style ); -aStyleId += OString::number( m_rExport.GetId( *pCharFmt ) ); +OString aStyleId(m_rExport.pStyles-GetStyleId(m_rExport.GetId(*pCharFmt))); m_pSerializer-singleElementNS( XML_w, XML_rStyle, FSNS( XML_w, XML_val ), aStyleId.getStr(), FSEND ); } void DocxAttributeOutput::TextCharFormat( const SwFmtCharFmt rCharFmt ) { -OString aStyleId( style ); -aStyleId += OString::number( m_rExport.GetId( *rCharFmt.GetCharFmt() ) ); +OString aStyleId(m_rExport.pStyles-GetStyleId(m_rExport.GetId(*rCharFmt.GetCharFmt(; m_pSerializer-singleElementNS( XML_w, XML_rStyle, FSNS( XML_w, XML_val ), aStyleId.getStr(), FSEND ); } @@ -4534,8 +4530,7 @@ void DocxAttributeOutput::TextFootnote_Impl( const SwFmtFtn rFootnote ) // footnote/endnote run properties const SwCharFmt* pCharFmt = rInfo.GetAnchorCharFmt( *m_rExport.pDoc ); -OString aStyleId( style ); -aStyleId += OString::number( m_rExport.GetId( *pCharFmt ) ); +OString aStyleId(m_rExport.pStyles-GetStyleId(m_rExport.GetId(*pCharFmt))); m_pSerializer-singleElementNS( XML_w, XML_rStyle, FSNS( XML_w, XML_val ), aStyleId.getStr(), FSEND ); diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index 573e98a..2ca0b04 100644 ---
[Libreoffice-commits] core.git: 3 commits - sw/inc sw/source sw/uiconfig sw/UIConfig_swriter.mk
sw/UIConfig_swriter.mk |3 sw/inc/dbui.hrc | 14 -- sw/inc/helpid.h |1 sw/source/ui/dbui/dbmgr.cxx | 10 +- sw/source/ui/dbui/dbui.cxx | 68 +++--- sw/source/ui/dbui/dbui.src | 72 --- sw/source/ui/dbui/mmoutputpage.cxx | 10 -- sw/source/ui/inc/dbui.hxx| 13 +- sw/uiconfig/swriter/ui/printmonitordialog.ui | 128 +++ 9 files changed, 159 insertions(+), 160 deletions(-) New commits: commit 9fe6586a0bb3f10e3bca6f1215733d373e8fdac3 Author: Caolán McNamara caol...@redhat.com Date: Thu Aug 22 12:50:58 2013 +0100 convert print monitory dialog to .ui Change-Id: I59081c74adaf88d81a3c539c8fbfe3b535d7f6bb diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk index f9d1578..f3eb50f 100644 --- a/sw/UIConfig_swriter.mk +++ b/sw/UIConfig_swriter.mk @@ -149,8 +149,9 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\ sw/uiconfig/swriter/ui/paradialog \ sw/uiconfig/swriter/ui/picturedialog \ sw/uiconfig/swriter/ui/previewzoomdialog \ - sw/uiconfig/swriter/ui/printoptionspage \ sw/uiconfig/swriter/ui/printeroptions \ + sw/uiconfig/swriter/ui/printmonitordialog \ + sw/uiconfig/swriter/ui/printoptionspage \ sw/uiconfig/swriter/ui/privateuserpage \ sw/uiconfig/swriter/ui/renameautotextdialog \ sw/uiconfig/swriter/ui/renameobjectdialog \ diff --git a/sw/inc/dbui.hrc b/sw/inc/dbui.hrc index e5dabf0..760835e 100644 --- a/sw/inc/dbui.hrc +++ b/sw/inc/dbui.hrc @@ -24,7 +24,6 @@ // Dialoge -#define DLG_PRINTMONITOR(RC_DBUI_BEGIN + 1) #define DLG_AP_INSERT_DB_SEL(RC_DBUI_BEGIN + 2) #define DLG_MAILMERGEWIZARD (RC_DBUI_BEGIN + 3) @@ -57,7 +56,6 @@ #define DLG_MM_CREATIONMONITOR(RC_DBUI_BEGIN + 30) // Strings -- -#define STR_DB_EMAIL(RC_DBUI_BEGIN) #define SA_ADDRESS_HEADER (RC_DBUI_BEGIN + 1) #define STR_NOTASSIGNED (RC_DBUI_BEGIN + 2) #define STR_FILTER_ALL (RC_DBUI_BEGIN + 3) @@ -71,27 +69,17 @@ #define STR_FILTER_MDB (RC_DBUI_BEGIN + 11) #define STR_FILTER_ACCDB(RC_DBUI_BEGIN + 12) -// Bitmaps -- - - // Elements - -#define TLB_DBLIST 1 #define BTN_OK 2 #define BTN_CANCEL 3 #define BTN_HELP4 -#define FT_DOCNAME 5 -#define FT_PRINTING 6 -#define FT_PRINTER 7 -#define FT_PRINTINFO8 #define PB_CANCELPRNMON 9 #define FT_STATUS 12 #define FT_CREATEDOCUMENTS 13 #define FT_PROGRESS 14 #define FT_COUNTING 15 -#define STR_SAVEMON 16 -#define FT_SAVING 17 #define MM_PART_TITLE 0 #define MM_PART_FIRSTNAME 1 diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx index f61471a..5f97d75 100644 --- a/sw/source/ui/dbui/dbmgr.cxx +++ b/sw/source/ui/dbui/dbmgr.cxx @@ -949,9 +949,9 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell, } PrintMonitor aPrtMonDlg(pSourceShell-GetView().GetEditWin(), PrintMonitor::MONITOR_TYPE_PRINT); - aPrtMonDlg.aDocName.SetText(pSourceShell-GetView().GetDocShell()-GetTitle(22)); + aPrtMonDlg.m_pDocName-SetText(pSourceShell-GetView().GetDocShell()-GetTitle(22)); -aPrtMonDlg.aCancel.SetClickHdl(LINK(this, SwNewDBMgr, PrtCancelHdl)); +aPrtMonDlg.m_pCancel-SetClickHdl(LINK(this, SwNewDBMgr, PrtCancelHdl)); if (!IsMergeSilent()) aPrtMonDlg.Show(); @@ -1016,11 +1016,11 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell, else { INetURLObject aTempFileURL(aTempFile-GetURL()); -aPrtMonDlg.aPrinter.SetText( aTempFileURL.GetBase() ); +aPrtMonDlg.m_pPrinter-SetText( aTempFileURL.GetBase() ); String sStat(SW_RES(STR_STATSTR_LETTER)); // Brief sStat += ' '; sStat += OUString::number( nDocNo ); -aPrtMonDlg.aPrintInfo.SetText(sStat); +aPrtMonDlg.m_pPrintInfo-SetText(sStat); // computation time for Save-Monitor: for (sal_uInt16 i = 0; i 25; i++) diff --git a/sw/source/ui/dbui/dbui.cxx b/sw/source/ui/dbui/dbui.cxx index aad23f2..09b2357 100644 --- a/sw/source/ui/dbui/dbui.cxx +++ b/sw/source/ui/dbui/dbui.cxx @@ -23,61 +23,25 @@
[Libreoffice-commits] core.git: 3 commits - sw/inc sw/source vcl/android
sw/inc/swtypes.hxx |8 +--- sw/source/ui/uiview/viewport.cxx |4 ++-- vcl/android/androidinst.cxx |1 + 3 files changed, 4 insertions(+), 9 deletions(-) New commits: commit 6cd8e92402746a193e4a19a5f31e9ac16318352e Author: Tor Lillqvist t...@iki.fi Date: Tue Mar 5 00:00:32 2013 +0200 Add a SAL_INFO Change-Id: I57702d2d848181f2df4af3fc0d1ce8cbed1455f9 diff --git a/vcl/android/androidinst.cxx b/vcl/android/androidinst.cxx index fdac1ec..dd49738 100644 --- a/vcl/android/androidinst.cxx +++ b/vcl/android/androidinst.cxx @@ -979,6 +979,7 @@ Java_org_libreoffice_experimental_desktop_Desktop_zoom(JNIEnv * /* env */, { SalFrame *pFocus = AndroidSalInstance::getInstance()-getFocusFrame(); if (pFocus) { +SAL_INFO( vcl.androidinst, zoom: scale @( x , y ) ); ZoomEvent aEvent( Point( x, y ), scale); Application::PostZoomEvent(VCLEVENT_WINDOW_ZOOM, pFocus-GetWindow(), aEvent); } commit 016206156d412b7df6445e81753f49a36f29b29a Author: Tor Lillqvist t...@iki.fi Date: Mon Mar 4 23:59:04 2013 +0200 Fix float scale factor - integer percentage conversion bug in my new code Change-Id: I1b843ee1921bad3607e62f7e61b085a33cd84aed diff --git a/sw/source/ui/uiview/viewport.cxx b/sw/source/ui/uiview/viewport.cxx index bd3444a..9fd7d63 100644 --- a/sw/source/ui/uiview/viewport.cxx +++ b/sw/source/ui/uiview/viewport.cxx @@ -1277,8 +1277,8 @@ sal_Bool SwView::HandleWheelCommands( const CommandEvent rCEvt ) } else if( pWData COMMAND_WHEEL_ZOOM_SCALE == pWData-GetMode() ) { -long newZoom = 100 * (long) ((pWrtShell-GetViewOptions()-GetZoom() / 100.0) * (pWData-GetDelta() / 100.0)); -SetZoom( SVX_ZOOM_PERCENT, Max( 20L, Min( 600L, newZoom ) ) ); +int newZoom = 100 * (pWrtShell-GetViewOptions()-GetZoom() / 100.0) * (pWData-GetDelta() / 100.0); +SetZoom( SVX_ZOOM_PERCENT, Max( 20, Min( 600, newZoom ) ) ); bOk = sal_True; } else commit 68eea32a6e1b38013c06e91fc2d88fb67b4b300e Author: Tor Lillqvist t...@iki.fi Date: Mon Mar 4 16:19:24 2013 +0200 Remove unused variables Change-Id: I81c62dd3f6319d6ca9c0da518ca07391a80179da diff --git a/sw/inc/swtypes.hxx b/sw/inc/swtypes.hxx index 1ea929e..9c3c18b 100644 --- a/sw/inc/swtypes.hxx +++ b/sw/inc/swtypes.hxx @@ -95,16 +95,10 @@ enum SwLabelType }; -const sal_uInt8 OLD_MAXLEVEL = 5; -const sal_uInt8 MAXLEVEL = 10; // Was: numrule.hxx. -const sal_uInt8 NO_NUM = 200; // Was: numrule.hxx. +const sal_uInt8 MAXLEVEL = 10; - -// For paragraphs with NO_NUM but on different levels. -// This makes the NO_NUM inapplicable. const sal_uInt8 NO_NUMLEVEL = 0x20;// or with the levels. - // Some helper functions as macros or inlines. // One kilobyte is 1024 bytes: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits