Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
69578bf0
Kaydet (Commit)
69578bf0
authored
May 27, 2014
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
SwXDrawPage::getByIndex(): ignore textboxes
Change-Id: I643ca4268e15af1882adb168af152835ef216cd9
üst
f1dae10c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
3 deletions
+38
-3
textboxhelper.hxx
sw/inc/textboxhelper.hxx
+3
-0
textboxhelper.cxx
sw/source/core/doc/textboxhelper.cxx
+30
-2
unodraw.cxx
sw/source/core/unocore/unodraw.cxx
+5
-1
No files found.
sw/inc/textboxhelper.hxx
Dosyayı görüntüle @
69578bf0
...
...
@@ -14,6 +14,7 @@
#include <com/sun/star/uno/Any.h>
#include <com/sun/star/uno/Type.h>
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
class
SdrPage
;
class
SwFrmFmt
;
...
...
@@ -43,6 +44,8 @@ public:
static
std
::
list
<
SwFrmFmt
*>
findTextBoxes
(
SwDoc
*
pDoc
);
/// Count number of shapes in the document, excluding TextBoxes.
static
sal_Int32
getCount
(
SdrPage
*
pPage
,
std
::
list
<
SwFrmFmt
*>&
rTextBoxes
);
/// Get a shape by index, excluding TextBoxes.
static
css
::
uno
::
Any
getByIndex
(
SdrPage
*
pPage
,
sal_Int32
nIndex
,
std
::
list
<
SwFrmFmt
*>&
rTextBoxes
)
throw
(
css
::
lang
::
IndexOutOfBoundsException
);
};
#endif // INCLUDED_SW_INC_TEXTBOXHELPER_HXX
...
...
sw/source/core/doc/textboxhelper.cxx
Dosyayı görüntüle @
69578bf0
...
...
@@ -98,19 +98,47 @@ std::list<SwFrmFmt*> SwTextBoxHelper::findTextBoxes(SwDoc* pDoc)
return
aRet
;
}
/// If the passed SdrObject is in fact a TextFrame, that is used as a TextBox.
bool
lcl_isTextBox
(
SdrObject
*
pSdrObject
,
std
::
list
<
SwFrmFmt
*>&
rTextBoxes
)
{
SwVirtFlyDrawObj
*
pObject
=
PTR_CAST
(
SwVirtFlyDrawObj
,
pSdrObject
);
return
pObject
&&
std
::
find
(
rTextBoxes
.
begin
(),
rTextBoxes
.
end
(),
pObject
->
GetFmt
())
!=
rTextBoxes
.
end
();
}
sal_Int32
SwTextBoxHelper
::
getCount
(
SdrPage
*
pPage
,
std
::
list
<
SwFrmFmt
*>&
rTextBoxes
)
{
sal_Int32
nRet
=
0
;
for
(
size_t
i
=
0
;
i
<
pPage
->
GetObjCount
();
++
i
)
{
SwVirtFlyDrawObj
*
pObject
=
PTR_CAST
(
SwVirtFlyDrawObj
,
pPage
->
GetObj
(
i
));
if
(
pObject
&&
std
::
find
(
rTextBoxes
.
begin
(),
rTextBoxes
.
end
(),
pObject
->
GetFmt
())
!=
rTextBoxes
.
end
())
if
(
lcl_isTextBox
(
pPage
->
GetObj
(
i
),
rTextBoxes
))
continue
;
++
nRet
;
}
return
nRet
;
}
uno
::
Any
SwTextBoxHelper
::
getByIndex
(
SdrPage
*
pPage
,
sal_Int32
nIndex
,
std
::
list
<
SwFrmFmt
*>&
rTextBoxes
)
throw
(
lang
::
IndexOutOfBoundsException
)
{
if
(
nIndex
<
0
||
nIndex
>=
getCount
(
pPage
,
rTextBoxes
))
throw
lang
::
IndexOutOfBoundsException
();
SdrObject
*
pRet
=
0
;
sal_Int32
nCount
=
0
;
// Current logical index.
for
(
size_t
i
=
0
;
i
<
pPage
->
GetObjCount
();
++
i
)
{
if
(
lcl_isTextBox
(
pPage
->
GetObj
(
i
),
rTextBoxes
))
continue
;
if
(
nCount
==
nIndex
)
{
pRet
=
pPage
->
GetObj
(
i
);
break
;
}
++
nCount
;
}
assert
(
pRet
);
return
uno
::
makeAny
(
uno
::
Reference
<
drawing
::
XShape
>
(
pRet
->
getUnoShape
(),
uno
::
UNO_QUERY
));
}
SwFrmFmt
*
SwTextBoxHelper
::
findTextBox
(
SwFrmFmt
*
pShape
)
{
SwFrmFmt
*
pRet
=
0
;
...
...
sw/source/core/unocore/unodraw.cxx
Dosyayı görüntüle @
69578bf0
...
...
@@ -538,7 +538,11 @@ uno::Any SwXDrawPage::getByIndex(sal_Int32 nIndex)
throw
lang
::
IndexOutOfBoundsException
();
((
SwXDrawPage
*
)
this
)
->
GetSvxPage
();
return
pDrawPage
->
getByIndex
(
nIndex
);
std
::
list
<
SwFrmFmt
*>
aTextBoxes
=
SwTextBoxHelper
::
findTextBoxes
(
pDoc
);
if
(
aTextBoxes
.
empty
())
return
pDrawPage
->
getByIndex
(
nIndex
);
else
return
SwTextBoxHelper
::
getByIndex
(
pDrawPage
->
GetSdrPage
(),
nIndex
,
aTextBoxes
);
}
uno
::
Type
SwXDrawPage
::
getElementType
(
void
)
throw
(
uno
::
RuntimeException
,
std
::
exception
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment