[Libreoffice-commits] core.git: Branch 'feature/textbox' - sw/source

2014-05-26 Thread Miklos Vajna
 sw/source/core/unocore/unoportenum.cxx |   14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

New commits:
commit 6f3c49e46205d705df24a6507c9eb14fcfaf4332
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Mon May 26 17:00:33 2014 +0200

SwXTextPortionEnumeration: do not expose inline anchored textboxes

Change-Id: I2f3e4295e4f1521c66a502650f214c9c46481e9e

diff --git a/sw/source/core/unocore/unoportenum.cxx 
b/sw/source/core/unocore/unoportenum.cxx
index c6a7bc4..887b84f 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -28,6 +28,7 @@
 #include ndtxt.hxx
 #include unocrsr.hxx
 #include docary.hxx
+#include textboxhelper.hxx
 #include tox.hxx
 #include unomid.h
 #include unoparaframeenum.hxx
@@ -43,6 +44,7 @@
 #include fmtanchr.hxx
 #include fmtrfmrk.hxx
 #include frmfmt.hxx
+#include fmtflcnt.hxx
 #include unoidx.hxx
 #include unocoll.hxx
 #include redline.hxx
@@ -687,7 +689,8 @@ lcl_ExportHints(
 const sal_Int32 nCurrentIndex,
 const bool bRightMoveForbidden,
 bool  o_rbCursorMoved,
-sal_Int32  o_rNextAttrPosition )
+sal_Int32  o_rNextAttrPosition,
+std::listSwFrmFmt* rTextBoxes)
 {
 // if the attribute has a dummy character, then xRef is set (except META)
 // otherwise, the portion for the attribute is inserted into rPortions!
@@ -856,6 +859,11 @@ lcl_ExportHints(
 pUnoCrsr-Right(1,CRSR_SKIP_CHARS,false,false);
 if( *pUnoCrsr-GetMark() == *pUnoCrsr-GetPoint() )
 break; // Robust #i81708 content in covered cells
+
+// Do not expose inline anchored textboxes.
+if (std::find(rTextBoxes.begin(), rTextBoxes.end(), 
pAttr-GetFlyCnt().GetFrmFmt()) != rTextBoxes.end())
+break;
+
 pUnoCrsr-Exchange();
 xRef = new SwXTextPortion( pUnoCrsr, xParent, 
PORTION_FRAME);
 }
@@ -1234,6 +1242,8 @@ static void lcl_CreatePortions(
 PortionStack_t PortionStack;
 PortionStack.push( PortionList_t(i_rPortions, (const SwTxtAttr *)0) );
 
+std::listSwFrmFmt* aTextBoxes = SwTextBoxHelper::findTextBoxes(pDoc);
+
 bool bAtEnd( false );
 while (!bAtEnd) // every iteration consumes at least current character!
 {
@@ -1284,7 +1294,7 @@ static void lcl_CreatePortions(
 // N.B.: side-effects nNextAttrIndex, bCursorMoved; may move cursor
 xRef = lcl_ExportHints(PortionStack, i_xParentText, pUnoCrsr,
 pHints, i_nStartPos, i_nEndPos, nCurrentIndex, bAtEnd,
-bCursorMoved, nNextAttrIndex);
+bCursorMoved, nNextAttrIndex, aTextBoxes);
 if (PortionStack.empty())
 {
 OSL_FAIL(CreatePortions: stack underflow);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/textbox' - sw/source

2014-05-21 Thread Miklos Vajna
 sw/source/core/unocore/unoobj2.cxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit caa94e48e5e23c1d3fc07828aa16e5b3211d63b1
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Wed May 21 15:21:34 2014 +0200

SwXParaFrameEnumeration: ignore textboxes

Change-Id: I20278c8764d97b45c20fcb7caf1615dd6f79d5e7

diff --git a/sw/source/core/unocore/unoobj2.cxx 
b/sw/source/core/unocore/unoobj2.cxx
index cc43ec6..4660ce1 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -27,6 +27,7 @@
 #include frmfmt.hxx
 #include doc.hxx
 #include IDocumentUndoRedo.hxx
+#include textboxhelper.hxx
 #include ndtxt.hxx
 #include ndnotxt.hxx
 #include unocrsr.hxx
@@ -181,10 +182,17 @@ void CollectFrameAtNode( SwClient rClnt, const 
SwNodeIndex rIdx,
 {
 const SwSortedObjs *pObjs = pCFrm-GetDrawObjs();
 if( pObjs )
+{
+std::listSwFrmFmt* aTextBoxes = 
SwTextBoxHelper::findTextBoxes(pDoc);
 for( sal_uInt16 i = 0; i  pObjs-Count(); ++i )
 {
 SwAnchoredObject* pAnchoredObj = (*pObjs)[i];
 SwFrmFmt rFmt = pAnchoredObj-GetFrmFmt();
+
+// Filter out textboxes, which are not interesting at an UNO 
level.
+if (std::find(aTextBoxes.begin(), aTextBoxes.end(), rFmt) != 
aTextBoxes.end())
+continue;
+
 if ( rFmt.GetAnchor().GetAnchorId() == nChkType )
 {
 // create SwDepend and insert into array
@@ -199,6 +207,7 @@ void CollectFrameAtNode( SwClient rClnt, const 
SwNodeIndex rIdx,
 rFrames.push_back(entry);
 }
 }
+}
 }
 else
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits