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
de751733
Kaydet (Commit)
de751733
authored
Mar 20, 2013
tarafından
Jürgen Schmidt
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#121734# extend XTextMarkup to support ranges
Patch by: Kai Labusch Review by: arielch, jsc
üst
5da75c78
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
105 additions
and
6 deletions
+105
-6
XTextMarkup.idl
offapi/com/sun/star/text/XTextMarkup.idl
+12
-1
unoflatpara.hxx
sw/inc/unoflatpara.hxx
+12
-1
unotextmarkup.hxx
sw/inc/unotextmarkup.hxx
+13
-1
unoflatpara.cxx
sw/source/core/unocore/unoflatpara.cxx
+13
-2
unotextmarkup.cxx
sw/source/core/unocore/unotextmarkup.cxx
+55
-1
No files found.
offapi/com/sun/star/text/XTextMarkup.idl
Dosyayı görüntüle @
de751733
...
...
@@ -32,6 +32,11 @@
#
include
<
com
/
sun
/
star
/
text
/
TextMarkupType
.
idl>
#
endif
#
ifndef
__com_sun_star_text_XTextRange_idl__
#
include
<
com
/
sun
/
star
/
text
/
XTextRange
.
idl>
#
endif
//=============================================================================
module
com
{
module
sun
{
module
star
{
module
text
{
...
...
@@ -74,11 +79,17 @@ interface XTextMarkup
@
param
xMarkupInfoContainer
contains
additional
information
about
the
markup
.
*/
void
commit
Text
Markup
(
[
in
]
long
nType
,
void
commit
String
Markup
(
[
in
]
long
nType
,
[
in
]
string
aIdentifier
,
[
in
]
long
nStart
,
[
in
]
long
nLength
,
[
in
]
com
::
sun
::
star
::
container
::
XStringKeyMap
xMarkupInfoContainer
)
;
void
commitTextRangeMarkup
(
[
in
]
long
nType
,
[
in
]
string
aIdentifier
,
[
in
]
com
::
sun
::
star
::
text
::
XTextRange
xRange
,
[
in
]
com
::
sun
::
star
::
container
::
XStringKeyMap
xMarkupInfoContainer
)
;
}
;
}
; }; }; };
...
...
sw/inc/unoflatpara.hxx
Dosyayı görüntüle @
de751733
...
...
@@ -40,6 +40,10 @@ namespace com { namespace sun { namespace star { namespace container {
class
XStringKeyMap
;
}
}
}
}
namespace
com
{
namespace
sun
{
namespace
star
{
namespace
text
{
class
XTextRange
;
}
}
}
}
class
SwTxtNode
;
class
SwDoc
;
...
...
@@ -68,7 +72,14 @@ public:
// text::XTextMarkup:
virtual
css
::
uno
::
Reference
<
css
::
container
::
XStringKeyMap
>
SAL_CALL
getMarkupInfoContainer
()
throw
(
css
::
uno
::
RuntimeException
);
virtual
void
SAL_CALL
commitTextMarkup
(
::
sal_Int32
nType
,
const
::
rtl
::
OUString
&
aIdentifier
,
::
sal_Int32
nStart
,
::
sal_Int32
nLength
,
const
css
::
uno
::
Reference
<
css
::
container
::
XStringKeyMap
>
&
xMarkupInfoContainer
)
throw
(
css
::
uno
::
RuntimeException
);
virtual
void
SAL_CALL
commitStringMarkup
(
::
sal_Int32
nType
,
const
::
rtl
::
OUString
&
aIdentifier
,
::
sal_Int32
nStart
,
::
sal_Int32
nLength
,
const
css
::
uno
::
Reference
<
css
::
container
::
XStringKeyMap
>
&
xMarkupInfoContainer
)
throw
(
css
::
uno
::
RuntimeException
);
virtual
void
SAL_CALL
commitTextRangeMarkup
(
::
sal_Int32
nType
,
const
::
rtl
::
OUString
&
aIdentifier
,
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
text
::
XTextRange
>
&
xRange
,
const
css
::
uno
::
Reference
<
css
::
container
::
XStringKeyMap
>
&
xMarkupInfoContainer
)
throw
(
css
::
uno
::
RuntimeException
);
// text::XFlatParagraph:
virtual
::
rtl
::
OUString
SAL_CALL
getText
()
throw
(
css
::
uno
::
RuntimeException
);
...
...
sw/inc/unotextmarkup.hxx
Dosyayı görüntüle @
de751733
...
...
@@ -37,6 +37,11 @@ namespace com { namespace sun { namespace star { namespace container {
class
XStringKeyMap
;
}
}
}
}
namespace
com
{
namespace
sun
{
namespace
star
{
namespace
text
{
class
XTextRange
;
}
}
}
}
class
SwTxtNode
;
class
SfxPoolItem
;
...
...
@@ -56,7 +61,14 @@ public:
// ::com::sun::star::text::XTextMarkup:
virtual
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
container
::
XStringKeyMap
>
SAL_CALL
getMarkupInfoContainer
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
void
SAL_CALL
commitTextMarkup
(
::
sal_Int32
nType
,
const
::
rtl
::
OUString
&
aIdentifier
,
::
sal_Int32
nStart
,
::
sal_Int32
nLength
,
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
container
::
XStringKeyMap
>
&
xMarkupInfoContainer
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
void
SAL_CALL
commitStringMarkup
(
::
sal_Int32
nType
,
const
::
rtl
::
OUString
&
aIdentifier
,
::
sal_Int32
nStart
,
::
sal_Int32
nLength
,
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
container
::
XStringKeyMap
>
&
xMarkupInfoContainer
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
void
SAL_CALL
commitTextRangeMarkup
(
::
sal_Int32
nType
,
const
::
rtl
::
OUString
&
aIdentifier
,
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
text
::
XTextRange
>
&
xRange
,
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
container
::
XStringKeyMap
>
&
xMarkupInfoContainer
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
// ::com::sun::star::text::XMultiTextMarkup:
virtual
void
SAL_CALL
commitMultiTextMarkup
(
const
::
com
::
sun
::
star
::
uno
::
Sequence
<
::
com
::
sun
::
star
::
text
::
TextMarkupDescriptor
>&
aMarkups
)
throw
(
::
com
::
sun
::
star
::
lang
::
IllegalArgumentException
,
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
...
...
sw/source/core/unocore/unoflatpara.cxx
Dosyayı görüntüle @
de751733
...
...
@@ -50,6 +50,9 @@
#include <IGrammarContact.hxx>
#include <viewopt.hxx>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/text/XTextRange.hpp>
using
namespace
::
com
::
sun
::
star
;
/******************************************************************************
...
...
@@ -117,10 +120,18 @@ css::uno::Reference< css::container::XStringKeyMap > SAL_CALL SwXFlatParagraph::
return
SwXTextMarkup
::
getMarkupInfoContainer
();
}
void
SAL_CALL
SwXFlatParagraph
::
commitTextMarkup
(
::
sal_Int32
nType
,
const
::
rtl
::
OUString
&
rIdentifier
,
::
sal_Int32
nStart
,
::
sal_Int32
nLength
,
const
css
::
uno
::
Reference
<
css
::
container
::
XStringKeyMap
>
&
rxMarkupInfoContainer
)
throw
(
css
::
uno
::
RuntimeException
)
void
SAL_CALL
SwXFlatParagraph
::
commitTextRangeMarkup
(
::
sal_Int32
nType
,
const
::
rtl
::
OUString
&
aIdentifier
,
const
uno
::
Reference
<
text
::
XTextRange
>
&
xRange
,
const
css
::
uno
::
Reference
<
css
::
container
::
XStringKeyMap
>
&
xMarkupInfoContainer
)
throw
(
uno
::
RuntimeException
)
{
vos
::
OGuard
aGuard
(
Application
::
GetSolarMutex
());
SwXTextMarkup
::
commitTextRangeMarkup
(
nType
,
aIdentifier
,
xRange
,
xMarkupInfoContainer
);
}
void
SAL_CALL
SwXFlatParagraph
::
commitStringMarkup
(
::
sal_Int32
nType
,
const
::
rtl
::
OUString
&
rIdentifier
,
::
sal_Int32
nStart
,
::
sal_Int32
nLength
,
const
css
::
uno
::
Reference
<
css
::
container
::
XStringKeyMap
>
&
rxMarkupInfoContainer
)
throw
(
css
::
uno
::
RuntimeException
)
{
vos
::
OGuard
aGuard
(
Application
::
GetSolarMutex
());
SwXTextMarkup
::
commit
Text
Markup
(
nType
,
rIdentifier
,
nStart
,
nLength
,
rxMarkupInfoContainer
);
SwXTextMarkup
::
commit
String
Markup
(
nType
,
rIdentifier
,
nStart
,
nLength
,
rxMarkupInfoContainer
);
}
// text::XFlatParagraph:
...
...
sw/source/core/unocore/unotextmarkup.cxx
Dosyayı görüntüle @
de751733
...
...
@@ -36,6 +36,15 @@
#include <IGrammarContact.hxx>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/text/XTextRange.hpp>
#include <pam.hxx>
#include <unotextrange.hxx>
#include <unotextcursor.hxx>
using
namespace
::
com
::
sun
::
star
;
/*
...
...
@@ -62,7 +71,52 @@ uno::Reference< container::XStringKeyMap > SAL_CALL SwXTextMarkup::getMarkupInfo
return
xProp
;
}
void
SAL_CALL
SwXTextMarkup
::
commitTextMarkup
(
void
SAL_CALL
SwXTextMarkup
::
commitTextRangeMarkup
(
::
sal_Int32
nType
,
const
::
rtl
::
OUString
&
aIdentifier
,
const
uno
::
Reference
<
text
::
XTextRange
>
&
xRange
,
const
uno
::
Reference
<
container
::
XStringKeyMap
>
&
xMarkupInfoContainer
)
throw
(
uno
::
RuntimeException
)
{
vos
::
OGuard
aGuard
(
Application
::
GetSolarMutex
());
uno
::
Reference
<
lang
::
XUnoTunnel
>
xRangeTunnel
(
xRange
,
uno
::
UNO_QUERY
);
if
(
!
xRangeTunnel
.
is
())
return
;
SwXTextRange
*
pRange
=
0
;
OTextCursorHelper
*
pCursor
=
0
;
if
(
xRangeTunnel
.
is
())
{
pRange
=
reinterpret_cast
<
SwXTextRange
*>
(
sal
::
static_int_cast
<
sal_IntPtr
>
(
xRangeTunnel
->
getSomething
(
SwXTextRange
::
getUnoTunnelId
())));
pCursor
=
reinterpret_cast
<
OTextCursorHelper
*>
(
sal
::
static_int_cast
<
sal_IntPtr
>
(
xRangeTunnel
->
getSomething
(
OTextCursorHelper
::
getUnoTunnelId
())));
}
if
(
pRange
)
{
SwDoc
*
pDoc
=
reinterpret_cast
<
SwDoc
*>
(
pRange
->
GetDoc
());
if
(
!
pDoc
)
return
;
SwUnoInternalPaM
aPam
(
*
pDoc
);
::
sw
::
XTextRangeToSwPaM
(
aPam
,
xRange
);
SwPosition
*
startPos
=
aPam
.
Start
();
SwPosition
*
endPos
=
aPam
.
End
();
commitStringMarkup
(
nType
,
aIdentifier
,
startPos
->
nContent
.
GetIndex
(),
endPos
->
nContent
.
GetIndex
()
-
startPos
->
nContent
.
GetIndex
(),
xMarkupInfoContainer
);
}
else
if
(
pCursor
)
{
SwPaM
aPam
(
*
pCursor
->
GetPaM
());
SwPosition
*
startPos
=
aPam
.
Start
();
SwPosition
*
endPos
=
aPam
.
End
();
commitStringMarkup
(
nType
,
aIdentifier
,
startPos
->
nContent
.
GetIndex
(),
endPos
->
nContent
.
GetIndex
()
-
startPos
->
nContent
.
GetIndex
(),
xMarkupInfoContainer
);
}
}
void
SAL_CALL
SwXTextMarkup
::
commitStringMarkup
(
::
sal_Int32
nType
,
const
::
rtl
::
OUString
&
rIdentifier
,
::
sal_Int32
nStart
,
...
...
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