[Libreoffice-commits] core.git: 8 commits - dictionaries include/svx m4/ax_boost_base.m4 offapi/com offapi/UnoApi_offapi.mk svx/source sw/inc sw/source vcl/source
Caolán McNamara
caolanm at redhat.com
Thu May 23 03:55:34 PDT 2013
dictionaries | 2
include/svx/SmartTagMgr.hxx | 8
m4/ax_boost_base.m4 | 2
offapi/UnoApi_offapi.mk | 2
offapi/com/sun/star/smarttags/XRangeBasedSmartTagRecognizer.idl | 68 +++
offapi/com/sun/star/smarttags/XSmartTagAction.idl | 9
offapi/com/sun/star/smarttags/XSmartTagRecognizer.idl | 3
offapi/com/sun/star/text/XMarkingAccess.idl | 34 +
offapi/com/sun/star/text/XTextMarkup.idl | 9
svx/source/mnuctrls/SmartTagCtl.cxx | 4
svx/source/smarttags/SmartTagMgr.cxx | 38 +
sw/inc/unotextcursor.hxx | 15
sw/source/core/inc/unoflatpara.hxx | 11
sw/source/core/inc/unotextmarkup.hxx | 12
sw/source/core/inc/wrong.hxx | 149 +++++++
sw/source/core/text/wrong.cxx | 29 +
sw/source/core/txtnode/fntcache.cxx | 195 +++++-----
sw/source/core/txtnode/txtedt.cxx | 11
sw/source/core/unocore/unoflatpara.cxx | 14
sw/source/core/unocore/unoobj.cxx | 41 ++
sw/source/core/unocore/unotextmarkup.cxx | 56 ++
sw/source/ui/smartmenu/stmenu.cxx | 2
vcl/source/gdi/pdfwriter_impl.cxx | 2
23 files changed, 594 insertions(+), 122 deletions(-)
New commits:
commit 28829fdefd263950ef2ccb7953e99a14154ac53a
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu May 23 10:45:52 2013 +0100
tweak bug comment to indicate which bug tracker its from
Change-Id: I4b6a27a72f76d0d22f4104004468292c19a190ce
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 3c7b186..bae72fe 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -7461,7 +7461,7 @@ void PDFWriterImpl::drawVerticalGlyphs(
}
aDeltaPos += (m_pReferenceDevice->PixelToLogic( Point( (int)((double)nXOffset/fXScale), 0 ) ) - m_pReferenceDevice->PixelToLogic( Point() ) );
if( i < rGlyphs.size()-1 )
- // [Bug 120627] the text on the Y axis is reversed when export ppt file to PDF format
+ // #i120627# the text on the Y axis is reversed when export ppt file to PDF format
{
long nOffsetX = rGlyphs[i+1].m_aPos.X() - rGlyphs[i].m_aPos.X();
long nOffsetY = rGlyphs[i+1].m_aPos.Y() - rGlyphs[i].m_aPos.Y();
commit c43ffd3d44060c0801138e33a9dfc917133b7c21
Author: Jürgen Schmidt <jsc at apache.org>
Date: Wed Mar 20 14:19:45 2013 +0000
Resolves: #i121734# extend XTextMarkup to support ranges
Patch by: Kai Labusch
Review by: arielch, jsc
(cherry picked from commit de75173372c022c3004643d8978f76662261130b)
Conflicts:
offapi/com/sun/star/text/XTextMarkup.idl
sw/inc/unoflatpara.hxx
sw/inc/unotextmarkup.hxx
sw/source/core/unocore/unoflatpara.cxx
Change-Id: I2cfa15f08a893feb8880dc729b76cff3d29ce4eb
diff --git a/offapi/com/sun/star/text/XTextMarkup.idl b/offapi/com/sun/star/text/XTextMarkup.idl
index 089b9b7..9edf5c4 100644
--- a/offapi/com/sun/star/text/XTextMarkup.idl
+++ b/offapi/com/sun/star/text/XTextMarkup.idl
@@ -22,6 +22,7 @@
#include <com/sun/star/container/XStringKeyMap.idl>
#include <com/sun/star/text/TextMarkupType.idl>
+#include <com/sun/star/text/XTextRange.idl>
module com { module sun { module star { module text {
@@ -61,11 +62,17 @@ interface XTextMarkup
@param xMarkupInfoContainer
contains additional information about the markup.
*/
- void commitTextMarkup( [in] long nType,
+ void commitStringMarkup( [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 );
+
};
}; }; }; };
diff --git a/sw/source/core/inc/unoflatpara.hxx b/sw/source/core/inc/unoflatpara.hxx
index ff499ab..3192751 100644
--- a/sw/source/core/inc/unoflatpara.hxx
+++ b/sw/source/core/inc/unoflatpara.hxx
@@ -34,6 +34,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;
@@ -62,7 +66,12 @@ 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 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 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 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 OUString SAL_CALL getText() throw (css::uno::RuntimeException);
diff --git a/sw/source/core/inc/unotextmarkup.hxx b/sw/source/core/inc/unotextmarkup.hxx
index 8a5b3c7..1ceb413 100644
--- a/sw/source/core/inc/unotextmarkup.hxx
+++ b/sw/source/core/inc/unotextmarkup.hxx
@@ -33,6 +33,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;
@@ -52,7 +57,12 @@ 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 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 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 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);
diff --git a/sw/source/core/unocore/unoflatpara.cxx b/sw/source/core/unocore/unoflatpara.cxx
index 2c3696a..c1c2b92 100644
--- a/sw/source/core/unocore/unoflatpara.cxx
+++ b/sw/source/core/unocore/unoflatpara.cxx
@@ -44,6 +44,9 @@
#include <viewopt.hxx>
#include <comphelper/servicehelper.hxx>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <com/sun/star/text/XTextRange.hpp>
+
using namespace ::com::sun::star;
namespace SwUnoCursorHelper {
@@ -119,10 +122,17 @@ css::uno::Reference< css::container::XStringKeyMap > SAL_CALL SwXFlatParagraph::
return SwXTextMarkup::getMarkupInfoContainer();
}
-void SAL_CALL SwXFlatParagraph::commitTextMarkup(::sal_Int32 nType, const 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 OUString & aIdentifier, const uno::Reference< text::XTextRange> & xRange,
+ const css::uno::Reference< css::container::XStringKeyMap > & xMarkupInfoContainer) throw (uno::RuntimeException)
+{
+ SolarMutexGuard aGuard;
+ SwXTextMarkup::commitTextRangeMarkup( nType, aIdentifier, xRange, xMarkupInfoContainer );
+}
+
+void SAL_CALL SwXFlatParagraph::commitStringMarkup(::sal_Int32 nType, const OUString & rIdentifier, ::sal_Int32 nStart, ::sal_Int32 nLength, const css::uno::Reference< css::container::XStringKeyMap > & rxMarkupInfoContainer) throw (css::uno::RuntimeException)
{
SolarMutexGuard aGuard;
- SwXTextMarkup::commitTextMarkup( nType, rIdentifier, nStart, nLength, rxMarkupInfoContainer );
+ SwXTextMarkup::commitStringMarkup( nType, rIdentifier, nStart, nLength, rxMarkupInfoContainer );
}
// text::XFlatParagraph:
diff --git a/sw/source/core/unocore/unotextmarkup.cxx b/sw/source/core/unocore/unotextmarkup.cxx
index 72ffaa7..8976a657 100644
--- a/sw/source/core/unocore/unotextmarkup.cxx
+++ b/sw/source/core/unocore/unotextmarkup.cxx
@@ -30,6 +30,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;
/*
@@ -55,7 +64,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)
+{
+ SolarMutexGuard aGuard;
+
+ 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 OUString & rIdentifier,
::sal_Int32 nStart,
commit 79b231f7a032c7e04b74fa019e18a5d7e3b5f4f3
Author: Jürgen Schmidt <jsc at apache.org>
Date: Wed Mar 20 14:18:15 2013 +0000
Resolves: #i121733# enhancement for colored smarttags
Patch By: Kai Labusch
Review by: arielch, jsc
(cherry picked from commit 5da75c78a80e43cb2bb4ed777ae5efcc1449cdda)
Conflicts:
sw/source/core/inc/wrong.hxx
sw/source/core/txtnode/fntcache.cxx
Change-Id: Ibc609ce4ef3492b537bb1ddec5ff7c460eb2c573
diff --git a/sw/source/core/inc/wrong.hxx b/sw/source/core/inc/wrong.hxx
index a2add85..215fcd9 100644
--- a/sw/source/core/inc/wrong.hxx
+++ b/sw/source/core/inc/wrong.hxx
@@ -22,12 +22,37 @@
#include <com/sun/star/container/XStringKeyMap.hpp>
+#include <com/sun/star/util/Color.hpp>
+#include <com/sun/star/awt/FontUnderline.hpp>
+#include <com/sun/star/uno/Any.hxx>
+
#include <vector>
#include <tools/string.hxx>
+#include <tools/color.hxx>
+#include <viewopt.hxx>
class SwWrongList;
+enum WrongAreaLineType
+{
+ WRONGAREA_DASHED,
+ WRONGAREA_WAVE,
+ WRONGAREA_WAVE_NORMAL,
+ WRONGAREA_WAVE_SMALL,
+ WRONGAREA_WAVE_FLAT,
+ WRONGAREA_NONE
+};
+
+enum WrongListType
+{
+ WRONGLIST_SPELL,
+ WRONGLIST_GRAMMAR,
+ WRONGLIST_SMARTTAG,
+ WRONGLIST_CHANGETRACKING
+};
+
+
// ST2
class SwWrongArea
{
@@ -38,21 +63,122 @@ public:
xub_StrLen mnLen;
SwWrongList* mpSubList;
- SwWrongArea() : mnPos(0), mnLen(0), mpSubList(NULL) {}
+ Color mColor;
+ WrongAreaLineType mLineType;
+
+ SwWrongArea( const OUString& rType,
+ WrongListType listType,
+ com::sun::star::uno::Reference< com::sun::star::container::XStringKeyMap > xPropertyBag,
+ xub_StrLen nPos,
+ xub_StrLen nLen);
+
SwWrongArea( const OUString& rType,
com::sun::star::uno::Reference< com::sun::star::container::XStringKeyMap > xPropertyBag,
xub_StrLen nPos,
xub_StrLen nLen,
- SwWrongList* pSubList )
- : maType(rType), mxPropertyBag(xPropertyBag), mnPos(nPos), mnLen(nLen), mpSubList(pSubList) {}
-};
+ SwWrongList* pSubList);
+private:
+
+ SwWrongArea() : mnPos(0), mnLen(0), mpSubList(NULL), mColor(0,0,0), mLineType(WRONGAREA_WAVE) {}
+
+ Color getSmartColor ( com::sun::star::uno::Reference< com::sun::star::container::XStringKeyMap > xPropertyBag)
+ {
+ try
+ {
+ if (xPropertyBag.is())
+ {
+ const ::rtl::OUString colorKey = ::rtl::OUString::createFromAscii ("LineColor");
+ com::sun::star::uno::Any aLineColor = xPropertyBag->getValue(colorKey).get< com::sun::star::uno::Any>();
+ com::sun::star::util::Color lineColor = 0;
+
+ if (aLineColor >>= lineColor)
+ {
+ return Color( lineColor );
+ }
+ }
+ }
+ catch(::com::sun::star::container::NoSuchElementException& ex)
+ {
+ }
+ catch(::com::sun::star::uno::RuntimeException& ex)
+ {
+ }
+
+ return SwViewOption::GetSmarttagColor( );
+ }
+
+ WrongAreaLineType getSmartLineType( com::sun::star::uno::Reference< com::sun::star::container::XStringKeyMap > xPropertyBag )
+ {
+ try
+ {
+ if (xPropertyBag.is())
+ {
+ const ::rtl::OUString typeKey = ::rtl::OUString::createFromAscii ("LineType");
+ com::sun::star::uno::Any aLineType = xPropertyBag->getValue(typeKey).get< com::sun::star::uno::Any>();
+ ::sal_Int16 lineType = 0;
+
+ if (!(aLineType >>= lineType))
+ {
+ return WRONGAREA_DASHED;
+ }
+ if (::com::sun::star::awt::FontUnderline::WAVE == lineType)
+ {
+ return WRONGAREA_WAVE_NORMAL;
+ }
+ if (::com::sun::star::awt::FontUnderline::SMALLWAVE == lineType)
+ {
+ return WRONGAREA_WAVE_SMALL;
+ }
+ }
+ }
+ catch(::com::sun::star::container::NoSuchElementException& ex)
+ {
+ }
+ catch(::com::sun::star::uno::RuntimeException& ex)
+ {
+ }
+
+ return WRONGAREA_DASHED;
+ }
+
+ Color getWrongAreaColor(WrongListType listType,
+ com::sun::star::uno::Reference< com::sun::star::container::XStringKeyMap > xPropertyBag )
+ {
+ if (WRONGLIST_SPELL == listType)
+ {
+ return SwViewOption::GetSpellColor();
+ }
+ else if (WRONGLIST_GRAMMAR == listType)
+ {
+ return Color( COL_LIGHTBLUE );
+ }
+ else if (WRONGLIST_SMARTTAG == listType)
+ {
+ return getSmartColor(xPropertyBag);
+ }
+
+ return SwViewOption::GetSpellColor();
+ }
+
+ WrongAreaLineType getWrongAreaLineType(WrongListType listType,
+ com::sun::star::uno::Reference< com::sun::star::container::XStringKeyMap > xPropertyBag )
+ {
+ if (WRONGLIST_SPELL == listType)
+ {
+ return WRONGAREA_WAVE;
+ }
+ else if (WRONGLIST_GRAMMAR == listType)
+ {
+ return WRONGAREA_WAVE;
+ }
+ else if (WRONGLIST_SMARTTAG == listType)
+ {
+ return getSmartLineType(xPropertyBag);
+ }
+
+ return WRONGAREA_WAVE;
+ }
-enum WrongListType
-{
- WRONGLIST_SPELL,
- WRONGLIST_GRAMMAR,
- WRONGLIST_SMARTTAG,
- WRONGLIST_CHANGETRACKING
};
class SwWrongList
@@ -131,7 +257,8 @@ public:
i = maList.end(); // robust
else
i += nWhere;
- maList.insert(i, SwWrongArea( rType, xPropertyBag, nNewPos, nNewLen, 0 ) );
+
+ maList.insert(i, SwWrongArea( rType, meType, xPropertyBag, nNewPos, nNewLen) );
}
void Insert( const OUString& rType,
diff --git a/sw/source/core/text/wrong.cxx b/sw/source/core/text/wrong.cxx
index 4dabc00..59ce856 100644
--- a/sw/source/core/text/wrong.cxx
+++ b/sw/source/core/text/wrong.cxx
@@ -22,6 +22,33 @@
#include "SwGrammarMarkUp.hxx"
+/*************************************************************************
+ *SwWrongArea::SwWrongArea
+ *************************************************************************/
+
+SwWrongArea::SwWrongArea( const rtl::OUString& rType, WrongListType listType,
+ com::sun::star::uno::Reference< com::sun::star::container::XStringKeyMap > xPropertyBag,
+ xub_StrLen nPos,
+ xub_StrLen nLen)
+: maType(rType), mxPropertyBag(xPropertyBag), mnPos(nPos), mnLen(nLen), mpSubList(0)
+{
+ mColor = getWrongAreaColor(listType, xPropertyBag);
+ mLineType = getWrongAreaLineType(listType, xPropertyBag);
+}
+
+SwWrongArea::SwWrongArea( const rtl::OUString& rType,
+ com::sun::star::uno::Reference< com::sun::star::container::XStringKeyMap > xPropertyBag,
+ xub_StrLen nPos,
+ xub_StrLen nLen,
+ SwWrongList* pSubList)
+: maType(rType), mxPropertyBag(xPropertyBag), mnPos(nPos), mnLen(nLen), mpSubList(pSubList), mLineType(WRONGAREA_NONE)
+{
+ if (pSubList != 0)
+ {
+ mColor = getWrongAreaColor(pSubList->GetWrongListType(), xPropertyBag);
+ mLineType = getWrongAreaLineType(pSubList->GetWrongListType(), xPropertyBag);
+ }
+}
/*************************************************************************
* SwWrongList::SwWrongList()
@@ -622,7 +649,7 @@ void SwWrongList::Insert( const OUString& rType,
++aIter;
}
- maList.insert(aIter, SwWrongArea( rType, xPropertyBag, nNewPos, nNewLen, 0 ) );
+ maList.insert(aIter, SwWrongArea( rType, meType, xPropertyBag, nNewPos, nNewLen) );
}
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index 8398159..77ae849 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -665,115 +665,136 @@ static void lcl_DrawLineForWrongListData(
const CalcLinePosData &rCalcLinePosData,
const Size &rPrtFontSize )
{
- if (!pWList)
- return;
+ if (!pWList) return;
xub_StrLen nStart = rInf.GetIdx();
xub_StrLen nWrLen = rInf.GetLen();
// check if respective data is available in the current text range
- if (pWList->Check( nStart, nWrLen ))
+ if (!pWList->Check( nStart, nWrLen ))
+ {
+ return;
+ }
+
+ long nHght = rInf.GetOut().LogicToPixel( rPrtFontSize ).Height();
+
+ // Draw wavy lines for spell and grammar errors only if font is large enough.
+ // Lines for smart tags will always be drawn.
+ if (pWList != rInf.GetSmartTags() && WRONG_SHOW_MIN >= nHght)
+ {
+ return;
+ }
+
+ SwForbidden::iterator pIter = rForbidden.begin();
+ if (rInf.GetOut().GetConnectMetaFile())
+ rInf.GetOut().Push();
+
+ const Color aCol( rInf.GetOut().GetLineColor() );
+
+ // iterate over all ranges stored in the respective SwWrongList
+ do
{
- // get line color to use...
- Color aLineColor;
- if (pWList == rInf.GetWrong()) // ... for spell checking
- aLineColor = SwViewOption::GetSpellColor();
- else if (pWList == rInf.GetGrammarCheck()) // ... for grammar checking
- // currently there is no specific color for grammar check errors available in the configuration
- aLineColor = Color( COL_LIGHTBLUE );
- else if (pWList == rInf.GetSmartTags()) // ... for smart tags
- aLineColor = SwViewOption::GetSmarttagColor();
-
- long nHght = rInf.GetOut().LogicToPixel( rPrtFontSize ).Height();
-
- // Draw wavy lines for spell and grammar errors only if font is large enough.
- // Lines for smart tags will always be drawn.
- if (pWList == rInf.GetSmartTags() || WRONG_SHOW_MIN < nHght)
+ nStart = nStart - rInf.GetIdx();
+
+ const xub_StrLen nEnd = nStart + nWrLen;
+ xub_StrLen nNext = nStart;
+ while( nNext < nEnd )
{
- SwForbidden::iterator pIter = rForbidden.begin();
- if (rInf.GetOut().GetConnectMetaFile())
- rInf.GetOut().Push();
+ while( pIter != rForbidden.end() && pIter->second <= nNext )
+ ++pIter;
- const Color aCol( rInf.GetOut().GetLineColor() );
- const bool bColSave = aCol != aLineColor;
- if (bColSave)
- rInf.GetOut().SetLineColor( aLineColor );
+ xub_StrLen nNextStart = nNext;
+ xub_StrLen nNextEnd = nEnd;
- // iterate over all ranges stored in the respective SwWrongList
- do
+ if( pIter == rForbidden.end() || nNextEnd <= pIter->first )
{
- nStart = nStart - rInf.GetIdx();
+ // No overlapping mark up found
+ std::pair< xub_StrLen, xub_StrLen > aNew;
+ aNew.first = nNextStart;
+ aNew.second = nNextEnd;
+ rForbidden.insert( pIter, aNew );
+ pIter = rForbidden.begin();
+ nNext = nEnd;
+ }
+ else
+ {
+ nNext = pIter->second;
+ if( nNextStart < pIter->first )
+ {
+ nNextEnd = pIter->first;
+ pIter->first = nNextStart;
+ }
+ else
+ continue;
+ }
+ // determine line pos
+ Point aStart( rInf.GetPos() );
+ Point aEnd;
+ lcl_calcLinePos( rCalcLinePosData, aStart, aEnd, nNextStart, nNextEnd - nNextStart );
+
- const xub_StrLen nEnd = nStart + nWrLen;
- xub_StrLen nNext = nStart;
- while( nNext < nEnd )
+ sal_uInt16 wrongPos = pWList->GetWrongPos(nNextStart + rInf.GetIdx());
+
+ const SwWrongArea* wrongArea = pWList->GetElement(wrongPos);
+
+ if (wrongArea != 0)
+ {
+ if (WRONGAREA_DASHED == wrongArea->mLineType)
{
- while( pIter != rForbidden.end() && pIter->second <= nNext )
- ++pIter;
- xub_StrLen nNextStart = nNext;
- xub_StrLen nNextEnd = nEnd;
- if( pIter == rForbidden.end() || nNextEnd <= pIter->first )
- {
- // No overlapping mark up found
- std::pair< xub_StrLen, xub_StrLen > aNew;
- aNew.first = nNextStart;
- aNew.second = nNextEnd;
- rForbidden.insert( pIter, aNew );
- pIter = rForbidden.begin();
- nNext = nEnd;
- }
- else
- {
- nNext = pIter->second;
- if( nNextStart < pIter->first )
- {
- nNextEnd = pIter->first;
- pIter->first = nNextStart;
- }
- else
- continue;
- }
- // determine line pos
- Point aStart( rInf.GetPos() );
- Point aEnd;
- lcl_calcLinePos( rCalcLinePosData, aStart, aEnd, nNextStart, nNextEnd - nNextStart );
+ rInf.GetOut().SetLineColor( wrongArea->mColor );
- // draw line for smart tags?
- if (pWList == rInf.GetSmartTags())
- {
- aStart.Y() +=30;
- aEnd.Y() +=30;
+ aStart.Y() +=30;
+ aEnd.Y() +=30;
- LineInfo aLineInfo( LINE_DASH );
- aLineInfo.SetDistance( 40 );
- aLineInfo.SetDashLen( 1 );
- aLineInfo.SetDashCount(1);
+ LineInfo aLineInfo( LINE_DASH );
+ aLineInfo.SetDistance( 40 );
+ aLineInfo.SetDashLen( 1 );
+ aLineInfo.SetDashCount(1);
- rInf.GetOut().DrawLine( aStart, aEnd, aLineInfo );
- }
- else // draw wavy lines for spell or grammar errors
- {
- // get wavy line type to use
- sal_uInt16 nWave =
- WRONG_SHOW_MEDIUM < nHght ? WAVE_NORMAL :
- ( WRONG_SHOW_SMALL < nHght ? WAVE_SMALL : WAVE_FLAT );
+ rInf.GetOut().DrawLine( aStart, aEnd, aLineInfo );
+ }
+ else if (WRONGAREA_WAVE == wrongArea->mLineType)
+ {
+ rInf.GetOut().SetLineColor( wrongArea->mColor );
- rInf.GetOut().DrawWaveLine( aStart, aEnd, nWave );
- }
+ // get wavy line type to use
+ sal_uInt16 nWave =
+ WRONG_SHOW_MEDIUM < nHght ? WAVE_NORMAL :
+ ( WRONG_SHOW_SMALL < nHght ? WAVE_SMALL : WAVE_FLAT );
+
+ rInf.GetOut().DrawWaveLine( aStart, aEnd, nWave );
}
+ else if (WRONGAREA_WAVE_NORMAL == wrongArea->mLineType)
+ {
+ rInf.GetOut().SetLineColor( wrongArea->mColor );
- nStart = nEnd + rInf.GetIdx();
- nWrLen = rInf.GetIdx() + rInf.GetLen() - nStart;
- }
- while (nWrLen && pWList->Check( nStart, nWrLen ));
+ rInf.GetOut().DrawWaveLine( aStart, aEnd, WAVE_NORMAL);
+ }
- if (bColSave)
- rInf.GetOut().SetLineColor( aCol );
+ else if (WRONGAREA_WAVE_SMALL == wrongArea->mLineType)
+ {
+ rInf.GetOut().SetLineColor( wrongArea->mColor );
- if (rInf.GetOut().GetConnectMetaFile())
- rInf.GetOut().Pop();
+ rInf.GetOut().DrawWaveLine( aStart, aEnd, WAVE_SMALL);
+ }
+ else if (WRONGAREA_WAVE_FLAT == wrongArea->mLineType)
+ {
+ rInf.GetOut().SetLineColor( wrongArea->mColor );
+
+ rInf.GetOut().DrawWaveLine( aStart, aEnd, WAVE_FLAT);
+ }
+ }
}
+
+ nStart = nEnd + rInf.GetIdx();
+ nWrLen = rInf.GetIdx() + rInf.GetLen() - nStart;
}
+ while (nWrLen && pWList->Check( nStart, nWrLen ));
+
+ rInf.GetOut().SetLineColor( aCol );
+
+ if (rInf.GetOut().GetConnectMetaFile())
+ rInf.GetOut().Pop();
}
commit c5b604b9527d0dc32066e17dc3ce7f7370a78fe1
Author: Jürgen Schmidt <jsc at apache.org>
Date: Wed Mar 20 14:17:09 2013 +0000
Resolves: #i121732# add new interface XMarkingAccess
Patch by: Kai Labusch
Review by: arielch, jsc
(cherry picked from commit c1fb6ce135ad39299164aeecebfa746db210d0e3)
Conflicts:
offapi/com/sun/star/text/makefile.mk
sw/inc/unotextcursor.hxx
sw/source/core/unocore/unoobj.cxx
Change-Id: I68029b28908a57c4ed39d798269b5a8786972be0
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 9f0df7a..2e5723f 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -3732,6 +3732,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/text,\
XLineNumberingProperties \
XMailMergeBroadcaster \
XMailMergeListener \
+ XMarkingAccess \
XMultiTextMarkup \
XNumberingFormatter \
XNumberingRulesSupplier \
diff --git a/offapi/com/sun/star/text/XMarkingAccess.idl b/offapi/com/sun/star/text/XMarkingAccess.idl
new file mode 100644
index 0000000..86cd891
--- /dev/null
+++ b/offapi/com/sun/star/text/XMarkingAccess.idl
@@ -0,0 +1,34 @@
+/*
+ * 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 .
+ */
+#ifndef __com_sun_star_text_XMarkingAccess_idl__
+#define __com_sun_star_text_XMarkingAccess_idl__
+
+#include <com/sun/star/uno/XInterface.idl>
+
+module com { module sun { module star { module text {
+
+/** extends a text range by method to modify its position.
+ */
+interface XMarkingAccess
+{
+ void invalidateMarkings([in] long nType);
+};
+
+}; }; }; };
+
+#endif
diff --git a/sw/inc/unotextcursor.hxx b/sw/inc/unotextcursor.hxx
index 6bb5bab..fc45d43 100644
--- a/sw/inc/unotextcursor.hxx
+++ b/sw/inc/unotextcursor.hxx
@@ -34,11 +34,18 @@
#include <com/sun/star/text/XWordCursor.hpp>
#include <com/sun/star/text/XParagraphCursor.hpp>
#include <com/sun/star/text/XRedline.hpp>
+#include <com/sun/star/text/XMarkingAccess.hpp>
#include <cppuhelper/implbase13.hxx>
#include <comphelper/uno3.hxx>
+#if ! defined(INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_14)
+#define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_14
+#define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 14
+#include <comphelper/implbase_var.hxx>
+#endif
+
#include <unobaseclass.hxx>
#include <TextCursorHelper.hxx>
@@ -47,8 +54,7 @@ class SwDoc;
struct SwPosition;
class SwUnoCrsr;
-
-typedef ::cppu::WeakImplHelper13
+typedef ::comphelper::WeakImplHelper14
< ::com::sun::star::lang::XServiceInfo
, ::com::sun::star::beans::XPropertySet
, ::com::sun::star::beans::XPropertyState
@@ -62,6 +68,7 @@ typedef ::cppu::WeakImplHelper13
, ::com::sun::star::text::XWordCursor
, ::com::sun::star::text::XParagraphCursor
, ::com::sun::star::text::XRedline
+, ::com::sun::star::text::XMarkingAccess
> SwXTextCursor_Base;
class SwXTextCursor
@@ -362,6 +369,10 @@ public:
throw (::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::uno::RuntimeException);
+ //XMarkingAccess
+ virtual void SAL_CALL invalidateMarkings(::sal_Int32 nType)
+ throw (::com::sun::star::uno::RuntimeException);
+
};
#endif // SW_UNOTEXTCURSOR_HXX
diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx
index 1771cdc..caa4567 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -85,6 +85,7 @@
#include <fmtftn.hxx>
#include <com/sun/star/text/WrapTextMode.hpp>
#include <com/sun/star/text/TextContentAnchorType.hpp>
+#include <com/sun/star/text/TextMarkupType.hpp>
#include <com/sun/star/style/PageStyleLayout.hpp>
#include <com/sun/star/text/XTextDocument.hpp>
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
@@ -2572,6 +2573,46 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
return aRet;
}
+void SAL_CALL SwXTextCursor::invalidateMarkings(::sal_Int32 nType)
+throw (uno::RuntimeException)
+{
+ SolarMutexGuard aGuard;
+
+ SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
+
+ SwNode* node = rUnoCursor.GetNode();
+
+ if (node == 0) return;
+
+ SwTxtNode* txtNode = node->GetTxtNode();
+
+ if (txtNode == 0) return;
+
+ if ( text::TextMarkupType::SPELLCHECK == nType )
+ {
+ txtNode->SetWrongDirty(true);
+ txtNode->SetWrong(0, true);
+ }
+ else if( text::TextMarkupType::PROOFREADING == nType )
+ {
+ txtNode->SetGrammarCheckDirty(true);
+ txtNode->SetGrammarCheck(0,true);
+ }
+ else if ( text::TextMarkupType::SMARTTAG == nType )
+ {
+ txtNode->SetSmartTagDirty(true);
+ txtNode->SetSmartTags (0, true);
+ }
+ else return;
+
+ SwFmtColl* fmtColl=txtNode->GetFmtColl();
+
+ if (fmtColl == 0) return;
+
+ SwFmtChg aNew( fmtColl );
+ txtNode->NotifyClients( 0, &aNew );
+}
+
void SAL_CALL
SwXTextCursor::makeRedline(
const OUString& rRedlineType,
commit 5e059c1ee53b6be058f66a7c43af0e75f3cadfa1
Author: Jürgen Schmidt <jsc at apache.org>
Date: Wed Mar 20 14:15:58 2013 +0000
Resolves: #i121731# extend XSmartTagAction->getActionCount...
with additional parameter to increase flexibility of context menus
Patch by: Kai Labusch
Review by: arielch, jsc
(cherry picked from commit 5898e201ae8bbc1203bf24629a389f8f3b3e02ee)
Conflicts:
svx/source/mnuctrls/SmartTagCtl.cxx
Change-Id: I91d50b94657c29db289864863ee752d4ce45db6c
diff --git a/offapi/com/sun/star/smarttags/XSmartTagAction.idl b/offapi/com/sun/star/smarttags/XSmartTagAction.idl
index 3f85469..005eb6f 100644
--- a/offapi/com/sun/star/smarttags/XSmartTagAction.idl
+++ b/offapi/com/sun/star/smarttags/XSmartTagAction.idl
@@ -82,7 +82,7 @@ interface XSmartTagAction: com::sun::star::lang::XInitialization
@throws com::sun::star::lang::IndexOutOfBoundsException
if nSmartTagIndex is greater than SmartTagCount.
*/
- string getSmartTagName( [in] long nSmartTagIndex )
+ string getSmartTagName( [in] long nSmartTagIndex)
raises( com::sun::star::lang::IndexOutOfBoundsException );
@@ -104,7 +104,7 @@ interface XSmartTagAction: com::sun::star::lang::XInitialization
if nSmartTagIndex is greater than SmartTagCount
*/
string getSmartTagCaption( [in] long nSmartTagIndex,
- [in] ::com::sun::star::lang::Locale aLocale )
+ [in] ::com::sun::star::lang::Locale aLocale)
raises( com::sun::star::lang::IndexOutOfBoundsException );
@@ -123,7 +123,8 @@ interface XSmartTagAction: com::sun::star::lang::XInitialization
type.
*/
long getActionCount( [in] string aSmartTagName,
- [in] com::sun::star::frame::XController xController );
+ [in] com::sun::star::frame::XController xController,
+ [in] com::sun::star::container::XStringKeyMap xProperties);
/** obtains a unique integer identifier for an action.
@@ -210,7 +211,7 @@ interface XSmartTagAction: com::sun::star::lang::XInitialization
if the ActionID is not recognized.
*/
string getActionNameFromID( [in] long nActionID,
- [in] com::sun::star::frame::XController xController )
+ [in] com::sun::star::frame::XController xController)
raises( com::sun::star::lang::IllegalArgumentException );
diff --git a/svx/source/mnuctrls/SmartTagCtl.cxx b/svx/source/mnuctrls/SmartTagCtl.cxx
index 4f0f3fe..8e9b053 100644
--- a/svx/source/mnuctrls/SmartTagCtl.cxx
+++ b/svx/source/mnuctrls/SmartTagCtl.cxx
@@ -92,7 +92,7 @@ void SvxSmartTagsControl::FillMenu()
const sal_Int32 nSmartTagIndex = rActionIndices[0];
const OUString aSmartTagType = xAction->getSmartTagName( nSmartTagIndex );
- const OUString aSmartTagCaption = xAction->getSmartTagCaption( nSmartTagIndex, rLocale );
+ const OUString aSmartTagCaption = xAction->getSmartTagCaption( nSmartTagIndex, rLocale);
// no sub-menus if there's only one smart tag type listed:
PopupMenu* pSbMenu = mpMenu;
@@ -115,7 +115,7 @@ void SvxSmartTagsControl::FillMenu()
{
xAction = rActionComponents[i];
- for ( sal_Int32 k = 0; k < xAction->getActionCount( aSmartTagType, xController ); ++k )
+ for ( sal_Int32 k = 0; k < xAction->getActionCount( aSmartTagType, xController, xSmartTagProperties ); ++k )
{
const sal_uInt32 nActionID = xAction->getActionID( aSmartTagType, k, xController );
OUString aActionCaption = xAction->getActionCaptionFromID( nActionID,
diff --git a/sw/source/ui/smartmenu/stmenu.cxx b/sw/source/ui/smartmenu/stmenu.cxx
index b77f7b6..795c910 100644
--- a/sw/source/ui/smartmenu/stmenu.cxx
+++ b/sw/source/ui/smartmenu/stmenu.cxx
@@ -104,7 +104,7 @@ SwSmartTagPopup::SwSmartTagPopup( SwView* pSwView,
{
xAction = rActionComponents[i];
- for ( sal_Int32 k = 0; k < xAction->getActionCount( aSmartTagType, xController ); ++k )
+ for ( sal_Int32 k = 0; k < xAction->getActionCount( aSmartTagType, xController, xSmartTagProperties ); ++k )
{
const sal_uInt32 nActionID = xAction->getActionID( aSmartTagType, k, xController );
OUString aActionCaption = xAction->getActionCaptionFromID( nActionID,
commit 1959113eac6bb23310883c974ac40cba6f222493
Author: Jürgen Schmidt <jsc at apache.org>
Date: Wed Mar 20 14:14:46 2013 +0000
Resolves: #i121730# add optional interface XRangeBasedSmartTagRecognizer
for SmartTags
Patch by: Kai Labusch
Review by: arielch, jsc
(cherry picked from commit a64c066b02924371f486688df01b6881bcd0da8b)
Conflicts:
offapi/com/sun/star/smarttags/XSmartTagRecognizer.idl
offapi/com/sun/star/smarttags/makefile.mk
svx/inc/svx/SmartTagMgr.hxx
svx/source/smarttags/SmartTagMgr.cxx
sw/source/core/txtnode/txtedt.cxx
Change-Id: I11f528b2c1a068d0b1db1e76c2f889c0632ab972
diff --git a/include/svx/SmartTagMgr.hxx b/include/svx/SmartTagMgr.hxx
index 836ff82..42563fd 100644
--- a/include/svx/SmartTagMgr.hxx
+++ b/include/svx/SmartTagMgr.hxx
@@ -42,6 +42,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 {
@@ -149,12 +150,17 @@ public:
The length of the text to be scanned.
*/
- void Recognize( const OUString& rText,
+
+ void RecognizeString( const 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
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index b08f125..9f0df7a 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -3534,6 +3534,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/sheet,\
))
$(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/smarttags,\
SmartTagRecognizerMode \
+ XRangeBasedSmartTagRecognizer \
XSmartTagAction \
XSmartTagRecognizer \
))
diff --git a/offapi/com/sun/star/smarttags/XRangeBasedSmartTagRecognizer.idl b/offapi/com/sun/star/smarttags/XRangeBasedSmartTagRecognizer.idl
new file mode 100644
index 0000000..7de7690
--- /dev/null
+++ b/offapi/com/sun/star/smarttags/XRangeBasedSmartTagRecognizer.idl
@@ -0,0 +1,68 @@
+/*
+ * 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 .
+ */
+#ifndef __com_sun_star_smarttags_XRangeBasedSmartTagRecognizer_idl__
+#define __com_sun_star_smarttags_XRangeBasedSmartTagRecognizer_idl__
+
+#include <com/sun/star/lang/XInitialization.idl>
+#include <com/sun/star/lang/Locale.idl>
+#include <com/sun/star/smarttags/SmartTagRecognizerMode.idl>
+#include <com/sun/star/text/XTextMarkup.idl>
+#include <com/sun/star/frame/XController.idl>
+#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
+#include <com/sun/star/text/XTextRange.idl>
+
+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
diff --git a/offapi/com/sun/star/smarttags/XSmartTagRecognizer.idl b/offapi/com/sun/star/smarttags/XSmartTagRecognizer.idl
index 1ab223b..4310a17 100644
--- a/offapi/com/sun/star/smarttags/XSmartTagRecognizer.idl
+++ b/offapi/com/sun/star/smarttags/XSmartTagRecognizer.idl
@@ -25,10 +25,10 @@
#include <com/sun/star/i18n/XBreakIterator.idl>
#include <com/sun/star/smarttags/SmartTagRecognizerMode.idl>
#include <com/sun/star/text/XTextMarkup.idl>
+#include <com/sun/star/text/XTextRange.idl>
#include <com/sun/star/frame/XController.idl>
#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
-
module com { module sun { module star { module smarttags {
@@ -146,7 +146,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.
@param nSmartTagIndex
diff --git a/svx/source/smarttags/SmartTagMgr.cxx b/svx/source/smarttags/SmartTagMgr.cxx
index ebd6733..218406c 100644
--- a/svx/source/smarttags/SmartTagMgr.cxx
+++ b/svx/source/smarttags/SmartTagMgr.cxx
@@ -24,6 +24,7 @@
#include <osl/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>
@@ -44,6 +45,8 @@
#include <comphelper/processfactory.hxx>
#include <rtl/ustring.hxx>
+#include <com/sun/star/text/XTextRange.hpp>
+
using namespace com::sun::star;
using namespace com::sun::star::uno;
using namespace com::sun::star::i18n;
@@ -86,7 +89,7 @@ void SmartTagMgr::CreateBreakIterator() const
/** Dispatches the recognize call to all installed smart tag recognizers
*/
-void SmartTagMgr::Recognize( const OUString& rText,
+void SmartTagMgr::RecognizeString( const OUString& rText,
const Reference< text::XTextMarkup > xMarkup,
const Reference< frame::XController > xController,
const lang::Locale& rLocale,
@@ -118,6 +121,39 @@ void SmartTagMgr::Recognize( const 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 < OUString, ActionReference >::const_iterator SmartTagMapIter;
void SmartTagMgr::GetActionSequences( Sequence < OUString >& rSmartTagTypes,
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index e1c2824..1716010 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -76,6 +76,8 @@
#include <vector>
#include <utility>
+#include <unotextrange.hxx>
+
using namespace ::com::sun::star;
using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::i18n;
@@ -1424,6 +1426,13 @@ SwRect SwTxtFrm::SmartTagScan( SwCntntNode* /*pActNode*/, xub_StrLen /*nActPos*/
com::sun::star::uno::Reference< ::com::sun::star::frame::XController > xController = pNode->GetDoc()->GetDocShell()->GetController();
+ 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;
@@ -1439,7 +1448,7 @@ SwRect SwTxtFrm::SmartTagScan( SwCntntNode* /*pActNode*/, xub_StrLen /*nActPos*/
const sal_uInt32 nExpandBegin = aConversionMap.ConvertToViewPosition( nLangBegin );
const sal_uInt32 nExpandEnd = aConversionMap.ConvertToViewPosition( nLangEnd );
- rSmartTagMgr.Recognize( aExpandText, xTextMarkup, xController, aLocale, nExpandBegin, nExpandEnd - nExpandBegin );
+ rSmartTagMgr.RecognizeString(aExpandText, xTextMarkup, xController, aLocale, nExpandBegin, nExpandEnd - nExpandBegin );
nLangBegin = nLangEnd;
}
commit 403bfea10fb8ef5c4596d6a137aa22cc5b895ccf
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu May 23 10:14:07 2013 +0100
aarch64 will be a 64bit multilib platform too
Change-Id: I6b0932ecd304e661e3331b22e6993b856b686982
diff --git a/m4/ax_boost_base.m4 b/m4/ax_boost_base.m4
index e5acfda..0dead6d 100644
--- a/m4/ax_boost_base.m4
+++ b/m4/ax_boost_base.m4
@@ -91,7 +91,7 @@ if test "x$want_boost" = "xyes"; then
dnl are found, e.g. when only header-only libraries are installed!
libsubdirs="lib"
ax_arch=`uname -m`
- if test $ax_arch = x86_64 -o $ax_arch = ppc64 -o $ax_arch = s390x -o $ax_arch = sparc64; then
+ if test $ax_arch = x86_64 -o $ax_arch = ppc64 -o $ax_arch = s390x -o $ax_arch = sparc64 -o $ax_arch = aarch64; then
libsubdirs="lib64 lib lib64"
fi
commit 9c4066e95c7cd8b6fe7dbbe81636d1721023ca40
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu May 23 11:22:59 2013 +0100
Updated core
Project: dictionaries 96569b9f3d03502c5108eb4db7eb3e0697535617
diff --git a/dictionaries b/dictionaries
index 5f7183f..96569b9 160000
--- a/dictionaries
+++ b/dictionaries
@@ -1 +1 @@
-Subproject commit 5f7183ff8e2358287bd99b64d7036475f1f0ff6a
+Subproject commit 96569b9f3d03502c5108eb4db7eb3e0697535617
More information about the Libreoffice-commits
mailing list