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
a64c066b
Kaydet (Commit)
a64c066b
authored
Mar 20, 2013
tarafından
Jürgen Schmidt
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#121730# add new optional interface XRangeBasedSmartTagRecognizer for SmartTags
Patch by: Kai Labusch Review by: arielch, jsc
üst
bc3d9d8e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
162 additions
and
5 deletions
+162
-5
XRangeBasedSmartTagRecognizer.idl
.../com/sun/star/smarttags/XRangeBasedSmartTagRecognizer.idl
+101
-0
XSmartTagRecognizer.idl
offapi/com/sun/star/smarttags/XSmartTagRecognizer.idl
+5
-1
makefile.mk
offapi/com/sun/star/smarttags/makefile.mk
+1
-0
SmartTagMgr.hxx
svx/inc/svx/SmartTagMgr.hxx
+7
-1
SmartTagMgr.cxx
svx/source/smarttags/SmartTagMgr.cxx
+38
-1
txtedt.cxx
sw/source/core/txtnode/txtedt.cxx
+10
-2
No files found.
offapi/com/sun/star/smarttags/XRangeBasedSmartTagRecognizer.idl
0 → 100644
Dosyayı görüntüle @
a64c066b
/**************************************************************
*
*
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
*
*
Unless
required
by
applicable
law
or
agreed
to
in
writing
,
*
software
distributed
under
the
License
is
distributed
on
an
*
"AS IS"
BASIS
,
WITHOUT
WARRANTIES
OR
CONDITIONS
OF
ANY
*
KIND
,
either
express
or
implied
.
See
the
License
for
the
*
specific
language
governing
permissions
and
limitations
*
under
the
License
.
*
*************************************************************/
#
ifndef
__com_sun_star_smarttags_XRangeBasedSmartTagRecognizer_idl__
#
define
__com_sun_star_smarttags_XRangeBasedSmartTagRecognizer_idl__
#
ifndef
__com_sun_star_uno_XInitialization_idl__
#
include
<
com
/
sun
/
star
/
lang
/
XInitialization
.
idl>
#
endif
#
ifndef
__com_sun_star_lang_Locale_idl__
#
include
<
com
/
sun
/
star
/
lang
/
Locale
.
idl>
#
endif
#
ifndef
__com_sun_star_smarttags_SmartTagRecognizerMode_idl__
#
include
<
com
/
sun
/
star
/
smarttags
/
SmartTagRecognizerMode
.
idl>
#
endif
#
ifndef
__com_sun_star_text_XTextMarkup_idl__
#
include
<
com
/
sun
/
star
/
text
/
XTextMarkup
.
idl>
#
endif
#
ifndef
__com_sun_star_frame_XController_idl__
#
include
<
com
/
sun
/
star
/
frame
/
XController
.
idl>
#
endif
#
ifndef
__com_sun_star_lang_IndexOutOfBoundsException_idl__
#
include
<
com
/
sun
/
star
/
lang
/
IndexOutOfBoundsException
.
idl>
#
endif
#
ifndef
__com_sun_star_text_XTextRange_idl__
#
include
<
com
/
sun
/
star
/
text
/
XTextRange
.
idl>
#
endif
//=============================================================================
module
com
{
module
sun
{
module
star
{
module
smarttags
{
//=============================================================================
/**
provides
access
to
a
range
based
smart
tag
recognizer
.
*/
interface
XRangeBasedSmartTagRecognizer
:
com
::
sun
::
star
::
lang
::
XInitialization
{
//-------------------------------------------------------------------------
/**
recognizes
smart
tags
.
@
param
xRange
The
text
that
should
be
scanned
by
the
recognizer
.
@
param
eDataType
This
value
indicates
the
type
of
the
passed
text
.
@
param
aLocale
Is
used
to
indicate
the
language
of
the
passed
text
.
@
param
xTextMarkup
This
object
is
used
to
submit
any
recognized
smart
tags
to
the
calling
application
.
@
param
aApplicationName
A
string
containing
the
name
of
the
calling
application
.
@
param
xController
The
current
controller
of
the
document
.
*/
void
recognizeTextRange
(
[
in
]
com
::
sun
::
star
::
text
::
XTextRange
xRange
,
[
in
]
SmartTagRecognizerMode
eDataType
,
[
in
]
com
::
sun
::
star
::
text
::
XTextMarkup
xTextMarkup
,
[
in
]
string
aApplicationName
,
[
in
]
com
::
sun
::
star
::
frame
::
XController
xController
)
;
}
;
}
; }; }; };
#
endif
offapi/com/sun/star/smarttags/XSmartTagRecognizer.idl
Dosyayı görüntüle @
a64c066b
...
...
@@ -52,6 +52,11 @@
#
include
<
com
/
sun
/
star
/
lang
/
IndexOutOfBoundsException
.
idl>
#
endif
#
ifndef
__com_sun_star_text_XTextRange_idl__
#
include
<
com
/
sun
/
star
/
text
/
XTextRange
.
idl>
#
endif
//=============================================================================
module
com
{
module
sun
{
module
star
{
module
smarttags
{
...
...
@@ -178,7 +183,6 @@ interface XSmartTagRecognizer: com::sun::star::lang::XInitialization
[
in
]
com
::
sun
::
star
::
frame
::
XController
xController
,
[
in
]
com
::
sun
::
star
::
i18n
::
XBreakIterator
xTokenizer
)
;
//-------------------------------------------------------------------------
/**
indicates
whether
there
is
a
property
page
for
a
smart
tag
type
.
...
...
offapi/com/sun/star/smarttags/makefile.mk
Dosyayı görüntüle @
a64c066b
...
...
@@ -37,6 +37,7 @@ IDLFILES=\
SmartTagAction.idl
\
SmartTagRecognizer.idl
\
SmartTagRecognizerMode.idl
\
XRangeBasedSmartTagRecognizer.idl
\
XSmartTagAction.idl
\
XSmartTagRecognizer.idl
...
...
svx/inc/svx/SmartTagMgr.hxx
Dosyayı görüntüle @
a64c066b
...
...
@@ -46,6 +46,7 @@ namespace com { namespace sun { namespace star { namespace smarttags {
namespace
com
{
namespace
sun
{
namespace
star
{
namespace
text
{
class
XTextMarkup
;
class
XTextRange
;
}
}
}
}
namespace
com
{
namespace
sun
{
namespace
star
{
namespace
i18n
{
...
...
@@ -155,12 +156,17 @@ public:
The length of the text to be scanned.
*/
void
Recognize
(
const
rtl
::
OUString
&
rText
,
void
Recognize
String
(
const
rtl
::
OUString
&
rText
,
const
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
text
::
XTextMarkup
>
xMarkup
,
const
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
frame
::
XController
>
xController
,
const
com
::
sun
::
star
::
lang
::
Locale
&
rLocale
,
sal_uInt32
nStart
,
sal_uInt32
nLen
)
const
;
void
RecognizeTextRange
(
const
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
text
::
XTextRange
>
xRange
,
const
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
text
::
XTextMarkup
>
xMarkup
,
const
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
frame
::
XController
>
xController
)
const
;
/** Returns all action references associated with a given list of smart tag types
@param rSmartTagTypes
...
...
svx/source/smarttags/SmartTagMgr.cxx
Dosyayı görüntüle @
a64c066b
...
...
@@ -30,6 +30,7 @@
#include <vos/mutex.hxx>
#include <vcl/svapp.hxx>
#include <com/sun/star/smarttags/XSmartTagRecognizer.hpp>
#include <com/sun/star/smarttags/XRangeBasedSmartTagRecognizer.hpp>
#include <com/sun/star/smarttags/XSmartTagAction.hpp>
#include <com/sun/star/deployment/ExtensionManager.hpp>
#include <com/sun/star/text/XTextMarkup.hpp>
...
...
@@ -50,6 +51,8 @@
#include <rtl/ustring.hxx>
#include <tools/string.hxx>
#include <com/sun/star/text/XTextRange.hpp>
using
namespace
com
::
sun
::
star
;
using
namespace
com
::
sun
::
star
::
uno
;
...
...
@@ -100,7 +103,7 @@ void SmartTagMgr::CreateBreakIterator() const
/** Dispatches the recognize call to all installed smart tag recognizers
*/
void
SmartTagMgr
::
Recognize
(
const
rtl
::
OUString
&
rText
,
void
SmartTagMgr
::
Recognize
String
(
const
rtl
::
OUString
&
rText
,
const
Reference
<
text
::
XTextMarkup
>
xMarkup
,
const
Reference
<
frame
::
XController
>
xController
,
const
lang
::
Locale
&
rLocale
,
...
...
@@ -132,6 +135,40 @@ void SmartTagMgr::Recognize( const rtl::OUString& rText,
}
}
void
SmartTagMgr
::
RecognizeTextRange
(
const
Reference
<
text
::
XTextRange
>
xRange
,
const
Reference
<
text
::
XTextMarkup
>
xMarkup
,
const
Reference
<
frame
::
XController
>
xController
)
const
{
for
(
sal_uInt32
i
=
0
;
i
<
maRecognizerList
.
size
();
i
++
)
{
Reference
<
smarttags
::
XSmartTagRecognizer
>
xRecognizer
=
maRecognizerList
[
i
];
Reference
<
smarttags
::
XRangeBasedSmartTagRecognizer
>
xRangeBasedRecognizer
=
Reference
<
smarttags
::
XRangeBasedSmartTagRecognizer
>
(
xRecognizer
,
UNO_QUERY
);
if
(
!
xRangeBasedRecognizer
.
is
())
continue
;
// if all smart tag types supported by this recognizer have been
// disabled, we do not have to call the recognizer:
bool
bCallRecognizer
=
false
;
const
sal_uInt32
nSmartTagCount
=
xRecognizer
->
getSmartTagCount
();
for
(
sal_uInt32
j
=
0
;
j
<
nSmartTagCount
&&
!
bCallRecognizer
;
++
j
)
{
const
rtl
::
OUString
aSmartTagName
=
xRecognizer
->
getSmartTagName
(
j
);
if
(
IsSmartTagTypeEnabled
(
aSmartTagName
)
)
bCallRecognizer
=
true
;
}
if
(
bCallRecognizer
)
{
xRangeBasedRecognizer
->
recognizeTextRange
(
xRange
,
smarttags
::
SmartTagRecognizerMode_PARAGRAPH
,
xMarkup
,
maApplicationName
,
xController
);
}
}
}
typedef
std
::
multimap
<
rtl
::
OUString
,
ActionReference
>::
const_iterator
SmartTagMapIter
;
void
SmartTagMgr
::
GetActionSequences
(
Sequence
<
rtl
::
OUString
>&
rSmartTagTypes
,
...
...
sw/source/core/txtnode/txtedt.cxx
Dosyayı görüntüle @
a64c066b
...
...
@@ -88,6 +88,7 @@
#include <vector>
#include <unotextrange.hxx>
using
rtl
::
OUString
;
using
namespace
::
com
::
sun
::
star
;
...
...
@@ -1352,7 +1353,14 @@ SwRect SwTxtFrm::SmartTagScan( SwCntntNode* /*pActNode*/, xub_StrLen /*nActPos*/
Reference
<
::
com
::
sun
::
star
::
frame
::
XController
>
xController
=
pNode
->
GetDoc
()
->
GetDocShell
()
->
GetController
();
xub_StrLen
nLangBegin
=
nBegin
;
SwPosition
start
(
*
pNode
,
nBegin
);
SwPosition
end
(
*
pNode
,
nEnd
);
Reference
<
::
com
::
sun
::
star
::
text
::
XTextRange
>
xRange
=
SwXTextRange
::
CreateXTextRange
(
*
pNode
->
GetDoc
(),
start
,
&
end
);
rSmartTagMgr
.
RecognizeTextRange
(
xRange
,
xTextMarkup
,
xController
);
xub_StrLen
nLangBegin
=
nBegin
;
xub_StrLen
nLangEnd
=
nEnd
;
// smart tag recognization has to be done for each language portion:
...
...
@@ -1367,7 +1375,7 @@ SwRect SwTxtFrm::SmartTagScan( SwCntntNode* /*pActNode*/, xub_StrLen /*nActPos*/
const
sal_uInt32
nExpandBegin
=
ModelToViewHelper
::
ConvertToViewPosition
(
pConversionMap
,
nLangBegin
);
const
sal_uInt32
nExpandEnd
=
ModelToViewHelper
::
ConvertToViewPosition
(
pConversionMap
,
nLangEnd
);
rSmartTagMgr
.
Recognize
(
aExpandText
,
xTextMarkup
,
xController
,
aLocale
,
nExpandBegin
,
nExpandEnd
-
nExpandBegin
);
rSmartTagMgr
.
Recognize
String
(
aExpandText
,
xTextMarkup
,
xController
,
aLocale
,
nExpandBegin
,
nExpandEnd
-
nExpandBegin
);
nLangBegin
=
nLangEnd
;
}
...
...
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