summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2011-10-04 10:48:09 -0500
committerNorbert Thiebaud <nthiebaud@gmail.com>2011-10-05 18:51:32 -0500
commit77eae7506ed815bd46c64dd8d8ebdb02f687b3fc (patch)
tree1be679f57ee7f1e3d5dbd092fb26713159de7c35
parent5a036ee882b46fc77aadfb621ff44d8edeec8b21 (diff)
accfixes2: GetAttributeRun with bInCell
-rw-r--r--editeng/inc/editeng/unoedhlp.hxx4
-rw-r--r--editeng/inc/editeng/unoedprx.hxx28
-rw-r--r--editeng/inc/editeng/unoedsrc.hxx2
-rw-r--r--editeng/inc/editeng/unofored.hxx12
-rw-r--r--editeng/inc/editeng/unoforou.hxx2
-rw-r--r--editeng/inc/editeng/unotext.hxx10
-rw-r--r--editeng/source/uno/unoedhlp.cxx140
-rw-r--r--editeng/source/uno/unoedprx.cxx2
-rw-r--r--editeng/source/uno/unofored.cxx4
-rw-r--r--editeng/source/uno/unoforou.cxx4
-rw-r--r--editeng/source/uno/unotext.cxx2
-rw-r--r--starmath/source/accessibility.cxx6
-rw-r--r--starmath/source/accessibility.hxx26
-rw-r--r--svx/source/accessibility/AccessibleEmptyEditSource.cxx10
14 files changed, 185 insertions, 67 deletions
diff --git a/editeng/inc/editeng/unoedhlp.hxx b/editeng/inc/editeng/unoedhlp.hxx
index 5d8caa616aef..8014fb410932 100644
--- a/editeng/inc/editeng/unoedhlp.hxx
+++ b/editeng/inc/editeng/unoedhlp.hxx
@@ -102,9 +102,11 @@ public:
@param nIndex
The character index from which the range of similar attributed characters is requested
+ @param bInCell
+
@return sal_True, if the range has been successfully determined
*/
- static sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, const EditEngine& rEE, sal_uInt16 nPara, sal_uInt16 nIndex );
+ static sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, const EditEngine& rEE, sal_uInt16 nPara, sal_uInt16 nIndex, bool bInCell = false );
/** Convert point from edit engine to user coordinate space
diff --git a/editeng/inc/editeng/unoedprx.hxx b/editeng/inc/editeng/unoedprx.hxx
index 7fa85deddbab..48f08bcdf44e 100644
--- a/editeng/inc/editeng/unoedprx.hxx
+++ b/editeng/inc/editeng/unoedprx.hxx
@@ -42,8 +42,8 @@ public:
SvxAccessibleTextAdapter();
virtual ~SvxAccessibleTextAdapter();
- virtual sal_uInt16 GetParagraphCount() const;
- virtual sal_uInt16 GetTextLen( sal_uInt16 nParagraph ) const;
+ virtual sal_uInt16 GetParagraphCount() const;
+ virtual sal_uInt16 GetTextLen( sal_uInt16 nParagraph ) const;
virtual String GetText( const ESelection& rSel ) const;
virtual SfxItemSet GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib = 0 ) const;
virtual SfxItemSet GetParaAttribs( sal_uInt16 nPara ) const;
@@ -52,10 +52,10 @@ public:
virtual void GetPortions( sal_uInt16 nPara, std::vector<sal_uInt16>& rList ) const;
virtual sal_Int32 CalcLogicalIndex( sal_uInt16 nPara, sal_uInt16 nEEIndex );
- virtual sal_uInt16 CalcEditEngineIndex( sal_uInt16 nPara, sal_Int32 nLogicalIndex );
+ virtual sal_uInt16 CalcEditEngineIndex( sal_uInt16 nPara, sal_Int32 nLogicalIndex );
- virtual sal_uInt16 GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const;
- virtual sal_uInt16 GetItemState( sal_uInt16 nPara, sal_uInt16 nWhich ) const;
+ virtual sal_uInt16 GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const;
+ virtual sal_uInt16 GetItemState( sal_uInt16 nPara, sal_uInt16 nWhich ) const;
virtual void QuickInsertText( const String& rText, const ESelection& rSel );
virtual void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel );
@@ -67,10 +67,10 @@ public:
virtual XubString CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor );
virtual void FieldClicked( const SvxFieldItem& rField, sal_uInt16 nPara, xub_StrLen nPos );
- virtual sal_Bool IsValid() const;
+ virtual sal_Bool IsValid() const;
virtual LanguageType GetLanguage( sal_uInt16, sal_uInt16 ) const;
- virtual sal_uInt16 GetFieldCount( sal_uInt16 nPara ) const;
+ virtual sal_uInt16 GetFieldCount( sal_uInt16 nPara ) const;
virtual EFieldInfo GetFieldInfo( sal_uInt16 nPara, sal_uInt16 nField ) const;
virtual EBulletInfo GetBulletInfo( sal_uInt16 nPara ) const;
virtual Rectangle GetCharBounds( sal_uInt16 nPara, sal_uInt16 nIndex ) const;
@@ -79,11 +79,11 @@ public:
virtual OutputDevice* GetRefDevice() const;
virtual sal_Bool GetIndexAtPoint( const Point&, sal_uInt16& nPara, sal_uInt16& nIndex ) const;
virtual sal_Bool GetWordIndices( sal_uInt16 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const;
- virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const;
- virtual sal_uInt16 GetLineCount( sal_uInt16 nPara ) const;
- virtual sal_uInt16 GetLineLen( sal_uInt16 nPara, sal_uInt16 nLine ) const;
+ virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex, bool bInCell = false ) const;
+ virtual sal_uInt16 GetLineCount( sal_uInt16 nPara ) const;
+ virtual sal_uInt16 GetLineLen( sal_uInt16 nPara, sal_uInt16 nLine ) const;
virtual void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nParagraph, sal_uInt16 nLine ) const;
- virtual sal_uInt16 GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const;
+ virtual sal_uInt16 GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const;
virtual sal_Bool Delete( const ESelection& );
virtual sal_Bool InsertText( const String&, const ESelection& );
@@ -95,11 +95,11 @@ public:
// implementation functions for XParagraphAppend and XTextPortionAppend
// (not needed for accessibility, only for new import API)
- virtual void AppendParagraph();
- virtual xub_StrLen AppendTextPortion( sal_uInt16 nPara, const String &rText, const SfxItemSet &rSet );
+ virtual void AppendParagraph();
+ virtual xub_StrLen AppendTextPortion( sal_uInt16 nPara, const String &rText, const SfxItemSet &rSet );
//XTextCopy
- virtual void CopyText(const SvxTextForwarder& rSource);
+ virtual void CopyText(const SvxTextForwarder& rSource);
void SetForwarder( SvxTextForwarder& );
sal_Bool HaveImageBullet( sal_uInt16 nPara ) const;
diff --git a/editeng/inc/editeng/unoedsrc.hxx b/editeng/inc/editeng/unoedsrc.hxx
index 3f45bae909c6..de92059a10ad 100644
--- a/editeng/inc/editeng/unoedsrc.hxx
+++ b/editeng/inc/editeng/unoedsrc.hxx
@@ -333,7 +333,7 @@ public:
@return sal_True, if the range has been successfully determined
*/
- virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const = 0;
+ virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex, bool bInCell = false ) const = 0;
/** Query number of lines in the formatted paragraph
diff --git a/editeng/inc/editeng/unofored.hxx b/editeng/inc/editeng/unofored.hxx
index 964fe6557090..845e26c6139f 100644
--- a/editeng/inc/editeng/unofored.hxx
+++ b/editeng/inc/editeng/unofored.hxx
@@ -65,10 +65,10 @@ public:
virtual XubString CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor );
virtual void FieldClicked( const SvxFieldItem& rField, sal_uInt16 nPara, xub_StrLen nPos );
- virtual sal_Bool IsValid() const;
+ virtual sal_Bool IsValid() const;
virtual LanguageType GetLanguage( sal_uInt16, sal_uInt16 ) const;
- virtual sal_uInt16 GetFieldCount( sal_uInt16 nPara ) const;
+ virtual sal_uInt16 GetFieldCount( sal_uInt16 nPara ) const;
virtual EFieldInfo GetFieldInfo( sal_uInt16 nPara, sal_uInt16 nField ) const;
virtual EBulletInfo GetBulletInfo( sal_uInt16 nPara ) const;
virtual Rectangle GetCharBounds( sal_uInt16 nPara, sal_uInt16 nIndex ) const;
@@ -77,11 +77,11 @@ public:
virtual OutputDevice* GetRefDevice() const;
virtual sal_Bool GetIndexAtPoint( const Point&, sal_uInt16& nPara, sal_uInt16& nIndex ) const;
virtual sal_Bool GetWordIndices( sal_uInt16 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const;
- virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const;
- virtual sal_uInt16 GetLineCount( sal_uInt16 nPara ) const;
- virtual sal_uInt16 GetLineLen( sal_uInt16 nPara, sal_uInt16 nLine ) const;
+ virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex, bool bInCell = false ) const;
+ virtual sal_uInt16 GetLineCount( sal_uInt16 nPara ) const;
+ virtual sal_uInt16 GetLineLen( sal_uInt16 nPara, sal_uInt16 nLine ) const;
virtual void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nParagraph, sal_uInt16 nLine ) const;
- virtual sal_uInt16 GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const;
+ virtual sal_uInt16 GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const;
virtual sal_Bool Delete( const ESelection& );
virtual sal_Bool InsertText( const String&, const ESelection& );
virtual sal_Bool QuickFormatDoc( sal_Bool bFull=sal_False );
diff --git a/editeng/inc/editeng/unoforou.hxx b/editeng/inc/editeng/unoforou.hxx
index d1c5325c92a3..07a945501991 100644
--- a/editeng/inc/editeng/unoforou.hxx
+++ b/editeng/inc/editeng/unoforou.hxx
@@ -98,7 +98,7 @@ public:
virtual OutputDevice* GetRefDevice() const;
virtual sal_Bool GetIndexAtPoint( const Point&, sal_uInt16& nPara, sal_uInt16& nIndex ) const;
virtual sal_Bool GetWordIndices( sal_uInt16 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const;
- virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const;
+ virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex, bool bInCell = false ) const;
virtual sal_uInt16 GetLineCount( sal_uInt16 nPara ) const;
virtual sal_uInt16 GetLineLen( sal_uInt16 nPara, sal_uInt16 nLine ) const;
virtual void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nPara, sal_uInt16 nLine ) const;
diff --git a/editeng/inc/editeng/unotext.hxx b/editeng/inc/editeng/unotext.hxx
index 2db3bd267d0e..92c1f73cb67a 100644
--- a/editeng/inc/editeng/unotext.hxx
+++ b/editeng/inc/editeng/unotext.hxx
@@ -221,7 +221,7 @@ public:
virtual void SetNotifyHdl( const Link& );
virtual LanguageType GetLanguage( sal_uInt16, sal_uInt16 ) const;
- virtual sal_uInt16 GetFieldCount( sal_uInt16 nPara ) const;
+ virtual sal_uInt16 GetFieldCount( sal_uInt16 nPara ) const;
virtual EFieldInfo GetFieldInfo( sal_uInt16 nPara, sal_uInt16 nField ) const;
virtual EBulletInfo GetBulletInfo( sal_uInt16 nPara ) const;
virtual Rectangle GetCharBounds( sal_uInt16 nPara, sal_uInt16 nIndex ) const;
@@ -230,11 +230,11 @@ public:
virtual OutputDevice* GetRefDevice() const;
virtual sal_Bool GetIndexAtPoint( const Point&, sal_uInt16& nPara, sal_uInt16& nIndex ) const;
virtual sal_Bool GetWordIndices( sal_uInt16 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const;
- virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const;
- virtual sal_uInt16 GetLineCount( sal_uInt16 nPara ) const;
- virtual sal_uInt16 GetLineLen( sal_uInt16 nPara, sal_uInt16 nLine ) const;
+ virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex, bool bInCell = false ) const;
+ virtual sal_uInt16 GetLineCount( sal_uInt16 nPara ) const;
+ virtual sal_uInt16 GetLineLen( sal_uInt16 nPara, sal_uInt16 nLine ) const;
virtual void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nParagraph, sal_uInt16 nLine ) const;
- virtual sal_uInt16 GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const;
+ virtual sal_uInt16 GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const;
virtual sal_Bool Delete( const ESelection& );
virtual sal_Bool InsertText( const String&, const ESelection& );
virtual sal_Bool QuickFormatDoc( sal_Bool bFull=sal_False );
diff --git a/editeng/source/uno/unoedhlp.cxx b/editeng/source/uno/unoedhlp.cxx
index 01dd6dfee54e..5b4dd79be453 100644
--- a/editeng/source/uno/unoedhlp.cxx
+++ b/editeng/source/uno/unoedhlp.cxx
@@ -33,6 +33,7 @@
#include <editeng/unoedhlp.hxx>
#include <editeng/editdata.hxx>
#include <editeng/editeng.hxx>
+#include <svl/itemset.hxx>
//------------------------------------------------------------------------
@@ -132,45 +133,160 @@ void SvxEditSourceHint::SetEndValue( sal_uLong n )
return ::std::auto_ptr<SfxHint>( new SfxHint() );
}
-sal_Bool SvxEditSourceHelper::GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, const EditEngine& rEE, sal_uInt16 nPara, sal_uInt16 nIndex )
+sal_Bool SvxEditSourceHelper::GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, const EditEngine& rEE,
+ sal_uInt16 nPara, sal_uInt16 nIndex, bool bInCell )
{
- EECharAttribArray aCharAttribs;
-
- rEE.GetCharAttribs( nPara, aCharAttribs );
+ //added dummy attributes for the default text
+ EECharAttribArray aCharAttribs, aTempCharAttribs;
+ rEE.GetCharAttribs( nPara, aTempCharAttribs );
+ if ( aTempCharAttribs.Count() )
+ {
+ sal_uInt32 nIndex2 = 0;
+ sal_uInt32 nParaLen = rEE.GetTextLen(nPara);
+ for ( sal_uInt16 nAttr = 0; nAttr < aTempCharAttribs.Count(); nAttr++ )
+ {
+ if ( nIndex2 < aTempCharAttribs[nAttr].nStart )
+ {
+ EECharAttrib aEEAttr;
+ aEEAttr.nStart = sal_uInt16(nIndex2);
+ aEEAttr.nEnd = aTempCharAttribs[nAttr].nStart;
+ aCharAttribs.Insert( aEEAttr, nAttr );
+ }
+ nIndex2 = aTempCharAttribs[nAttr].nEnd;
+ aCharAttribs.Insert( aTempCharAttribs[nAttr], aCharAttribs.Count() );
+ }
+ if ( nIndex2 != nParaLen )
+ {
+ EECharAttrib aEEAttr;
+ aEEAttr.nStart = sal_uInt16(nIndex2);
+ aEEAttr.nEnd = sal_uInt16(nParaLen);
+ aCharAttribs.Insert( aEEAttr, aCharAttribs.Count() );
+ }
+ }
// find closest index in front of nIndex
sal_uInt16 nAttr, nCurrIndex;
sal_Int32 nClosestStartIndex;
- for( nAttr=0, nClosestStartIndex=0; nAttr<aCharAttribs.Count(); ++nAttr )
+ sal_Int32 nClosestStartIndex_s, nClosestStartIndex_e;
+ for( nAttr=0, nClosestStartIndex_s=0, nClosestStartIndex_e=0; nAttr<aCharAttribs.Count(); ++nAttr )
{
nCurrIndex = aCharAttribs[nAttr].nStart;
- if( nCurrIndex > nIndex )
- break; // aCharAttribs array is sorted in increasing order for nStart values
+ //if( nCurrIndex > nIndex )
+ // break; // aCharAttribs array is sorted in increasing order for nStart values
- if( nCurrIndex > nClosestStartIndex )
+ if( nCurrIndex > nClosestStartIndex_s &&
+ nCurrIndex <= nIndex)
+ {
+ nClosestStartIndex_s = nCurrIndex;
+ }
+ nCurrIndex = aCharAttribs[nAttr].nEnd;
+ if ( nCurrIndex > nClosestStartIndex_e &&
+ nCurrIndex < nIndex )
{
- nClosestStartIndex = nCurrIndex;
+ nClosestStartIndex_e = nCurrIndex;
}
}
+ nClosestStartIndex = nClosestStartIndex_s > nClosestStartIndex_e ? nClosestStartIndex_s : nClosestStartIndex_e;
// find closest index behind of nIndex
sal_Int32 nClosestEndIndex;
- for( nAttr=0, nClosestEndIndex=rEE.GetTextLen(nPara); nAttr<aCharAttribs.Count(); ++nAttr )
+ sal_Int32 nClosestEndIndex_s, nClosestEndIndex_e;
+ for( nAttr=0, nClosestEndIndex_s=nClosestEndIndex_e=rEE.GetTextLen(nPara); nAttr<aCharAttribs.Count(); ++nAttr )
{
nCurrIndex = aCharAttribs[nAttr].nEnd;
if( nCurrIndex > nIndex &&
- nCurrIndex < nClosestEndIndex )
+ nCurrIndex < nClosestEndIndex_e )
+ {
+ nClosestEndIndex_e = nCurrIndex;
+ }
+ nCurrIndex = aCharAttribs[nAttr].nStart;
+ if ( nCurrIndex > nIndex &&
+ nCurrIndex < nClosestEndIndex_s)
{
- nClosestEndIndex = nCurrIndex;
+ nClosestEndIndex_s = nCurrIndex;
}
}
+ nClosestEndIndex = nClosestEndIndex_s < nClosestEndIndex_e ? nClosestEndIndex_s : nClosestEndIndex_e;
nStartIndex = static_cast<sal_uInt16>( nClosestStartIndex );
nEndIndex = static_cast<sal_uInt16>( nClosestEndIndex );
+ if ( bInCell )
+ {
+ EPosition aStartPos( nPara, nStartIndex ), aEndPos( nPara, nEndIndex );
+ sal_uInt32 nParaCount = rEE.GetParagraphCount();
+ sal_uInt32 nCrrntParaLen = rEE.GetTextLen(nPara);
+ //need to find closest index in front of nIndex in the previous paragraphs
+ if ( aStartPos.nIndex == 0 )
+ {
+ SfxItemSet aCrrntSet = rEE.GetAttribs( nPara, 0, 1, GETATTRIBS_CHARATTRIBS );
+ for ( sal_Int32 nParaIdx = nPara-1; nParaIdx >= 0; nParaIdx-- )
+ {
+ sal_uInt32 nLen = rEE.GetTextLen( sal_uInt16(nParaIdx) );
+ if ( nLen )
+ {
+ sal_uInt16 nStartIdx, nEndIdx;
+ GetAttributeRun( nStartIdx, nEndIdx, rEE, sal_uInt16(nParaIdx), sal_uInt16(nLen), sal_False );
+ SfxItemSet aSet = rEE.GetAttribs( sal_uInt16(nParaIdx), sal_uInt16(nLen-1), sal_uInt16(nLen), GETATTRIBS_CHARATTRIBS );
+ if ( aSet == aCrrntSet )
+ {
+ aStartPos.nPara = sal_uInt16(nParaIdx);
+ aStartPos.nIndex = nStartIdx;
+ if ( aStartPos.nIndex != 0 )
+ {
+ break;
+ }
+ }
+ }
+ }
+ }
+ //need find closest index behind nIndex in the following paragrphs
+ if ( aEndPos.nIndex == nCrrntParaLen )
+ {
+ SfxItemSet aCrrntSet = rEE.GetAttribs( nPara, sal_uInt16(nCrrntParaLen-1), sal_uInt16(nCrrntParaLen), GETATTRIBS_CHARATTRIBS );
+ for ( sal_uInt32 nParaIdx = nPara+1; nParaIdx < nParaCount; nParaIdx++ )
+ {
+ sal_uInt32 nLen = rEE.GetTextLen( sal_uInt16(nParaIdx) );
+ if ( nLen )
+ {
+ sal_uInt16 nStartIdx, nEndIdx;
+ GetAttributeRun( nStartIdx, nEndIdx, rEE, sal_uInt16(nParaIdx), 0, sal_False );
+ SfxItemSet aSet = rEE.GetAttribs( sal_uInt16(nParaIdx), 0, 1, GETATTRIBS_CHARATTRIBS );
+ if ( aSet == aCrrntSet )
+ {
+ aEndPos.nPara = sal_uInt16(nParaIdx);
+ aEndPos.nIndex = nEndIdx;
+ if ( aEndPos.nIndex != nLen )
+ {
+ break;
+ }
+ }
+ }
+ }
+ }
+ nStartIndex = 0;
+ if ( aStartPos.nPara > 0 )
+ {
+ for ( sal_uInt16 i = 0; i < aStartPos.nPara; i++ )
+ {
+ nStartIndex += rEE.GetTextLen(i)+1;
+ }
+ }
+ nStartIndex += aStartPos.nIndex;
+ nEndIndex = 0;
+ if ( aEndPos.nPara > 0 )
+ {
+ for ( sal_uInt16 i = 0; i < aEndPos.nPara; i++ )
+ {
+ nEndIndex += rEE.GetTextLen(i)+1;
+ }
+ }
+ nEndIndex += aEndPos.nIndex;
+ }
return sal_True;
+
}
Point SvxEditSourceHelper::EEToUserSpace( const Point& rPoint, const Size& rEESize, bool bIsVertical )
diff --git a/editeng/source/uno/unoedprx.cxx b/editeng/source/uno/unoedprx.cxx
index 73220b8fbac0..4bdcf1d3217b 100644
--- a/editeng/source/uno/unoedprx.cxx
+++ b/editeng/source/uno/unoedprx.cxx
@@ -986,7 +986,7 @@ sal_Bool SvxAccessibleTextAdapter::GetWordIndices( sal_uInt16 nPara, sal_uInt16
return sal_True;
}
-sal_Bool SvxAccessibleTextAdapter::GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const
+sal_Bool SvxAccessibleTextAdapter::GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex, bool /*bInCell*/ ) const
{
DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
diff --git a/editeng/source/uno/unofored.cxx b/editeng/source/uno/unofored.cxx
index b91227545da7..4a7998d38e1d 100644
--- a/editeng/source/uno/unofored.cxx
+++ b/editeng/source/uno/unofored.cxx
@@ -458,9 +458,9 @@ sal_Bool SvxEditEngineForwarder::GetWordIndices( sal_uInt16 nPara, sal_uInt16 nI
return sal_False;
}
-sal_Bool SvxEditEngineForwarder::GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const
+sal_Bool SvxEditEngineForwarder::GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex, bool bInCell ) const
{
- return SvxEditSourceHelper::GetAttributeRun( nStartIndex, nEndIndex, rEditEngine, nPara, nIndex );
+ return SvxEditSourceHelper::GetAttributeRun( nStartIndex, nEndIndex, rEditEngine, nPara, nIndex, bInCell );
}
sal_uInt16 SvxEditEngineForwarder::GetLineCount( sal_uInt16 nPara ) const
diff --git a/editeng/source/uno/unoforou.cxx b/editeng/source/uno/unoforou.cxx
index 5561d740dee2..b521a94e6b60 100644
--- a/editeng/source/uno/unoforou.cxx
+++ b/editeng/source/uno/unoforou.cxx
@@ -414,9 +414,9 @@ sal_Bool SvxOutlinerForwarder::GetWordIndices( sal_uInt16 nPara, sal_uInt16 nInd
return sal_False;
}
-sal_Bool SvxOutlinerForwarder::GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const
+sal_Bool SvxOutlinerForwarder::GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex, bool bInCell ) const
{
- return SvxEditSourceHelper::GetAttributeRun( nStartIndex, nEndIndex, rOutliner.GetEditEngine(), nPara, nIndex );
+ return SvxEditSourceHelper::GetAttributeRun( nStartIndex, nEndIndex, rOutliner.GetEditEngine(), nPara, nIndex, bInCell );
}
sal_uInt16 SvxOutlinerForwarder::GetLineCount( sal_uInt16 nPara ) const
diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index ac241d2fd477..b41baf67bcdc 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -2378,7 +2378,7 @@ sal_Bool SvxDummyTextSource::GetWordIndices( sal_uInt16, sal_uInt16, sal_uInt16&
return sal_False;
}
-sal_Bool SvxDummyTextSource::GetAttributeRun( sal_uInt16&, sal_uInt16&, sal_uInt16, sal_uInt16 ) const
+sal_Bool SvxDummyTextSource::GetAttributeRun( sal_uInt16&, sal_uInt16&, sal_uInt16, sal_uInt16, bool /*bInCell*/ ) const
{
return sal_False;
}
diff --git a/starmath/source/accessibility.cxx b/starmath/source/accessibility.cxx
index 96f40993c3ce..bb76e9cd839e 100644
--- a/starmath/source/accessibility.cxx
+++ b/starmath/source/accessibility.cxx
@@ -1366,12 +1366,12 @@ sal_Bool SmTextForwarder::GetWordIndices( sal_uInt16 nPara, sal_uInt16 nIndex, s
return bRes;
}
-sal_Bool SmTextForwarder::GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const
+sal_Bool SmTextForwarder::GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex, bool bInCell ) const
{
EditEngine *pEditEngine = rEditAcc.GetEditEngine();
return pEditEngine ?
- SvxEditSourceHelper::GetAttributeRun( nStartIndex, nEndIndex, *pEditEngine, nPara, nIndex )
- : sal_False;
+ SvxEditSourceHelper::GetAttributeRun( nStartIndex, nEndIndex, *pEditEngine, nPara, nIndex, bInCell )
+ : sal_False;
}
sal_uInt16 SmTextForwarder::GetLineCount( sal_uInt16 nPara ) const
diff --git a/starmath/source/accessibility.hxx b/starmath/source/accessibility.hxx
index 8ed6c48465f9..e9e8e33e8ebe 100644
--- a/starmath/source/accessibility.hxx
+++ b/starmath/source/accessibility.hxx
@@ -211,8 +211,8 @@ public:
SmTextForwarder( SmEditAccessible& rAcc, SmEditSource & rSource );
virtual ~SmTextForwarder();
- virtual sal_uInt16 GetParagraphCount() const;
- virtual sal_uInt16 GetTextLen( sal_uInt16 nParagraph ) const;
+ virtual sal_uInt16 GetParagraphCount() const;
+ virtual sal_uInt16 GetTextLen( sal_uInt16 nParagraph ) const;
virtual String GetText( const ESelection& rSel ) const;
virtual SfxItemSet GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib = EditEngineAttribs_All ) const;
virtual SfxItemSet GetParaAttribs( sal_uInt16 nPara ) const;
@@ -220,22 +220,22 @@ public:
virtual void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich );
virtual void GetPortions( sal_uInt16 nPara, std::vector<sal_uInt16>& rList ) const;
- virtual sal_uInt16 GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const;
- virtual sal_uInt16 GetItemState( sal_uInt16 nPara, sal_uInt16 nWhich ) const;
+ virtual sal_uInt16 GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const;
+ virtual sal_uInt16 GetItemState( sal_uInt16 nPara, sal_uInt16 nWhich ) const;
virtual void QuickInsertText( const String& rText, const ESelection& rSel );
virtual void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel );
virtual void QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel );
virtual void QuickInsertLineBreak( const ESelection& rSel );
- virtual SfxItemPool* GetPool() const;
+ virtual SfxItemPool* GetPool() const;
- virtual XubString CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor );
- virtual void FieldClicked(const SvxFieldItem&, sal_uInt16, sal_uInt16);
- virtual sal_Bool IsValid() const;
+ virtual XubString CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor );
+ virtual void FieldClicked(const SvxFieldItem&, sal_uInt16, sal_uInt16);
+ virtual sal_Bool IsValid() const;
virtual LanguageType GetLanguage( sal_uInt16, sal_uInt16 ) const;
- virtual sal_uInt16 GetFieldCount( sal_uInt16 nPara ) const;
+ virtual sal_uInt16 GetFieldCount( sal_uInt16 nPara ) const;
virtual EFieldInfo GetFieldInfo( sal_uInt16 nPara, sal_uInt16 nField ) const;
virtual EBulletInfo GetBulletInfo( sal_uInt16 nPara ) const;
virtual Rectangle GetCharBounds( sal_uInt16 nPara, sal_uInt16 nIndex ) const;
@@ -244,11 +244,11 @@ public:
virtual OutputDevice* GetRefDevice() const;
virtual sal_Bool GetIndexAtPoint( const Point&, sal_uInt16& nPara, sal_uInt16& nIndex ) const;
virtual sal_Bool GetWordIndices( sal_uInt16 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const;
- virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const;
- virtual sal_uInt16 GetLineCount( sal_uInt16 nPara ) const;
- virtual sal_uInt16 GetLineLen( sal_uInt16 nPara, sal_uInt16 nLine ) const;
+ virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex, bool bInCell = false ) const;
+ virtual sal_uInt16 GetLineCount( sal_uInt16 nPara ) const;
+ virtual sal_uInt16 GetLineLen( sal_uInt16 nPara, sal_uInt16 nLine ) const;
virtual void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nParagraph, sal_uInt16 nLine ) const;
- virtual sal_uInt16 GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nLine ) const;
+ virtual sal_uInt16 GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nLine ) const;
virtual sal_Bool Delete( const ESelection& );
virtual sal_Bool InsertText( const String&, const ESelection& );
virtual sal_Bool QuickFormatDoc( sal_Bool bFull=sal_False );
diff --git a/svx/source/accessibility/AccessibleEmptyEditSource.cxx b/svx/source/accessibility/AccessibleEmptyEditSource.cxx
index 72dd4e132451..31d01584c019 100644
--- a/svx/source/accessibility/AccessibleEmptyEditSource.cxx
+++ b/svx/source/accessibility/AccessibleEmptyEditSource.cxx
@@ -149,7 +149,7 @@ namespace accessibility
void SetNotifyHdl( const Link& ) {}
LanguageType GetLanguage( sal_uInt16, sal_uInt16 ) const { return LANGUAGE_DONTKNOW; }
- sal_uInt16 GetFieldCount( sal_uInt16 ) const { return 0; }
+ sal_uInt16 GetFieldCount( sal_uInt16 ) const { return 0; }
EFieldInfo GetFieldInfo( sal_uInt16, sal_uInt16 ) const { return EFieldInfo(); }
EBulletInfo GetBulletInfo( sal_uInt16 ) const { return EBulletInfo(); }
Rectangle GetCharBounds( sal_uInt16, sal_uInt16 ) const { return Rectangle(); }
@@ -158,11 +158,11 @@ namespace accessibility
OutputDevice* GetRefDevice() const { return NULL; }
sal_Bool GetIndexAtPoint( const Point&, sal_uInt16&, sal_uInt16& ) const { return sal_False; }
sal_Bool GetWordIndices( sal_uInt16, sal_uInt16, sal_uInt16&, sal_uInt16& ) const { return sal_False; }
- sal_Bool GetAttributeRun( sal_uInt16&, sal_uInt16&, sal_uInt16, sal_uInt16 ) const { return sal_False; }
- sal_uInt16 GetLineCount( sal_uInt16 nPara ) const { return nPara == 0 ? 1 : 0; }
- sal_uInt16 GetLineLen( sal_uInt16, sal_uInt16 ) const { return 0; }
+ sal_Bool GetAttributeRun( sal_uInt16&, sal_uInt16&, sal_uInt16, sal_uInt16, bool ) const { return sal_False; }
+ sal_uInt16 GetLineCount( sal_uInt16 nPara ) const { return nPara == 0 ? 1 : 0; }
+ sal_uInt16 GetLineLen( sal_uInt16, sal_uInt16 ) const { return 0; }
void GetLineBoundaries( /*out*/sal_uInt16 & rStart, /*out*/sal_uInt16 & rEnd, sal_uInt16 /*nParagraph*/, sal_uInt16 /*nLine*/ ) const { rStart = rEnd = 0; }
- sal_uInt16 GetLineNumberAtIndex( sal_uInt16 /*nPara*/, sal_uInt16 /*nIndex*/ ) const { return 0; }
+ sal_uInt16 GetLineNumberAtIndex( sal_uInt16 /*nPara*/, sal_uInt16 /*nIndex*/ ) const { return 0; }
// the following two methods would, strictly speaking, require
// a switch to a real EditSource, too. Fortunately, the