summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/access/acccell.cxx232
-rw-r--r--sw/source/core/access/acccell.hxx58
-rw-r--r--sw/source/core/access/acccontext.cxx112
-rw-r--r--sw/source/core/access/acccontext.hxx21
-rw-r--r--sw/source/core/access/accdoc.cxx538
-rw-r--r--sw/source/core/access/accdoc.hxx41
-rw-r--r--sw/source/core/access/accembedded.cxx64
-rw-r--r--sw/source/core/access/accembedded.hxx26
-rw-r--r--sw/source/core/access/accfield.cxx348
-rw-r--r--sw/source/core/access/accfield.hxx213
-rw-r--r--sw/source/core/access/accfootnote.cxx15
-rw-r--r--sw/source/core/access/accfootnote.hxx1
-rw-r--r--sw/source/core/access/accframe.cxx19
-rw-r--r--sw/source/core/access/accframe.hxx11
-rw-r--r--sw/source/core/access/accframebase.cxx174
-rw-r--r--sw/source/core/access/accframebase.hxx13
-rw-r--r--sw/source/core/access/accfrmobj.cxx23
-rw-r--r--sw/source/core/access/accfrmobj.hxx4
-rw-r--r--sw/source/core/access/accfrmobjmap.cxx94
-rw-r--r--sw/source/core/access/accfrmobjmap.hxx40
-rw-r--r--sw/source/core/access/accgraphic.cxx17
-rw-r--r--sw/source/core/access/accgraphic.hxx4
-rw-r--r--sw/source/core/access/accheaderfooter.cxx17
-rw-r--r--sw/source/core/access/accheaderfooter.hxx5
-rw-r--r--sw/source/core/access/acchyperlink.cxx116
-rw-r--r--sw/source/core/access/accmap.cxx1089
-rw-r--r--sw/source/core/access/accnotextframe.cxx167
-rw-r--r--sw/source/core/access/accnotextframe.hxx64
-rw-r--r--sw/source/core/access/accnotexthyperlink.cxx232
-rw-r--r--sw/source/core/access/accnotexthyperlink.hxx93
-rw-r--r--sw/source/core/access/accpara.cxx1793
-rw-r--r--sw/source/core/access/accpara.hxx69
-rw-r--r--sw/source/core/access/accportions.cxx126
-rw-r--r--sw/source/core/access/accportions.hxx19
-rw-r--r--sw/source/core/access/accpreview.cxx27
-rw-r--r--sw/source/core/access/accpreview.hxx6
-rw-r--r--sw/source/core/access/accselectionhelper.cxx105
-rw-r--r--sw/source/core/access/acctable.cxx340
-rw-r--r--sw/source/core/access/acctable.hxx33
-rw-r--r--sw/source/core/access/acctextframe.cxx140
-rw-r--r--sw/source/core/access/acctextframe.hxx44
-rw-r--r--sw/source/core/attr/format.cxx4
-rw-r--r--sw/source/core/bastyp/init.cxx6
-rw-r--r--sw/source/core/crsr/callnk.cxx2
-rw-r--r--sw/source/core/crsr/crsrsh.cxx101
-rw-r--r--sw/source/core/crsr/crstrvl.cxx439
-rw-r--r--sw/source/core/crsr/findattr.cxx4
-rw-r--r--sw/source/core/crsr/findtxt.cxx30
-rw-r--r--sw/source/core/crsr/overlayrangesoutline.cxx117
-rw-r--r--sw/source/core/crsr/overlayrangesoutline.hxx70
-rw-r--r--sw/source/core/crsr/swcrsr.cxx117
-rw-r--r--sw/source/core/crsr/viscrs.cxx133
-rw-r--r--sw/source/core/doc/dbgoutsw.cxx4
-rw-r--r--sw/source/core/doc/doc.cxx31
-rw-r--r--sw/source/core/doc/docedt.cxx4
-rw-r--r--sw/source/core/doc/docfld.cxx26
-rw-r--r--sw/source/core/doc/docfmt.cxx58
-rw-r--r--sw/source/core/doc/doclay.cxx4
-rw-r--r--sw/source/core/doc/docnum.cxx28
-rw-r--r--sw/source/core/doc/docredln.cxx4
-rw-r--r--sw/source/core/doc/docruby.cxx4
-rw-r--r--sw/source/core/doc/doctxm.cxx6
-rw-r--r--sw/source/core/doc/tblcpy.cxx6
-rw-r--r--sw/source/core/doc/visiturl.cxx2
-rw-r--r--sw/source/core/docnode/node.cxx78
-rw-r--r--sw/source/core/docnode/nodes.cxx27
-rw-r--r--sw/source/core/draw/dview.cxx2
-rw-r--r--sw/source/core/edit/acorrect.cxx2
-rw-r--r--sw/source/core/edit/edatmisc.cxx4
-rw-r--r--sw/source/core/edit/edattr.cxx30
-rw-r--r--sw/source/core/edit/edfld.cxx100
-rw-r--r--sw/source/core/edit/edfldexp.cxx1
-rw-r--r--sw/source/core/edit/editsh.cxx4
-rw-r--r--sw/source/core/edit/edlingu.cxx6
-rw-r--r--sw/source/core/edit/ednumber.cxx16
-rw-r--r--sw/source/core/edit/edtox.cxx4
-rw-r--r--sw/source/core/fields/expfld.cxx409
-rw-r--r--sw/source/core/fields/fldbas.cxx29
-rw-r--r--sw/source/core/fields/reffld.cxx28
-rw-r--r--sw/source/core/frmedt/fefly1.cxx78
-rw-r--r--sw/source/core/frmedt/feshview.cxx36
-rw-r--r--sw/source/core/frmedt/tblsel.cxx13
-rw-r--r--sw/source/core/inc/SwPortionHandler.hxx4
-rw-r--r--sw/source/core/inc/docfld.hxx5
-rw-r--r--sw/source/core/inc/doctxm.hxx3
-rw-r--r--sw/source/core/inc/frame.hxx19
-rw-r--r--sw/source/core/inc/rolbck.hxx11
-rw-r--r--sw/source/core/inc/rootfrm.hxx5
-rw-r--r--sw/source/core/inc/swfont.hxx27
-rw-r--r--sw/source/core/inc/tabfrm.hxx61
-rw-r--r--sw/source/core/inc/txtfrm.hxx7
-rw-r--r--sw/source/core/inc/txttypes.hxx1
-rw-r--r--sw/source/core/inc/viewimp.hxx6
-rw-r--r--sw/source/core/layout/atrfrm.cxx16
-rw-r--r--sw/source/core/layout/flycnt.cxx24
-rw-r--r--sw/source/core/layout/laycache.cxx4
-rw-r--r--sw/source/core/layout/tabfrm.cxx93
-rw-r--r--sw/source/core/layout/trvlfrm.cxx4
-rw-r--r--sw/source/core/layout/wsfrm.cxx4
-rw-r--r--sw/source/core/ole/ndole.cxx9
-rw-r--r--sw/source/core/text/atrhndl.hxx2
-rw-r--r--sw/source/core/text/atrstck.cxx21
-rw-r--r--sw/source/core/text/frmform.cxx46
-rw-r--r--sw/source/core/text/inftxt.cxx58
-rw-r--r--sw/source/core/text/itrform2.cxx26
-rw-r--r--sw/source/core/text/porfld.cxx22
-rw-r--r--sw/source/core/text/porfld.hxx7
-rw-r--r--sw/source/core/text/porlay.cxx4
-rw-r--r--sw/source/core/text/pormulti.cxx36
-rw-r--r--sw/source/core/text/portxt.cxx118
-rw-r--r--sw/source/core/text/portxt.hxx18
-rw-r--r--sw/source/core/text/txtfld.cxx75
-rw-r--r--sw/source/core/text/txtfrm.cxx10
-rw-r--r--sw/source/core/tox/tox.cxx2
-rw-r--r--sw/source/core/tox/txmsrt.cxx14
-rw-r--r--sw/source/core/txtnode/atrfld.cxx294
-rw-r--r--sw/source/core/txtnode/ndhints.cxx18
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx535
-rw-r--r--sw/source/core/txtnode/swfont.cxx3
-rw-r--r--sw/source/core/txtnode/thints.cxx244
-rw-r--r--sw/source/core/txtnode/txatbase.cxx1
-rw-r--r--sw/source/core/txtnode/txatritr.cxx8
-rw-r--r--sw/source/core/txtnode/txtedt.cxx39
-rw-r--r--sw/source/core/undo/SwUndoField.cxx8
-rw-r--r--sw/source/core/undo/rolbck.cxx24
-rw-r--r--sw/source/core/undo/unsect.cxx7
-rw-r--r--sw/source/core/undo/untbl.cxx5
-rw-r--r--sw/source/core/undo/untblk.cxx2
-rw-r--r--sw/source/core/unocore/unocrsrhelper.cxx387
-rw-r--r--sw/source/core/unocore/unodraw.cxx3
-rw-r--r--sw/source/core/unocore/unofield.cxx25
-rw-r--r--sw/source/core/unocore/unoframe.cxx25
-rw-r--r--sw/source/core/unocore/unoidx.cxx12
-rw-r--r--sw/source/core/unocore/unomap.cxx38
-rw-r--r--sw/source/core/unocore/unoportenum.cxx64
-rw-r--r--sw/source/core/unocore/unorefmk.cxx20
-rw-r--r--sw/source/core/view/viewimp.cxx18
-rw-r--r--sw/source/core/view/vprint.cxx17
-rw-r--r--sw/source/filter/ascii/ascatr.cxx52
-rw-r--r--sw/source/filter/ascii/parasc.cxx4
-rw-r--r--sw/source/filter/html/css1atr.cxx2
-rw-r--r--sw/source/filter/html/htmlatr.cxx14
-rw-r--r--sw/source/filter/html/swhtml.cxx5
-rw-r--r--sw/source/filter/html/wrthtml.cxx2
-rw-r--r--sw/source/filter/rtf/rtffly.cxx2
-rw-r--r--sw/source/filter/ww1/fltshell.cxx19
-rw-r--r--sw/source/filter/ww1/w1filter.cxx4
-rw-r--r--sw/source/filter/ww8/attributeoutputbase.hxx2
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx5
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx23
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx25
-rw-r--r--sw/source/filter/ww8/ww8par.cxx43
-rw-r--r--sw/source/filter/ww8/ww8par3.cxx156
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx8
-rw-r--r--sw/source/ui/app/applab.cxx2
-rw-r--r--sw/source/ui/app/docsh.cxx56
-rw-r--r--sw/source/ui/app/docst.cxx4
-rw-r--r--sw/source/ui/cctrl/actctrl.cxx5
-rw-r--r--sw/source/ui/cctrl/swlbox.cxx10
-rw-r--r--sw/source/ui/chrdlg/swuiccoll.cxx15
-rw-r--r--sw/source/ui/dialog/uiregionsw.cxx3
-rw-r--r--sw/source/ui/docvw/SidebarTxtControl.hxx2
-rw-r--r--sw/source/ui/docvw/edtdd.cxx4
-rw-r--r--sw/source/ui/docvw/edtwin.cxx85
-rw-r--r--sw/source/ui/docvw/edtwin2.cxx224
-rw-r--r--sw/source/ui/docvw/edtwin3.cxx28
-rw-r--r--sw/source/ui/envelp/envfmt.cxx2
-rw-r--r--sw/source/ui/fldui/fldedt.cxx38
-rw-r--r--sw/source/ui/fldui/fldmgr.cxx12
-rw-r--r--sw/source/ui/frmdlg/column.cxx38
-rw-r--r--sw/source/ui/frmdlg/column.hrc7
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx22
-rw-r--r--sw/source/ui/inc/conttree.hxx17
-rw-r--r--sw/source/ui/inc/edtwin.hxx3
-rw-r--r--sw/source/ui/inc/pview.hxx11
-rw-r--r--sw/source/ui/inc/swlbox.hxx3
-rw-r--r--sw/source/ui/inc/swuicnttab.hxx15
-rw-r--r--sw/source/ui/inc/view.hxx5
-rw-r--r--sw/source/ui/inc/wrtsh.hxx5
-rw-r--r--sw/source/ui/index/cnttab.cxx159
-rw-r--r--sw/source/ui/index/cnttab.hrc7
-rw-r--r--sw/source/ui/index/cnttab.src18
-rw-r--r--sw/source/ui/lingu/hhcwrp.cxx6
-rw-r--r--sw/source/ui/misc/glossary.hrc4
-rw-r--r--sw/source/ui/misc/insfnote.cxx2
-rw-r--r--sw/source/ui/ribbar/inputwin.cxx8
-rw-r--r--sw/source/ui/ribbar/inputwin.hrc5
-rw-r--r--sw/source/ui/ribbar/inputwin.src16
-rw-r--r--sw/source/ui/ribbar/workctrl.cxx9
-rw-r--r--sw/source/ui/shells/annotsh.cxx36
-rw-r--r--sw/source/ui/shells/basesh.cxx72
-rw-r--r--sw/source/ui/shells/drwtxtex.cxx44
-rw-r--r--sw/source/ui/shells/frmsh.cxx10
-rw-r--r--sw/source/ui/shells/grfsh.cxx25
-rw-r--r--sw/source/ui/shells/langhelper.cxx6
-rw-r--r--sw/source/ui/shells/listsh.cxx7
-rw-r--r--sw/source/ui/shells/tabsh.cxx7
-rw-r--r--sw/source/ui/shells/textfld.cxx148
-rw-r--r--sw/source/ui/shells/textidx.cxx11
-rw-r--r--sw/source/ui/shells/textsh.cxx164
-rw-r--r--sw/source/ui/shells/textsh1.cxx211
-rw-r--r--sw/source/ui/shells/txtattr.cxx22
-rw-r--r--sw/source/ui/shells/txtnum.cxx4
-rw-r--r--sw/source/ui/table/convert.hrc6
-rw-r--r--sw/source/ui/table/tabledlg.cxx2
-rw-r--r--sw/source/ui/table/tabledlg.hrc3
-rw-r--r--sw/source/ui/uiview/formatclipboard.cxx4
-rw-r--r--sw/source/ui/uiview/pview.cxx200
-rw-r--r--sw/source/ui/uiview/view.cxx20
-rw-r--r--sw/source/ui/uiview/view2.cxx38
-rw-r--r--sw/source/ui/uiview/viewmdi.cxx28
-rw-r--r--sw/source/ui/uiview/viewsrch.cxx53
-rw-r--r--sw/source/ui/uiview/viewstat.cxx83
-rw-r--r--sw/source/ui/uiview/viewtab.cxx10
-rw-r--r--sw/source/ui/utlui/content.cxx361
-rw-r--r--sw/source/ui/utlui/navipi.hrc5
-rw-r--r--sw/source/ui/wrtsh/delete.cxx2
-rw-r--r--sw/source/ui/wrtsh/select.cxx13
-rw-r--r--sw/source/ui/wrtsh/wrtsh1.cxx57
-rw-r--r--sw/source/ui/wrtsh/wrtsh2.cxx14
220 files changed, 11325 insertions, 2736 deletions
diff --git a/sw/source/core/access/acccell.cxx b/sw/source/core/access/acccell.cxx
index c70a5146e3b0..28a8bc1e2065 100644
--- a/sw/source/core/access/acccell.cxx
+++ b/sw/source/core/access/acccell.cxx
@@ -50,6 +50,14 @@
#include <limits.h>
+//IAccessibility2 Implementation 2009-----
+#include <ndtxt.hxx>
+#include <editeng/brshitem.hxx>
+#include <swatrset.hxx>
+#include <frmatr.hxx>
+#include "acctable.hxx"
+//-----IAccessibility2 Implementation 2009
+
using namespace ::com::sun::star;
using namespace ::com::sun::star::accessibility;
using ::rtl::OUString;
@@ -91,6 +99,10 @@ void SwAccessibleCell::GetStates( ::utl::AccessibleStateSetHelper& rStateSet )
DBG_ASSERT( pVSh, "no shell?" );
if( dynamic_cast< const SwCrsrShell* >(pVSh) )
rStateSet.AddState( AccessibleStateType::SELECTABLE );
+ //IAccessibility2 Implementation 2009-----
+ //Solution:Add resizable state to table cell.
+ rStateSet.AddState( AccessibleStateType::RESIZABLE );
+ //-----IAccessibility2 Implementation 2009
// SELECTED
if( IsSelected() )
@@ -105,6 +117,7 @@ void SwAccessibleCell::GetStates( ::utl::AccessibleStateSetHelper& rStateSet )
SwAccessibleCell::SwAccessibleCell( SwAccessibleMap *pInitMap,
const SwCellFrm *pCellFrm )
: SwAccessibleContext( pInitMap, AccessibleRole::TABLE_CELL, pCellFrm )
+ , aSelectionHelper( *this )
, bIsSelected( sal_False )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -112,6 +125,13 @@ SwAccessibleCell::SwAccessibleCell( SwAccessibleMap *pInitMap,
SetName( sBoxName );
bIsSelected = IsSelected();
+
+ //IAccessibility2 Implementation 2009-----
+ //Need not assign the pointer of accessible table object to m_pAccTable,
+ //for it already done in SwAccessibleCell::GetTable(); Former codes:
+ //m_pAccTable= GetTable();
+ GetTable();
+ //-----IAccessibility2 Implementation 2009
}
sal_Bool SwAccessibleCell::_InvalidateMyCursorPos()
@@ -132,9 +152,16 @@ sal_Bool SwAccessibleCell::_InvalidateMyCursorPos()
}
sal_Bool bChanged = bOld != bNew;
+ //IAccessibility2 Implementation 2009-----
if( bChanged )
+ {
FireStateChangedEvent( AccessibleStateType::SELECTED, bNew );
-
+ if (m_pAccTable)
+ {
+ m_pAccTable->AddSelectionCell(this,bNew);
+ }
+ }
+ //-----IAccessibility2 Implementation 2009
return bChanged;
}
@@ -158,8 +185,10 @@ sal_Bool SwAccessibleCell::_InvalidateChildrenCursorPos( const SwFrm *pFrm )
{
ASSERT( xAccImpl->GetFrm()->IsCellFrm(),
"table child is not a cell frame" )
- bChanged |= static_cast< SwAccessibleCell *>(
+ //IAccessibility2 Implementation 2009-----
+ bChanged = static_cast< SwAccessibleCell *>(
xAccImpl.getBodyPtr() )->_InvalidateMyCursorPos();
+ //-----IAccessibility2 Implementation 2009
}
else
bChanged = sal_True; // If the context is not know we
@@ -180,6 +209,22 @@ sal_Bool SwAccessibleCell::_InvalidateChildrenCursorPos( const SwFrm *pFrm )
void SwAccessibleCell::_InvalidateCursorPos()
{
+ //IAccessibility2 Implementation 2009-----
+ if (IsSelected())
+ {
+ const SwAccessibleChild aChild( GetChild( *(GetMap()), 0 ) );
+ if( aChild.IsValid() && aChild.GetSwFrm() )
+ {
+ ::vos::ORef < SwAccessibleContext > xChildImpl( GetMap()->GetContextImpl( aChild.GetSwFrm()) );
+ if(xChildImpl.isValid())
+ {
+ AccessibleEventObject aEvent;
+ aEvent.EventId = AccessibleEventId::STATE_CHANGED;
+ aEvent.NewValue<<=AccessibleStateType::FOCUSED;
+ xChildImpl->FireAccessibleEvent( aEvent );
+ }
+ }
+ }
const SwFrm *pParent = GetParent( SwAccessibleChild(GetFrm()), IsInPagePreview() );
ASSERT( pParent->IsTabFrm(), "parent is not a tab frame" );
@@ -189,6 +234,8 @@ void SwAccessibleCell::_InvalidateCursorPos()
while( pTabFrm )
{
+ _InvalidateChildrenCursorPos( pTabFrm );
+/*
sal_Bool bChanged = _InvalidateChildrenCursorPos( pTabFrm );
if( bChanged )
{
@@ -201,9 +248,14 @@ void SwAccessibleCell::_InvalidateCursorPos()
xAccImpl->FireAccessibleEvent( aEvent );
}
}
-
+*/
pTabFrm = pTabFrm->GetFollow();
}
+ if (m_pAccTable)
+ {
+ m_pAccTable->FireSelectionEvent();
+ }
+ //-----IAccessibility2 Implementation 2009
}
sal_Bool SwAccessibleCell::HasCursor()
@@ -274,6 +326,21 @@ void SwAccessibleCell::InvalidatePosOrSize( const SwRect& rOldBox )
uno::Any SwAccessibleCell::queryInterface( const uno::Type& rType )
throw( uno::RuntimeException )
{
+ //IAccessibility2 Implementation 2009-----
+ if (rType == ::getCppuType((const uno::Reference<XAccessibleExtendedAttributes>*)0))
+ {
+ uno::Any aR;
+ aR <<= uno::Reference<XAccessibleExtendedAttributes>(this);
+ return aR;
+ }
+
+ if (rType == ::getCppuType((const uno::Reference<XAccessibleSelection>*)0))
+ {
+ uno::Any aR;
+ aR <<= uno::Reference<XAccessibleSelection>(this);
+ return aR;
+ }
+ //-----IAccessibility2 Implementation 2009
if ( rType == ::getCppuType( static_cast< uno::Reference< XAccessibleValue > * >( 0 ) ) )
{
uno::Reference<XAccessibleValue> xValue = this;
@@ -327,7 +394,8 @@ SwFrmFmt* SwAccessibleCell::GetTblBoxFormat() const
return pCellFrm->GetTabBox()->GetFrmFmt();
}
-
+//IAccessibility2 Implementation 2009-----
+//Implement TableCell currentValue
uno::Any SwAccessibleCell::getCurrentValue( )
throw( uno::RuntimeException )
{
@@ -335,9 +403,33 @@ uno::Any SwAccessibleCell::getCurrentValue( )
CHECK_FOR_DEFUNC( XAccessibleValue );
uno::Any aAny;
- aAny <<= GetTblBoxFormat()->GetTblBoxValue().GetValue();
+
+ const SwCellFrm* pCellFrm = static_cast<const SwCellFrm*>( GetFrm() );
+ const SwStartNode *pSttNd = pCellFrm->GetTabBox()->GetSttNd();
+ if( pSttNd )
+ {
+ ::rtl::OUString strRet;
+ SwNodeIndex aCntntIdx( *pSttNd, 0 );
+ SwCntntNode* pCNd=NULL;
+ for(int nIndex = 0 ;
+ 0 != ( pCNd = pSttNd->GetNodes().GoNext( &aCntntIdx ) ) &&
+ aCntntIdx.GetIndex() < pSttNd->EndOfSectionIndex();
+ ++nIndex )
+ {
+ if(pCNd && pCNd->IsTxtNode())
+ {
+ if (0 != nIndex)
+ {
+ strRet += ::rtl::OUString::createFromAscii(" ");
+ }
+ strRet +=((SwTxtNode*)pCNd)->GetTxt();
+ }
+ }
+ aAny <<= strRet;
+ }
return aAny;
}
+//-----IAccessibility2 Implementation 2009
sal_Bool SwAccessibleCell::setCurrentValue( const uno::Any& aNumber )
throw( uno::RuntimeException )
@@ -370,3 +462,133 @@ uno::Any SwAccessibleCell::getMinimumValue( )
aAny <<= -DBL_MAX;
return aAny;
}
+
+//IAccessibility2 Implementation 2009-----
+::rtl::OUString ReplaceOneChar(::rtl::OUString oldOUString, ::rtl::OUString replacedChar, ::rtl::OUString replaceStr)
+{
+ int iReplace = -1;
+ iReplace = oldOUString.lastIndexOf(replacedChar);
+ if (iReplace > -1)
+ {
+ for(;iReplace>-1;)
+ {
+ oldOUString = oldOUString.replaceAt(iReplace,1, replaceStr);
+ iReplace=oldOUString.lastIndexOf(replacedChar,iReplace);
+ }
+ }
+ return oldOUString;
+}
+::rtl::OUString ReplaceFourChar(::rtl::OUString oldOUString)
+{
+ oldOUString = ReplaceOneChar(oldOUString,OUString::createFromAscii("\\"),OUString::createFromAscii("\\\\"));
+ oldOUString = ReplaceOneChar(oldOUString,::rtl::OUString::createFromAscii(";"),::rtl::OUString::createFromAscii("\\;"));
+ oldOUString = ReplaceOneChar(oldOUString,::rtl::OUString::createFromAscii("="),::rtl::OUString::createFromAscii("\\="));
+ oldOUString = ReplaceOneChar(oldOUString,::rtl::OUString::createFromAscii(","),::rtl::OUString::createFromAscii("\\,"));
+ oldOUString = ReplaceOneChar(oldOUString,::rtl::OUString::createFromAscii(":"),::rtl::OUString::createFromAscii("\\:"));
+ return oldOUString;
+}
+
+::com::sun::star::uno::Any SAL_CALL SwAccessibleCell::getExtendedAttributes()
+ throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException)
+{
+ ::com::sun::star::uno::Any strRet;
+ SwFrmFmt *pFrmFmt = GetTblBoxFormat();
+ DBG_ASSERT(pFrmFmt,"Must be Valid");
+
+ const SwTblBoxFormula& tbl_formula = pFrmFmt->GetTblBoxFormula();
+
+ ::rtl::OUString strFormula = ReplaceFourChar(tbl_formula.GetFormula());
+ ::rtl::OUString strFor = ::rtl::OUString::createFromAscii("Formula:");
+ strFor += strFormula;
+ strFor += ::rtl::OUString::createFromAscii(";") ;
+ strRet <<= strFor;
+
+ return strRet;
+}
+
+sal_Int32 SAL_CALL SwAccessibleCell::getBackground()
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ const SvxBrushItem &rBack = GetFrm()->GetAttrSet()->GetBackground();
+ sal_uInt32 crBack = rBack.GetColor().GetColor();
+
+ if (COL_AUTO == crBack)
+ {
+ uno::Reference<XAccessible> xAccDoc = getAccessibleParent();
+ if (xAccDoc.is())
+ {
+ uno::Reference<XAccessibleComponent> xCompoentDoc(xAccDoc, uno::UNO_QUERY);
+ if (xCompoentDoc.is())
+ {
+ crBack = (sal_uInt32)xCompoentDoc->getBackground();
+ }
+ }
+ }
+ return crBack;
+}
+
+//===== XAccessibleSelection ============================================
+void SwAccessibleCell::selectAccessibleChild(
+ sal_Int32 nChildIndex )
+ throw ( lang::IndexOutOfBoundsException, uno::RuntimeException )
+{
+ aSelectionHelper.selectAccessibleChild(nChildIndex);
+}
+
+sal_Bool SwAccessibleCell::isAccessibleChildSelected(
+ sal_Int32 nChildIndex )
+ throw ( lang::IndexOutOfBoundsException, uno::RuntimeException )
+{
+ return aSelectionHelper.isAccessibleChildSelected(nChildIndex);
+}
+
+void SwAccessibleCell::clearAccessibleSelection( )
+ throw ( uno::RuntimeException )
+{
+ aSelectionHelper.clearAccessibleSelection();
+}
+
+void SwAccessibleCell::selectAllAccessibleChildren( )
+ throw ( uno::RuntimeException )
+{
+ aSelectionHelper.selectAllAccessibleChildren();
+}
+
+sal_Int32 SwAccessibleCell::getSelectedAccessibleChildCount( )
+ throw ( uno::RuntimeException )
+{
+ return aSelectionHelper.getSelectedAccessibleChildCount();
+}
+
+uno::Reference<XAccessible> SwAccessibleCell::getSelectedAccessibleChild(
+ sal_Int32 nSelectedChildIndex )
+ throw ( lang::IndexOutOfBoundsException, uno::RuntimeException)
+{
+ return aSelectionHelper.getSelectedAccessibleChild(nSelectedChildIndex);
+}
+
+void SwAccessibleCell::deselectAccessibleChild(
+ sal_Int32 nSelectedChildIndex )
+ throw ( lang::IndexOutOfBoundsException, uno::RuntimeException )
+{
+ aSelectionHelper.deselectAccessibleChild(nSelectedChildIndex);
+}
+
+SwAccessibleTable *SwAccessibleCell::GetTable()
+{
+ if (!m_pAccTable)
+ {
+ if (!xTableReference.is())
+ {
+ xTableReference = getAccessibleParent();
+ #ifdef OSL_DEBUG_LEVEL
+ uno::Reference<XAccessibleContext> xContextTable(xTableReference, uno::UNO_QUERY);
+ OSL_ASSERT(xContextTable.is() && xContextTable->getAccessibleRole() == AccessibleRole::TABLE);
+ #endif
+ //SwAccessibleTable aTable = *(static_cast<SwAccessibleTable *>(xTable.get()));
+ }
+ m_pAccTable = static_cast<SwAccessibleTable *>(xTableReference.get());
+ }
+ return m_pAccTable;
+}
+//-----IAccessibility2 Implementation 2009
diff --git a/sw/source/core/access/acccell.hxx b/sw/source/core/access/acccell.hxx
index 130ae7c432d9..bc16a660a5a4 100644
--- a/sw/source/core/access/acccell.hxx
+++ b/sw/source/core/access/acccell.hxx
@@ -26,13 +26,27 @@
#include "acccontext.hxx"
#include <com/sun/star/accessibility/XAccessibleValue.hpp>
+//IAccessibility2 Implementation 2009-----
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_XAccessibleExtendedAttributes_HPP_
+#include <com/sun/star/accessibility/XAccessibleExtendedAttributes.hpp>
+#endif
+
+#ifndef _ACCSELECTIONHELPER_HXX_
+#include <accselectionhelper.hxx>
+#endif
+//-----IAccessibility2 Implementation 2009
+
class SwCellFrm;
+class SwAccessibleTable;
class SwFrmFmt;
class SwAccessibleCell : public SwAccessibleContext,
- ::com::sun::star::accessibility::XAccessibleValue
-
+ ::com::sun::star::accessibility::XAccessibleValue,
+ ::com::sun::star::accessibility::XAccessibleSelection,
+ public ::com::sun::star::accessibility::XAccessibleExtendedAttributes
{
+ // Implementation for XAccessibleSelection interface
+ SwAccessibleSelectionHelper aSelectionHelper;
sal_Bool bIsSelected; // protected by base class mutex
sal_Bool IsSelected();
@@ -110,6 +124,11 @@ public:
//===== XAccessibleValue ================================================
+ //===== XAccessibleExtendedAttributes ================================================
+ //IAccessibility2 Implementation 2009-----
+ ::com::sun::star::uno::Any SAL_CALL getExtendedAttributes()
+ throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) ;
+ //-----IAccessibility2 Implementation 2009
private:
SwFrmFmt* GetTblBoxFormat() const;
@@ -126,6 +145,41 @@ public:
virtual ::com::sun::star::uno::Any SAL_CALL getMinimumValue( )
throw (::com::sun::star::uno::RuntimeException);
+ //IAccessibility2 Implementation 2009-----
+ //===== XAccessibleComponent ============================================
+ sal_Int32 SAL_CALL getBackground()
+ throw (::com::sun::star::uno::RuntimeException);
+
+ //===== XAccessibleSelection ============================================
+ virtual void SAL_CALL selectAccessibleChild(
+ sal_Int32 nChildIndex )
+ throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual sal_Bool SAL_CALL isAccessibleChildSelected(
+ sal_Int32 nChildIndex )
+ throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL clearAccessibleSelection( )
+ throw ( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL selectAllAccessibleChildren( )
+ throw ( ::com::sun::star::uno::RuntimeException );
+ virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( )
+ throw ( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild(
+ sal_Int32 nSelectedChildIndex )
+ throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
+ ::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL deselectAccessibleChild(
+ sal_Int32 nSelectedChildIndex )
+ throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
+ ::com::sun::star::uno::RuntimeException );
+
+ SwAccessibleTable *GetTable();
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xTableReference;
+ SwAccessibleTable *m_pAccTable;
+ //-----IAccessibility2 Implementation 2009
};
diff --git a/sw/source/core/access/acccontext.cxx b/sw/source/core/access/acccontext.cxx
index a4a0399747f7..df207e989350 100644
--- a/sw/source/core/access/acccontext.cxx
+++ b/sw/source/core/access/acccontext.cxx
@@ -60,6 +60,11 @@
#include <acccontext.hxx>
#include <svx/AccessibleShape.hxx>
#include <comphelper/accessibleeventnotifier.hxx>
+//IAccessibility2 Implementation 2009-----
+#ifndef _ACCPARA_HXX
+#include "accpara.hxx"
+#endif
+//-----IAccessibility2 Implementation 2009
#include <PostItMgr.hxx>
using namespace sw::access;
@@ -215,8 +220,11 @@ void SwAccessibleContext::ChildrenScrolled( const SwFrm *pFrm,
"<SwAccessibleContext::ChildrenScrolled(..)> - always included child not considered!" );
const SwFrm* pLower( rLower.GetSwFrm() );
::vos::ORef< SwAccessibleContext > xAccImpl =
- GetMap()->GetContextImpl( pLower, SCROLLED_OUT == eAction ||
- SCROLLED_IN == eAction );
+ //IAccessibility2 Implementation 2009-----
+ //O is: GetMap()->GetContextImpl( pLower, SCROLLED_OUT == eAction ||
+ // SCROLLED_IN == eAction );
+ GetMap()->GetContextImpl( pLower, sal_True );
+ //-----IAccessibility2 Implementation 2009
if( xAccImpl.isValid() )
{
switch( eAction )
@@ -247,10 +255,15 @@ void SwAccessibleContext::ChildrenScrolled( const SwFrm *pFrm,
ASSERT( !rLower.AlwaysIncludeAsChild(),
"<SwAccessibleContext::ChildrenScrolled(..)> - always included child not considered!" );
::vos::ORef< ::accessibility::AccessibleShape > xAccImpl =
+ //IAccessibility2 Implementation 2009-----
+ //O is: GetMap()->GetContextImpl( rLower.GetSdrObject(),
+ // this,
+ // SCROLLED_OUT == eAction ||
+ // SCROLLED_IN == eAction );
GetMap()->GetContextImpl( rLower.GetDrawObject(),
this,
- SCROLLED_OUT == eAction ||
- SCROLLED_IN == eAction );
+ sal_True );
+ //-----IAccessibility2 Implementation 2009
if( xAccImpl.isValid() )
{
switch( eAction )
@@ -270,8 +283,11 @@ void SwAccessibleContext::ChildrenScrolled( const SwFrm *pFrm,
xAccImpl->ViewForwarderChanged(
::accessibility::IAccessibleViewForwarderListener::VISIBLE_AREA,
GetMap() );
- DisposeShape( rLower.GetDrawObject(),
- xAccImpl.getBodyPtr() );
+ //IAccessibility2 Implementation 2009-----
+ //Remove
+ //DisposeShape( rLower.GetDrawObject(),
+ // xAccImpl.getBodyPtr() );
+ //-----IAccessibility2 Implementation 2009
}
break;
case NONE:
@@ -380,8 +396,11 @@ void SwAccessibleContext::ScrolledOut( const SwRect& rOldVisArea )
// the child event. In this case no listener will exist.
FireStateChangedEvent( AccessibleStateType::SHOWING, sal_False );
+ //IAccessibility2 Implementation 2009-----
+ //Remove Dispose When scrolledout
// We now dispose the frame
- Dispose( sal_True );
+ // Dispose( sal_True );
+ //-----IAccessibility2 Implementation 2009
}
// --> OD 2005-12-12 #i27301# - use new type definition for <_nStates>
@@ -517,8 +536,14 @@ void SwAccessibleContext::GetStates(
// EDITABLE
if( bIsEditableState )
+ //IAccessibility2 Implementation 2009-----
+ //Solution:Set editable state to graphic and other object when the document is editable
+ {
rStateSet.AddState( AccessibleStateType::EDITABLE );
-
+ rStateSet.AddState( AccessibleStateType::RESIZABLE );
+ rStateSet.AddState( AccessibleStateType::MOVEABLE );
+ }
+ //-----IAccessibility2 Implementation 2009
// ENABLED
rStateSet.AddState( AccessibleStateType::ENABLED );
@@ -554,6 +579,12 @@ SwAccessibleContext::SwAccessibleContext( SwAccessibleMap *pM,
, nRole( nR )
, bDisposing( sal_False )
, bRegisteredAtAccessibleMap( true )
+ //IAccessibility2 Implementation 2009-----
+ //Solution:Initialize the begin document load and IfAsynLoad to true
+ , bBeginDocumentLoad( sal_True )
+ , isIfAsynLoad( sal_True )
+ , bIsSeletedInDoc( sal_False)
+ //-----IAccessibility2 Implementation 2009
{
InitStates();
DBG_MSG_CD( "constructed" )
@@ -581,6 +612,11 @@ sal_Int32 SAL_CALL SwAccessibleContext::getAccessibleChildCount( void )
vos::OGuard aGuard(Application::GetSolarMutex());
CHECK_FOR_DEFUNC( XAccessibleContext )
+ //IAccessibility2 Implementation 2009-----
+ //Solution:Notify the frame is a document
+ if( nRole == AccessibleRole::DOCUMENT )
+ bIsAccDocUse = sal_True;
+ //-----IAccessibility2 Implementation 2009
return bDisposing ? 0 : GetChildCount( *(GetMap()) );
}
@@ -593,6 +629,12 @@ uno::Reference< XAccessible> SAL_CALL
CHECK_FOR_DEFUNC( XAccessibleContext )
+ //IAccessibility2 Implementation 2009-----
+ //Solution:Notify the frame is a document
+ if( nRole == AccessibleRole::DOCUMENT )
+ bIsAccDocUse = sal_True;
+ //-----IAccessibility2 Implementation 2009
+
const SwAccessibleChild aChild( GetChild( *(GetMap()), nIndex ) );
if( !aChild.IsValid() )
{
@@ -608,6 +650,26 @@ uno::Reference< XAccessible> SAL_CALL
{
::vos::ORef < SwAccessibleContext > xChildImpl(
GetMap()->GetContextImpl( aChild.GetSwFrm(), !bDisposing ) );
+ //IAccessibility2 Implementation 2009-----
+ //Solution:Send out accessible event when begin load.
+ if( bBeginDocumentLoad && nRole == AccessibleRole::DOCUMENT )
+ {
+
+ FireStateChangedEvent( AccessibleStateType::FOCUSABLE,sal_True );
+ FireStateChangedEvent( AccessibleStateType::BUSY,sal_True );
+ if( !isIfAsynLoad )
+ {
+ FireStateChangedEvent( AccessibleStateType::FOCUSED,sal_True );
+ // IA2 CWS. MT: OFFSCREEN == !SHOWING, should stay consistent
+ // FireStateChangedEvent( AccessibleStateType::OFFSCREEN,sal_True );
+ FireStateChangedEvent( AccessibleStateType::SHOWING,sal_True );
+ FireStateChangedEvent( AccessibleStateType::BUSY,sal_False );
+ // MT: OFFSCREEN again?
+ // FireStateChangedEvent( AccessibleStateType::OFFSCREEN,sal_False );
+ }
+ bBeginDocumentLoad = sal_False;
+ }
+ //-----IAccessibility2 Implementation 2009
if( xChildImpl.isValid() )
{
xChildImpl->SetParent( this );
@@ -717,6 +779,11 @@ uno::Reference<XAccessibleStateSet> SAL_CALL
::utl::AccessibleStateSetHelper *pStateSet =
new ::utl::AccessibleStateSetHelper;
+ //IAccessibility2 Implementation 2009-----
+ if( bIsSeletedInDoc )
+ pStateSet->AddState( AccessibleStateType::SELECTED );
+ //-----IAccessibility2 Implementation 2009
+
uno::Reference<XAccessibleStateSet> xStateSet( pStateSet );
GetStates( *pStateSet );
@@ -988,13 +1055,15 @@ uno::Any SAL_CALL SwAccessibleContext::getAccessibleKeyBinding()
sal_Int32 SAL_CALL SwAccessibleContext::getForeground()
throw (uno::RuntimeException)
{
- return 0;
+ //IAccessibility2 Implementation 2009-----
+ return COL_BLACK;
+ //-----IAccessibility2 Implementation 2009
}
sal_Int32 SAL_CALL SwAccessibleContext::getBackground()
throw (uno::RuntimeException)
{
- return 0xffffff;
+ return COL_WHITE;
}
@@ -1041,6 +1110,12 @@ void SwAccessibleContext::DisposeShape( const SdrObject *pObj,
void SwAccessibleContext::ScrolledInShape( const SdrObject* ,
::accessibility::AccessibleShape *pAccImpl )
{
+ //IAccessibility2 Implementation 2009-----
+ if(NULL == pAccImpl)
+ {
+ return ;
+ }
+ //-----IAccessibility2 Implementation 2009
AccessibleEventObject aEvent;
aEvent.EventId = AccessibleEventId::CHILD;
uno::Reference< XAccessible > xAcc( pAccImpl );
@@ -1184,7 +1259,10 @@ void SwAccessibleContext::InvalidatePosOrSize( const SwRect& )
SwAccessibleChild( GetParent() ).IsVisibleChildrenOnly() )
{
// The frame is now invisible -> dispose it
- Dispose( sal_True );
+ //IAccessibility2 Implementation 2009-----
+ //Remove
+ //Dispose( sal_True );
+ //-----IAccessibility2 Implementation 2009
}
else
{
@@ -1585,3 +1663,15 @@ void lcl_SwAccessibleContext_DbgMsg( SwAccessibleContext *pThisAcc,
aStrm.Flush();
}
#endif
+//IAccessibility2 Implementation 2009-----
+sal_Bool SwAccessibleContext::SetSelectedState(sal_Bool bSeleted)
+{
+ if(bIsSeletedInDoc != bSeleted)
+ {
+ bIsSeletedInDoc = bSeleted;
+ FireStateChangedEvent( AccessibleStateType::SELECTED, bSeleted );
+ return sal_True;
+ }
+ return sal_False;
+};
+//-----IAccessibility2 Implementation 2009
diff --git a/sw/source/core/access/acccontext.hxx b/sw/source/core/access/acccontext.hxx
index e712973b7190..915a46e12627 100644
--- a/sw/source/core/access/acccontext.hxx
+++ b/sw/source/core/access/acccontext.hxx
@@ -98,6 +98,10 @@ private:
// <--
void InitStates();
+ //IAccessibility2 Implementation 2009-----
+ //Solution:Add a member to identify the firt time that document load
+ sal_Bool bBeginDocumentLoad;
+ //-----IAccessibility2 Implementation 2009
protected:
void SetName( const ::rtl::OUString& rName ) { sName = rName; }
@@ -105,7 +109,12 @@ protected:
{
return nRole;
}
-
+ //IAccessibility2 Implementation 2009-----
+ //Solution:Add a member to identify if the document is Asyn load.
+ sal_Bool isIfAsynLoad;
+ //This flag is used to mark the object's selected state.
+ sal_Bool bIsSeletedInDoc;
+ //-----IAccessibility2 Implementation 2009
void SetParent( SwAccessibleContext *pParent );
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> GetWeakParent() const;
@@ -172,6 +181,9 @@ protected:
public:
+ //IAccessibility2 Implementation 2009-----
+ void SetMap(SwAccessibleMap *pM){pMap = pM;}
+ //-----IAccessibility2 Implementation 2009
void FireAccessibleEvent( ::com::sun::star::accessibility::AccessibleEventObject& rEvent );
protected:
@@ -415,12 +427,15 @@ public:
{
return Select( 0, pObj, bAdd );
}
+ //IAccessibility2 Implementation 2009-----
+ //This method is used to updated the selected state and fire the selected state changed event.
+ virtual sal_Bool SetSelectedState(sal_Bool bSeleted);
+ sal_Bool IsSeletedInDoc(){ return bIsSeletedInDoc; }
+ //-----IAccessibility2 Implementation 2009
static ::rtl::OUString GetResource( sal_uInt16 nResId,
const ::rtl::OUString *pArg1 = 0,
const ::rtl::OUString *pArg2 = 0 );
-
-
};
// some heaviliy used exception support
diff --git a/sw/source/core/access/accdoc.cxx b/sw/source/core/access/accdoc.cxx
index 83db96973a2d..fce090d5c4ac 100644
--- a/sw/source/core/access/accdoc.cxx
+++ b/sw/source/core/access/accdoc.cxx
@@ -45,6 +45,30 @@
#endif
#include <pagefrm.hxx>
+//IAccessibility2 Implementation 2009-----
+#include <editeng/brshitem.hxx>
+#include <swatrset.hxx>
+#include <frmatr.hxx>
+#include "unostyle.hxx"
+#include "viewsh.hxx"
+#include "docsh.hxx"
+#include <crsrsh.hxx>
+#include "fesh.hxx"
+#include <fmtclds.hxx>
+#include <flyfrm.hxx>
+#include <colfrm.hxx>
+#include <txtfrm.hxx>
+#include <sectfrm.hxx>
+#include <section.hxx>
+#include <svx/unoapi.hxx>
+#include <swmodule.hxx>
+#include <svtools/colorcfg.hxx>
+
+#include <fmtanchr.hxx>
+#include <viewimp.hxx>
+#include <dview.hxx>
+#include <dcontact.hxx>
+//-----IAccessibility2 Implementation 2009
const sal_Char sServiceName[] = "com.sun.star.text.AccessibleTextDocumentView";
const sal_Char sImplementationName[] = "com.sun.star.comp.Writer.SwAccessibleDocumentView";
@@ -178,8 +202,17 @@ sal_Int32 SAL_CALL SwAccessibleDocumentBase::getAccessibleIndexInParent (void)
for( sal_Int32 i=0; i < nCount; i++ )
{
- if( xAcc->getAccessibleChild( i ) == xThis )
- return i;
+ //IAccessibility2 Implementation 2009-----
+ try
+ {
+ if( xAcc->getAccessibleChild( i ) == xThis )
+ return i;
+ }
+ catch(::com::sun::star::lang::IndexOutOfBoundsException e)
+ {
+ return -1L;
+ }
+ //-----IAccessibility2 Implementation 2009
}
return -1L;
}
@@ -190,20 +223,62 @@ OUString SAL_CALL SwAccessibleDocumentBase::getAccessibleDescription (void)
return GetResource( STR_ACCESS_DOC_DESC );
}
+//IAccessibility2 Implementation 2009-----
+OUString SAL_CALL SwAccessibleDocumentBase::getAccessibleName (void)
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ OUString sAccName = GetResource( STR_ACCESS_DOC_WORDPROCESSING );
+ SwDoc *pDoc = GetShell()->GetDoc();
+ if ( pDoc )
+ {
+ OUString sFileName = pDoc->getDocAccTitle();
+ if ( !sFileName.getLength() )
+ {
+ SwDocShell* pDocSh = pDoc->GetDocShell();
+ if ( pDocSh )
+ {
+ sFileName = pDocSh->GetTitle( SFX_TITLE_APINAME );
+ }
+ }
+ OUString sReadOnly;
+ if(pDoc->getDocReadOnly())
+ {
+ sReadOnly = GetResource( STR_ACCESS_DOC_WORDPROCESSING_READONLY );
+ }
+
+ if ( sFileName.getLength() )
+ {
+ sAccName = sFileName + sReadOnly + OUString(RTL_CONSTASCII_USTRINGPARAM(" - ")) + sAccName;
+ }
+ }
+
+ return sAccName;
+}
+//-----IAccessibility2 Implementation 2009
+
awt::Rectangle SAL_CALL SwAccessibleDocumentBase::getBounds()
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ //IAccessibility2 Implementation 2009-----
+ try
+ {
+ vos::OGuard aGuard(Application::GetSolarMutex());
- Window *pWin = GetWindow();
+ Window *pWin = GetWindow();
- CHECK_FOR_WINDOW( XAccessibleComponent, pWin )
+ CHECK_FOR_WINDOW( XAccessibleComponent, pWin )
- Rectangle aPixBounds( pWin->GetWindowExtentsRelative( pWin->GetAccessibleParentWindow() ) );
- awt::Rectangle aBox( aPixBounds.Left(), aPixBounds.Top(),
- aPixBounds.GetWidth(), aPixBounds.GetHeight() );
+ Rectangle aPixBounds( pWin->GetWindowExtentsRelative( pWin->GetAccessibleParentWindow() ) );
+ awt::Rectangle aBox( aPixBounds.Left(), aPixBounds.Top(),
+ aPixBounds.GetWidth(), aPixBounds.GetHeight() );
- return aBox;
+ return aBox;
+ }
+ catch(::com::sun::star::lang::IndexOutOfBoundsException e)
+ {
+ return awt::Rectangle();
+ }
+ //-----IAccessibility2 Implementation 2009
}
@@ -303,6 +378,9 @@ void SwAccessibleDocument::GetStates(
// MULTISELECTABLE
rStateSet.AddState( AccessibleStateType::MULTI_SELECTABLE );
+ //IAccessibility2 Implementation 2009-----
+ rStateSet.AddState( AccessibleStateType::MANAGES_DESCENDANTS );
+ //-----IAccessibility2 Implementation 2009
}
@@ -424,6 +502,24 @@ uno::Any SwAccessibleDocument::queryInterface(
uno::Reference<XAccessibleSelection> aSelect = this;
aRet <<= aSelect;
}
+ //IAccessibility2 Implementation 2009-----
+ //Solution:Add XEventListener interface support.
+ else if ( (rType == ::getCppuType((uno::Reference<com::sun::star::document::XEventListener> *)NULL)) )
+ {
+ uno::Reference<com::sun::star::document::XEventListener> aSelect = this;
+ aRet <<= aSelect;
+ }
+ else if ( rType == ::getCppuType((uno::Reference<XAccessibleExtendedAttributes> *)NULL) )
+ {
+ uno::Reference<XAccessibleExtendedAttributes> aAttribute = this;
+ aRet <<= aAttribute;
+ }
+ else if(rType == ::getCppuType((uno::Reference<XAccessibleGetAccFlowTo> *)NULL) )
+ {
+ uno::Reference<XAccessibleGetAccFlowTo> AccFlowTo = this;
+ aRet <<= AccFlowTo;
+ }
+ //-----IAccessibility2 Implementation 2009
else
aRet = SwAccessibleContext::queryInterface( rType );
return aRet;
@@ -436,11 +532,16 @@ uno::Sequence< uno::Type > SAL_CALL SwAccessibleDocument::getTypes()
uno::Sequence< uno::Type > aTypes( SwAccessibleDocumentBase::getTypes() );
sal_Int32 nIndex = aTypes.getLength();
- aTypes.realloc( nIndex + 1 );
+ //IAccessibility2 Implementation 2009-----
+ //Solution:Reset types memory alloc
+ //aTypes.realloc( nIndex + 1 );
+ aTypes.realloc( nIndex + 2 );
uno::Type* pTypes = aTypes.getArray();
pTypes[nIndex] = ::getCppuType( static_cast< uno::Reference< XAccessibleSelection > * >( 0 ) );
-
+ //Solution:Add XEventListener interface support.
+ pTypes[nIndex + 1 ] = ::getCppuType( static_cast< uno::Reference< com::sun::star::document::XEventListener > * >( 0 ) );
+ //-----IAccessibility2 Implementation 2009
return aTypes;
}
@@ -510,3 +611,418 @@ void SwAccessibleDocument::deselectAccessibleChild(
{
maSelectionHelper.deselectAccessibleChild( nChildIndex );
}
+//IAccessibility2 Implementation 2009-----
+//Solution:Implement XEventListener interfaces
+void SAL_CALL SwAccessibleDocument::notifyEvent( const ::com::sun::star::document::EventObject& Event )
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ if ( Event.EventName.equalsAscii( "FirstPageShows" ) )
+ {
+ FireStateChangedEvent( AccessibleStateType::FOCUSED,sal_True );
+ }
+ else if ( Event.EventName.equalsAscii( "LoadFinished" ) )
+ {
+ // IA2 CWS. MT: OFFSCREEN == !SHOWING, should stay consistent
+ // FireStateChangedEvent( AccessibleStateType::OFFSCREEN,sal_True );
+ // MT: LoadFinished => Why not SHOWING == TRUE?
+ FireStateChangedEvent( AccessibleStateType::SHOWING,sal_False );
+ }
+ else if ( Event.EventName.equalsAscii( "FormatFinished" ) )
+ {
+ FireStateChangedEvent( AccessibleStateType::BUSY,sal_False );
+ // FireStateChangedEvent( AccessibleStateType::OFFSCREEN,sal_False );
+ FireStateChangedEvent( AccessibleStateType::SHOWING,sal_True );
+ }
+ else
+ {
+ isIfAsynLoad = sal_False;
+ }
+}
+
+void SAL_CALL SwAccessibleDocument::disposing( const ::com::sun::star::lang::EventObject& )
+ throw (::com::sun::star::uno::RuntimeException)
+{
+}
+
+uno::Any SAL_CALL SwAccessibleDocument::getExtendedAttributes()
+ throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException)
+{
+ uno::Any anyAtrribute;
+ SwDoc *pDoc = GetShell()->GetDoc();
+
+ if (!pDoc)
+ return anyAtrribute;
+ SwCrsrShell* pCrsrShell = GetCrsrShell();
+ if( !pCrsrShell )
+ return anyAtrribute;
+
+ SwFEShell* pFEShell = dynamic_cast< SwFEShell* >(pCrsrShell);
+ rtl::OUString sAttrName;
+ rtl::OUString sValue;
+ sal_uInt16 nPage, nLogPage;
+ String sDisplay;
+
+ if( pFEShell )
+ {
+ pFEShell->GetPageNumber(-1,sal_True,nPage,nLogPage,sDisplay);
+ sAttrName = rtl::OUString::createFromAscii("page-name:");
+
+
+ sValue = sAttrName + sDisplay ;
+ sAttrName = rtl::OUString::createFromAscii(";page-number:");
+ sValue += sAttrName;
+ sValue += String::CreateFromInt32( nPage ) ;
+ sAttrName = rtl::OUString::createFromAscii(";total-pages:");
+ sValue += sAttrName;
+ sValue += String::CreateFromInt32( pCrsrShell->GetPageCnt() ) ;
+ sValue += rtl::OUString::createFromAscii(";");
+
+
+ sAttrName=rtl::OUString::createFromAscii("line-number:");
+
+
+
+ SwCntntFrm* pCurrFrm = pCrsrShell->GetCurrFrm();
+ SwPageFrm* pCurrPage=((SwFrm*)pCurrFrm)->FindPageFrm();
+ sal_uLong nLineNum = 0;
+ //IAccessibility2 Implementation 2009-----
+ SwTxtFrm* pTxtFrm = NULL;
+ SwTxtFrm* pCurrTxtFrm = NULL;
+ pTxtFrm = static_cast< SwTxtFrm* >(static_cast< SwPageFrm* > (pCurrPage)->ContainsCntnt());
+ if (pCurrFrm->IsInFly())//such as, graphic,chart
+ {
+ SwFlyFrm *pFlyFrm = pCurrFrm->FindFlyFrm();
+ const SwFmtAnchor& rAnchor = pFlyFrm->GetFmt()->GetAnchor();
+ RndStdIds eAnchorId = rAnchor.GetAnchorId();
+ if(eAnchorId == FLY_AS_CHAR)
+ {
+ const SwFrm *pSwFrm = pFlyFrm->GetAnchorFrm();
+ if(pSwFrm->IsTxtFrm())
+ pCurrTxtFrm = ((SwTxtFrm*)(pSwFrm));
+ }
+ }
+ else
+ pCurrTxtFrm = static_cast< SwTxtFrm* >(pCurrFrm);
+ //check whether the text frame where the Graph/OLE/Frame anchored is in the Header/Footer
+ SwFrm* pFrm = pCurrTxtFrm;
+ while ( pFrm && !pFrm->IsHeaderFrm() && !pFrm->IsFooterFrm() )
+ pFrm = pFrm->GetUpper();
+ if ( pFrm )
+ pCurrTxtFrm = NULL;
+ //check shape
+ if(pCrsrShell->Imp()->GetDrawView())
+ {
+ const SdrObjectVector aSdrObjectVector(pCrsrShell->Imp()->GetDrawView()->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for(sal_uInt32 i(0); i < aSdrObjectVector.size(); ++i )
+ {
+ SdrObject* pObj = aSdrObjectVector[i];
+
+ // replace formally used 'GetUserCall()' by new notify/listener mechanism
+ const SwDrawContact* pContact = static_cast< const SwDrawContact* >(findConnectionToSdrObject(pObj));
+
+ const SwFrmFmt* pFmt = pContact->GetFmt();
+ const SwFmtAnchor& rAnchor = pFmt->GetAnchor();
+ if( FLY_AS_CHAR != rAnchor.GetAnchorId() )
+ pCurrTxtFrm = NULL;
+ }
+ }
+ //calculate line number
+ if (pCurrTxtFrm && pTxtFrm)
+ {
+ if (!(pCurrTxtFrm->IsInTab() || pCurrTxtFrm->IsInFtn()))
+ {
+ while( pTxtFrm != pCurrTxtFrm )
+ {
+ //check header/footer
+ pFrm = pTxtFrm;
+ while ( pFrm && !pFrm->IsHeaderFrm() && !pFrm->IsFooterFrm() )
+ pFrm = pFrm->GetUpper();
+ if ( pFrm )
+ {
+ pTxtFrm = static_cast< SwTxtFrm*>(pTxtFrm->GetNextCntntFrm());
+ continue;
+ }
+ if (!(pTxtFrm->IsInTab() || pTxtFrm->IsInFtn() || pTxtFrm->IsInFly()))
+ nLineNum += pTxtFrm->GetThisLines();
+ pTxtFrm = static_cast< SwTxtFrm* >(pTxtFrm ->GetNextCntntFrm());
+ }
+ SwPaM* pCaret = pCrsrShell->GetCrsr();
+ if (!pCurrTxtFrm->IsEmpty() && pCaret)
+ {
+ sal_uInt16 nActPos = 0;
+ if (pCurrTxtFrm->IsTxtFrm())
+ {
+ const SwPosition* pPoint = NULL;
+ if(pCurrTxtFrm->IsInFly())
+ {
+ SwFlyFrm *pFlyFrm = pCurrTxtFrm->FindFlyFrm();
+ const SwFmtAnchor& rAnchor = pFlyFrm->GetFmt()->GetAnchor();
+ pPoint= rAnchor.GetCntntAnchor();
+ }
+ else
+ pPoint = pCaret->GetPoint();
+ nActPos = pPoint->nContent.GetIndex();
+ nLineNum += pCurrTxtFrm->GetLineCount( nActPos );
+ }
+ else//graphic, form, shape, etc.
+ {
+ SwPosition* pPoint = pCaret->GetPoint();
+ Point aPt = pCrsrShell->_GetCrsr()->GetPtPos();
+ if( pCrsrShell->GetLayout()->GetCrsrOfst( pPoint, aPt/*,* &eTmpState*/ ) )
+ {
+ nActPos = pPoint->nContent.GetIndex();
+ nLineNum += pCurrTxtFrm->GetLineCount( nActPos );
+ }
+ }
+ }
+ else
+ ++nLineNum;
+ }
+ }
+ //-----IAccessibility2 Implementation 2009
+
+ sValue += sAttrName;
+ sValue += String::CreateFromInt32( nLineNum ) ;
+
+ sValue += rtl::OUString::createFromAscii(";");
+
+
+ SwFrm* pCurrCol=((SwFrm*)pCurrFrm)->FindColFrm();
+
+ sAttrName=rtl::OUString::createFromAscii("column-number:");
+ sValue += sAttrName;
+
+ sal_uInt16 nCurrCol = 1;
+ if(pCurrCol!=NULL)
+ {
+ //SwLayoutFrm* pParent = pCurrCol->GetUpper();
+ SwFrm* pCurrPageCol=((SwFrm*)pCurrFrm)->FindColFrm();
+ while(pCurrPageCol && pCurrPageCol->GetUpper() && pCurrPageCol->GetUpper()->IsPageFrm())
+ {
+ pCurrPageCol = pCurrPageCol->GetUpper();
+ }
+
+ SwLayoutFrm* pParent = (SwLayoutFrm*)(pCurrPageCol->GetUpper());
+
+ if(pParent!=NULL)
+ {
+ SwFrm* pCol = pParent->Lower();
+ while(pCol&&(pCol!=pCurrPageCol))
+ {
+ pCol = pCol->GetNext();
+ nCurrCol +=1;
+ }
+ }
+ }
+ sValue += String::CreateFromInt32( nCurrCol ) ;
+ sValue += rtl::OUString::createFromAscii(";");
+
+ sAttrName=rtl::OUString::createFromAscii("total-columns:");
+
+ const SwFmtCol &rFmtCol=pCurrPage->GetAttrSet()->GetCol();
+ sal_uInt16 nColCount=rFmtCol.GetNumCols();
+ nColCount = nColCount>0?nColCount:1;
+ sValue += sAttrName;
+ sValue += String::CreateFromInt32( nColCount ) ;
+
+ sValue += rtl::OUString::createFromAscii(";");
+
+ if(pCurrFrm!=NULL)
+ {
+ SwSectionFrm* pCurrSctFrm=((SwFrm*)pCurrFrm)->FindSctFrm();
+ if(pCurrSctFrm!=NULL && pCurrSctFrm->GetSection()!=NULL )
+ {
+ sAttrName = rtl::OUString::createFromAscii("section-name:");
+
+ sValue += sAttrName;
+ String sectionName = pCurrSctFrm->GetSection()->GetSectionName();
+
+ sectionName.SearchAndReplace( String::CreateFromAscii( "\\" ), String::CreateFromAscii("\\\\" ));
+ sectionName.SearchAndReplace( String::CreateFromAscii( "=" ), String::CreateFromAscii("\\=" ) );
+ sectionName.SearchAndReplace( String::CreateFromAscii( ";" ), String::CreateFromAscii("\\;" ) );
+ sectionName.SearchAndReplace( String::CreateFromAscii( "," ), String::CreateFromAscii("\\," ) );
+ sectionName.SearchAndReplace( String::CreateFromAscii( ":" ), String::CreateFromAscii("\\:" ) );
+
+ sValue += sectionName;
+ //sValue += pCurrSctFrm->GetSection()->GetName();
+
+ sValue += rtl::OUString::createFromAscii(";");
+
+ //section-columns-number
+ {
+ sAttrName=rtl::OUString::createFromAscii("section-columns-number:");
+
+ nCurrCol = 1;
+
+ if(pCurrCol!=NULL)
+ {
+ SwLayoutFrm* pParent = pCurrCol->GetUpper();
+ if(pParent!=NULL)
+ {
+ SwFrm* pCol = pParent->Lower();
+ while(pCol&&(pCol!=pCurrCol))
+ {
+ pCol = pCol->GetNext();
+ nCurrCol +=1;
+ }
+ }
+ }
+ sValue += sAttrName;
+ sValue += String::CreateFromInt32( nCurrCol ) ;
+ sValue += rtl::OUString::createFromAscii(";");
+ }
+
+ //section-total-columns
+ {
+ sAttrName=rtl::OUString::createFromAscii("section-total-columns:");
+ const SwFmtCol &rFmtSctCol=pCurrSctFrm->GetAttrSet()->GetCol();
+ sal_uInt16 nSctColCount=rFmtSctCol.GetNumCols();
+ nSctColCount = nSctColCount>0?nSctColCount:1;
+ sValue += sAttrName;
+ sValue += String::CreateFromInt32( nSctColCount ) ;
+
+ sValue += rtl::OUString::createFromAscii(";");
+ }
+ }
+ }
+ anyAtrribute <<= sValue;
+ }
+ return anyAtrribute;
+}
+
+sal_Int32 SAL_CALL SwAccessibleDocument::getBackground()
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ //IAccessibility2 Implementation 2009-----
+ vos::OGuard aGuard(Application::GetSolarMutex());
+ return SW_MOD()->GetColorConfig().GetColorValue( ::svtools::DOCCOLOR ).nColor;
+ //-----IAccessibility2 Implementation 2009
+}
+
+::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >
+ SAL_CALL SwAccessibleDocument::get_AccFlowTo(const ::com::sun::star::uno::Any& rAny, sal_Int32 nType)
+ throw ( ::com::sun::star::uno::RuntimeException )
+{
+ const sal_Int32 FORSPELLCHECKFLOWTO = 1;
+ const sal_Int32 FORFINDREPLACEFLOWTO = 2;
+ SwAccessibleMap* pAccMap = GetMap();
+ if ( !pAccMap )
+ {
+ goto Rt;
+ }
+
+ if ( nType == FORSPELLCHECKFLOWTO )
+ {
+ uno::Reference< ::com::sun::star::drawing::XShape > xShape;
+ rAny >>= xShape;
+ if( xShape.is() )
+ {
+ SdrObject* pObj = GetSdrObjectFromXShape(xShape);
+ if( pObj )
+ {
+ uno::Reference<XAccessible> xAcc = pAccMap->GetContext(pObj, this, sal_False);
+ uno::Reference < XAccessibleSelection > xAccSelection( xAcc, uno::UNO_QUERY );
+ if ( xAccSelection.is() )
+ {
+ try
+ {
+ if ( xAccSelection->getSelectedAccessibleChildCount() )
+ {
+ uno::Reference < XAccessible > xSel = xAccSelection->getSelectedAccessibleChild( 0 );
+ if ( xSel.is() )
+ {
+ uno::Reference < XAccessibleContext > xSelContext( xSel->getAccessibleContext() );
+ if ( xSelContext.is() )
+ {
+ //if in sw we find the selected paragraph here
+ if ( xSelContext->getAccessibleRole() == AccessibleRole::PARAGRAPH )
+ {
+ uno::Sequence<uno::Any> aRet( 1 );
+ aRet[0] = uno::makeAny( xSel );
+ return aRet;
+ }
+ }
+ }
+ }
+ }
+ catch ( com::sun::star::lang::IndexOutOfBoundsException )
+ {
+ //return empty sequence
+ goto Rt;
+ }
+ //end of try...catch
+ }
+ /*uno::Sequence< uno::Any > aRet(1);
+ aRet[0] = uno::makeAny( xAcc );
+ return aRet;*/
+ }
+ }
+ else
+ {
+ uno::Reference< XAccessible > xAcc = pAccMap->GetCursorContext();
+ SwAccessibleContext *pAccImpl = static_cast< SwAccessibleContext *>( xAcc.get() );
+ if ( pAccImpl && pAccImpl->getAccessibleRole() == AccessibleRole::PARAGRAPH )
+ {
+ uno::Sequence< uno::Any > aRet(1);
+ aRet[0] = uno::makeAny( xAcc );
+ return aRet;
+ }
+ }
+ }
+ else if ( nType == FORFINDREPLACEFLOWTO )
+ {
+ SwCrsrShell* pCrsrShell = GetCrsrShell();
+ if ( pCrsrShell )
+ {
+ SwPaM *_pStartCrsr = pCrsrShell->GetCrsr(), *__pStartCrsr = _pStartCrsr;
+ SwCntntNode* pPrevNode = NULL;
+ std::vector<SwFrm*> vFrmList;
+ do
+ {
+ if ( _pStartCrsr && _pStartCrsr->HasMark() )
+ {
+ SwCntntNode* pCntntNode = _pStartCrsr->GetCntntNode();
+ if ( pCntntNode == pPrevNode )
+ {
+ continue;
+ }
+ SwFrm* pFrm = pCntntNode ? pCntntNode->getLayoutFrm( pCrsrShell->GetLayout() ) : NULL;
+ if ( pFrm )
+ {
+ vFrmList.push_back( pFrm );
+ }
+
+ pPrevNode = pCntntNode;
+ }
+ }
+
+ while( _pStartCrsr && ( (_pStartCrsr=(SwPaM *)_pStartCrsr->GetNext()) != __pStartCrsr) );
+
+ if ( vFrmList.size() )
+ {
+ uno::Sequence< uno::Any > aRet(vFrmList.size());
+ std::vector<SwFrm*>::iterator aIter = vFrmList.begin();
+ for ( sal_Int32 nIndex = 0; aIter != vFrmList.end(); aIter++, nIndex++ )
+ {
+ uno::Reference< XAccessible > xAcc = pAccMap->GetContext(*aIter, sal_False);
+ if ( xAcc.is() )
+ {
+ SwAccessibleContext *pAccImpl = static_cast< SwAccessibleContext *>( xAcc.get() );
+ if ( pAccImpl && pAccImpl->getAccessibleRole() == AccessibleRole::PARAGRAPH )
+ {
+ aRet[nIndex] = uno::makeAny( xAcc );
+ }
+ }
+ }
+
+ return aRet;
+ }
+ }
+ }
+
+Rt:
+ uno::Sequence< uno::Any > aEmpty;
+ return aEmpty;
+}
+//-----IAccessibility2 Implementation 2009
diff --git a/sw/source/core/access/accdoc.hxx b/sw/source/core/access/accdoc.hxx
index a8ae434256bf..24a0e75f7203 100644
--- a/sw/source/core/access/accdoc.hxx
+++ b/sw/source/core/access/accdoc.hxx
@@ -26,8 +26,19 @@
#include "acccontext.hxx"
#endif
#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
+//IAccessibility2 Implementation 2009-----
+#include <com/sun/star/document/XEventListener.hpp>
#include <accselectionhelper.hxx>
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_XAccessibleExtendedAttributes_HPP_
+#include <com/sun/star/accessibility/XAccessibleExtendedAttributes.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEGETACCFLOWTO_HPP_
+#include <com/sun/star/accessibility/XAccessibleGetAccFlowTo.hpp>
+#endif
+//-----IAccessibility2 Implementation 2009
+
class VclSimpleEvent;
/**
@@ -81,6 +92,9 @@ public:
/// Return this object's description.
virtual ::rtl::OUString SAL_CALL
getAccessibleDescription (void) throw (com::sun::star::uno::RuntimeException);
+ //IAccessibility2 Implementation 2009-----
+ virtual ::rtl::OUString SAL_CALL getAccessibleName (void) throw (::com::sun::star::uno::RuntimeException);
+ //-----IAccessibility2 Implementation 2009
//===== XAccessibleComponent ==============================================
virtual sal_Bool SAL_CALL containsPoint(
@@ -111,7 +125,12 @@ public:
* access to an accessible Writer document
*/
class SwAccessibleDocument : public SwAccessibleDocumentBase,
- public com::sun::star::accessibility::XAccessibleSelection
+ public com::sun::star::accessibility::XAccessibleSelection,
+ //IAccessibility2 Implementation 2009-----
+ public com::sun::star::document::XEventListener,
+ public com::sun::star::accessibility::XAccessibleExtendedAttributes,
+ //-----IAccessibility2 Implementation 2009
+ public com::sun::star::accessibility::XAccessibleGetAccFlowTo
{
// Implementation for XAccessibleSelection interface
SwAccessibleSelectionHelper maSelectionHelper;
@@ -129,6 +148,13 @@ public:
SwAccessibleDocument( SwAccessibleMap* pInitMap );
DECL_LINK( WindowChildEventListener, VclSimpleEvent* );
+ //IAccessibility2 Implementation 2009-----
+ //===== XEventListener====================================================
+ virtual void SAL_CALL notifyEvent( const ::com::sun::star::document::EventObject& Event )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Event )
+ throw (::com::sun::star::uno::RuntimeException);
+ //-----IAccessibility2 Implementation 2009
//===== XServiceInfo ====================================================
@@ -199,10 +225,23 @@ public:
throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
::com::sun::star::uno::RuntimeException );
+ //IAccessibility2 Implementation 2009-----
+ virtual ::com::sun::star::uno::Any SAL_CALL getExtendedAttributes()
+ throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) ;
//====== thread safe C++ interface ========================================
// The object is not visible an longer and should be destroyed
virtual void Dispose( sal_Bool bRecursive = sal_False );
+
+ //===== XAccessibleComponent ============================================
+ sal_Int32 SAL_CALL getBackground()
+ throw (::com::sun::star::uno::RuntimeException);
+
+ //===== XAccessibleGetAccFlowTo ============================================
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >
+ SAL_CALL get_AccFlowTo(const ::com::sun::star::uno::Any& rAny, sal_Int32 nType)
+ throw ( ::com::sun::star::uno::RuntimeException );
+ //-----IAccessibility2 Implementation 2009
};
#endif
diff --git a/sw/source/core/access/accembedded.cxx b/sw/source/core/access/accembedded.cxx
index a3efadcd726a..48a123f1bcf7 100644
--- a/sw/source/core/access/accembedded.cxx
+++ b/sw/source/core/access/accembedded.cxx
@@ -31,6 +31,14 @@
#include <rtl/uuid.h>
#include <flyfrm.hxx>
#include "accembedded.hxx"
+//IAccessibility2 Implementation 2009-----
+#include "cntfrm.hxx"
+#include "ndole.hxx"
+#include <doc.hxx>
+#include <docsh.hxx>
+#include <../../ui/inc/wrtsh.hxx>
+#include <../../ui/inc/view.hxx>
+//-----IAccessibility2 Implementation 2009
using namespace ::com::sun::star;
using namespace ::com::sun::star::lang;
@@ -51,6 +59,34 @@ SwAccessibleEmbeddedObject::~SwAccessibleEmbeddedObject()
{
}
+//IAccessibility2 Implementation 2009-----
+//===== XInterface ==========================================================
+com::sun::star::uno::Any SAL_CALL
+ SwAccessibleEmbeddedObject::queryInterface (const com::sun::star::uno::Type & rType)
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ ::com::sun::star::uno::Any aReturn = SwAccessibleNoTextFrame::queryInterface (rType);
+ if ( ! aReturn.hasValue())
+ aReturn = ::cppu::queryInterface (rType,
+ static_cast< ::com::sun::star::accessibility::XAccessibleExtendedAttributes* >(this) );
+ return aReturn;
+}
+
+void SAL_CALL
+ SwAccessibleEmbeddedObject::acquire (void)
+ throw ()
+{
+ SwAccessibleNoTextFrame::acquire ();
+}
+
+void SAL_CALL
+ SwAccessibleEmbeddedObject::release (void)
+ throw ()
+{
+ SwAccessibleNoTextFrame::release ();
+}
+//-----IAccessibility2 Implementation 2009
+
OUString SAL_CALL SwAccessibleEmbeddedObject::getImplementationName()
throw( uno::RuntimeException )
{
@@ -91,3 +127,31 @@ uno::Sequence< sal_Int8 > SAL_CALL SwAccessibleEmbeddedObject::getImplementation
}
return aId;
}
+//IAccessibility2 Implementation 2009-----
+//===== XAccessibleExtendedAttributes ========================================================
+::com::sun::star::uno::Any SAL_CALL SwAccessibleEmbeddedObject::getExtendedAttributes()
+ throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException)
+{
+ ::com::sun::star::uno::Any strRet;
+ ::rtl::OUString style;
+ SwFlyFrm* pFFrm = getFlyFrm();
+
+ if( pFFrm )
+ {
+ style = ::rtl::OUString::createFromAscii("style:");
+ SwCntntFrm* pCFrm;
+ pCFrm = pFFrm->ContainsCntnt();
+ if( pCFrm )
+ {
+ SwCntntNode* pCNode = pCFrm->GetNode();
+ if( pCNode )
+ {
+ style += ((SwOLENode*)pCNode)->GetOLEObj().GetStyleString();
+ }
+ }
+ style += ::rtl::OUString::createFromAscii(";");
+ }
+ strRet <<= style;
+ return strRet;
+}
+//-----IAccessibility2 Implementation 2009
diff --git a/sw/source/core/access/accembedded.hxx b/sw/source/core/access/accembedded.hxx
index f18ef2e1ec35..9347b16e1a58 100644
--- a/sw/source/core/access/accembedded.hxx
+++ b/sw/source/core/access/accembedded.hxx
@@ -24,7 +24,12 @@
#define _ACCEMBEDDED_HXX
#include "accnotextframe.hxx"
+//IAccessibility2 Implementation 2009-----
+#include <com/sun/star/accessibility/XAccessibleExtendedAttributes.hpp>
+//-----IAccessibility2 Implementation 2009
class SwAccessibleEmbeddedObject : public SwAccessibleNoTextFrame
+ , public ::com::sun::star::accessibility::XAccessibleExtendedAttributes
+
{
protected:
@@ -36,6 +41,21 @@ public:
SwAccessibleEmbeddedObject( SwAccessibleMap* pInitMap,
const SwFlyFrm* pFlyFrm );
+ //IAccessibility2 Implementation 2009-----
+ //===== XInterface ======================================================
+
+ virtual com::sun::star::uno::Any SAL_CALL
+ queryInterface (const com::sun::star::uno::Type & rType)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL
+ acquire (void)
+ throw ();
+
+ virtual void SAL_CALL
+ release (void)
+ throw ();
+ //-----IAccessibility2 Implementation 2009
//===== XServiceInfo ====================================================
/** Returns an identifier for the implementation of this object.
@@ -59,6 +79,12 @@ public:
//===== XTypeProvider ====================================================
virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
+
+ //IAccessibility2 Implementation 2009-----
+ // ====== XAccessibleExtendedAttributes =====================================
+ virtual ::com::sun::star::uno::Any SAL_CALL getExtendedAttributes()
+ throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) ;
+ //-----IAccessibility2 Implementation 2009
};
diff --git a/sw/source/core/access/accfield.cxx b/sw/source/core/access/accfield.cxx
new file mode 100644
index 000000000000..8aa79f29c497
--- /dev/null
+++ b/sw/source/core/access/accfield.cxx
@@ -0,0 +1,348 @@
+/**************************************************************
+ *
+ * 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.
+ *
+ *************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_sw.hxx"
+
+#ifndef COMPHELPER_ACCESSIBLE_KEYBINDING_HELPER_HXX
+#include <comphelper/accessiblekeybindinghelper.hxx>
+#endif
+#ifndef _SWURL_HXX //autogen
+#include <swurl.hxx>
+#endif
+#ifndef _VOS_MUTEX_HXX_ //autogen
+#include <vos/mutex.hxx>
+#endif
+#ifndef _SV_SVAPP_HXX //autogen
+#include <vcl/svapp.hxx>
+#endif
+#ifndef _NDTXT_HXX
+#include <ndtxt.hxx>
+#endif
+#ifndef _TXTINET_HXX
+#include <txtinet.hxx>
+#endif
+
+#ifndef _ACCPARA_HXX
+#include <accpara.hxx>
+#endif
+#ifndef _ACCFIELD_HXX
+#include <accfield.hxx>
+#endif
+
+#include <comphelper/processfactory.hxx>
+
+#ifndef _COM_SUN_STAR_FRAME_XDESKTOP_HPP_
+#include <com/sun/star/frame/XDesktop.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XCOMPONENTLOADER_HPP_
+#include <com/sun/star/frame/XComponentLoader.hpp>
+#endif
+#ifndef _COM_SUN_STAR_DOCUMENT_XLINKTARGETSUPPLIER_HPP_
+#include <com/sun/star/document/XLinkTargetSupplier.hpp>
+#endif
+#ifndef COMPHELPER_ACCESSIBLE_EVENT_NOTIFIER
+#include <comphelper/accessibleeventnotifier.hxx>
+#endif
+
+//Add end
+
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::accessibility;
+// using namespace ::rtl;
+
+SwAccessibleField::SwAccessibleField( SwField *pSwFld,SwAccessibleParagraph *p,sal_Int16 nRole) :
+ m_xPara( p ),m_pSwField(pSwFld),m_nRole(nRole)
+{
+ m_nClientId=0;
+}
+
+uno::Reference< XAccessibleContext > SAL_CALL
+ SwAccessibleField::getAccessibleContext( void )
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ uno::Reference < XAccessibleContext > xRet( this );
+ return xRet;
+}
+
+sal_Int32 SAL_CALL SwAccessibleField::getAccessibleChildCount( void )
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ vos::OGuard aGuard(Application::GetSolarMutex());
+ return 0;
+}
+
+uno::Reference< XAccessible> SAL_CALL
+ SwAccessibleField::getAccessibleChild( long )
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IndexOutOfBoundsException)
+{
+ vos::OGuard aGuard(Application::GetSolarMutex());
+ return uno::Reference< XAccessible >();
+}
+
+uno::Reference< XAccessible> SAL_CALL SwAccessibleField::getAccessibleParent (void)
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ vos::OGuard aGuard(Application::GetSolarMutex());
+
+ uno::Reference< XAccessible > xParent(static_cast<XAccessible*>(m_xPara.getBodyPtr()),UNO_QUERY);
+ return xParent;
+}
+
+sal_Int32 SAL_CALL SwAccessibleField::getAccessibleIndexInParent (void)
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ vos::OGuard aGuard(Application::GetSolarMutex());
+ return 0;
+}
+
+sal_Int16 SAL_CALL SwAccessibleField::getAccessibleRole (void)
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ return m_nRole;
+}
+
+rtl::OUString SAL_CALL SwAccessibleField::getAccessibleDescription (void)
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ ASSERT( !this, "description needs to be overloaded" );
+ //THROW_RUNTIME_EXCEPTION( XAccessibleContext, "internal error (method must be overloaded)" );
+ return rtl::OUString();
+}
+
+rtl::OUString SAL_CALL SwAccessibleField::getAccessibleName (void)
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ return rtl::OUString();
+}
+
+uno::Reference< XAccessibleRelationSet> SAL_CALL
+ SwAccessibleField::getAccessibleRelationSet (void)
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ return NULL;
+}
+
+uno::Reference<XAccessibleStateSet> SAL_CALL
+ SwAccessibleField::getAccessibleStateSet (void)
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ vos::OGuard aGuard(Application::GetSolarMutex());
+ return uno::Reference<XAccessibleStateSet>();
+}
+
+com::sun::star::lang::Locale SAL_CALL SwAccessibleField::getLocale (void)
+ throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException, ::com::sun::star::uno::RuntimeException)
+{
+ vos::OGuard aGuard(Application::GetSolarMutex());
+
+ com::sun::star::lang::Locale aLoc( Application::GetSettings().GetLocale() );
+ return aLoc;
+}
+
+static sal_Bool lcl_PointInRectangle(const awt::Point & aPoint,
+ const awt::Rectangle & aRect)
+{
+ long nDiffX = aPoint.X - aRect.X;
+ long nDiffY = aPoint.Y - aRect.Y;
+
+ return
+ nDiffX >= 0 && nDiffX < aRect.Width && nDiffY >= 0 &&
+ nDiffY < aRect.Height;
+
+}
+
+sal_Bool SAL_CALL SwAccessibleField::containsPoint(
+ const ::com::sun::star::awt::Point& aPoint )
+ throw (RuntimeException)
+{
+ awt::Rectangle aPixBounds = getBoundsImpl(sal_True);
+ aPixBounds.X = 0;
+ aPixBounds.Y = 0;
+
+ return lcl_PointInRectangle(aPoint, aPixBounds);
+}
+
+uno::Reference< XAccessible > SAL_CALL SwAccessibleField::getAccessibleAtPoint(
+ const awt::Point& aPoint )
+ throw (RuntimeException)
+{
+ vos::OGuard aGuard(Application::GetSolarMutex());
+
+ uno::Reference< XAccessible > xAcc;
+ awt::Rectangle rc = getBounds();
+ if(aPoint.X >= rc.X && aPoint.X <= rc.X + rc.Width &&
+ aPoint.Y >= rc.Y && aPoint.Y <= rc.Y + rc.Height )
+ {
+ xAcc =this;
+ }
+ return xAcc;
+}
+
+
+/**
+ Get bounding box.
+
+ There are two modes.
+
+ - realative
+
+ Return bounding box relative to parent if parent is no root
+ frame. Otherwise return the absolute bounding box.
+
+ - absolute
+
+ Return the absolute bounding box.
+
+ @param bRelative
+ true: Use relative mode.
+ false: Use absolute mode.
+*/
+awt::Rectangle SAL_CALL SwAccessibleField::getBoundsImpl( sal_Bool )
+ throw (RuntimeException)
+{
+ vos::OGuard aGuard(Application::GetSolarMutex());
+ return awt::Rectangle();
+}
+
+awt::Rectangle SAL_CALL SwAccessibleField::getBounds()
+ throw (RuntimeException)
+{
+ return getBoundsImpl(sal_True);
+}
+
+awt::Point SAL_CALL SwAccessibleField::getLocation()
+ throw (RuntimeException)
+{
+ awt::Rectangle aRect = getBoundsImpl(sal_True);
+ awt::Point aPoint(aRect.X, aRect.Y);
+
+ return aPoint;
+}
+
+
+awt::Point SAL_CALL SwAccessibleField::getLocationOnScreen()
+ throw (RuntimeException)
+{
+ awt::Rectangle aRect = getBoundsImpl(sal_False);
+ //Point aPixPos = m_xPara->getLocationOnScreen();
+ return awt::Point( aRect.X,aRect.Y);//aPixPos.X() + aRect.nLeft , aPixPos.Y() + + aRect.nRight );
+}
+
+
+awt::Size SAL_CALL SwAccessibleField::getSize()
+ throw (RuntimeException)
+{
+ awt::Rectangle aRect = getBoundsImpl(sal_False);
+ awt::Size aSize( aRect.Width, aRect.Height );
+
+ return aSize;
+}
+
+void SAL_CALL SwAccessibleField::grabFocus()
+ throw (RuntimeException)
+{
+ vos::OGuard aGuard(Application::GetSolarMutex());
+ return;
+}
+
+
+sal_Int32 SAL_CALL SwAccessibleField::getForeground()
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ return 0;
+}
+
+sal_Int32 SAL_CALL SwAccessibleField::getBackground()
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ return 0xffffff;
+}
+::com::sun::star::uno::Any SAL_CALL SwAccessibleField::queryInterface(
+ const ::com::sun::star::uno::Type& rType )
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ Any aRet;
+ if ( rType == ::getCppuType((uno::Reference<XAccessibleContext> *)0) )
+ {
+ Reference<XAccessibleContext> aAccContext = (XAccessibleContext *) this; // resolve ambiguity
+ aRet <<= aAccContext;
+ }
+ else if ( rType == ::getCppuType((Reference<XAccessibleComponent> *)0) )
+ {
+ Reference<XAccessibleComponent> aAccEditComponent = this;
+ aRet <<= aAccEditComponent;
+ }
+ if (rType == ::getCppuType((Reference<XAccessibleEventBroadcaster> *)0))
+ {
+ Reference<XAccessibleEventBroadcaster> aAccBroadcaster= this;
+ aRet <<= aAccBroadcaster;
+ }
+ return aRet;
+}
+
+void SAL_CALL SwAccessibleField::acquire( ) throw ()
+{
+}
+void SAL_CALL SwAccessibleField::release( ) throw ()
+{
+}
+
+void SAL_CALL SwAccessibleField::addEventListener(
+ const Reference< XAccessibleEventListener >& xListener )
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ //DBG_MSG( "accessible event listener added" )
+
+ if (xListener.is())
+ {
+ vos::OGuard aGuard(Application::GetSolarMutex());
+ if (!m_nClientId)
+ m_nClientId = comphelper::AccessibleEventNotifier::registerClient( );
+ comphelper::AccessibleEventNotifier::addEventListener( m_nClientId, xListener );
+ }
+}
+
+void SAL_CALL SwAccessibleField::removeEventListener(
+ const Reference< XAccessibleEventListener >& xListener )
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ //DBG_MSG( "accessible event listener removed" )
+
+ if (xListener.is())
+ {
+ vos::OGuard aGuard(Application::GetSolarMutex());
+ sal_Int32 nListenerCount = comphelper::AccessibleEventNotifier::removeEventListener( m_nClientId, xListener );
+ if ( !nListenerCount )
+ {
+ // no listeners anymore
+ // -> revoke ourself. This may lead to the notifier thread dying (if we were the last client),
+ // and at least to us not firing any events anymore, in case somebody calls
+ // NotifyAccessibleEvent, again
+ comphelper::AccessibleEventNotifier::revokeClient( m_nClientId );
+ m_nClientId = 0;
+ }
+ }
+}
diff --git a/sw/source/core/access/accfield.hxx b/sw/source/core/access/accfield.hxx
new file mode 100644
index 000000000000..a206866ab23c
--- /dev/null
+++ b/sw/source/core/access/accfield.hxx
@@ -0,0 +1,213 @@
+/**************************************************************
+ *
+ * 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 _ACCFIELD_HXX
+#define _ACCFIELD_HXX
+
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLE_HPP_
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#endif
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLECONTEXT_HPP_
+#include <com/sun/star/accessibility/XAccessibleContext.hpp>
+#endif
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLECOMPONENT_HPP_
+#include <com/sun/star/accessibility/XAccessibleComponent.hpp>
+#endif
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEEVENTBROADCASTER_HPP_
+#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
+#endif
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_ILLEGALACCESSIBLECOMPONENTSTATEEXCEPTION_HDL_
+#include <com/sun/star/accessibility/IllegalAccessibleComponentStateException.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_DISPOSEDEXCEPTION_HPP_
+#include <com/sun/star/lang/DisposedException.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_INDEXOUTOFBOUNDSEXCEPTION_HPP_
+#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
+#endif
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEHYPERLINK_HPP_
+#include <com/sun/star/accessibility/XAccessibleHyperlink.hpp>
+#endif
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEVALUE_HPP_
+#include <com/sun/star/accessibility/XAccessibleValue.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UNO_RUNTIMEEXCEPTION_HPP_
+#include <com/sun/star/uno/RuntimeException.hpp>
+#endif
+#ifndef _VOS_REF_HXX_
+#include <vos/ref.hxx>
+#endif
+#ifndef _CPPUHELPER_IMPLBASE4_HXX_
+#include <cppuhelper/implbase4.hxx>
+#endif
+#ifndef _FMTINFMT_HXX //autogen
+#include <fmtinfmt.hxx>
+#endif
+
+class SwAccessibleParagraph;
+class SwField;
+class SwAccessibleField :
+ public ::cppu::WeakImplHelper4<
+ ::com::sun::star::accessibility::XAccessible,
+ ::com::sun::star::accessibility::XAccessibleContext,
+ ::com::sun::star::accessibility::XAccessibleComponent,
+ ::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ >
+{
+ friend class SwAccessibleParagraph;
+ friend class SwAccessibleHyperTextData;
+
+protected:
+// sal_uInt16 nHintPos;
+ ::vos::ORef< SwAccessibleParagraph > m_xPara;
+ SwField *m_pSwField;
+
+ sal_uInt32 m_nClientId; // client id in the AccessibleEventNotifier queue
+ sal_Int16 m_nRole; // immutable outside constructor
+// sal_Int32 nStartIdx;
+// sal_Int32 nEndIdx;
+public:
+ SwAccessibleField( SwField *pSwFld,SwAccessibleParagraph *p,sal_Int16);
+
+ virtual void SAL_CALL addEventListener(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessibleEventListener >& xListener )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeEventListener(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessibleEventListener >& xListener )
+ throw (::com::sun::star::uno::RuntimeException);
+
+// const SwTxtAttr *GetTxtAttr() const;
+// void Invalidate();
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
+ const ::com::sun::star::uno::Type& aType )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL acquire( ) throw () ;
+ virtual void SAL_CALL release( ) throw () ;
+
+public:
+ //===== XAccessible =====================================================
+
+ /// Return the XAccessibleContext.
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext> SAL_CALL
+ getAccessibleContext (void) throw (com::sun::star::uno::RuntimeException);
+
+ //===== XAccessibleContext ==============================================
+
+ /// Return the number of currently visible children.
+ virtual sal_Int32 SAL_CALL getAccessibleChildCount (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /// Return the specified child or NULL if index is invalid.
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
+ getAccessibleChild (long nIndex)
+ throw (::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::lang::IndexOutOfBoundsException);
+
+ /// Return a reference to the parent.
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
+ getAccessibleParent (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /// Return this objects index among the parents children.
+ virtual sal_Int32 SAL_CALL
+ getAccessibleIndexInParent (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /// Return this object's role.
+ virtual sal_Int16 SAL_CALL
+ getAccessibleRole (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /// Return this object's description.
+ virtual ::rtl::OUString SAL_CALL
+ getAccessibleDescription (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /// Return the object's current name.
+ virtual ::rtl::OUString SAL_CALL
+ getAccessibleName (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /// Return NULL to indicate that an empty relation set.
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessibleRelationSet> SAL_CALL
+ getAccessibleRelationSet (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /// Return the set of current states.
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL
+ getAccessibleStateSet (void)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /** Return the parents locale or throw exception if this object has no
+ parent yet/anymore.
+ */
+ virtual ::com::sun::star::lang::Locale SAL_CALL
+ getLocale (void)
+ throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException, ::com::sun::star::uno::RuntimeException);
+
+ //===== XAccessibleComponent ============================================
+ virtual sal_Bool SAL_CALL containsPoint(
+ const ::com::sun::star::awt::Point& aPoint )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(
+ const ::com::sun::star::awt::Point& aPoint )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds()
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual ::com::sun::star::awt::Point SAL_CALL getLocation()
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen()
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual ::com::sun::star::awt::Size SAL_CALL getSize()
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL grabFocus()
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual sal_Int32 SAL_CALL getForeground()
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getBackground()
+ throw (::com::sun::star::uno::RuntimeException);
+
+
+ virtual ::com::sun::star::awt::Rectangle SAL_CALL
+ getBoundsImpl(sal_Bool bRelative)
+ throw (::com::sun::star::uno::RuntimeException) ;
+
+
+};
+
+#endif
+
diff --git a/sw/source/core/access/accfootnote.cxx b/sw/source/core/access/accfootnote.cxx
index 588bbb1c8161..95c2c09d9d75 100644
--- a/sw/source/core/access/accfootnote.cxx
+++ b/sw/source/core/access/accfootnote.cxx
@@ -55,7 +55,6 @@ const sal_Char sImplementationNameEndnote[] = "com.sun.star.comp.Writer.SwAccess
SwAccessibleFootnote::SwAccessibleFootnote(
SwAccessibleMap* pInitMap,
sal_Bool bIsEndnote,
- sal_Int32 nFootEndNote,
const SwFtnFrm *pFtnFrm ) :
SwAccessibleContext( pInitMap,
bIsEndnote ? AccessibleRole::END_NOTE : AccessibleRole::FOOTNOTE,
@@ -65,7 +64,19 @@ SwAccessibleFootnote::SwAccessibleFootnote(
sal_uInt16 nResId = bIsEndnote ? STR_ACCESS_ENDNOTE_NAME
: STR_ACCESS_FOOTNOTE_NAME;
- OUString sArg( OUString::valueOf( nFootEndNote ) );
+ //IAccessibility2 Implementation 2009-----
+ //OUString sArg( OUString::valueOf( nFootEndNote ) );
+ //old codes end
+ OUString sArg;
+ const SwTxtFtn *pTxtFtn =
+ static_cast< const SwFtnFrm *>( GetFrm() )->GetAttr();
+ if( pTxtFtn )
+ {
+ const SwDoc *pDoc = GetShell()->GetDoc();
+ sArg = pTxtFtn->GetFtn().GetViewNumStr( *pDoc );
+ }
+ //-----IAccessibility2 Implementation 2009
+
SetName( GetResource( nResId, &sArg ) );
}
diff --git a/sw/source/core/access/accfootnote.hxx b/sw/source/core/access/accfootnote.hxx
index 9cec3b47ff2d..dadc3bcc7f05 100644
--- a/sw/source/core/access/accfootnote.hxx
+++ b/sw/source/core/access/accfootnote.hxx
@@ -41,7 +41,6 @@ public:
SwAccessibleFootnote( SwAccessibleMap* pInitMap,
sal_Bool bIsEndnote,
- sal_Int32 nFootEndNote,
const SwFtnFrm *pFtnFrm );
diff --git a/sw/source/core/access/accframe.cxx b/sw/source/core/access/accframe.cxx
index 0099a63e9416..b9916a63d7fd 100644
--- a/sw/source/core/access/accframe.cxx
+++ b/sw/source/core/access/accframe.cxx
@@ -61,7 +61,9 @@ using namespace sw::access;
{
sal_Int32 nCount = 0;
- const SwAccessibleChildSList aVisList( rVisArea, *pFrm, rAccMap );
+ // const SwAccessibleChildSList aVisList( rVisArea, *pFrm, rAccMap );
+ const SwAccessibleChildSList aVisList( pFrm->PaintArea(), *pFrm, rAccMap );
+
SwAccessibleChildSList::const_iterator aIter( aVisList.begin() );
while( aIter != aVisList.end() )
{
@@ -163,7 +165,10 @@ using namespace sw::access;
if( SwAccessibleChildMap::IsSortingRequired( rFrm ) )
{
// We need a sorted list here
- const SwAccessibleChildMap aVisMap( rVisArea, rFrm, rAccMap );
+ //IAccessibility2 Implementation 2009-----
+ // const SwAccessibleChildMap aVisMap( rVisArea, rFrm, rAccMap );
+ const SwAccessibleChildMap aVisMap( rFrm.PaintArea(), rFrm, rAccMap );
+ //-----IAccessibility2 Implementation 2009
SwAccessibleChildMap::const_iterator aIter( aVisMap.begin() );
while( aIter != aVisMap.end() && !bFound )
{
@@ -189,7 +194,12 @@ using namespace sw::access;
{
// The unsorted list is sorted enough, because it return lower
// frames in the correct order.
- const SwAccessibleChildSList aVisList( rVisArea, rFrm, rAccMap );
+
+ //IAccessibility2 Implementation 2009-----
+ // const SwAccessibleChildSList aVisList( rVisArea, rFrm, rAccMap );
+ const SwAccessibleChildSList aVisList( rFrm.PaintArea(), rFrm, rAccMap );
+ //-----IAccessibility2 Implementation 2009
+
SwAccessibleChildSList::const_iterator aIter( aVisList.begin() );
while( aIter != aVisList.end() && !bFound )
{
@@ -425,7 +435,8 @@ SwAccessibleFrame::SwAccessibleFrame( const SwRect& rVisArea,
sal_Bool bIsPagePreview ) :
maVisArea( rVisArea ),
mpFrm( pF ),
- mbIsInPagePreview( bIsPagePreview )
+ mbIsInPagePreview( bIsPagePreview ),
+ bIsAccDocUse( sal_False )
{
}
diff --git a/sw/source/core/access/accframe.hxx b/sw/source/core/access/accframe.hxx
index 129caa2768c1..06ab5302d059 100644
--- a/sw/source/core/access/accframe.hxx
+++ b/sw/source/core/access/accframe.hxx
@@ -52,8 +52,9 @@ protected:
static sal_Int32 GetChildCount( SwAccessibleMap& rAccMap,
const SwRect& rVisArea,
const SwFrm *pFrm,
- sal_Bool bInPagePreview );
-private:
+ sal_Bool bInPagePreviewr );
+
+// private:
static sw::access::SwAccessibleChild GetChild( SwAccessibleMap& rAccMap,
const SwRect& rVisArea,
const SwFrm& rFrm,
@@ -105,6 +106,12 @@ protected:
sal_Bool bIsPagePreview );
virtual ~SwAccessibleFrame();
+ //IAccessibility2 Implementation 2009-----
+ // MT: Move to private area?
+ sal_Bool bIsAccDocUse;
+ //-----IAccessibility2 Implementation 2009
+
+
public:
// Return the SwFrm this context is attached to.
const SwFrm* GetFrm() const { return mpFrm; };
diff --git a/sw/source/core/access/accframebase.cxx b/sw/source/core/access/accframebase.cxx
index e2ce6ad6e89b..53b2b6600a58 100644
--- a/sw/source/core/access/accframebase.cxx
+++ b/sw/source/core/access/accframebase.cxx
@@ -42,6 +42,26 @@
#include "accmap.hxx"
#include "accframebase.hxx"
+//IAccessibility2 Implementation 2009-----
+#ifndef _CRSRSH_HXX
+#include <crsrsh.hxx>
+#endif
+#ifndef _FESH_HXX
+#include "fesh.hxx"
+#endif
+#ifndef _TXTFRM_HXX
+#include <txtfrm.hxx>
+#endif
+#ifndef _NDTXT_HXX
+#include <ndtxt.hxx>
+#endif
+#ifndef _DCONTACT_HXX
+#include <dcontact.hxx>
+#endif
+#ifndef _FMTANCHR_HXX
+#include <fmtanchr.hxx>
+#endif
+//-----IAccessibility2 Implementation 2009
using namespace ::com::sun::star;
using namespace ::com::sun::star::accessibility;
using ::rtl::OUString;
@@ -94,6 +114,10 @@ void SwAccessibleFrameBase::GetStates(
if( pWin && pWin->HasFocus() )
rStateSet.AddState( AccessibleStateType::FOCUSED );
}
+ //IAccessibility2 Implementation 2009-----
+ if( GetSelectedState() )
+ rStateSet.AddState( AccessibleStateType::SELECTED );
+ //-----IAccessibility2 Implementation 2009
}
@@ -167,20 +191,26 @@ void SwAccessibleFrameBase::_InvalidateCursorPos()
Window *pWin = GetWindow();
if( pWin && pWin->HasFocus() && bNewSelected )
FireStateChangedEvent( AccessibleStateType::FOCUSED, bNewSelected );
- FireStateChangedEvent( AccessibleStateType::SELECTED, bNewSelected );
+ //IAccessibility2 Implementation 2009-----
+ //FireStateChangedEvent( AccessibleStateType::SELECTED, bNewSelected );
if( pWin && pWin->HasFocus() && !bNewSelected )
FireStateChangedEvent( AccessibleStateType::FOCUSED, bNewSelected );
-
- uno::Reference< XAccessible > xParent( GetWeakParent() );
- if( xParent.is() )
+ if(bNewSelected)
{
- SwAccessibleContext *pAcc =
- static_cast <SwAccessibleContext *>( xParent.get() );
+ uno::Reference< XAccessible > xParent( GetWeakParent() );
+ if( xParent.is() )
+ {
+ SwAccessibleContext *pAcc =
+ static_cast <SwAccessibleContext *>( xParent.get() );
- AccessibleEventObject aEvent;
- aEvent.EventId = AccessibleEventId::SELECTION_CHANGED;
- pAcc->FireAccessibleEvent( aEvent );
+ AccessibleEventObject aEvent;
+ aEvent.EventId = AccessibleEventId::SELECTION_CHANGED;
+ uno::Reference< XAccessible > xChild(this);
+ aEvent.NewValue <<= xChild;
+ pAcc->FireAccessibleEvent( aEvent );
+ }
}
+ //-----IAccessibility2 Implementation 2009
}
}
@@ -248,13 +278,13 @@ void SwAccessibleFrameBase::Modify( const SfxPoolItem* pOld, const SfxPoolItem *
break;
case RES_OBJECTDYING:
// mba: it seems that this class intentionally does not call code in base class SwClient
- if( GetRegisteredIn() ==
- static_cast< SwModify *>( static_cast< const SwPtrMsgPoolItem * >( pOld )->pObject ) )
+ if( pOld && ( GetRegisteredIn() == static_cast< SwModify *>( static_cast< const SwPtrMsgPoolItem * >( pOld )->pObject ) ) )
GetRegisteredInNonConst()->Remove( this );
break;
case RES_FMT_CHG:
- if( static_cast< const SwFmtChg * >(pNew)->pChangedFmt == GetRegisteredIn() &&
+ if( pOld &&
+ static_cast< const SwFmtChg * >(pNew)->pChangedFmt == GetRegisteredIn() &&
static_cast< const SwFmtChg * >(pOld)->pChangedFmt->IsFmtInDTOR() )
GetRegisteredInNonConst()->Remove( this );
break;
@@ -274,3 +304,123 @@ void SwAccessibleFrameBase::Dispose( sal_Bool bRecursive )
SwAccessibleContext::Dispose( bRecursive );
}
+//IAccessibility2 Implementation 2009-----
+//Get the selection cursor of the document.
+SwPaM* SwAccessibleFrameBase::GetCrsr()
+{
+ // get the cursor shell; if we don't have any, we don't have a
+ // cursor/selection either
+ SwPaM* pCrsr = NULL;
+ SwCrsrShell* pCrsrShell = GetCrsrShell();
+ if( pCrsrShell != NULL && !pCrsrShell->IsTableMode() )
+ {
+ SwFEShell *pFESh = dynamic_cast< SwFEShell* >(pCrsrShell);
+ if( !pFESh ||
+ !(pFESh->IsFrmSelected() || pFESh->IsObjSelected() > 0) )
+ {
+ // get the selection, and test whether it affects our text node
+ pCrsr = pCrsrShell->GetCrsr( sal_False /* ??? */ );
+ }
+ }
+
+ return pCrsr;
+}
+//Return the selected state of the object.
+//when the object's anchor are in the selection cursor, we should return true.
+sal_Bool SwAccessibleFrameBase::GetSelectedState( )
+{
+ vos::OGuard aGuard(Application::GetSolarMutex());
+
+ //IAccessibility2 Implementation 2009-----
+ if(GetMap()->IsDocumentSelAll())
+ {
+ return sal_True;
+ }
+ //-----IAccessibility2 Implementation 2009
+
+ // SELETED.
+ SwFlyFrm* pFlyFrm = getFlyFrm();
+ const SwFrmFmt *pFrmFmt = pFlyFrm->GetFmt();
+ const SwFmtAnchor& pAnchor = pFrmFmt->GetAnchor();
+ const SwPosition *pPos = pAnchor.GetCntntAnchor();
+ if( !pPos )
+ return sal_False;
+ int pIndex = pPos->nContent.GetIndex();
+ if( pPos->nNode.GetNode().GetTxtNode() )
+ {
+ SwPaM* pCrsr = GetCrsr();
+ if( pCrsr != NULL )
+ {
+ const SwTxtNode* pNode = pPos->nNode.GetNode().GetTxtNode();
+ sal_uLong nHere = pNode->GetIndex();
+
+ // iterate over ring
+ SwPaM* pRingStart = pCrsr;
+ do
+ {
+ // ignore, if no mark
+ if( pCrsr->HasMark() )
+ {
+ // check whether nHere is 'inside' pCrsr
+ SwPosition* pStart = pCrsr->Start();
+ sal_uLong nStartIndex = pStart->nNode.GetIndex();
+ SwPosition* pEnd = pCrsr->End();
+ sal_uLong nEndIndex = pEnd->nNode.GetIndex();
+ if( ( nHere >= nStartIndex ) && (nHere <= nEndIndex) )
+ {
+ if( pAnchor.GetAnchorId() == FLY_AS_CHAR )
+ {
+ //IAccessibility2 Implementation 2009-----
+ if( (nHere == nStartIndex) && (pIndex >= pStart->nContent.GetIndex()) || (nHere > nStartIndex) )
+ if( (nHere == nEndIndex) && (pIndex < pEnd->nContent.GetIndex()) || (nHere < nEndIndex) )
+ return sal_True;
+ //-----IAccessibility2 Implementation 2009
+ }
+ else if( pAnchor.GetAnchorId() == FLY_AT_PARA )
+ {
+ if( ((nHere > nStartIndex) || pStart->nContent.GetIndex() ==0 )
+ && (nHere < nEndIndex ) )
+ return sal_True;
+ }
+ break;
+ }
+ // else: this PaM doesn't point to this paragraph
+ }
+ // else: this PaM is collapsed and doesn't select anything
+
+ // next PaM in ring
+ pCrsr = static_cast<SwPaM*>( pCrsr->GetNext() );
+ }
+ while( pCrsr != pRingStart );
+ }
+ }
+ return sal_False;
+}
+
+SwFlyFrm* SwAccessibleFrameBase::getFlyFrm() const
+{
+ SwFlyFrm* pFlyFrm = NULL;
+
+ const SwFrm* pFrm = GetFrm();
+ DBG_ASSERT( pFrm != NULL, "frame expected" );
+ if( pFrm->IsFlyFrm() )
+ {
+ pFlyFrm = static_cast<SwFlyFrm*>( const_cast<SwFrm*>( pFrm ) );
+ }
+
+ return pFlyFrm;
+}
+
+sal_Bool SwAccessibleFrameBase::SetSelectedState( sal_Bool )
+{
+ sal_Bool bParaSeleted = GetSelectedState() || IsSelected();
+
+ if(bIsSeletedInDoc != bParaSeleted)
+ {
+ bIsSeletedInDoc = bParaSeleted;
+ FireStateChangedEvent( AccessibleStateType::SELECTED, bParaSeleted );
+ return sal_True;
+ }
+ return sal_False;
+}
+//-----IAccessibility2 Implementation 2009
diff --git a/sw/source/core/access/accframebase.hxx b/sw/source/core/access/accframebase.hxx
index 14ae334065b2..6e2fd6f1bcef 100644
--- a/sw/source/core/access/accframebase.hxx
+++ b/sw/source/core/access/accframebase.hxx
@@ -23,6 +23,12 @@
#ifndef _ACCFRAMEBASE_HXX
#define _ACCFRAMEBASE_HXX
+//IAccessibility2 Implementation 2009-----
+#ifndef _PAM_HXX
+#include <pam.hxx>
+#endif
+//-----IAccessibility2 Implementation 2009
+
#include <acccontext.hxx>
#include <calbck.hxx>
@@ -42,6 +48,11 @@ protected:
// This drived class additionaly sets SELECTABLE(1), SELECTED(+),
// FOCUSABLE(1) and FOCUSED(+)
virtual void GetStates( ::utl::AccessibleStateSetHelper& rStateSet );
+ //IAccessibility2 Implementation 2009-----
+ SwFlyFrm* getFlyFrm() const;
+ sal_Bool GetSelectedState( );
+ SwPaM* GetCrsr();
+ //-----IAccessibility2 Implementation 2009
virtual void _InvalidateCursorPos();
virtual void _InvalidateFocus();
@@ -61,6 +72,8 @@ public:
// The object is not visible an longer and should be destroyed
virtual void Dispose( sal_Bool bRecursive = sal_False );
+ virtual sal_Bool SetSelectedState( sal_Bool bSeleted );
+ //-----IAccessibility2 Implementation 2009
};
diff --git a/sw/source/core/access/accfrmobj.cxx b/sw/source/core/access/accfrmobj.cxx
index 53ca64a50c7b..913e6206093d 100644
--- a/sw/source/core/access/accfrmobj.cxx
+++ b/sw/source/core/access/accfrmobj.cxx
@@ -39,6 +39,10 @@
#include <frmfmt.hxx>
#include <fmtanchr.hxx>
#include <dcontact.hxx>
+//IAccessibility2 Implementation 2009-----
+#include <pam.hxx>
+//-----IAccessibility2 Implementation 2009
+
#include <vcl/window.hxx>
#include <svx/svdlegacy.hxx>
@@ -172,6 +176,25 @@ bool SwAccessibleChild::IsBoundAsChar() const
return bRet;
}
+//IAccessibility2 Implementation 2009-----
+sal_uInt32 SwAccessibleChild::GetAnchorPosition() const
+{
+ if( mpDrawObj )
+ {
+ const SwFrmFmt *pFrmFmt = ::FindFrmFmt( mpDrawObj );
+ if ( pFrmFmt )
+ {
+ const SwPosition *pPos = pFrmFmt->GetAnchor().GetCntntAnchor();
+ if ( pPos )
+ {
+ return pPos->nContent.GetIndex();
+ }
+ }
+ }
+ return 0;
+}
+//-----IAccessibility2 Implementation 2009
+
SwAccessibleChild::SwAccessibleChild( const SwAccessibleChild& r )
: mpFrm( r.mpFrm )
, mpDrawObj( r.mpDrawObj )
diff --git a/sw/source/core/access/accfrmobj.hxx b/sw/source/core/access/accfrmobj.hxx
index 60d41b3eb2d9..ff6012aa9c06 100644
--- a/sw/source/core/access/accfrmobj.hxx
+++ b/sw/source/core/access/accfrmobj.hxx
@@ -64,6 +64,10 @@ class SwAccessibleChild
bool IsAccessible( sal_Bool bPagePreview ) const;
bool IsBoundAsChar() const;
+ //IAccessibility2 Implementation 2009-----
+ sal_uInt32 GetAnchorPosition() const;
+ //-----IAccessibility2 Implementation 2009
+
bool IsVisibleChildrenOnly() const;
SwRect GetBox( const SwAccessibleMap& rAccMap ) const;
SwRect GetBounds( const SwAccessibleMap& rAccMap ) const;
diff --git a/sw/source/core/access/accfrmobjmap.cxx b/sw/source/core/access/accfrmobjmap.cxx
index 4fc284ae9fb2..c76df1453d1f 100644
--- a/sw/source/core/access/accfrmobjmap.cxx
+++ b/sw/source/core/access/accfrmobjmap.cxx
@@ -162,3 +162,97 @@ SwAccessibleChildMap::SwAccessibleChildMap( const SwRect& rVisArea,
( rFrm.IsTxtFrm() &&
rFrm.GetDrawObjs() );
}
+
+/* MT: The two insert methods had been introduced in the IA2 CWS (OOO310m11), but meanwhile we also have some in DEV300m80 (above)
+ Not sure if they have something which needs to be update in above methods.
+ Also, since there is no SwFrmOrObjMap CTOR anymore, the updated code in DEV300 might need some of the changes flagged with //IAccessibility2 Implementation 2009-----
+
+//IAccessibility2 Implementation 2009-----
+::std::pair< SwFrmOrObjMap::iterator, bool > SwFrmOrObjMap::insert(
+ sal_uInt32 nOrd, Point nPos, const SwFrmOrObj& rLower )
+{
+ SwFrmOrObjMapKey aKey( SwFrmOrObjMapKey::TEXT, nOrd, nPos );
+ value_type aEntry( aKey, rLower );
+ return _SwFrmOrObjMap::insert( aEntry );
+}
+
+::std::pair< SwFrmOrObjMap::iterator, bool > SwFrmOrObjMap::insert(
+ const SdrObject *pObj, const SwFrmOrObj& rLower, const SwDoc *pDoc , Point nPos)
+{
+ if( !bLayerIdsValid )
+ {
+ nHellId = pDoc->GetHellId();
+ nControlsId = pDoc->GetControlsId();
+ bLayerIdsValid = sal_True;
+ }
+
+ SdrLayerID nLayer = pObj->GetLayer();
+ SwFrmOrObjMapKey::LayerId eLayerId = (nHellId == nLayer)
+ ? SwFrmOrObjMapKey::HELL
+ : ((nControlsId == nLayer) ? SwFrmOrObjMapKey::CONTROLS
+ : SwFrmOrObjMapKey::HEAVEN);
+ SwFrmOrObjMapKey aKey( eLayerId, pObj->GetOrdNum(), nPos );
+ value_type aEntry( aKey, rLower );
+ return _SwFrmOrObjMap::insert( aEntry );
+}
+//-----IAccessibility2 Implementation 2009
+
+SwFrmOrObjMap::SwFrmOrObjMap(
+ const SwRect& rVisArea, const SwFrm *pFrm ) :
+ bLayerIdsValid( sal_False )
+{
+ SwFrmOrObj aFrm( pFrm );
+ sal_Bool bVisibleOnly = aFrm.IsVisibleChildrenOnly();
+
+ sal_uInt32 nPos = 0;
+ SwFrmOrObj aLower( pFrm->GetLower() );
+ while( aLower.GetSwFrm() )
+ {
+ //IAccessibility2 Implementation 2009-----
+ if( !bVisibleOnly || aLower.GetBox().IsOver( rVisArea ) )
+ insert( nPos++, aLower.GetBounds().Pos(), aLower );
+ //-----IAccessibility2 Implementation 2009
+ aLower = aLower.GetSwFrm()->GetNext();
+ }
+
+ if( pFrm->IsPageFrm() )
+ {
+ ASSERT( bVisibleOnly, "page frame within tab frame???" );
+ const SwPageFrm *pPgFrm =
+ static_cast< const SwPageFrm * >( pFrm );
+ const SwSortedObjs *pObjs = pPgFrm->GetSortedObjs();
+ if( pObjs )
+ {
+ const SwDoc *pDoc = pPgFrm->GetFmt()->GetDoc();
+ for( sal_uInt16 i=0; i<pObjs->Count(); i++ )
+ {
+ aLower = (*pObjs)[i]->GetDrawObj();
+ //IAccessibility2 Implementation 2009-----
+ if( aLower.GetBox().IsOver( rVisArea ) )
+ insert( aLower.GetSdrObject(), aLower, pDoc , aLower.GetBounds().Pos() );
+ //-----IAccessibility2 Implementation 2009
+ }
+ }
+ }
+ else if( pFrm->IsTxtFrm() )
+ {
+ const SwDoc *pDoc = static_cast< const SwTxtFrm * >( pFrm )->GetNode()
+ ->GetDoc();
+ const SwSortedObjs *pObjs = pFrm->GetDrawObjs();
+ if( pObjs )
+ {
+ for( sal_uInt16 i=0; i<pObjs->Count(); i++ )
+ {
+ aLower = (*pObjs)[i]->GetDrawObj();
+ //IAccessibility2 Implementation 2009-----
+ if( aLower.IsBoundAsChar() &&
+ (!bVisibleOnly || aLower.GetBox().IsOver( rVisArea )) )
+ insert( aLower.GetSdrObject(), aLower, pDoc , Point(aLower.GetAnchorPosition(),0) );
+ //-----IAccessibility2 Implementation 2009
+ }
+ }
+ }
+}
+
+*/
+
diff --git a/sw/source/core/access/accfrmobjmap.hxx b/sw/source/core/access/accfrmobjmap.hxx
index d9df578277a7..fb05f9c8e117 100644
--- a/sw/source/core/access/accfrmobjmap.hxx
+++ b/sw/source/core/access/accfrmobjmap.hxx
@@ -26,6 +26,7 @@
#include <accfrmobj.hxx>
#include <svx/svdtypes.hxx>
+#include <tools/gen.hxx>
#include <map>
@@ -43,26 +44,59 @@ public:
inline SwAccessibleChildMapKey()
: eLayerId( INVALID )
, nOrdNum( 0 )
+ , nPosNum( 0, 0 )
{}
inline SwAccessibleChildMapKey( LayerId eId, sal_uInt32 nOrd )
: eLayerId( eId )
, nOrdNum( nOrd )
+ , nPosNum( 0, 0 )
{}
+//IAccessibility2 Implementation 2009-----
+ inline SwAccessibleChildMapKey( LayerId eId, sal_uInt32 nOrd, Point nPos )
+ : eLayerId( eId )
+ , nOrdNum( nOrd )
+ , nPosNum( nPos )
+ {}
+//-----IAccessibility2 Implementation 2009
+
inline bool operator()( const SwAccessibleChildMapKey& r1,
const SwAccessibleChildMapKey& r2 ) const
{
- return (r1.eLayerId == r2.eLayerId)
- ? (r1.nOrdNum < r2.nOrdNum)
- : (r1.eLayerId < r2.eLayerId);
+//IAccessibility2 Implementation 2009-----
+// return (r1.eLayerId == r2.eLayerId)
+// ? (r1.nOrdNum < r2.nOrdNum)
+// : (r1.eLayerId < r2.eLayerId);
+ return (r1.eLayerId == r2.eLayerId) ?
+ ( (r1.nPosNum == r2.nPosNum) ?(r1.nOrdNum < r2.nOrdNum) :
+ (r1.nPosNum.getY() == r2.nPosNum.getY()? r1.nPosNum.getX() < r2.nPosNum.getX() :
+ r1.nPosNum.getY() < r2.nPosNum.getY()) ) :
+ (r1.eLayerId < r2.eLayerId);
+//-----IAccessibility2 Implementation 2009
}
+ /* MT: Need to get this position parameter stuff in dev300 somehow...
+ //IAccessibility2 Implementation 2009-----
+ //This methods are used to insert an object to the map, adding a position parameter.
+ ::std::pair< iterator, bool > insert( sal_uInt32 nOrd, Point nPos,
+ const SwFrmOrObj& rLower );
+ ::std::pair< iterator, bool > insert( const SdrObject *pObj,
+ const SwFrmOrObj& rLower,
+ const SwDoc *pDoc,
+ Point nPos);
+ //-----IAccessibility2 Implementation 2009
+ */
+
private:
LayerId eLayerId;
sal_uInt32 nOrdNum;
+ //IAccessibility2 Implementation 2009-----
+ Point nPosNum;
+ //-----IAccessibility2 Implementation 2009
+
};
typedef ::std::map < SwAccessibleChildMapKey, sw::access::SwAccessibleChild, SwAccessibleChildMapKey >
diff --git a/sw/source/core/access/accgraphic.cxx b/sw/source/core/access/accgraphic.cxx
index 5b1e0f66857d..6b94077d4d75 100644
--- a/sw/source/core/access/accgraphic.cxx
+++ b/sw/source/core/access/accgraphic.cxx
@@ -33,6 +33,11 @@
#include "accgraphic.hxx"
using namespace ::com::sun::star;
+//IAccessibility2 Implementation 2009-----
+#ifndef _FMTURL_HXX //autogen
+#include <fmturl.hxx>
+#endif
+//-----IAccessibility2 Implementation 2009
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::accessibility;
@@ -91,3 +96,15 @@ Sequence< sal_Int8 > SAL_CALL SwAccessibleGraphic::getImplementationId()
}
return aId;
}
+//IAccessibility2 Implementation 2009-----
+// Return this object's role.
+sal_Int16 SAL_CALL SwAccessibleGraphic::getAccessibleRole (void)
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ SwFmtURL aURL( ((SwLayoutFrm*)GetFrm())->GetFmt()->GetURL() );
+
+ if(aURL.GetMap() )
+ return AccessibleRole::IMAGE_MAP ;
+ return AccessibleRole::GRAPHIC ;
+}
+//-----IAccessibility2 Implementation 2009
diff --git a/sw/source/core/access/accgraphic.hxx b/sw/source/core/access/accgraphic.hxx
index 379a95c274ee..af6391baa6f6 100644
--- a/sw/source/core/access/accgraphic.hxx
+++ b/sw/source/core/access/accgraphic.hxx
@@ -59,6 +59,10 @@ public:
//===== XTypeProvider ====================================================
virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
+ //IAccessibility2 Implementation 2009-----
+ /// Return this object's role.
+ virtual sal_Int16 SAL_CALL getAccessibleRole (void) throw (::com::sun::star::uno::RuntimeException);
+ //-----IAccessibility2 Implementation 2009
};
diff --git a/sw/source/core/access/accheaderfooter.cxx b/sw/source/core/access/accheaderfooter.cxx
index c8a65f8d8bd0..5d6238f8a3e4 100644
--- a/sw/source/core/access/accheaderfooter.cxx
+++ b/sw/source/core/access/accheaderfooter.cxx
@@ -139,3 +139,20 @@ Sequence< sal_Int8 > SAL_CALL SwAccessibleHeaderFooter::getImplementationId()
}
return aId;
}
+
+//IAccessibility2 Implementation 2009-----
+sal_Int32 SAL_CALL SwAccessibleHeaderFooter::getBackground()
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ Reference< XAccessible > xParent = getAccessibleParent();
+ if (xParent.is())
+ {
+ Reference< XAccessibleComponent > xAccContext (xParent,UNO_QUERY);
+ if(xAccContext.is())
+ {
+ return xAccContext->getBackground();
+ }
+ }
+ return SwAccessibleContext::getBackground();
+}
+//-----IAccessibility2 Implementation 2009
diff --git a/sw/source/core/access/accheaderfooter.hxx b/sw/source/core/access/accheaderfooter.hxx
index 286639ca6474..e674bfd8ac8c 100644
--- a/sw/source/core/access/accheaderfooter.hxx
+++ b/sw/source/core/access/accheaderfooter.hxx
@@ -74,6 +74,11 @@ public:
//===== XTypeProvider ====================================================
virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
+ //IAccessibility2 Implementation 2009-----
+ //===== XAccessibleComponent ============================================
+ sal_Int32 SAL_CALL getBackground()
+ throw (::com::sun::star::uno::RuntimeException);
+ //-----IAccessibility2 Implementation 2009
};
diff --git a/sw/source/core/access/acchyperlink.cxx b/sw/source/core/access/acchyperlink.cxx
index 872d73e4f9bc..7c6c3d3cea51 100644
--- a/sw/source/core/access/acchyperlink.cxx
+++ b/sw/source/core/access/acchyperlink.cxx
@@ -32,9 +32,23 @@
#include <accpara.hxx>
#include <acchyperlink.hxx>
+//IAccessibility2 Implementation 2009-----
+#include <comphelper/processfactory.hxx>
+#ifndef _COM_SUN_STAR_FRAME_XDESKTOP_HPP_
+#include <com/sun/star/frame/XDesktop.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XCOMPONENTLOADER_HPP_
+#include <com/sun/star/frame/XComponentLoader.hpp>
+#endif
+#ifndef _COM_SUN_STAR_DOCUMENT_XLINKTARGETSUPPLIER_HPP_
+#include <com/sun/star/document/XLinkTargetSupplier.hpp>
+#endif
+//-----IAccessibility2 Implementation 2009
+
using namespace ::com::sun::star;
using namespace ::com::sun::star::accessibility;
using ::rtl::OUString;
+using ::com::sun::star::lang::IndexOutOfBoundsException;
SwAccessibleHyperlink::SwAccessibleHyperlink( sal_uInt16 nHPos,
SwAccessibleParagraph *p, sal_Int32 nStt, sal_Int32 nEnd ) :
@@ -78,8 +92,12 @@ sal_Bool SAL_CALL SwAccessibleHyperlink::doAccessibleAction( sal_Int32 nIndex )
sal_Bool bRet = sal_False;
+ //IAccessibility2 Implementation 2009-----
+ if(nIndex != 0)
+ throw new IndexOutOfBoundsException;
const SwTxtAttr *pTxtAttr = GetTxtAttr();
- if( pTxtAttr && 0 == nIndex )
+ if( pTxtAttr /*&& 0 == nIndex*/ )
+ //-----IAccessibility2 Implementation 2009
{
const SwFmtINetFmt& rINetFmt = pTxtAttr->GetINetFmt();
if( rINetFmt.GetValue().Len() )
@@ -111,23 +129,28 @@ OUString SAL_CALL SwAccessibleHyperlink::getAccessibleActionDescription(
{
OUString sDesc;
+ //IAccessibility2 Implementation 2009-----
+ if(nIndex != 0)
+ throw new IndexOutOfBoundsException;
const SwTxtAttr *pTxtAttr = GetTxtAttr();
- if( pTxtAttr && 0 == nIndex )
+ if( pTxtAttr /*&& 0 == nIndex*/ )
{
const SwFmtINetFmt& rINetFmt = pTxtAttr->GetINetFmt();
sDesc = OUString( rINetFmt.GetValue() );
}
-
+ //-----IAccessibility2 Implementation 2009
return sDesc;
}
uno::Reference< XAccessibleKeyBinding > SAL_CALL
- SwAccessibleHyperlink::getAccessibleActionKeyBinding( sal_Int32 nIndex )
+ SwAccessibleHyperlink::getAccessibleActionKeyBinding( sal_Int32 )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
uno::Reference< XAccessibleKeyBinding > xKeyBinding;
- if( isValid() && 0==nIndex )
+ //IAccessibility2 Implementation 2009-----
+ if( isValid() /*&& 0 == nIndex*/ )
+ //-----IAccessibility2 Implementation 2009
{
::comphelper::OAccessibleKeyBindingHelper* pKeyBindingHelper =
new ::comphelper::OAccessibleKeyBindingHelper();
@@ -146,17 +169,40 @@ uno::Reference< XAccessibleKeyBinding > SAL_CALL
// XAccessibleHyperlink
uno::Any SAL_CALL SwAccessibleHyperlink::getAccessibleActionAnchor(
- sal_Int32 /*nIndex*/ )
+ sal_Int32 nIndex)
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- return uno::Any();
+ uno::Any aRet;
+ //IAccessibility2 Implementation 2009-----
+ if(nIndex != 0)
+ throw new IndexOutOfBoundsException;
+ //End Added.
+ ::rtl::OUString text = OUString( xPara->GetString() );
+ ::rtl::OUString retText = text.copy(nStartIdx, nEndIdx - nStartIdx);
+ aRet <<= retText;
+ //-----IAccessibility2 Implementation 2009
+ return aRet;
}
uno::Any SAL_CALL SwAccessibleHyperlink::getAccessibleActionObject(
- sal_Int32 /*nIndex*/ )
+ sal_Int32 nIndex )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- return uno::Any();
+ //IAccessibility2 Implementation 2009-----
+ if(nIndex != 0)
+ throw new IndexOutOfBoundsException;
+ //End Added.
+ const SwTxtAttr *pTxtAttr = GetTxtAttr();
+ ::rtl::OUString retText;
+ if( pTxtAttr /*&& 0 == nIndex*/ )
+ {
+ const SwFmtINetFmt& rINetFmt = pTxtAttr->GetINetFmt();
+ retText = OUString( rINetFmt.GetValue() );
+ }
+ uno::Any aRet;
+ aRet <<= retText;
+ return aRet;
+ //-----IAccessibility2 Implementation 2009
}
sal_Int32 SAL_CALL SwAccessibleHyperlink::getStartIndex()
@@ -175,7 +221,57 @@ sal_Bool SAL_CALL SwAccessibleHyperlink::isValid( )
throw (uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
- return xPara.isValid();
+ //IAccessibility2 Implementation 2009-----
+ // return xPara.isValid();
+ if (xPara.isValid())
+ {
+ const SwTxtAttr *pTxtAttr = GetTxtAttr();
+ ::rtl::OUString sText;
+ if( pTxtAttr )
+ {
+ const SwFmtINetFmt& rINetFmt = pTxtAttr->GetINetFmt();
+ sText = OUString( rINetFmt.GetValue() );
+ ::rtl::OUString sToken = ::rtl::OUString::createFromAscii("#");
+ sal_Int32 nPos = sText.indexOf(sToken);
+ if (nPos==0)//document link
+ {
+ uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
+ if( ! xFactory.is() )
+ return sal_False;
+ uno::Reference< com::sun::star::frame::XDesktop > xDesktop( xFactory->createInstance( OUString::createFromAscii( "com.sun.star.frame.Desktop" ) ),
+ uno::UNO_QUERY );
+ if( !xDesktop.is() )
+ return sal_False;
+ uno::Reference< lang::XComponent > xComp;
+ xComp = xDesktop->getCurrentComponent();
+ if( !xComp.is() )
+ return sal_False;
+ uno::Reference< com::sun::star::document::XLinkTargetSupplier > xLTS(xComp, uno::UNO_QUERY);
+ if ( !xLTS.is())
+ return sal_False;
+
+ uno::Reference< ::com::sun::star::container::XNameAccess > xLinks = xLTS->getLinks();
+ uno::Reference< ::com::sun::star::container::XNameAccess > xSubLinks;
+ const uno::Sequence< OUString > aNames( xLinks->getElementNames() );
+ const sal_uLong nLinks = aNames.getLength();
+ const OUString* pNames = aNames.getConstArray();
+
+ for( sal_uLong i = 0; i < nLinks; i++ )
+ {
+ uno::Any aAny;
+ OUString aLink( *pNames++ );
+ aAny = xLinks->getByName( aLink );
+ aAny >>= xSubLinks;
+ if (xSubLinks->hasByName(sText.copy(1)) )
+ return sal_True;
+ }
+ }
+ else//internet
+ return sal_True;
+ }
+ }//xpara valid
+ return sal_False;
+ //-----IAccessibility2 Implementation 2009
}
void SwAccessibleHyperlink::Invalidate()
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index 8be7f772f90d..8918bb598c59 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -34,6 +34,7 @@
#include <map>
#include <list>
+#include <vector>
#include <accmap.hxx>
#include <acccontext.hxx>
#include <accdoc.hxx>
@@ -60,11 +61,25 @@
#include <IDocumentDrawModelAccess.hxx>
#include <svx/ShapeTypeHandler.hxx>
#include <vcl/svapp.hxx>
+//IAccessibility2 Implementation 2009-----
+#ifndef _SVX_ACCESSIBILITY_SHAPE_TYPE_HANDLER_HXX
+#include <svx/ShapeTypeHandler.hxx>
+#endif
+#ifndef _SVX_ACCESSIBILITY_SVX_SHAPE_TYPES_HXX
+#include <svx/SvxShapeTypes.hxx>
+#endif
+#ifndef _SVDPAGE_HXX
+#include <svx/svdpage.hxx>
+#endif
#include <com/sun/star/accessibility/AccessibleRelationType.hpp>
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
+#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <cppuhelper/implbase1.hxx>
#include <pagepreviewlayout.hxx>
+#include <dcontact.hxx>
+#include <svx/unoapi.hxx>
+#include <doc.hxx>
#include <pam.hxx>
#include <ndtxt.hxx>
#include <dflyobj.hxx>
@@ -280,7 +295,9 @@ SwAccessibleObjShape_Impl
{
const SdrObject *pObj = (*aIter).first;
uno::Reference < XAccessible > xAcc( (*aIter).second );
- if( nSelShapes && pFESh->IsObjSelected( *pObj ) )
+ //IAccessibility2 Implementation 2009-----
+ if( nSelShapes && pFESh &&pFESh->IsObjSelected( *pObj ) )
+ //-----IAccessibility2 Implementation 2009
{
// selected objects are inserted from the back
--pSelShape;
@@ -336,20 +353,31 @@ private:
SwAccessibleEvent_Impl& operator==( const SwAccessibleEvent_Impl& );
public:
+ //IAccessibility2 Implementation 2009-----
+ const SwFrm* mpParentFrm; // The object that fires the event
+ sal_Bool IsNoXaccParentFrm() const
+ {
+ return CHILD_POS_CHANGED == meType && mpParentFrm != 0;
+ }
+ uno::WeakReference < XAccessible > GetxAcc() const { return mxAcc;}
+ //-----IAccessibility2 Implementation 2009
+public:
SwAccessibleEvent_Impl( EventType eT,
SwAccessibleContext *pA,
const SwAccessibleChild& rFrmOrObj )
: mxAcc( pA ),
maFrmOrObj( rFrmOrObj ),
meType( eT ),
- mnStates( 0 )
+ mnStates( 0 ),
+ mpParentFrm( 0 )
{}
SwAccessibleEvent_Impl( EventType eT,
const SwAccessibleChild& rFrmOrObj )
: maFrmOrObj( rFrmOrObj ),
meType( eT ),
- mnStates( 0 )
+ mnStates( 0 ),
+ mpParentFrm( 0 )
{
ASSERT( SwAccessibleEvent_Impl::DISPOSE == meType,
"wrong event constructor, DISPOSE only" );
@@ -357,7 +385,8 @@ public:
SwAccessibleEvent_Impl( EventType eT )
: meType( eT ),
- mnStates( 0 )
+ mnStates( 0 ),
+ mpParentFrm( 0 )
{
ASSERT( SwAccessibleEvent_Impl::SHAPE_SELECTION == meType,
"wrong event constructor, SHAPE_SELECTION only" );
@@ -371,7 +400,8 @@ public:
mxAcc( pA ),
maFrmOrObj( rFrmOrObj ),
meType( eT ),
- mnStates( 0 )
+ mnStates( 0 ),
+ mpParentFrm( 0 )
{
ASSERT( SwAccessibleEvent_Impl::CHILD_POS_CHANGED == meType ||
SwAccessibleEvent_Impl::POS_CHANGED == meType,
@@ -386,12 +416,28 @@ public:
: mxAcc( pA ),
maFrmOrObj( rFrmOrObj ),
meType( eT ),
- mnStates( _nStates )
+ mnStates( _nStates ),
+ mpParentFrm( 0 )
{
ASSERT( SwAccessibleEvent_Impl::CARET_OR_STATES == meType,
"wrong event constructor, CARET_OR_STATES only" );
}
+ //IAccessibility2 Implementation 2009-----
+ SwAccessibleEvent_Impl( EventType eT,
+ const SwFrm *pParentFrm,
+ const SwAccessibleChild& rFrmOrObj,
+ const SwRect& rR ) :
+ maOldBox( rR ),
+ maFrmOrObj( rFrmOrObj ),
+ meType( eT ),
+ mnStates( 0 ),
+ mpParentFrm( pParentFrm )
+ {
+ OSL_ENSURE( SwAccessibleEvent_Impl::CHILD_POS_CHANGED == meType,
+ "wrong event constructor, CHILD_POS_CHANGED only" );
+ }
+ //-----IAccessibility2 Implementation 2009
// <SetType(..)> only used in method <SwAccessibleMap::AppendEvent(..)>
inline void SetType( EventType eT )
{
@@ -495,8 +541,47 @@ public:
{
return mbFiring;
}
+ //IAccessibility2 Implementation 2009-----
+ struct XAccisNULL
+ {
+ bool operator()(const SwAccessibleEvent_Impl& e)
+ {
+ return e.IsNoXaccParentFrm();
+ }
+ };
+ void MoveInvalidXAccToEnd();
+ //-----IAccessibility2 Implementation 2009
};
+//IAccessibility2 Implementation 2009-----
+void SwAccessibleEventList_Impl::MoveInvalidXAccToEnd()
+{
+ int nSize = size();
+ if (nSize < 2 )
+ {
+ return;
+ }
+ SwAccessibleEventList_Impl lstEvent;
+ iterator li = begin();
+ for ( ;li != end();)
+ {
+ SwAccessibleEvent_Impl e = *li;
+ if (e.IsNoXaccParentFrm())
+ {
+ iterator liNext = li;
+ ++liNext;
+ erase(li);
+ li = liNext;
+ lstEvent.insert(lstEvent.end(),e);
+ }
+ else
+ ++li;
+ }
+ OSL_ENSURE(size() + lstEvent.size() == nSize ,"");
+ insert(end(),lstEvent.begin(),lstEvent.end());
+ OSL_ENSURE(size() == nSize ,"");
+}
+//-----IAccessibility2 Implementation 2009
//------------------------------------------------------------------------------
// The shape list is filled if an accessible shape is destroyed. It
// simply keeps a reference to the accessible shape's XShape. These
@@ -827,6 +912,25 @@ static sal_Bool AreInSameTable( const uno::Reference< XAccessible >& rAcc,
void SwAccessibleMap::FireEvent( const SwAccessibleEvent_Impl& rEvent )
{
::vos::ORef < SwAccessibleContext > xAccImpl( rEvent.GetContext() );
+ //IAccessibility2 Implementation 2009-----
+ if (!xAccImpl.isValid() && rEvent.mpParentFrm != 0 )
+ {
+ SwAccessibleContextMap_Impl::iterator aIter =
+ mpFrmMap->find( rEvent.mpParentFrm );
+ if( aIter != mpFrmMap->end() )
+ {
+ uno::Reference < XAccessible > xAcc( (*aIter).second );
+ if (xAcc.is())
+ {
+ uno::Reference < XAccessibleContext > xContext(xAcc,uno::UNO_QUERY);
+ if (xContext.is() && xContext->getAccessibleRole() == AccessibleRole::PARAGRAPH)
+ {
+ xAccImpl = static_cast< SwAccessibleContext *>( xAcc.get() );
+ }
+ }
+ }
+ }
+ //-----IAccessibility2 Implementation 2009
if( SwAccessibleEvent_Impl::SHAPE_SELECTION == rEvent.GetType() )
{
DoInvalidateShapeSelection();
@@ -1044,8 +1148,323 @@ void SwAccessibleMap::InvalidateShapeSelection()
DoInvalidateShapeSelection();
}
}
+//IAccessibility2 Implementation 2009-----
+//This method should implement the following functions:
+//1.find the shape objects and set the selected state.
+//2.find the Swframe objects and set the selected state.
+//3.find the paragraph objects and set the selected state.
+void SwAccessibleMap::InvalidateShapeInParaSelection()
+{
+ SwAccessibleObjShape_Impl *pShapes = 0;
+ SwAccessibleObjShape_Impl *pSelShape = 0;
+ size_t nShapes = 0;
+
+ const ViewShell *pVSh = GetShell();
+ const SwFEShell *pFESh = dynamic_cast< const SwFEShell* >(pVSh);
+ SwPaM* pCrsr = pFESh ? pFESh->GetCrsr( sal_False /* ??? */ ) : NULL;//IAccessibility2 Implementation 2009
+
+ //sal_uInt16 nSelShapes = pFESh ? pFESh->IsObjSelected() : 0;
-void SwAccessibleMap::DoInvalidateShapeSelection()
+ {
+ vos::OGuard aGuard( maMutex );
+ if( mpShapeMap )
+ pShapes = mpShapeMap->Copy( nShapes, pFESh, &pSelShape );
+ }
+
+ sal_Bool bIsSelAll =IsDocumentSelAll();
+
+ if( mpShapeMap )
+ {
+ //Checked for shapes.
+ _SwAccessibleShapeMap_Impl::const_iterator aIter = mpShapeMap->begin();
+ _SwAccessibleShapeMap_Impl::const_iterator aEndIter = mpShapeMap->end();
+ ::vos::ORef< SwAccessibleContext > xParentAccImpl;
+
+ if( bIsSelAll)
+ {
+ while( aIter != aEndIter )
+ {
+ uno::Reference < XAccessible > xAcc( (*aIter).second );
+ if( xAcc.is() )
+ (static_cast < ::accessibility::AccessibleShape* >(xAcc.get()))->SetState( AccessibleStateType::SELECTED );
+
+ ++aIter;
+ }
+ }
+ else
+ {
+ while( aIter != aEndIter )
+ {
+ sal_Bool bChanged = sal_False;
+ sal_Bool bMarked = sal_False;
+ SwAccessibleChild pFrm( (*aIter).first );
+
+ const SwFrmFmt *pFrmFmt = (*aIter).first ? ::FindFrmFmt( (*aIter).first ) : 0;
+ if( !pFrmFmt ) { ++aIter; continue; }
+ const SwFmtAnchor& pAnchor = pFrmFmt->GetAnchor();
+ const SwPosition *pPos = pAnchor.GetCntntAnchor();
+
+ if(pAnchor.GetAnchorId() == FLY_AT_PAGE)
+ {
+ uno::Reference < XAccessible > xAcc( (*aIter).second );
+ if(xAcc.is())
+ (static_cast < ::accessibility::AccessibleShape* >(xAcc.get()))->ResetState( AccessibleStateType::SELECTED );
+
+ ++aIter; continue;
+ }
+
+ if( !pPos ) { ++aIter; continue; }
+ if( pPos->nNode.GetNode().GetTxtNode() )
+ {
+ int pIndex = pPos->nContent.GetIndex();
+ SwPaM* pTmpCrsr = pCrsr;
+ if( pTmpCrsr != NULL )
+ {
+ const SwTxtNode* pNode = pPos->nNode.GetNode().GetTxtNode();
+ sal_uLong nHere = pNode->GetIndex();
+
+ do
+ {
+ // ignore, if no mark
+ if( pTmpCrsr->HasMark() )
+ {
+ bMarked = sal_True;
+ // check whether nHere is 'inside' pCrsr
+ SwPosition* pStart = pTmpCrsr->Start();
+ sal_uLong nStartIndex = pStart->nNode.GetIndex();
+ SwPosition* pEnd = pTmpCrsr->End();
+ sal_uLong nEndIndex = pEnd->nNode.GetIndex();
+ if( ( nHere >= nStartIndex ) && (nHere <= nEndIndex) )
+ {
+ if( pAnchor.GetAnchorId() == FLY_AS_CHAR )
+ {
+ if( ( (nHere == nStartIndex) && (pIndex >= pStart->nContent.GetIndex()) || (nHere > nStartIndex) )
+ &&( (nHere == nEndIndex) && (pIndex < pEnd->nContent.GetIndex()) || (nHere < nEndIndex) ) )
+ {
+ uno::Reference < XAccessible > xAcc( (*aIter).second );
+ if( xAcc.is() )
+ bChanged = (static_cast < ::accessibility::AccessibleShape* >(xAcc.get()))->SetState( AccessibleStateType::SELECTED );
+ }
+ else
+ {
+ uno::Reference < XAccessible > xAcc( (*aIter).second );
+ if( xAcc.is() )
+ bChanged = (static_cast < ::accessibility::AccessibleShape* >(xAcc.get()))->ResetState( AccessibleStateType::SELECTED );
+ }
+ }
+ else if( pAnchor.GetAnchorId() == FLY_AT_PARA )
+ {
+ if( ((nHere > nStartIndex) || pStart->nContent.GetIndex() ==0 )
+ && (nHere < nEndIndex ) )
+ {
+ uno::Reference < XAccessible > xAcc( (*aIter).second );
+ if( xAcc.is() )
+ bChanged = (static_cast < ::accessibility::AccessibleShape* >(xAcc.get()))->SetState( AccessibleStateType::SELECTED );
+ }
+ else
+ {
+ uno::Reference < XAccessible > xAcc( (*aIter).second );
+ if(xAcc.is())
+ bChanged = (static_cast < ::accessibility::AccessibleShape* >(xAcc.get()))->ResetState( AccessibleStateType::SELECTED );
+ }
+ }
+ }
+ }
+ // next PaM in ring
+ pTmpCrsr = static_cast<SwPaM*>( pTmpCrsr->GetNext() );
+ }
+ while( pTmpCrsr != pCrsr );
+ }
+ if( !bMarked )
+ {
+ SwAccessibleObjShape_Impl *pShape = pShapes;
+ size_t nNumShapes = nShapes;
+ while( nNumShapes )
+ {
+ if( pShape < pSelShape && (pShape->first==(*aIter).first) )
+ {
+ uno::Reference < XAccessible > xAcc( (*aIter).second );
+ if(xAcc.is())
+ bChanged = (static_cast < ::accessibility::AccessibleShape* >(xAcc.get()))->ResetState( AccessibleStateType::SELECTED );
+ }
+ --nNumShapes;
+ ++pShape;
+ }
+ }
+ }
+ ++aIter;
+ }//while( aIter != aEndIter )
+ }//else
+ }
+
+ //Checked for FlyFrm
+ SwAccessibleContextMap_Impl::iterator aIter = mpFrmMap->begin();
+ while( aIter != mpFrmMap->end() )
+ {
+ const SwFrm *pFrm = (*aIter).first;
+ if(pFrm->IsFlyFrm())
+ {
+ sal_Bool bFrmChanged = sal_False;
+ uno::Reference < XAccessible > xAcc = (*aIter).second;
+
+ if(xAcc.is())
+ {
+ SwAccessibleFrameBase *pAccFrame = (static_cast< SwAccessibleFrameBase * >(xAcc.get()));
+ bFrmChanged = pAccFrame->SetSelectedState( sal_True );
+ if (bFrmChanged)
+ {
+ const SwFlyFrm *pFlyFrm = static_cast< const SwFlyFrm * >( pFrm );
+ const SwFrmFmt *pFrmFmt = pFlyFrm->GetFmt();
+ if (pFrmFmt)
+ {
+ const SwFmtAnchor& pAnchor = pFrmFmt->GetAnchor();
+ if( pAnchor.GetAnchorId() == FLY_AS_CHAR )
+ {
+ uno::Reference< XAccessible > xAccParent = pAccFrame->getAccessibleParent();
+ if (xAccParent.is())
+ {
+ uno::Reference< XAccessibleContext > xAccContext = xAccParent->getAccessibleContext();
+ if(xAccContext.is() && xAccContext->getAccessibleRole() == AccessibleRole::PARAGRAPH)
+ {
+ SwAccessibleParagraph* pAccPara = static_cast< SwAccessibleParagraph *>(xAccContext.get());
+ if(pAccFrame->IsSeletedInDoc())
+ {
+ m_setParaAdd.insert(pAccPara);
+ }
+ else if(m_setParaAdd.count(pAccPara) == 0)
+ {
+ m_setParaRemove.insert(pAccPara);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ ++aIter;
+ }
+ typedef std::vector< SwAccessibleContext* > VEC_PARA;
+ VEC_PARA vecAdd;
+ VEC_PARA vecRemove;
+ //Checked for Paras.
+ SwPaM* pTmpCrsr = pCrsr;
+ sal_Bool bMarkChanged = sal_False;
+ SwAccessibleContextMap_Impl mapTemp;
+ if( pTmpCrsr != NULL )
+ {
+ do
+ {
+ if( pTmpCrsr->HasMark() )
+ {
+ SwNodeIndex nStartIndex( pTmpCrsr->Start()->nNode );
+ SwNodeIndex nEndIndex( pTmpCrsr->End()->nNode );
+ while(nStartIndex <= nEndIndex)
+ {
+ SwFrm *pFrm = NULL;
+ if(nStartIndex.GetNode().IsCntntNode())
+ {
+ SwCntntNode* pCNd = (SwCntntNode*)&(nStartIndex.GetNode());
+ SwClientIter aClientIter( *pCNd );
+ pFrm = dynamic_cast< SwFrm* >(aClientIter.SwClientIter_First());
+ }
+ else if( nStartIndex.GetNode().IsTableNode() )
+ {
+ SwTableNode * pTable= (SwTableNode *)&(nStartIndex.GetNode());
+ SwFrmFmt* pFmt = const_cast<SwFrmFmt*>(pTable->GetTable().GetFrmFmt());
+ SwClientIter aClientIter( *pFmt );
+ pFrm = dynamic_cast< SwFrm* >(aClientIter.SwClientIter_First());
+ }
+
+ if( pFrm && mpFrmMap)
+ {
+ aIter = mpFrmMap->find( pFrm );
+ if( aIter != mpFrmMap->end() )
+ {
+ uno::Reference < XAccessible > xAcc = (*aIter).second;
+ sal_Bool isChanged = sal_False;
+ if( xAcc.is() )
+ {
+ isChanged = (static_cast< SwAccessibleContext * >(xAcc.get()))->SetSelectedState( sal_True );
+ }
+ if(!isChanged)
+ {
+ SwAccessibleContextMap_Impl::iterator aEraseIter = mpSeletedFrmMap->find( pFrm );
+ if(aEraseIter != mpSeletedFrmMap->end())
+ mpSeletedFrmMap->erase(aEraseIter);
+ }
+ else
+ {
+ bMarkChanged = sal_True;
+ vecAdd.push_back(static_cast< SwAccessibleContext * >(xAcc.get()));
+ }
+
+ mapTemp.insert( SwAccessibleContextMap_Impl::value_type( pFrm, xAcc ) );
+ }
+ }
+ nStartIndex++;
+ }
+ }
+ pTmpCrsr = static_cast<SwPaM*>( pTmpCrsr->GetNext() );
+ }
+ while( pTmpCrsr != pCrsr );
+ }
+ if( !mpSeletedFrmMap )
+ mpSeletedFrmMap = new SwAccessibleContextMap_Impl;
+ if( !mpSeletedFrmMap->empty() )
+ {
+ aIter = mpSeletedFrmMap->begin();
+ while( aIter != mpSeletedFrmMap->end() )
+ {
+ uno::Reference < XAccessible > xAcc = (*aIter).second;
+ if(xAcc.is())
+ (static_cast< SwAccessibleContext * >(xAcc.get()))->SetSelectedState( sal_False );
+ ++aIter;
+ vecRemove.push_back(static_cast< SwAccessibleContext * >(xAcc.get()));
+ }
+ bMarkChanged = sal_True;
+ mpSeletedFrmMap->clear();
+ }
+
+ if( !mapTemp.empty() )
+ {
+ aIter = mapTemp.begin();
+ while( aIter != mapTemp.end() )
+ {
+ mpSeletedFrmMap->insert( SwAccessibleContextMap_Impl::value_type( (*aIter).first, (*aIter).second ) );
+ ++aIter;
+ }
+ mapTemp.clear();
+ }
+ if( bMarkChanged && mpFrmMap)
+ {
+ VEC_PARA::iterator vi = vecAdd.begin();
+ for (; vi != vecAdd.end() ; ++vi)
+ {
+ AccessibleEventObject aEvent;
+ aEvent.EventId = AccessibleEventId::SELECTION_CHANGED;
+ SwAccessibleContext* pAccPara = *vi;
+ if (pAccPara)
+ {
+ pAccPara->FireAccessibleEvent( aEvent );
+ }
+ }
+ vi = vecRemove.begin();
+ for (; vi != vecRemove.end() ; ++vi)
+ {
+ AccessibleEventObject aEvent;
+ aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_REMOVE;
+ SwAccessibleContext* pAccPara = *vi;
+ if (pAccPara)
+ {
+ pAccPara->FireAccessibleEvent( aEvent );
+ }
+ }
+ }
+}
+
+//Marge with DoInvalidateShapeFocus
+void SwAccessibleMap::DoInvalidateShapeSelection(sal_Bool bInvalidateFocusMode /*=sal_False*/)
{
SwAccessibleObjShape_Impl *pShapes = 0;
SwAccessibleObjShape_Impl *pSelShape = 0;
@@ -1055,6 +1474,13 @@ void SwAccessibleMap::DoInvalidateShapeSelection()
const SwFEShell *pFESh = dynamic_cast< const SwFEShell * >( pVSh );
sal_uInt32 nSelShapes = pFESh ? pFESh->GetNumberOfSelectedObjects() : 0;
+
+ //when InvalidateFocus Call this function ,and the current selected shape count is not 1 ,
+ //return
+ if (bInvalidateFocusMode && nSelShapes != 1)
+ {
+ return;
+ }
{
vos::OGuard aGuard( maMutex );
if( mpShapeMap )
@@ -1063,24 +1489,71 @@ void SwAccessibleMap::DoInvalidateShapeSelection()
if( pShapes )
{
- ::std::list< const SwFrm * > aParents;
+ typedef std::vector< ::vos::ORef < ::accessibility::AccessibleShape > > VEC_SHAPE;
+ VEC_SHAPE vecxShapeAdd;
+ VEC_SHAPE vecxShapeRemove;
+ int nCountSelectedShape=0;
+
Window *pWin = GetShell()->GetWin();
sal_Bool bFocused = pWin && pWin->HasFocus();
SwAccessibleObjShape_Impl *pShape = pShapes;
+ int nShapeCount = nShapes;
+ while( nShapeCount )
+ {
+ //if( pShape->second.isValid() )
+ if (pShape->second.isValid() && IsInSameLevel(pShape->first, pFESh))
+ {
+ if( pShape < pSelShape )
+ {
+ if(pShape->second->ResetState( AccessibleStateType::SELECTED ))
+ {
+ vecxShapeRemove.push_back(pShape->second);
+ }
+ pShape->second->ResetState( AccessibleStateType::FOCUSED );
+ }
+ }
+ --nShapeCount;
+ ++pShape;
+ }
+
+ VEC_SHAPE::iterator vi =vecxShapeRemove.begin();
+ for (; vi != vecxShapeRemove.end(); ++vi)
+ {
+ ::accessibility::AccessibleShape *pAccShape = static_cast< ::accessibility::AccessibleShape * >(vi->getBodyPtr());
+ if (pAccShape)
+ {
+ pAccShape->CommitChange(AccessibleEventId::SELECTION_CHANGED_REMOVE, uno::Any(), uno::Any());
+ }
+ }
+
+ pShape = pShapes;
while( nShapes )
{
- if( pShape->second.isValid() )
+ //if( pShape->second.isValid() )
+ if (pShape->second.isValid() && IsInSameLevel(pShape->first, pFESh))
{
- sal_Bool bChanged;
+ // IA2 - why?
+ // sal_Bool bChanged;
if( pShape >= pSelShape )
{
- bChanged =
- pShape->second->SetState( AccessibleStateType::SELECTED );
+ // IA2: first fire focus event
+ // bChanged = pShape->second->SetState( AccessibleStateType::SELECTED );
+
+ //first fire focus event
if( bFocused && 1 == nSelShapes )
pShape->second->SetState( AccessibleStateType::FOCUSED );
else
pShape->second->ResetState( AccessibleStateType::FOCUSED );
+
+ // IA2 CWS:
+ if(pShape->second->SetState( AccessibleStateType::SELECTED ))
+ {
+ vecxShapeAdd.push_back(pShape->second);
+ }
+ ++nCountSelectedShape;
}
+ /* MT: This still was in DEV300m80, but was removed in IA2 CWS.
+ Someone needs to check what should happen here, see original diff CWS oo31ia2 vs. OOO310M11
else
{
bChanged =
@@ -1094,47 +1567,97 @@ void SwAccessibleMap::DoInvalidateShapeSelection()
GetShell()->IsPreView() );
aParents.push_back( pParent );
}
+ */
}
--nShapes;
++pShape;
}
- if( aParents.size() > 0 )
+
+ const int SELECTION_WITH_NUM =10;
+ if (vecxShapeAdd.size() > SELECTION_WITH_NUM )
{
- ::std::list< const SwFrm * >::const_iterator aIter = aParents.begin();
- ::std::list< const SwFrm * >::const_iterator aEndIter = aParents.end();
- while( aIter != aEndIter )
+ uno::Reference< XAccessible > xDoc = GetDocumentView( );
+ SwAccessibleContext * pCont = static_cast<SwAccessibleContext *>(xDoc.get());
+ if (pCont)
+ {
+ AccessibleEventObject aEvent;
+ aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_WITHIN;
+ pCont->FireAccessibleEvent(aEvent);
+ }
+ }
+ else
+ {
+ short nEventID = AccessibleEventId::SELECTION_CHANGED_ADD;
+ if (nCountSelectedShape <= 1 && vecxShapeAdd.size() == 1 )
+ {
+ nEventID = AccessibleEventId::SELECTION_CHANGED;
+ }
+ vi = vecxShapeAdd.begin();
+ for (; vi != vecxShapeAdd.end(); ++vi)
{
- ::vos::ORef< SwAccessibleContext > xParentAccImpl;
+ ::accessibility::AccessibleShape *pAccShape = static_cast< ::accessibility::AccessibleShape * >(vi->getBodyPtr());
+ if (pAccShape)
{
- vos::OGuard aGuard( maMutex );
- if( mpFrmMap )
+ pAccShape->CommitChange(nEventID, uno::Any(), uno::Any());
+ }
+ }
+ }
+
+ vi = vecxShapeAdd.begin();
+ for (; vi != vecxShapeAdd.end(); ++vi)
+ {
+ ::accessibility::AccessibleShape *pAccShape = static_cast< ::accessibility::AccessibleShape * >(vi->getBodyPtr());
+ if (pAccShape)
+ {
+ SdrObject *pObj = GetSdrObjectFromXShape(pAccShape->GetXShape());
+ SwFrmFmt *pFrmFmt = pObj ? FindFrmFmt( pObj ) : NULL;
+ if (pFrmFmt)
+ {
+ const SwFmtAnchor& pAnchor = pFrmFmt->GetAnchor();
+ if( pAnchor.GetAnchorId() == FLY_AS_CHAR )
{
- SwAccessibleContextMap_Impl::const_iterator aMapIter =
- mpFrmMap->find( *aIter );
- if( aMapIter != mpFrmMap->end() )
+ uno::Reference< XAccessible > xPara = pAccShape->getAccessibleParent();
+ if (xPara.is())
{
- uno::Reference < XAccessible > xAcc( (*aMapIter).second );
- xParentAccImpl =
- static_cast< SwAccessibleContext *>( xAcc.get() );
+ uno::Reference< XAccessibleContext > xParaContext = xPara->getAccessibleContext();
+ if (xParaContext.is() && xParaContext->getAccessibleRole() == AccessibleRole::PARAGRAPH)
+ {
+ SwAccessibleParagraph* pAccPara = static_cast< SwAccessibleParagraph *>(xPara.get());
+ if (pAccPara)
+ {
+ m_setParaAdd.insert(pAccPara);
+ }
+ }
}
}
}
- if( xParentAccImpl.isValid() )
+ }
+ }
+ vi = vecxShapeRemove.begin();
+ for (; vi != vecxShapeRemove.end(); ++vi)
+ {
+ ::accessibility::AccessibleShape *pAccShape = static_cast< ::accessibility::AccessibleShape * >(vi->getBodyPtr());
+ if (pAccShape)
+ {
+ uno::Reference< XAccessible > xPara = pAccShape->getAccessibleParent();
+ uno::Reference< XAccessibleContext > xParaContext = xPara->getAccessibleContext();
+ if (xParaContext.is() && xParaContext->getAccessibleRole() == AccessibleRole::PARAGRAPH)
{
- AccessibleEventObject aEvent;
- aEvent.EventId = AccessibleEventId::SELECTION_CHANGED;
- xParentAccImpl->FireAccessibleEvent( aEvent );
+ SwAccessibleParagraph* pAccPara = static_cast< SwAccessibleParagraph *>(xPara.get());
+ if (m_setParaAdd.count(pAccPara) == 0 )
+ {
+ m_setParaRemove.insert(pAccPara);
+ }
}
-
- ++aIter;
}
}
-
delete[] pShapes;
}
}
+//Marge with DoInvalidateShapeSelection
+/*
void SwAccessibleMap::DoInvalidateShapeFocus()
{
const ViewShell *pVSh = GetShell();
@@ -1177,7 +1700,8 @@ void SwAccessibleMap::DoInvalidateShapeFocus()
delete[] pShapes;
}
}
-
+*/
+//-----IAccessibility2 Implementation 2009
SwAccessibleMap::SwAccessibleMap( ViewShell *pSh ) :
mpFrmMap( 0 ),
@@ -1193,7 +1717,8 @@ SwAccessibleMap::SwAccessibleMap( ViewShell *pSh ) :
mnPara( 1 ),
mnFootnote( 1 ),
mnEndnote( 1 ),
- mbShapeSelected( sal_False )
+ mbShapeSelected( sal_False ),
+ mpSeletedFrmMap(NULL)//IAccessibility2 Implementation 2009
{
pSh->GetLayout()->AddAccessibleShell();
}
@@ -1214,10 +1739,28 @@ SwAccessibleMap::~SwAccessibleMap()
}
}
+ //IAccessibility2 Implementation 2009-----
+ if(xAcc.is())
+ {
SwAccessibleDocument *pAcc =
static_cast< SwAccessibleDocument * >( xAcc.get() );
pAcc->Dispose( sal_True );
-
+ }
+ if( mpFrmMap )
+ {
+ SwAccessibleContextMap_Impl::iterator aIter = mpFrmMap->begin();
+ while( aIter != mpFrmMap->end() )
+ {
+ uno::Reference < XAccessible > xTmp = (*aIter).second;
+ if( xTmp.is() )
+ {
+ SwAccessibleContext *pTmp = static_cast< SwAccessibleContext * >( xTmp.get() );
+ pTmp->SetMap(NULL);
+ }
+ ++aIter;
+ }
+ }
+ //-----IAccessibility2 Implementation 2009
{
vos::OGuard aGuard( maMutex );
#ifdef DBG_UTIL
@@ -1298,6 +1841,7 @@ SwAccessibleMap::~SwAccessibleMap()
mpEvents = 0;
}
mpVSh->GetLayout()->RemoveAccessibleShell();
+ delete mpSeletedFrmMap;//IAccessibility2 Implementation 2009
}
uno::Reference< XAccessible > SwAccessibleMap::_GetDocumentView(
@@ -1429,7 +1973,7 @@ uno::Reference< XAccessible> SwAccessibleMap::GetContext( const SwFrm *pFrm,
sal_Bool bIsEndnote =
SwAccessibleFootnote::IsEndnote( pFtnFrm );
pAcc = new SwAccessibleFootnote( this, bIsEndnote,
- (bIsEndnote ? mnEndnote++ : mnFootnote++),
+ /*(bIsEndnote ? mnEndnote++ : mnFootnote++),*/
pFtnFrm );
}
break;
@@ -1584,6 +2128,10 @@ uno::Reference< XAccessible> SwAccessibleMap::GetContext(
}
// TODO: focus!!!
}
+ //IAccessibility2 Implementation 2009-----
+ if (xAcc.is())
+ AddGroupContext(pObj, xAcc);
+ //-----IAccessibility2 Implementation 2009
}
}
}
@@ -1594,6 +2142,105 @@ uno::Reference< XAccessible> SwAccessibleMap::GetContext(
return xAcc;
}
+//IAccessibility2 Implementation 2009-----
+sal_Bool SwAccessibleMap::IsInSameLevel(const SdrObject* pObj, const SwFEShell* pFESh)
+{
+ if (pFESh && pObj)
+ return pFESh->IsObjSameLevelWithMarked(*pObj);
+ return sal_False;
+}
+void SwAccessibleMap::AddShapeContext(const SdrObject *pObj, uno::Reference < XAccessible > xAccShape)
+{
+ vos::OGuard aGuard( maMutex );
+
+ if( mpShapeMap )
+ {
+ SwAccessibleShapeMap_Impl::value_type aEntry( pObj, xAccShape );
+ mpShapeMap->insert( aEntry );
+ }
+
+}
+
+//Added by yanjun for sym2_6407
+void SwAccessibleMap::RemoveGroupContext(const SdrObject *pParentObj, ::com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessible > xAccParent)
+{
+ vos::OGuard aGuard( maMutex );
+ if (mpShapeMap && pParentObj && pParentObj->getChildrenOfSdrObject() && xAccParent.is())
+ {
+ uno::Reference < XAccessibleContext > xContext = xAccParent->getAccessibleContext();
+ if (xContext.is())
+ {
+ for (sal_Int32 i = 0; i < xContext->getAccessibleChildCount(); ++i)
+ {
+ uno::Reference < XAccessible > xChild = xContext->getAccessibleChild(i);
+ if (xChild.is())
+ {
+ uno::Reference < XAccessibleContext > xChildContext = xChild->getAccessibleContext();
+ if (xChildContext.is())
+ {
+ if (xChildContext->getAccessibleRole() == AccessibleRole::SHAPE)
+ {
+ ::accessibility::AccessibleShape* pAccShape = static_cast < ::accessibility::AccessibleShape* >( xChild.get());
+ uno::Reference < drawing::XShape > xShape = pAccShape->GetXShape();
+ if (xShape.is())
+ {
+ SdrObject* pObj = GetSdrObjectFromXShape(xShape);
+ if (pObj)
+ RemoveContext(pObj);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+//End
+
+
+void SwAccessibleMap::AddGroupContext(const SdrObject *pParentObj, uno::Reference < XAccessible > xAccParent)
+{
+ vos::OGuard aGuard( maMutex );
+ if( mpShapeMap )
+ {
+ //here get all the sub list.
+ if (pParentObj->getChildrenOfSdrObject())
+ {
+ if (xAccParent.is())
+ {
+ uno::Reference < XAccessibleContext > xContext = xAccParent->getAccessibleContext();
+ if (xContext.is())
+ {
+ sal_Int32 nChildren = xContext->getAccessibleChildCount();
+ for(sal_Int32 i = 0; i<nChildren; i++)
+ {
+ uno::Reference < XAccessible > xChild = xContext->getAccessibleChild(i);
+ if (xChild.is())
+ {
+ uno::Reference < XAccessibleContext > xChildContext = xChild->getAccessibleContext();
+ if (xChildContext.is())
+ {
+ short nRole = xChildContext->getAccessibleRole();
+ if (nRole == AccessibleRole::SHAPE)
+ {
+ ::accessibility::AccessibleShape* pAccShape = static_cast < ::accessibility::AccessibleShape* >( xChild.get());
+ uno::Reference < drawing::XShape > xShape = pAccShape->GetXShape();
+ if (xShape.is())
+ {
+ SdrObject* pObj = GetSdrObjectFromXShape(xShape);
+ AddShapeContext(pObj, xChild);
+ AddGroupContext(pObj,xChild);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+//-----IAccessibility2 Implementation 2009
::vos::ORef < ::accessibility::AccessibleShape > SwAccessibleMap::GetContextImpl(
const SdrObject *pObj,
@@ -1656,13 +2303,16 @@ void SwAccessibleMap::RemoveContext( const SdrObject *pObj )
mpShapeMap->find( pObj );
if( aIter != mpShapeMap->end() )
{
+ //IAccessible2 Implementation 2009 ----
+ uno::Reference < XAccessible > xAcc( (*aIter).second );
mpShapeMap->erase( aIter );
-
+ RemoveGroupContext(pObj, xAcc);
// The shape selection flag is not cleared, but one might do
// so but has to make sure that the removed context is the one
// that is selected.
- if( mpShapeMap->empty() )
+ if( mpShapeMap && mpShapeMap->empty() )
+ //---- IAccessible2 Implementation 2009
{
delete mpShapeMap;
mpShapeMap = 0;
@@ -1809,6 +2459,7 @@ void SwAccessibleMap::InvalidatePosOrSize( const SwFrm *pFrm,
{
::vos::ORef< SwAccessibleContext > xAccImpl;
::vos::ORef< SwAccessibleContext > xParentAccImpl;
+ const SwFrm *pParent =NULL; //IAccessibility2 Implementation 2009
{
vos::OGuard aGuard( maMutex );
@@ -1831,7 +2482,7 @@ void SwAccessibleMap::InvalidatePosOrSize( const SwFrm *pFrm,
{
// Otherwise we look if the parent is accessible.
// If not, there is nothing to do.
- const SwFrm *pParent =
+ pParent = //IAccessibility2 Implementation 2009
SwAccessibleFrame::GetParent( aFrmOrObj,
GetShell()->IsPreView());
@@ -1881,7 +2532,54 @@ void SwAccessibleMap::InvalidatePosOrSize( const SwFrm *pFrm,
rOldBox );
}
}
+ //IAccessibility2 Implementation 2009-----
+ else if(pParent)
+ {
+/*
+For child graphic and it's parent paragraph,if split 2 graphic to 2 paragraph,
+will delete one graphic swfrm and new create 1 graphic swfrm ,
+then the new paragraph and the new graphic SwFrm will add .
+but when add graphic SwFrm ,the accessible of the new Paragraph is not created yet.
+so the new graphic accessible 'parent is NULL,
+so run here: save the parent's SwFrm not the accessible object parent,
+*/
+ sal_Bool bIsValidFrm = sal_False;
+ sal_Bool bIsTxtParent = sal_False;
+ if (aFrmOrObj.GetSwFrm())
+ {
+ int nType = pFrm->GetType();
+ if ( FRM_FLY == nType )
+ {
+ bIsValidFrm =sal_True;
+ }
+ }
+ else if(pObj)
+ {
+ int nType = pParent->GetType();
+ if (FRM_TXT == nType)
+ {
+ bIsTxtParent =sal_True;
+ }
+ }
+// sal_Bool bIsVisibleChildrenOnly =aFrmOrObj.IsVisibleChildrenOnly() ;
+// sal_Bool bIsBoundAsChar =aFrmOrObj.IsBoundAsChar() ;//bIsVisibleChildrenOnly && bIsBoundAsChar &&
+ if((bIsValidFrm || bIsTxtParent) )
+ {
+ if( GetShell()->ActionPend() )
+ {
+ SwAccessibleEvent_Impl aEvent(
+ SwAccessibleEvent_Impl::CHILD_POS_CHANGED,
+ pParent, aFrmOrObj, rOldBox );
+ AppendEvent( aEvent );
+ }
+ else
+ {
+ OSL_ENSURE(false,"");
+ }
+ }
+ }
}
+ //-----IAccessibility2 Implementation 2009
}
void SwAccessibleMap::InvalidateContent( const SwFrm *pFrm )
@@ -2020,6 +2718,29 @@ void SwAccessibleMap::InvalidateCursorPosition( const SwFrm *pFrm )
mpFrmMap->find( aFrmOrObj.GetSwFrm() );
if( aIter != mpFrmMap->end() )
xAcc = (*aIter).second;
+ //IAccessibility2 Implementation 2009-----
+ else
+ {
+ SwRect rcEmpty;
+ const SwTabFrm* pTabFrm = aFrmOrObj.GetSwFrm()->FindTabFrm();
+ if (pTabFrm)
+ {
+ InvalidatePosOrSize(pTabFrm,0,0,rcEmpty);
+ }
+ else
+ {
+ InvalidatePosOrSize(aFrmOrObj.GetSwFrm(),0,0,rcEmpty);
+ }
+
+
+ aIter =
+ mpFrmMap->find( aFrmOrObj.GetSwFrm() );
+ if( aIter != mpFrmMap->end() )
+ {
+ xAcc = (*aIter).second;
+ }
+ }
+ //-----IAccessibility2 Implementation 2009
// For cells, some extra thoughts are necessary,
// because invalidating the cursor for one cell
@@ -2048,18 +2769,204 @@ void SwAccessibleMap::InvalidateCursorPosition( const SwFrm *pFrm )
xAcc = GetContext( aFrmOrObj.GetSwFrm(), sal_True );
}
}
+ //IAccessibility2 Implementation 2009-----
+ else if (bShapeSelected)
+ {
+ const SwFEShell *pFESh = pVSh ? static_cast< const SwFEShell * >( pVSh ) : NULL ;
+ if(pFESh)
+ {
+ SdrObject* pObj = pFESh->getSingleSelected();
+
+ if(pObj)
+ {
+ ::vos::ORef < ::accessibility::AccessibleShape > pAccShapeImpl = GetContextImpl(pObj,NULL,sal_False);
+
+ if (!pAccShapeImpl.isValid())
+ {
+ while(pObj && pObj->GetParentSdrObject())
+ {
+ pObj = pObj->GetParentSdrObject();
+ }
+
+ if (pObj != NULL)
+ {
+ const SwFrm *pParent = SwAccessibleFrame::GetParent( SwAccessibleChild(pObj), GetShell()->IsPreView() );
+ if( pParent )
+ {
+ ::vos::ORef< SwAccessibleContext > xParentAccImpl = GetContextImpl(pParent,sal_False);
+ if (!xParentAccImpl.isValid())
+ {
+ const SwTabFrm* pTabFrm = pParent->FindTabFrm();
+ if (pTabFrm)
+ {
+ //The Table should not add in acc.because the "pParent" is not add to acc .
+ uno::Reference< XAccessible> xAccParentTab = GetContext(pTabFrm,sal_True);//Should Create.
+
+ const SwFrm *pParentRoot = SwAccessibleFrame::GetParent( SwAccessibleChild(pTabFrm), GetShell()->IsPreView() );
+ if (pParentRoot)
+ {
+ ::vos::ORef< SwAccessibleContext > xParentAccImplRoot = GetContextImpl(pParentRoot,sal_False);
+ if(xParentAccImplRoot.isValid())
+ {
+ AccessibleEventObject aEvent;
+ aEvent.EventId = AccessibleEventId::CHILD;
+ aEvent.NewValue <<= xAccParentTab;
+ xParentAccImplRoot->FireAccessibleEvent( aEvent );
+ }
+ }
+
+ //Get "pParent" acc again.
+ xParentAccImpl = GetContextImpl(pParent,sal_False);
+ }
+ else
+ {
+ //directly create this acc para .
+ xParentAccImpl = GetContextImpl(pParent,sal_True);//Should Create.
+
+ const SwFrm *pParentRoot = SwAccessibleFrame::GetParent( SwAccessibleChild(pParent), GetShell()->IsPreView() );
+
+ ::vos::ORef< SwAccessibleContext > xParentAccImplRoot = GetContextImpl(pParentRoot,sal_False);
+ if(xParentAccImplRoot.isValid())
+ {
+ AccessibleEventObject aEvent;
+ aEvent.EventId = AccessibleEventId::CHILD;
+ aEvent.NewValue <<= uno::Reference< XAccessible>(xParentAccImpl.getBodyPtr());
+ xParentAccImplRoot->FireAccessibleEvent( aEvent );
+ }
+ }
+ }
+ if (xParentAccImpl.isValid())
+ {
+ uno::Reference< XAccessible> xAccShape =
+ GetContext(pObj,xParentAccImpl.getBodyPtr(),sal_True);
+
+ AccessibleEventObject aEvent;
+ aEvent.EventId = AccessibleEventId::CHILD;
+ aEvent.NewValue <<= xAccShape;
+ xParentAccImpl->FireAccessibleEvent( aEvent );
+ }
+ }
+ }
+ }
+ }
+ }
+ }
}
+ m_setParaAdd.clear();
+ m_setParaRemove.clear();
if( xOldAcc.is() && xOldAcc != xAcc )
InvalidateCursorPosition( xOldAcc );
if( bOldShapeSelected || bShapeSelected )
InvalidateShapeSelection();
if( xAcc.is() )
InvalidateCursorPosition( xAcc );
+
+ InvalidateShapeInParaSelection();
+
+ SET_PARA::iterator si = m_setParaRemove.begin();
+ for (; si != m_setParaRemove.end() ; ++si)
+ {
+ SwAccessibleParagraph* pAccPara = *si;
+ if(pAccPara && pAccPara->getSelectedAccessibleChildCount() == 0 && pAccPara->getSelectedText().getLength() == 0)
+ {
+ if(pAccPara->SetSelectedState(sal_False))
+ {
+ AccessibleEventObject aEvent;
+ aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_REMOVE;
+ pAccPara->FireAccessibleEvent( aEvent );
+ }
+ }
+ }
+ si = m_setParaAdd.begin();
+ for (; si != m_setParaAdd.end() ; ++si)
+ {
+ SwAccessibleParagraph* pAccPara = *si;
+ if(pAccPara && pAccPara->SetSelectedState(sal_True))
+ {
+ AccessibleEventObject aEvent;
+ aEvent.EventId = AccessibleEventId::SELECTION_CHANGED;
+ pAccPara->FireAccessibleEvent( aEvent );
+ }
+ }
+ //-----IAccessibility2 Implementation 2009
+}
+
+//IAccessibility2 Implementation 2009-----
+//Notify the page change event to bridge.
+void SwAccessibleMap::FirePageChangeEvent(sal_uInt16 nOldPage, sal_uInt16 nNewPage)
+{
+ uno::Reference<XAccessible> xAcc = GetDocumentView( );
+ if ( xAcc.is() )
+ {
+ SwAccessibleDocumentBase *pAcc =
+ static_cast< SwAccessibleDocumentBase * >( xAcc.get() );
+ if (pAcc)
+ {
+ AccessibleEventObject aEvent;
+ aEvent.EventId = AccessibleEventId::PAGE_CHANGED;
+ aEvent.OldValue <<= nOldPage;
+ aEvent.NewValue <<= nNewPage;
+ pAcc->FireAccessibleEvent( aEvent );
+ }
+ }
+}
+
+void SwAccessibleMap::FireSectionChangeEvent(sal_uInt16 nOldSection, sal_uInt16 nNewSection)
+{
+ uno::Reference<XAccessible> xAcc = GetDocumentView( );
+ if ( xAcc.is() )
+ {
+ SwAccessibleDocumentBase *pAcc =
+ static_cast< SwAccessibleDocumentBase * >( xAcc.get() );
+ if (pAcc)
+ {
+ AccessibleEventObject aEvent;
+ aEvent.EventId = AccessibleEventId::SECTION_CHANGED;
+ aEvent.OldValue <<= nOldSection;
+ aEvent.NewValue <<= nNewSection;
+ pAcc->FireAccessibleEvent( aEvent );
+
+ }
+ }
}
+void SwAccessibleMap::FireColumnChangeEvent(sal_uInt16 nOldColumn, sal_uInt16 nNewColumn)
+{
+ uno::Reference<XAccessible> xAcc = GetDocumentView( );
+ if ( xAcc.is() )
+ {
+ SwAccessibleDocumentBase *pAcc =
+ static_cast< SwAccessibleDocumentBase * >( xAcc.get() );
+ if (pAcc)
+ {
+ AccessibleEventObject aEvent;
+ aEvent.EventId = AccessibleEventId::COLUMN_CHANGED;
+ aEvent.OldValue <<= nOldColumn;
+ aEvent.NewValue <<= nNewColumn;
+ pAcc->FireAccessibleEvent( aEvent );
+
+ }
+ }
+}
+//-----IAccessibility2 Implementation 2009
void SwAccessibleMap::InvalidateFocus()
{
+ //IAccessibility2 Implementation 2009-----
+ if(GetShell()->IsPreView())
+ {
+ uno::Reference<XAccessible> xAcc = _GetDocumentView( sal_True );
+ if (xAcc.get())
+ {
+ SwAccessiblePreview *pAccPreview = static_cast<SwAccessiblePreview *>(xAcc.get());
+ if (pAccPreview)
+ {
+ pAccPreview->InvalidateFocus();
+ return ;
+ }
+ }
+ }
+ //-----IAccessibility2 Implementation 2009
uno::Reference < XAccessible > xAcc;
sal_Bool bShapeSelected;
{
@@ -2075,10 +2982,12 @@ void SwAccessibleMap::InvalidateFocus()
static_cast< SwAccessibleContext *>( xAcc.get() );
pAccImpl->InvalidateFocus();
}
- else if( bShapeSelected )
+ //IAccessibility2 Implementation 2009-----
+ else
{
- DoInvalidateShapeFocus();
+ DoInvalidateShapeSelection(sal_True);
}
+ //-----IAccessibility2 Implementation 2009
}
void SwAccessibleMap::SetCursorContext(
@@ -2361,6 +3270,9 @@ void SwAccessibleMap::FireEvents()
if( mpEvents )
{
mpEvents->SetFiring();
+ //IAccessibility2 Implementation 2009-----
+ mpEvents->MoveInvalidXAccToEnd();
+ //-----IAccessibility2 Implementation 2009
SwAccessibleEventList_Impl::iterator aIter = mpEvents->begin();
while( aIter != mpEvents->end() )
{
@@ -2551,6 +3463,94 @@ sal_Bool SwAccessibleMap::ReplaceChild (
return sal_True;
}
+//IAccessibility2 Implementation 2009-----
+//Get the accessible control shape from the model object, here model object is with XPropertySet type
+::accessibility::AccessibleControlShape * SwAccessibleMap::GetAccControlShapeFromModel(::com::sun::star::beans::XPropertySet* pSet) throw (::com::sun::star::uno::RuntimeException)
+{
+ if( mpShapeMap )
+ {
+ SwAccessibleShapeMap_Impl::const_iterator aIter = mpShapeMap->begin();
+ SwAccessibleShapeMap_Impl::const_iterator aEndIter = mpShapeMap->end();
+ while( aIter != aEndIter)
+ {
+ uno::Reference < XAccessible > xAcc( (*aIter).second );
+ ::accessibility::AccessibleShape *pAccShape =
+ static_cast < ::accessibility::AccessibleShape* >( xAcc.get() );
+ if(pAccShape && ::accessibility::ShapeTypeHandler::Instance().GetTypeId (pAccShape->GetXShape()) == ::accessibility::DRAWING_CONTROL)
+ {
+ ::accessibility::AccessibleControlShape *pCtlAccShape = static_cast < ::accessibility::AccessibleControlShape* >(pAccShape);
+ if (pCtlAccShape && pCtlAccShape->GetControlModel() == pSet)
+ return pCtlAccShape;
+ }
+ ++aIter;
+ }
+ }
+ return NULL;
+}
+
+::com::sun::star::uno::Reference< XAccessible >
+ SwAccessibleMap::GetAccessibleCaption (const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape)
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ SdrObject* captionedObject = GetSdrObjectFromXShape(xShape);
+
+ // replace formally used 'GetUserCall()' by new notify/listener mechanism
+ const SwDrawContact* pContact = static_cast< const SwDrawContact* >(findConnectionToSdrObject(captionedObject));
+
+ ASSERT( RES_DRAWFRMFMT == pContact->GetFmt()->Which(),
+ "fail" );
+ if( !pContact )
+ return 0;
+
+ SwDrawFrmFmt *pCaptionedFmt = (SwDrawFrmFmt *)pContact->GetFmt();
+ if( !pCaptionedFmt )
+ return 0;
+
+ SwFlyFrm* pFrm = NULL;
+ if (pCaptionedFmt->HasCaption())
+ {
+ const SwFrmFmt *pCaptionFrmFmt = pCaptionedFmt->GetCaptionFmt();
+ SwClientIter aIter (*(SwModify*)pCaptionFrmFmt);
+ pFrm = dynamic_cast< SwFlyFrm* >(aIter.SwClientIter_First());
+ }
+ if (!pFrm)
+ return 0;
+ //SwFrmFmt* pFrm = pCaptionedFmt->GetCaptionFmt();
+ uno::Reference < XAccessible > xAcc( GetContext((SwFrm*)pFrm,sal_True) );
+ //Reference < XAccessibleShape > xAccShape( xAcc, UNO_QUERY );
+
+ uno::Reference< XAccessibleContext > xAccContext = xAcc->getAccessibleContext();
+ if( xAccContext.is() )
+ { //get the parent of caption frame, which is paragaph
+ uno::Reference< XAccessible > xAccParent = xAccContext->getAccessibleParent();
+ if(xAccParent.is())
+ {
+ //get the great parent of caption frame which is text frame.
+ uno::Reference< XAccessibleContext > xAccParentContext = xAccParent->getAccessibleContext();
+ uno::Reference< XAccessible > xAccGreatParent = xAccParentContext->getAccessibleParent();
+ if(xAccGreatParent.is())
+ {
+ AccessibleEventObject aEvent;
+ aEvent.EventId = AccessibleEventId::CHILD;
+ aEvent.NewValue <<= xAccParent;
+ ( static_cast< SwAccessibleContext * >(xAccGreatParent.get()) )->FireAccessibleEvent( aEvent );
+
+ }
+
+ AccessibleEventObject aEvent;
+ aEvent.EventId = AccessibleEventId::CHILD;
+ aEvent.NewValue <<= xAcc;
+ ( static_cast< SwAccessibleContext * >(xAccParent.get()) )->FireAccessibleEvent( aEvent );
+ }
+ }
+
+ if(xAcc.get())
+ return xAcc;
+ else
+ return NULL;
+
+}
+//-----IAccessibility2 Implementation 2009
Point SwAccessibleMap::PixelToCore( const Point& rPoint ) const
{
Point aPoint;
@@ -2876,3 +3876,10 @@ const SwRect& SwAccessibleMap::GetVisArea() const
: GetShell()->VisArea();
}
+//IAccessibility2 Implementation 2009-----
+sal_Bool SwAccessibleMap::IsDocumentSelAll()
+{
+ return GetShell()->GetDoc()->IsPrepareSelAll();
+}
+//-----IAccessibility2 Implementation 2009
+
diff --git a/sw/source/core/access/accnotextframe.cxx b/sw/source/core/access/accnotextframe.cxx
index f33498e9e06d..3c330dd17b0b 100644
--- a/sw/source/core/access/accnotextframe.cxx
+++ b/sw/source/core/access/accnotextframe.cxx
@@ -39,10 +39,20 @@
#include <hints.hxx>
// <--
#include "accnotextframe.hxx"
+//IAccessibility2 Implementation 2009-----
+#include <fmturl.hxx>
+#include <accnotexthyperlink.hxx>
+#include <svtools/imap.hxx>
+#include <unotools/accessiblerelationsethelper.hxx>
+#include <com/sun/star/accessibility/AccessibleRelationType.hpp>
+#include <com/sun/star/accessibility/XAccessibleRelationSet.hpp>
+#include <doc.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::accessibility;
using ::rtl::OUString;
+using utl::AccessibleRelationSetHelper;
+//-----IAccessibility2 Implementation 2009
const SwNoTxtNode *SwAccessibleNoTextFrame::GetNoTxtNode() const
{
@@ -52,7 +62,13 @@ const SwNoTxtNode *SwAccessibleNoTextFrame::GetNoTxtNode() const
{
const SwCntntFrm *pCntFrm =
static_cast<const SwCntntFrm *>( pFlyFrm->Lower() );
- pNd = pCntFrm->GetNode()->GetNoTxtNode();
+ //IAccessibility2 Implementation 2009-----
+ const SwCntntNode* pSwCntntNode = pCntFrm->GetNode();
+ if(pSwCntntNode != NULL)
+ {
+ pNd = pSwCntntNode->GetNoTxtNode();
+ }
+ //-----IAccessibility2 Implementation 2009
}
return pNd;
@@ -203,6 +219,12 @@ OUString SAL_CALL SwAccessibleNoTextFrame::getAccessibleDescription (void)
vos::OGuard aGuard(Application::GetSolarMutex());
CHECK_FOR_DEFUNC( XAccessibleContext )
+ //IAccessibility2 Implementation 2009-----
+ // OUString longDesc;
+ // const SwFlyFrmFmt* pFlyFmt = GetShell()->GetDoc()->FindFlyByName( GetName(), 0);
+ // longDesc = OUString( pFlyFmt->GetLongDescription() );
+ // return longDesc; MT: Do not return longDesc, which still is empty - why was the line above commented out?
+ //-----IAccessibility2 Implementation 2009
return msDesc;
}
@@ -224,6 +246,15 @@ uno::Any SAL_CALL SwAccessibleNoTextFrame::queryInterface( const uno::Type& aTyp
aAny <<= xImage;
return aAny;
}
+ //IAccessibility2 Implementation 2009-----
+ else if ( aType == ::getCppuType((uno::Reference<XAccessibleHypertext> *)0) )
+ {
+ uno::Reference<XAccessibleHypertext> aAccHypertext = this;
+ uno::Any aAny;
+ aAny <<= aAccHypertext;
+ return aAny;
+ }
+ //-----IAccessibility2 Implementation 2009
else
return SwAccessibleContext::queryInterface( aType );
}
@@ -269,3 +300,137 @@ sal_Int32 SAL_CALL SwAccessibleNoTextFrame::getAccessibleImageWidth( )
{
return getSize().Width;
}
+//IAccessibility2 Implementation 2009-----
+//===== XAccesibleText ==================================================
+sal_Int32 SAL_CALL SwAccessibleNoTextFrame::getCaretPosition( ) throw (::com::sun::star::uno::RuntimeException){return 0;}
+sal_Bool SAL_CALL SwAccessibleNoTextFrame::setCaretPosition( sal_Int32 ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException){return 0;}
+sal_Unicode SAL_CALL SwAccessibleNoTextFrame::getCharacter( sal_Int32 ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException){return 0;}
+::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL SwAccessibleNoTextFrame::getCharacterAttributes( sal_Int32 , const ::com::sun::star::uno::Sequence< ::rtl::OUString >& ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException)
+{
+ uno::Sequence<beans::PropertyValue> aValues(0);
+ return aValues;
+}
+::com::sun::star::awt::Rectangle SAL_CALL SwAccessibleNoTextFrame::getCharacterBounds( sal_Int32 ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException)
+{
+ return com::sun::star::awt::Rectangle(0, 0, 0, 0 );
+}
+sal_Int32 SAL_CALL SwAccessibleNoTextFrame::getCharacterCount( ) throw (::com::sun::star::uno::RuntimeException){return 0;}
+sal_Int32 SAL_CALL SwAccessibleNoTextFrame::getIndexAtPoint( const ::com::sun::star::awt::Point& ) throw (::com::sun::star::uno::RuntimeException){return 0;}
+::rtl::OUString SAL_CALL SwAccessibleNoTextFrame::getSelectedText( ) throw (::com::sun::star::uno::RuntimeException){return OUString();}
+sal_Int32 SAL_CALL SwAccessibleNoTextFrame::getSelectionStart( ) throw (::com::sun::star::uno::RuntimeException){return 0;}
+sal_Int32 SAL_CALL SwAccessibleNoTextFrame::getSelectionEnd( ) throw (::com::sun::star::uno::RuntimeException){return 0;}
+sal_Bool SAL_CALL SwAccessibleNoTextFrame::setSelection( sal_Int32 , sal_Int32 ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException){return sal_True;}
+::rtl::OUString SAL_CALL SwAccessibleNoTextFrame::getText( ) throw (::com::sun::star::uno::RuntimeException){return OUString();}
+::rtl::OUString SAL_CALL SwAccessibleNoTextFrame::getTextRange( sal_Int32 , sal_Int32 ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException){return OUString();}
+::com::sun::star::accessibility::TextSegment SAL_CALL SwAccessibleNoTextFrame::getTextAtIndex( sal_Int32 , sal_Int16 ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
+{
+ ::com::sun::star::accessibility::TextSegment aResult;
+ return aResult;
+}
+::com::sun::star::accessibility::TextSegment SAL_CALL SwAccessibleNoTextFrame::getTextBeforeIndex( sal_Int32, sal_Int16 ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
+{
+ ::com::sun::star::accessibility::TextSegment aResult;
+ return aResult;
+}
+::com::sun::star::accessibility::TextSegment SAL_CALL SwAccessibleNoTextFrame::getTextBehindIndex( sal_Int32 , sal_Int16 ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
+{
+ ::com::sun::star::accessibility::TextSegment aResult;
+ return aResult;
+}
+
+sal_Bool SAL_CALL SwAccessibleNoTextFrame::copyText( sal_Int32, sal_Int32 ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException){return sal_True;}
+
+
+//
+// XAccessibleHyperText
+//
+sal_Int32 SAL_CALL SwAccessibleNoTextFrame::getHyperLinkCount()
+throw (uno::RuntimeException)
+{
+ vos::OGuard aGuard(Application::GetSolarMutex());
+
+ CHECK_FOR_DEFUNC( XAccessibleHypertext );
+
+ sal_Int32 nCount = 0;
+ SwFmtURL aURL( ((SwLayoutFrm*)GetFrm())->GetFmt()->GetURL() );
+
+ if(aURL.GetMap() || aURL.GetURL().Len())
+ nCount = 1;
+
+ return nCount;
+}
+
+uno::Reference< XAccessibleHyperlink > SAL_CALL
+ SwAccessibleNoTextFrame::getHyperLink( sal_Int32 nLinkIndex )
+ throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
+{
+ vos::OGuard aGuard(Application::GetSolarMutex());
+ CHECK_FOR_DEFUNC( XAccessibleHypertext );
+
+ uno::Reference< XAccessibleHyperlink > xRet;
+
+ SwFmtURL aURL( ((SwLayoutFrm*)GetFrm())->GetFmt()->GetURL() );
+
+ if( nLinkIndex > 0 )
+ throw lang::IndexOutOfBoundsException();
+
+ if( aURL.GetMap() || aURL.GetURL().Len() )
+ {
+ if ( !alink.is() )
+ {
+ alink = new SwAccessibleNoTextHyperlink( this, GetFrm() );
+ }
+
+ return alink;
+ }
+
+ return NULL;
+}
+
+sal_Int32 SAL_CALL SwAccessibleNoTextFrame::getHyperLinkIndex( sal_Int32 )
+ throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
+{
+ vos::OGuard aGuard(Application::GetSolarMutex());
+ CHECK_FOR_DEFUNC( XAccessibleHypertext );
+
+ sal_Int32 nRet = 0;
+
+ return nRet;
+}
+
+AccessibleRelation SwAccessibleNoTextFrame::makeRelation( sal_Int16 nType, const SwFlyFrm* pFrm )
+{
+ uno::Sequence<uno::Reference<XInterface> > aSequence(1);
+ aSequence[0] = GetMap()->GetContext( pFrm );
+ return AccessibleRelation( nType, aSequence );
+}
+
+
+uno::Reference<XAccessibleRelationSet> SAL_CALL SwAccessibleNoTextFrame::getAccessibleRelationSet( )
+ throw ( uno::RuntimeException )
+{
+ vos::OGuard aGuard(Application::GetSolarMutex());
+ CHECK_FOR_DEFUNC( XAccessibleContext );
+
+ // get the caption frame, and insert label relations into helper
+
+ AccessibleRelationSetHelper* pHelper = new AccessibleRelationSetHelper();
+
+ SwFlyFrm* pFlyFrm = getFlyFrm();
+ DBG_ASSERT( pFlyFrm != NULL, "fly frame expected" );
+
+ SwFlyFrm* pCaptionFrm = NULL;
+ const SwFrmFmt* pFrm = pFlyFrm ->GetFmt()->GetCaptionFmt();
+ if (pFrm)
+ {
+ SwClientIter aIter (*(SwModify*)pFrm);
+ pCaptionFrm = dynamic_cast< SwFlyFrm* >(aIter.SwClientIter_First());
+ }
+ if(pCaptionFrm!=NULL)
+ {
+ pHelper->AddRelation( makeRelation( AccessibleRelationType::DESCRIBED_BY, pCaptionFrm ) );
+ }
+
+ return pHelper;
+}
+//-----IAccessibility2 Implementation 2009
diff --git a/sw/source/core/access/accnotextframe.hxx b/sw/source/core/access/accnotextframe.hxx
index ebcb9c282245..6c7725c00af9 100644
--- a/sw/source/core/access/accnotextframe.hxx
+++ b/sw/source/core/access/accnotextframe.hxx
@@ -24,13 +24,30 @@
#define _ACCNOTEXTFRAME_HXX
#include "accframebase.hxx"
#include <com/sun/star/accessibility/XAccessibleImage.hpp>
+//IAccessibility2 Implementation 2009-----
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEHYPERTEXT_HPP_
+#include <com/sun/star/accessibility/XAccessibleHypertext.hpp>
+#endif
+
+namespace utl { class AccessibleRelationSetHelper; }
+namespace com { namespace star {
+ namespace accessibility { struct AccessibleRelation; }
+} }
class SwFlyFrm;
class SwNoTxtNode;
+class SwAccessibleNoTextHyperlink;
+//-----IAccessibility2 Implementation 2009
class SwAccessibleNoTextFrame : public SwAccessibleFrameBase,
- public ::com::sun::star::accessibility::XAccessibleImage
+ public ::com::sun::star::accessibility::XAccessibleImage,
+ public ::com::sun::star::accessibility::XAccessibleHypertext//Added by yangzhh for HyperLink
{
+ //IAccessibility2 Implementation 2009-----
+ friend class SwAccessibleNoTextHyperlink;
+ //HyperLinksMap alinksMap;
+ com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleHyperlink > alink;
+ //-----IAccessibility2 Implementation 2009
SwDepend aDepend;
// --> OD 2009-07-14 #i73249#
::rtl::OUString msTitle;
@@ -100,6 +117,51 @@ public:
// The object is not visible an longer and should be destroyed
virtual void Dispose( sal_Bool bRecursive = sal_False );
+
+ //IAccessibility2 Implementation 2009-----
+ virtual sal_Int32 SAL_CALL getCaretPosition( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);//Shen Zhen Jie changed sal_Unicode to sal_uInt32
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aRequestedAttributes ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getCharacterCount( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getIndexAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getSelectedText( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getSelectionStart( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getSelectionEnd( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getText( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+
+
+ //===== XAccessibleHypertext ============================================
+ virtual sal_Int32 SAL_CALL getHyperLinkCount()
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessibleHyperlink >
+ SAL_CALL getHyperLink( sal_Int32 nLinkIndex )
+ throw (::com::sun::star::lang::IndexOutOfBoundsException,
+ ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getHyperLinkIndex( sal_Int32 nCharIndex )
+ throw (::com::sun::star::lang::IndexOutOfBoundsException,
+ ::com::sun::star::uno::RuntimeException);
+
+ SwAccessibleMap *GetAccessibleMap(){ return GetMap();}
+
+private:
+ com::sun::star::accessibility::AccessibleRelation makeRelation(
+ sal_Int16 nType, const SwFlyFrm* pFrm );
+
+public:
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessibleRelationSet> SAL_CALL
+ getAccessibleRelationSet (void)
+ throw (::com::sun::star::uno::RuntimeException);
+ //-----IAccessibility2 Implementation 2009
};
diff --git a/sw/source/core/access/accnotexthyperlink.cxx b/sw/source/core/access/accnotexthyperlink.cxx
new file mode 100644
index 000000000000..4101ea51adc6
--- /dev/null
+++ b/sw/source/core/access/accnotexthyperlink.cxx
@@ -0,0 +1,232 @@
+/**************************************************************
+ *
+ * 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.
+ *
+ *************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_sw.hxx"
+
+#include <comphelper/accessiblekeybindinghelper.hxx>
+#include <swurl.hxx>
+#include <vos/mutex.hxx>
+#include <vcl/svapp.hxx>
+#include <ndtxt.hxx>
+#include <txtinet.hxx>
+#include <frmfmt.hxx>
+
+#include <accnotexthyperlink.hxx>
+
+#include <fmturl.hxx>
+
+#include <svtools/imap.hxx>
+#include <svtools/imapobj.hxx>
+
+#include <accmap.hxx>
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::accessibility;
+//using namespace ::rtl;
+
+SwAccessibleNoTextHyperlink::SwAccessibleNoTextHyperlink( SwAccessibleNoTextFrame *p, const SwFrm *aFrm, sal_uInt16 nIndex) :
+ xFrame( p ),
+ mpFrm( aFrm ),
+ mnIndex(nIndex)
+{
+}
+
+// XAccessibleAction
+sal_Int32 SAL_CALL SwAccessibleNoTextHyperlink::getAccessibleActionCount()
+ throw (RuntimeException)
+{
+ SwFmtURL aURL( GetFmt()->GetURL() );
+ ImageMap* pMap = aURL.GetMap();
+ if( pMap != NULL )
+ {
+ return pMap->GetIMapObjectCount();
+ }else if( aURL.GetURL().Len() )
+ {
+ return 1;
+ }
+
+ return 0;
+}
+
+sal_Bool SAL_CALL SwAccessibleNoTextHyperlink::doAccessibleAction( sal_Int32 nIndex )
+ throw (IndexOutOfBoundsException, RuntimeException)
+{
+ vos::OGuard aGuard(Application::GetSolarMutex());
+
+ if(nIndex < 0 || nIndex >= getAccessibleActionCount())
+ throw new IndexOutOfBoundsException;
+
+ sal_Bool bRet = sal_False;
+ SwFmtURL aURL( GetFmt()->GetURL() );
+ ImageMap* pMap = aURL.GetMap();
+ if( pMap != NULL )
+ {
+ IMapObject* pMapObj = pMap->GetIMapObject(nIndex);
+ if(pMapObj->GetURL().Len())
+ {
+ ViewShell *pVSh = xFrame->GetShell();
+ if( pVSh )
+ {
+ LoadURL( pMapObj->GetURL(), pVSh, URLLOAD_NOFILTER,
+ &pMapObj->GetTarget() );
+ bRet = sal_True;
+ }
+ }
+ }
+ else if( aURL.GetURL().Len() )
+ {
+ ViewShell *pVSh = xFrame->GetShell();
+ if( pVSh )
+ {
+ LoadURL( aURL.GetURL(), pVSh, URLLOAD_NOFILTER,
+ &aURL.GetTargetFrameName() );
+ bRet = sal_True;
+ }
+ }
+
+ return bRet;
+}
+
+rtl::OUString SAL_CALL SwAccessibleNoTextHyperlink::getAccessibleActionDescription(
+ sal_Int32 nIndex )
+ throw (IndexOutOfBoundsException, RuntimeException)
+{
+ rtl::OUString sDesc;
+
+ if(nIndex < 0 || nIndex >= getAccessibleActionCount())
+ throw new IndexOutOfBoundsException;
+
+ SwFmtURL aURL( GetFmt()->GetURL() );
+ ImageMap* pMap = aURL.GetMap();
+ if( pMap != NULL )
+ {
+ IMapObject* pMapObj = pMap->GetIMapObject(nIndex);
+ if(pMapObj->GetDesc().Len())
+ sDesc = rtl::OUString( pMapObj->GetDesc() );
+ else if(pMapObj->GetURL().Len())
+ sDesc = rtl::OUString( pMapObj->GetURL() );
+ }
+ else if( aURL.GetURL().Len() )
+ sDesc = rtl::OUString( aURL.GetName() );
+ //sDesc = rtl::OUString( aURL.GetName() );
+
+ return sDesc;
+}
+
+Reference< XAccessibleKeyBinding > SAL_CALL
+ SwAccessibleNoTextHyperlink::getAccessibleActionKeyBinding( sal_Int32 nIndex )
+ throw (IndexOutOfBoundsException, RuntimeException)
+{
+ Reference< XAccessibleKeyBinding > xKeyBinding;
+
+ if(nIndex < 0 || nIndex >= getAccessibleActionCount())
+ throw new IndexOutOfBoundsException;
+
+ bool bIsValid = sal_False;
+ SwFmtURL aURL( GetFmt()->GetURL() );
+ ImageMap* pMap = aURL.GetMap();
+ if( pMap != NULL )
+ {
+ IMapObject* pMapObj = pMap->GetIMapObject(nIndex);
+ if(pMapObj->GetURL().Len())
+ bIsValid = sal_True;
+ }else if( aURL.GetURL().Len() )
+ bIsValid = sal_True;
+
+ if(bIsValid)
+ {
+ ::comphelper::OAccessibleKeyBindingHelper* pKeyBindingHelper =
+ new ::comphelper::OAccessibleKeyBindingHelper();
+ xKeyBinding = pKeyBindingHelper;
+
+ ::com::sun::star::awt::KeyStroke aKeyStroke;
+ aKeyStroke.Modifiers = 0;
+ aKeyStroke.KeyCode = KEY_RETURN;
+ aKeyStroke.KeyChar = 0;
+ aKeyStroke.KeyFunc = 0;
+ pKeyBindingHelper->AddKeyBinding( aKeyStroke );
+ }
+
+ return xKeyBinding;
+}
+
+// XAccessibleHyperlink
+Any SAL_CALL SwAccessibleNoTextHyperlink::getAccessibleActionAnchor(
+ sal_Int32 nIndex )
+ throw (IndexOutOfBoundsException, RuntimeException)
+{
+ if(nIndex < 0 || nIndex >= getAccessibleActionCount())
+ throw new IndexOutOfBoundsException;
+
+ Any aRet;
+ //SwFrm* pAnchor = ((SwFlyFrm*)mpFrm)->GetAnchor();
+ Reference< XAccessible > xAnchor = xFrame->GetAccessibleMap()->GetContext(mpFrm, sal_True);
+ //SwAccessibleNoTextFrame* pFrame = xFrame.get();
+ //Reference< XAccessible > xAnchor = (XAccessible*)pFrame;
+ aRet <<= xAnchor;
+ return aRet;
+}
+
+Any SAL_CALL SwAccessibleNoTextHyperlink::getAccessibleActionObject(
+ sal_Int32 nIndex )
+ throw (IndexOutOfBoundsException, RuntimeException)
+{
+ if(nIndex < 0 || nIndex >= getAccessibleActionCount())
+ throw new IndexOutOfBoundsException;
+
+ SwFmtURL aURL( GetFmt()->GetURL() );
+ ::rtl::OUString retText;
+ ImageMap* pMap = aURL.GetMap();
+ if( pMap != NULL )
+ {
+ IMapObject* pMapObj = pMap->GetIMapObject(nIndex);
+ if(pMapObj->GetURL().Len())
+ retText = rtl::OUString( pMapObj->GetURL() );
+ }else if( aURL.GetURL().Len() )
+ retText = rtl::OUString( aURL.GetURL() );
+
+ Any aRet;
+ aRet <<= retText;
+ return aRet;
+}
+
+sal_Int32 SAL_CALL SwAccessibleNoTextHyperlink::getStartIndex()
+ throw (RuntimeException)
+{
+ return 0;
+}
+
+sal_Int32 SAL_CALL SwAccessibleNoTextHyperlink::getEndIndex()
+ throw (RuntimeException)
+{
+ return 0;
+}
+
+sal_Bool SAL_CALL SwAccessibleNoTextHyperlink::isValid( )
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ SwFmtURL aURL( GetFmt()->GetURL() );
+
+ if( aURL.GetMap() || aURL.GetURL().Len() )
+ return sal_True;
+ return sal_False;
+}
diff --git a/sw/source/core/access/accnotexthyperlink.hxx b/sw/source/core/access/accnotexthyperlink.hxx
new file mode 100644
index 000000000000..29de85d79462
--- /dev/null
+++ b/sw/source/core/access/accnotexthyperlink.hxx
@@ -0,0 +1,93 @@
+/**************************************************************
+ *
+ * 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 _ACCNOTEXTHYPERLINK_HXX
+#define _ACCNOTEXTHYPERLINK_HXX
+
+
+#include <com/sun/star/accessibility/XAccessibleHyperlink.hpp>
+#include <com/sun/star/uno/RuntimeException.hpp>
+#include <vos/ref.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <fmtinfmt.hxx>
+#include <frame.hxx>
+#include <layfrm.hxx>
+
+#include "accnotextframe.hxx"
+/*
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::accessibility;
+using namespace ::rtl;
+*/
+class SwAccessibleNoTextHyperlink :
+ public ::cppu::WeakImplHelper1<
+ ::com::sun::star::accessibility::XAccessibleHyperlink >
+{
+ friend class SwAccessibleNoTextFrame;
+
+ ::vos::ORef< SwAccessibleNoTextFrame > xFrame;
+ const SwFrm *mpFrm;
+ sal_uInt16 mnIndex;
+
+ SwFrmFmt *GetFmt()
+ {
+ return ((SwLayoutFrm*)mpFrm)->GetFmt();
+ }
+public:
+
+ SwAccessibleNoTextHyperlink( SwAccessibleNoTextFrame *p, const SwFrm* aFrm, sal_uInt16 nIndex = 0xFFFF );
+
+ // XAccessibleAction
+ virtual sal_Int32 SAL_CALL getAccessibleActionCount()
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL doAccessibleAction( sal_Int32 nIndex )
+ throw (::com::sun::star::lang::IndexOutOfBoundsException,
+ ::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getAccessibleActionDescription(
+ sal_Int32 nIndex )
+ throw (::com::sun::star::lang::IndexOutOfBoundsException,
+ ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::accessibility::XAccessibleKeyBinding > SAL_CALL
+ getAccessibleActionKeyBinding( sal_Int32 nIndex )
+ throw (::com::sun::star::lang::IndexOutOfBoundsException,
+ ::com::sun::star::uno::RuntimeException);
+
+ // XAccessibleHyperlink
+ virtual ::com::sun::star::uno::Any SAL_CALL getAccessibleActionAnchor(
+ sal_Int32 nIndex )
+ throw (::com::sun::star::lang::IndexOutOfBoundsException,
+ ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getAccessibleActionObject(
+ sal_Int32 nIndex )
+ throw (::com::sun::star::lang::IndexOutOfBoundsException,
+ ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getStartIndex()
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getEndIndex()
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL isValid( )
+ throw (::com::sun::star::uno::RuntimeException);
+};
+
+#endif
+
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx
index e5c0c8b68099..8c84b6578265 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -56,6 +56,15 @@
#include <sfx2/dispatch.hxx> // for ExecuteAtViewShell(...)
#include <unotools/charclass.hxx> // for GetWordBoundary
// for get/setCharacterAttribute(...)
+
+#include <reffld.hxx>
+#include <docufld.hxx>
+#include <expfld.hxx>
+#include <flddat.hxx>
+#include <fldui.hrc>
+#include "../../ui/inc/fldmgr.hxx"
+#include "fldbas.hxx" // SwField
+#include <svl/svstdarr.hxx>
#include <unocrsr.hxx>
//#include <unoobj.hxx>
#include <unoport.hxx>
@@ -66,7 +75,31 @@
#include <acchypertextdata.hxx>
#include <unotools/accessiblerelationsethelper.hxx>
#include <com/sun/star/accessibility/AccessibleRelationType.hpp>
+//IAccessibility2 Implementation 2009-----
+#include <section.hxx>
+#include <doctxm.hxx>
#include <comphelper/accessibletexthelper.hxx>
+#include <algorithm>
+#include <docufld.hxx>
+#include <txtfld.hxx>
+#include <fmtfld.hxx>
+#include <modcfg.hxx>
+//#include "accnote.hxx"
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include "swmodule.hxx"
+#include "redline.hxx"
+#include <com/sun/star/awt/FontWeight.hpp>
+#include <com/sun/star/awt/FontStrikeout.hpp>
+#include <com/sun/star/awt/FontSlant.hpp>
+#include <wrong.hxx>
+#include <editeng/brshitem.hxx>
+#include <swatrset.hxx>
+#include <frmatr.hxx>
+#include <unosett.hxx>
+#include <paratr.hxx>
+#include <com/sun/star/container/XIndexReplace.hpp>
+//-----IAccessibility2 Implementation 2009
+// --> OD 2006-07-12 #i63870#
#include <unomap.hxx>
#include <unoprnms.hxx>
#include <com/sun/star/text/WritingMode2.hpp>
@@ -86,6 +119,8 @@
using namespace ::com::sun::star;
using namespace ::com::sun::star::accessibility;
+using namespace ::com::sun::star::container;
+using ::rtl::OUString;
using beans::PropertyValue;
using beans::XMultiPropertySet;
@@ -148,6 +183,19 @@ sal_Int32 SwAccessibleParagraph::GetCaretPos()
// same node? Then check whether it's also within 'our' part
// of the paragraph
sal_uInt16 nIndex = pPoint->nContent.GetIndex();
+ //IAccessibility2 Implementation 2009-----
+ if(!GetPortionData().IsValidCorePosition( nIndex ) ||
+ ( GetPortionData().IsZeroCorePositionData() && nIndex== 0) )
+ {
+ const SwTxtFrm *pTxtFrm = dynamic_cast< const SwTxtFrm* >(GetFrm());
+ bool bFormat = (pTxtFrm && pTxtFrm->HasPara());
+ if(bFormat)
+ {
+ ClearPortionData();
+ UpdatePortionData();
+ }
+ }
+ //-----IAccessibility2 Implementation 2009
if( GetPortionData().IsValidCorePosition( nIndex ) )
{
// Yes, it's us!
@@ -391,6 +439,20 @@ void SwAccessibleParagraph::_InvalidateContent( sal_Bool bVisibleDataFired )
aEvent.OldValue, aEvent.NewValue );
FireAccessibleEvent( aEvent );
+ //IAccessibility2 Implementation 2009-----
+ uno::Reference< XAccessible > xparent = getAccessibleParent();
+ uno::Reference< XAccessibleContext > xAccContext(xparent,uno::UNO_QUERY);
+ if (xAccContext.is() && xAccContext->getAccessibleRole() == AccessibleRole::TABLE_CELL)
+ {
+ SwAccessibleContext* pPara = static_cast< SwAccessibleContext* >(xparent.get());
+ if(pPara)
+ {
+ AccessibleEventObject aParaEvent;
+ aParaEvent.EventId = AccessibleEventId::VALUE_CHANGED;
+ pPara->FireAccessibleEvent(aParaEvent);
+ }
+ }
+ //-----IAccessibility2 Implementation 2009
}
else if( !bVisibleDataFired )
{
@@ -398,6 +460,10 @@ void SwAccessibleParagraph::_InvalidateContent( sal_Bool bVisibleDataFired )
}
sal_Bool bNewIsHeading = IsHeading();
+ //IAccessibility2 Implementation 2009-----
+ //Get the real heading level, Heading1 ~ Heading10
+ nHeadingLevel = GetRealHeadingLevel();
+ //-----IAccessibility2 Implementation 2009
sal_Bool bOldIsHeading;
{
vos::OGuard aGuard( aMutex );
@@ -466,6 +532,20 @@ void SwAccessibleParagraph::_InvalidateCursorPos()
if( pWin && pWin->HasFocus() && -1 == nNew )
FireStateChangedEvent( AccessibleStateType::FOCUSED, sal_False );
+ //IAccessibility2 Implementation 2009-----
+ //To send TEXT_SELECTION_CHANGED event
+ sal_Int32 nStart=0;
+ sal_Int32 nEnd =0;
+ sal_Bool bCurSelection=GetSelection(nStart,nEnd);
+ if(m_bLastHasSelection || bCurSelection )
+ {
+ aEvent.EventId = AccessibleEventId::TEXT_SELECTION_CHANGED;
+ aEvent.OldValue <<= uno::Any();
+ aEvent.NewValue <<= uno::Any();
+ FireAccessibleEvent(aEvent);
+ }
+ m_bLastHasSelection =bCurSelection;
+ //-----IAccessibility2 Implementation 2009
}
}
@@ -498,20 +578,35 @@ SwAccessibleParagraph::SwAccessibleParagraph(
, pHyperTextData( NULL )
, nOldCaretPos( -1 )
, bIsHeading( sal_False )
+ //IAccessibility2 Implementation 2009-----
+ //Get the real heading level, Heading1 ~ Heading10
+ , nHeadingLevel (-1)
+ //-----IAccessibility2 Implementation 2009
, aSelectionHelper( *this )
// --> OD 2010-02-19 #i108125#
, mpParaChangeTrackInfo( new SwParaChangeTrackingInfo( rTxtFrm ) )
// <--
+ //IAccessibility2 Implementation 2009-----
+ , m_bLastHasSelection(false) //To add TEXT_SELECTION_CHANGED event
+ //-----IAccessibility2 Implementation 2009
{
vos::OGuard aGuard(Application::GetSolarMutex());
bIsHeading = IsHeading();
+ //IAccessibility2 Implementation 2009-----
+ //Get the real heading level, Heading1 ~ Heading10
+ nHeadingLevel = GetRealHeadingLevel();
+ //-----IAccessibility2 Implementation 2009
// --> OD 2004-09-27 #117970# - set an empty accessibility name for paragraphs
SetName( ::rtl::OUString() );
// <--
// If this object has the focus, then it is remembered by the map itself.
- nOldCaretPos = GetCaretPos();
+ //IAccessibility2 Implementation 2009-----
+ // not necessary to remember this pos here. Generally, the pos will be updated in invalidateXXX method, which may fire the
+ //Focus event based on the difference of new & old caret pos.
+ //nOldCaretPos = GetCaretPos();
+ //-----IAccessibility2 Implementation 2009
}
SwAccessibleParagraph::~SwAccessibleParagraph()
@@ -635,7 +730,76 @@ sal_Bool SwAccessibleParagraph::IsValidRange(
{
return IsValidPosition(nBegin, nLength) && IsValidPosition(nEnd, nLength);
}
+//IAccessibility2 Implementation 2009-----
+SwTOXSortTabBase* SwAccessibleParagraph::GetTOXSortTabBase()
+{
+ const SwTxtNode* pTxtNd = GetTxtNode();
+ if( pTxtNd )
+ {
+ const SwSectionNode * pSectNd = pTxtNd->FindSectionNode();
+ if( pSectNd )
+ {
+ const SwSection * pSect = &pSectNd->GetSection();
+ SwTOXBaseSection *pTOXBaseSect = (SwTOXBaseSection *)pSect;
+ if( pSect->GetType() == TOX_CONTENT_SECTION )
+ {
+ SwTOXSortTabBase* pSortBase = 0;
+ int nSize = pTOXBaseSect->GetTOXSortTabBases()->Count();
+
+ for(int nIndex = 0; nIndex<nSize; nIndex++ )
+ {
+ pSortBase = (*(pTOXBaseSect->GetTOXSortTabBases()))[nIndex];
+ if( pSortBase->pTOXNd == pTxtNd )
+ break;
+ }
+
+ if (pSortBase)
+ {
+ return pSortBase;
+ }
+ }
+ }
+ }
+ return NULL;
+}
+
+short SwAccessibleParagraph::GetTOCLevel()
+{
+ SwTOXSortTabBase* pToxBase = GetTOXSortTabBase();
+ if( pToxBase )
+ {
+ const SwCntntNode* pNd = pToxBase->aTOXSources[0].pNd;
+ if( pNd )
+ return pToxBase->GetLevel();
+ else
+ return -1;
+ }
+ else
+ return -1;
+}
+//the function is to check whether the position is in a redline range.
+const SwRedline* SwAccessibleParagraph::GetRedlineAtIndex( sal_Int32 )
+{
+ const SwRedline* pRedline = NULL;
+ SwPaM* pCrSr = GetCursor( true );
+ if ( pCrSr )
+ {
+ SwPosition* pStart = pCrSr->Start();
+ const SwTxtNode* pNode = GetTxtNode();
+ if ( pNode )
+ {
+ const SwDoc* pDoc = pNode->GetDoc();
+ if ( pDoc )
+ {
+ pRedline = pDoc->GetRedline( *pStart, NULL );
+ }
+ }
+ }
+
+ return pRedline;
+}
+//-----IAccessibility2 Implementation 2009
//
// text boundaries
@@ -647,6 +811,11 @@ sal_Bool SwAccessibleParagraph::GetCharBoundary(
const ::rtl::OUString&,
sal_Int32 nPos )
{
+ //IAccessibility2 Implementation 2009-----
+ if( GetPortionData().FillBoundaryIFDateField( rBound, nPos) )
+ return sal_True;
+ //-----IAccessibility2 Implementation 2009
+
rBound.startPos = nPos;
rBound.endPos = nPos+1;
return sal_True;
@@ -673,6 +842,46 @@ sal_Bool SwAccessibleParagraph::GetWordBoundary(
// (DICTIONARY_WORD includes punctuation, ANY_WORD doesn't.)
const sal_uInt16 nWordType = i18n::WordType::ANY_WORD;
+/*
+ // get word boundary, as the Break-Iterator sees fit.
+ sal_Unicode SpaceChar(' ');
+ if (rText.getCodePointAt(nPos) == SpaceChar)
+ {
+ int nStartPos = nPos;
+ int nEndPos = nPos+1;
+ while (nStartPos >= 0 && rText.getCodePointAt(nStartPos) == SpaceChar)
+ --nStartPos;
+ while (nEndPos < rText.getLength() && rText.getCodePointAt(nEndPos) == SpaceChar)
+ ++nEndPos;
+ //Get the previous word boundary + the followed space characters
+ if (nStartPos >= 0)
+ {
+ rBound = pBreakIt->xBreak->getWordBoundary( rText, nStartPos, aLocale, nWordType, sal_True );
+ rBound.endPos += (nEndPos-nStartPos - 1);
+ }
+ //When the frontal characters are whitespace, return the all space characters directly.
+ else
+ {
+ rBound.startPos = 0;
+ rBound.endPos = nEndPos;
+ }
+ }
+ // add the " " into the word boundry
+ else
+ {
+ rBound = pBreakIt->xBreak->getWordBoundary(rText, nPos, aLocale, nWordType, sal_True );
+ sal_Int32 nEndPos = rBound.endPos, nLength = rText.getLength();
+ while ( nEndPos < nLength && rText.getCodePointAt(nEndPos) == SpaceChar )
+ nEndPos++;
+ rBound.endPos = nEndPos;
+ }
+ //IAccessibility2 Implementation 2009-----
+ tabCharInWord( nPos, rBound);
+ if( GetPortionData().FillBoundaryIFDateField( rBound, rBound.startPos) )
+ return sal_True;
+ //-----IAccessibility2 Implementation 2009
+ return sal_True; // MT: So why do we need the return TRUE above???
+*/
// get word boundary, as the Break-Iterator sees fit.
rBound = pBreakIt->GetBreakIter()->getWordBoundary(
rText, nPos, aLocale, nWordType, sal_True );
@@ -693,9 +902,17 @@ sal_Bool SwAccessibleParagraph::GetWordBoundary(
sal_Bool SwAccessibleParagraph::GetSentenceBoundary(
i18n::Boundary& rBound,
- const ::rtl::OUString&,
+ const ::rtl::OUString& rText,
sal_Int32 nPos )
{
+ //IAccessibility2 Implementation 2009-----
+ const sal_Unicode* pStr = rText.getStr();
+ if (pStr)
+ {
+ while( pStr[nPos] == sal_Unicode(' ') && nPos < rText.getLength())
+ nPos++;
+ }
+ //-----IAccessibility2 Implementation 2009
GetPortionData().GetSentenceBoundary( rBound, nPos );
return sal_True;
}
@@ -809,11 +1026,80 @@ sal_Bool SwAccessibleParagraph::GetTextBoundary(
break;
case AccessibleTextType::LINE:
- bRet = GetLineBoundary( rBound, rText, nPos );
+ //IAccessibility2 Implementation 2009-----
+ //Solve the problem of returning wrong LINE and PARAGRAPH
+ if((nPos == rText.getLength()) && nPos > 0)
+ bRet = GetLineBoundary( rBound, rText, nPos - 1);
+ else
+ bRet = GetLineBoundary( rBound, rText, nPos );
+ //-----IAccessibility2 Implementation 2009
break;
case AccessibleTextType::ATTRIBUTE_RUN:
bRet = GetAttributeBoundary( rBound, rText, nPos );
+ //IAccessibility2 Implementation 2009-----
+ if(bRet)
+ {
+ SwCrsrShell* pCrsrShell = GetCrsrShell();
+ if( pCrsrShell != NULL && pCrsrShell->GetViewOptions() && pCrsrShell->GetViewOptions()->IsOnlineSpell())
+ {
+ SwTxtNode* pTxtNode = const_cast<SwTxtNode*>( GetTxtNode() );
+ if(pTxtNode)
+ {
+ const SwWrongList* pWrongList = pTxtNode->GetWrong();
+ if( NULL != pWrongList )
+ {
+ xub_StrLen nBegin = nPos;
+ xub_StrLen nLen = 1;
+ const xub_StrLen nNext = pWrongList->NextWrong(nBegin);
+ xub_StrLen nLast;
+ xub_StrLen nWrongPos = pWrongList->GetWrongPos( nBegin );
+ if ( nWrongPos >= pWrongList->Count() ||
+ ( nLast = pWrongList->Pos( nWrongPos ) ) >= nBegin )
+ {
+ nLast = nWrongPos
+ ? pWrongList->Pos( --nWrongPos )
+ : STRING_LEN;
+ }
+ if ( nBegin > pWrongList->GetBeginInv() &&
+ ( nLast == STRING_LEN || nLast < pWrongList->GetEndInv() ) )
+ {
+ nLast = nBegin > pWrongList->GetEndInv()
+ ? pWrongList->GetEndInv()
+ : nBegin;
+ }
+ else if ( nLast < STRING_LEN )
+ {
+ nLast += pWrongList->Len( nWrongPos );
+ }
+ //
+ sal_Bool bIn = pWrongList->InWrongWord(nBegin,nLen); // && !pTxtNode->IsSymbol(nBegin) )
+ if(bIn)
+ {
+ rBound.startPos = max(nNext,(xub_StrLen)rBound.startPos);
+ rBound.endPos = min(xub_StrLen(nNext + nLen),(xub_StrLen)rBound.endPos);
+ }
+ else
+ {
+ if (STRING_LEN == nLast)//first
+ {
+ rBound.endPos = min(nNext,(xub_StrLen)rBound.endPos);
+ }
+ else if(STRING_LEN == nNext)
+ {
+ rBound.startPos = max(nLast,(xub_StrLen)rBound.startPos);
+ }
+ else
+ {
+ rBound.startPos = max(nLast,(xub_StrLen)rBound.startPos);
+ rBound.endPos = min(nNext,(xub_StrLen)rBound.endPos);
+ }
+ }
+ }
+ }
+ }
+ }
+ //-----IAccessibility2 Implementation 2009
break;
case AccessibleTextType::GLYPH:
@@ -1032,6 +1318,76 @@ uno::Sequence< ::rtl::OUString > SAL_CALL SwAccessibleParagraph::getSupportedSer
return aRet;
}
+//IAccessibility2 Implementation 2009-----
+uno::Sequence< ::rtl::OUString > getAttributeNames()
+{
+ static uno::Sequence< ::rtl::OUString >* pNames = NULL;
+
+ if( pNames == NULL )
+ {
+ // Add the font name to attribute list
+ uno::Sequence< ::rtl::OUString >* pSeq = new uno::Sequence< ::rtl::OUString >( 13 );
+
+ ::rtl::OUString* pStrings = pSeq->getArray();
+
+ // sorted list of strings
+ sal_Int32 i = 0;
+
+#define STR(x) pStrings[i++] = OUString::createFromAscii(x)
+ STR( GetPropName( UNO_NAME_CHAR_BACK_COLOR ).pName );
+ STR( GetPropName( UNO_NAME_CHAR_COLOR ).pName );
+ STR( GetPropName( UNO_NAME_CHAR_CONTOURED ).pName );
+ STR( GetPropName( UNO_NAME_CHAR_EMPHASIS ).pName );
+ STR( GetPropName( UNO_NAME_CHAR_ESCAPEMENT ).pName );
+ STR( GetPropName( UNO_NAME_CHAR_FONT_NAME ).pName );
+ STR( GetPropName( UNO_NAME_CHAR_HEIGHT ).pName );
+ STR( GetPropName( UNO_NAME_CHAR_POSTURE ).pName );
+ STR( GetPropName( UNO_NAME_CHAR_SHADOWED ).pName );
+ STR( GetPropName( UNO_NAME_CHAR_STRIKEOUT ).pName );
+ STR( GetPropName( UNO_NAME_CHAR_UNDERLINE ).pName );
+ STR( GetPropName( UNO_NAME_CHAR_UNDERLINE_COLOR ).pName );
+ STR( GetPropName( UNO_NAME_CHAR_WEIGHT ).pName );
+#undef STR
+ DBG_ASSERT( i == pSeq->getLength(), "Please adjust length" );
+ if( i != pSeq->getLength() )
+ pSeq->realloc( i );
+ pNames = pSeq;
+ }
+ return *pNames;
+}
+
+uno::Sequence< ::rtl::OUString > getSupplementalAttributeNames()
+{
+ static uno::Sequence< ::rtl::OUString >* pNames = NULL;
+
+ if( pNames == NULL )
+ {
+ uno::Sequence< ::rtl::OUString >* pSeq = new uno::Sequence< ::rtl::OUString >( 9 );
+
+ ::rtl::OUString* pStrings = pSeq->getArray();
+
+ // sorted list of strings
+ sal_Int32 i = 0;
+
+#define STR(x) pStrings[i++] = OUString::createFromAscii(x)
+ STR( GetPropName( UNO_NAME_NUMBERING_LEVEL ).pName );
+ STR( GetPropName( UNO_NAME_NUMBERING_RULES ).pName );
+ STR( GetPropName( UNO_NAME_PARA_ADJUST ).pName );
+ STR( GetPropName( UNO_NAME_PARA_BOTTOM_MARGIN ).pName );
+ STR( GetPropName( UNO_NAME_PARA_FIRST_LINE_INDENT ).pName );
+ STR( GetPropName( UNO_NAME_PARA_LEFT_MARGIN ).pName );
+ STR( GetPropName( UNO_NAME_PARA_LINE_SPACING ).pName );
+ STR( GetPropName( UNO_NAME_PARA_RIGHT_MARGIN ).pName );
+ STR( GetPropName( UNO_NAME_TABSTOPS ).pName );
+#undef STR
+ DBG_ASSERT( i == pSeq->getLength(), "Please adjust length" );
+ if( i != pSeq->getLength() )
+ pSeq->realloc( i );
+ pNames = pSeq;
+ }
+ return *pNames;
+}
+//-----IAccessibility2 Implementation 2009
//
//===== XInterface =======================================================
//
@@ -1082,6 +1438,19 @@ uno::Any SwAccessibleParagraph::queryInterface( const uno::Type& rType )
aRet <<= aAccMultiLineText;
}
// <--
+ //IAccessibility2 Implementation 2009-----
+ //MSAA Extension Implementation in app module
+ else if ( rType == ::getCppuType((uno::Reference<XAccessibleTextSelection> *)NULL) )
+ {
+ uno::Reference< com::sun::star::accessibility::XAccessibleTextSelection > aTextExtension = this;
+ aRet <<= aTextExtension;
+ }
+ else if ( rType == ::getCppuType((uno::Reference<XAccessibleExtendedAttributes> *)NULL) )
+ {
+ uno::Reference<XAccessibleExtendedAttributes> xAttr = this;
+ aRet <<= xAttr;
+ }
+ //-----IAccessibility2 Implementation 2009
else
{
aRet = SwAccessibleContext::queryInterface(rType);
@@ -1206,6 +1575,270 @@ sal_Unicode SwAccessibleParagraph::getCharacter( sal_Int32 nIndex )
throw lang::IndexOutOfBoundsException();
}
+//IAccessibility2 Implementation 2009-----
+com::sun::star::uno::Sequence< ::com::sun::star::style::TabStop > SwAccessibleParagraph::GetCurrentTabStop( sal_Int32 nIndex )
+{
+vos::OGuard aGuard(Application::GetSolarMutex());
+ CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
+
+
+
+ /* #i12332# The position after the string needs special treatment.
+ IsValidChar -> IsValidPosition
+ */
+ if( ! (IsValidPosition( nIndex, GetString().getLength() ) ) )
+ throw lang::IndexOutOfBoundsException();
+
+ /* #i12332# */
+ sal_Bool bBehindText = sal_False;
+ if ( nIndex == GetString().getLength() )
+ bBehindText = sal_True;
+
+ // get model position & prepare GetCharRect() arguments
+ SwCrsrMoveState aMoveState;
+ aMoveState.bRealHeight = sal_True;
+ aMoveState.bRealWidth = sal_True;
+ SwSpecialPos aSpecialPos;
+ SwTxtNode* pNode = const_cast<SwTxtNode*>( GetTxtNode() );
+
+ sal_uInt16 nPos = 0;
+
+ /* #i12332# FillSpecialPos does not accept nIndex ==
+ GetString().getLength(). In that case nPos is set to the
+ length of the string in the core. This way GetCharRect
+ returns the rectangle for a cursor at the end of the
+ paragraph. */
+ if (bBehindText)
+ {
+ nPos = pNode->GetTxt().Len();
+ }
+ else
+ nPos = GetPortionData().FillSpecialPos
+ (nIndex, aSpecialPos, aMoveState.pSpecialPos );
+
+ // call GetCharRect
+ SwRect aCoreRect;
+ SwIndex aIndex( pNode, nPos );
+ SwPosition aPosition( *pNode, aIndex );
+ GetFrm()->GetCharRect( aCoreRect, aPosition, &aMoveState );
+
+ // already get the caret postion
+
+ //IAccessibility2 Implementation 2009-----
+ /*SwFrm* pTFrm = const_cast<SwFrm*>(GetFrm());
+ com::sun::star::uno::Sequence< ::com::sun::star::style::TabStop > tabs =
+ pTFrm->GetTabStopInfo(aCoreRect.Left());*/
+
+ com::sun::star::uno::Sequence< ::com::sun::star::style::TabStop > tabs;
+ const xub_StrLen nStrLen = GetTxtNode()->GetTxt().Len();
+ if( nStrLen > 0 )
+ {
+ SwFrm* pTFrm = const_cast<SwFrm*>(GetFrm());
+ tabs = pTFrm->GetTabStopInfo(aCoreRect.Left());
+ }
+ //-----IAccessibility2 Implementation 2009
+
+ if( tabs.hasElements() )
+ {
+ // translate core coordinates into accessibility coordinates
+ Window *pWin = GetWindow();
+ CHECK_FOR_WINDOW( XAccessibleComponent, pWin );
+
+ SwRect aTmpRect(0, 0, tabs[0].Position, 0);
+
+ Rectangle aScreenRect( GetMap()->CoreToPixel( aTmpRect.SVRect() ));
+ SwRect aFrmLogBounds( GetBounds( *(GetMap()) ) ); // twip rel to doc root
+
+ Point aFrmPixPos( GetMap()->CoreToPixel( aFrmLogBounds.SVRect() ).TopLeft() );
+ aScreenRect.Move( -aFrmPixPos.X(), -aFrmPixPos.Y() );
+
+ tabs[0].Position = aScreenRect.GetWidth();
+ }
+
+ return tabs;
+}
+
+struct IndexCompare
+{
+ const PropertyValue* pValues;
+ IndexCompare( const PropertyValue* pVals ) : pValues(pVals) {}
+ bool operator() ( const sal_Int32& a, const sal_Int32& b ) const
+ {
+ return (pValues[a].Name < pValues[b].Name) ? true : false;
+ }
+};
+//-----IAccessibility2 Implementation 2009
+
+String SwAccessibleParagraph::GetFieldTypeNameAtIndex(sal_Int32 nIndex)
+{
+ String strTypeName;
+ SwFldMgr aMgr;
+ SwTxtFld* pTxtFld = NULL;
+ SwTxtNode* pTxtNd = const_cast<SwTxtNode*>( GetTxtNode() );
+ SwIndex fldIndex( pTxtNd, nIndex );
+ sal_Int32 nFldIndex = GetPortionData().GetFieldIndex(nIndex);
+ if (nFldIndex >= 0)
+ {
+ const SwpHints* pSwpHints = GetTxtNode()->GetpSwpHints();
+ if (pSwpHints)
+ {
+ const sal_uInt16 nSize = pSwpHints ? pSwpHints->Count() : 0;
+ for( sal_uInt16 i = 0; i < nSize; ++i )
+ {
+ const SwTxtAttr* pHt = (*pSwpHints)[i];
+ if (pHt->Which() == RES_TXTATR_FIELD && (nFldIndex-- == 0))
+ {
+ pTxtFld = (SwTxtFld *)pHt;
+ break;
+ }
+ else if (pHt->Which() == RES_TXTATR_REFMARK && (nFldIndex-- == 0))
+ strTypeName = String(OUString(RTL_CONSTASCII_USTRINGPARAM("set reference")));
+ }
+ }
+ }
+ if (pTxtFld)
+ {
+ const SwField* pField = (pTxtFld->GetFmtFld()).GetField();
+ if (pField)
+ {
+ strTypeName = pField->GetTyp()->GetTypeStr(pField->GetTypeId());
+ sal_uInt16 nWhich = pField->GetTyp()->Which();
+ rtl::OUString sEntry;
+ sal_Int32 subType = 0;
+ switch (nWhich)
+ {
+ case RES_DOCSTATFLD:
+ subType = ((SwDocStatField*)pField)->GetSubType();
+ break;
+ case RES_GETREFFLD:
+ {
+ sal_uInt16 nSub = pField->GetSubType();
+ switch( nSub )
+ {
+ case REF_BOOKMARK:
+ {
+ const SwGetRefField* pRefFld = dynamic_cast<const SwGetRefField*>(pField);
+ if ( pRefFld && pRefFld->IsRefToHeadingCrossRefBookmark() )
+ sEntry = OUString(RTL_CONSTASCII_USTRINGPARAM("Headings"));
+ else if ( pRefFld && pRefFld->IsRefToNumItemCrossRefBookmark() )
+ sEntry = OUString(RTL_CONSTASCII_USTRINGPARAM("Numbered Paragraphs"));
+ else
+ sEntry = OUString(RTL_CONSTASCII_USTRINGPARAM("Bookmarks"));
+ }
+ break;
+ case REF_FOOTNOTE:
+ sEntry = OUString(RTL_CONSTASCII_USTRINGPARAM("Footnotes"));
+ break;
+ case REF_ENDNOTE:
+ sEntry = OUString(RTL_CONSTASCII_USTRINGPARAM("Endnotes"));
+ break;
+ case REF_SETREFATTR:
+ sEntry = OUString(RTL_CONSTASCII_USTRINGPARAM("Insert Reference"));
+ break;
+ case REF_SEQUENCEFLD:
+ sEntry = ((SwGetRefField*)pField)->GetSetRefName();
+ break;
+ }
+ //Get format string
+ strTypeName = sEntry;
+ // <pField->GetFormat() >= 0> is always true as <pField->GetFormat()> is unsigned
+// if (pField->GetFormat() >= 0)
+ {
+ sEntry = aMgr.GetFormatStr( pField->GetTypeId(), pField->GetFormat() );
+ if (sEntry.getLength() > 0)
+ {
+ strTypeName.AppendAscii("-");
+ strTypeName += String(sEntry);
+ }
+ }
+ }
+ break;
+ case RES_DATETIMEFLD:
+ subType = ((SwDateTimeField*)pField)->GetSubType();
+ break;
+ case RES_JUMPEDITFLD:
+ {
+ sal_uInt16 nFormat= pField->GetFormat();
+ sal_uInt16 nSize = aMgr.GetFormatCount(pField->GetTypeId(), sal_False);
+ if (nFormat < nSize)
+ {
+ sEntry = aMgr.GetFormatStr(pField->GetTypeId(), nFormat);
+ if (sEntry.getLength() > 0)
+ {
+ strTypeName.AppendAscii("-");
+ strTypeName += String(sEntry);
+ }
+ }
+ }
+ break;
+ case RES_EXTUSERFLD:
+ subType = ((SwExtUserField*)pField)->GetSubType();
+ break;
+ case RES_HIDDENTXTFLD:
+ case RES_SETEXPFLD:
+ {
+ sEntry = pField->GetTyp()->GetName();
+ if (sEntry.getLength() > 0)
+ {
+ strTypeName.AppendAscii("-");
+ strTypeName += String(sEntry);
+ }
+ }
+ break;
+ case RES_DOCINFOFLD:
+ subType = pField->GetSubType();
+ subType &= 0x00ff;
+ break;
+ case RES_REFPAGESETFLD:
+ {
+ SwRefPageSetField* pRPld = (SwRefPageSetField*)pField;
+ sal_Bool bOn = pRPld->IsOn();
+ strTypeName.AppendAscii("-");
+ if (bOn)
+ strTypeName += String(OUString(RTL_CONSTASCII_USTRINGPARAM("on")));
+ else
+ strTypeName += String(OUString(RTL_CONSTASCII_USTRINGPARAM("off")));
+ }
+ break;
+ case RES_AUTHORFLD:
+ {
+ strTypeName.AppendAscii("-");
+ strTypeName += aMgr.GetFormatStr(pField->GetTypeId(), pField->GetFormat() & 0xff);
+ }
+ break;
+ }
+ if (subType > 0 || (subType == 0 && (nWhich == RES_DOCINFOFLD || nWhich == RES_EXTUSERFLD || nWhich == RES_DOCSTATFLD)))
+ {
+ SvStringsDtor aLst;
+ aMgr.GetSubTypes(pField->GetTypeId(), aLst);
+ if (subType < aLst.Count())
+ sEntry = *aLst[subType];
+ if (sEntry.getLength() > 0)
+ {
+ if (nWhich == RES_DOCINFOFLD)
+ {
+ strTypeName = String(sEntry);
+ sal_uInt32 nSize = aMgr.GetFormatCount(pField->GetTypeId(), sal_False);
+ sal_uInt16 nExSub = pField->GetSubType() & 0xff00;
+ if (nSize > 0 && nExSub > 0)
+ {
+ //Get extra subtype string
+ strTypeName.AppendAscii("-");
+ sEntry = aMgr.GetFormatStr(pField->GetTypeId(), nExSub/0x0100-1);
+ strTypeName += String(sEntry);
+ }
+ }
+ else
+ {
+ strTypeName.AppendAscii("-");
+ strTypeName += String(sEntry);
+ }
+ }
+ }
+ }
+ }
+ return strTypeName;
+}
// --> OD 2006-07-20 #i63870#
// re-implement method on behalf of methods <_getDefaultAttributesImpl(..)> and
// <_getRunAttributesImpl(..)>
@@ -1220,16 +1853,24 @@ uno::Sequence<PropertyValue> SwAccessibleParagraph::getCharacterAttributes(
const ::rtl::OUString& rText = GetString();
- if( ! IsValidChar( nIndex, rText.getLength() ) )
+ if( ! IsValidChar( nIndex, rText.getLength()+1 ) )//IAccessibility2 Implementation 2009
throw lang::IndexOutOfBoundsException();
+ //IAccessibility2 Implementation 2009-----
+ bool bSupplementalMode = false;
+ uno::Sequence< ::rtl::OUString > aNames = aRequestedAttributes;
+ if (aNames.getLength() == 0)
+ {
+ bSupplementalMode = true;
+ aNames = getAttributeNames();
+ }
// retrieve default character attributes
tAccParaPropValMap aDefAttrSeq;
- _getDefaultAttributesImpl( aRequestedAttributes, aDefAttrSeq, true );
+ _getDefaultAttributesImpl( aNames, aDefAttrSeq, true );
// retrieved run character attributes
tAccParaPropValMap aRunAttrSeq;
- _getRunAttributesImpl( nIndex, aRequestedAttributes, aRunAttrSeq );
+ _getRunAttributesImpl( nIndex, aNames, aRunAttrSeq );
// merge default and run attributes
uno::Sequence< PropertyValue > aValues( aDefAttrSeq.size() );
@@ -1251,6 +1892,70 @@ uno::Sequence<PropertyValue> SwAccessibleParagraph::getCharacterAttributes(
}
++i;
}
+ if( bSupplementalMode )
+ {
+ uno::Sequence< ::rtl::OUString > aSupplementalNames = aRequestedAttributes;
+ if (aSupplementalNames.getLength() == 0)
+ aSupplementalNames = getSupplementalAttributeNames();
+
+ tAccParaPropValMap aSupplementalAttrSeq;
+ _getSupplementalAttributesImpl( nIndex, aSupplementalNames, aSupplementalAttrSeq );
+
+ aValues.realloc( aValues.getLength() + aSupplementalAttrSeq.size() );
+ pValues = aValues.getArray();
+
+ for ( tAccParaPropValMap::const_iterator aSupplementalIter = aSupplementalAttrSeq.begin();
+ aSupplementalIter != aSupplementalAttrSeq.end();
+ ++aSupplementalIter )
+ {
+ pValues[i] = aSupplementalIter->second;
+ ++i;
+ }
+
+ _correctValues( nIndex, aValues );
+
+ aValues.realloc( aValues.getLength() + 1 );
+
+ pValues = aValues.getArray();
+
+ const SwTxtNode* pTxtNode( GetTxtNode() );
+ PropertyValue& rValue = pValues[aValues.getLength() - 1 ];
+ rValue.Name = OUString::createFromAscii("NumberingPrefix");
+ OUString sNumBullet = pTxtNode->GetNumString();
+ rValue.Value <<= sNumBullet;
+ rValue.Handle = -1;
+ rValue.State = PropertyState_DIRECT_VALUE;
+
+ String strTypeName = GetFieldTypeNameAtIndex(nIndex);
+ if (strTypeName.Len() > 0)
+ {
+ aValues.realloc( aValues.getLength() + 1 );
+ pValues = aValues.getArray();
+ rValue = pValues[aValues.getLength() - 1];
+ rValue.Name = OUString::createFromAscii("FieldType");
+ rValue.Value <<= rtl::OUString(strTypeName.ToLowerAscii());
+ rValue.Handle = -1;
+ rValue.State = PropertyState_DIRECT_VALUE;
+ }
+
+ //sort property values
+ // build sorted index array
+ sal_Int32 nLength = aValues.getLength();
+ const PropertyValue* pPairs = aValues.getConstArray();
+ sal_Int32* pIndices = new sal_Int32[nLength];
+ for( i = 0; i < nLength; i++ )
+ pIndices[i] = i;
+ sort( &pIndices[0], &pIndices[nLength], IndexCompare(pPairs) );
+ // create sorted sequences accoring to index array
+ uno::Sequence<PropertyValue> aNewValues( nLength );
+ PropertyValue* pNewValues = aNewValues.getArray();
+ for( i = 0; i < nLength; i++ )
+ {
+ pNewValues[i] = pPairs[pIndices[i]];
+ }
+ delete[] pIndices;
+ return aNewValues;
+ }
// // create a (dummy) text portion for the sole purpose of calling
// // getPropertyValues on it
@@ -1669,6 +2374,308 @@ uno::Sequence< PropertyValue > SwAccessibleParagraph::getRunAttributes(
return aValues;
}
// <--
+// IAccessibility2 Implementation 2009----
+void SwAccessibleParagraph::_getSupplementalAttributesImpl(
+ const sal_Int32,
+ const uno::Sequence< ::rtl::OUString >& aRequestedAttributes,
+ tAccParaPropValMap& rSupplementalAttrSeq )
+{
+ const SwTxtNode* pTxtNode( GetTxtNode() );
+ ::boost::scoped_ptr<SfxItemSet> pSet;
+ pSet.reset( new SfxItemSet( const_cast<SwAttrPool&>(pTxtNode->GetDoc()->GetAttrPool()),
+ RES_PARATR_ADJUST, RES_PARATR_ADJUST,
+ RES_PARATR_TABSTOP, RES_PARATR_TABSTOP,
+ RES_PARATR_LINESPACING, RES_PARATR_LINESPACING,
+ RES_UL_SPACE, RES_UL_SPACE,
+ RES_LR_SPACE, RES_LR_SPACE,
+ RES_PARATR_NUMRULE, RES_PARATR_NUMRULE,
+ RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END-1,
+ 0 ) );
+
+ if ( pTxtNode->HasBullet() || pTxtNode->HasNumber() )
+ {
+ pSet->Put( pTxtNode->GetAttr(RES_PARATR_LIST_LEVEL, RES_PARATR_LIST_LEVEL) );
+ }
+ pSet->Put( pTxtNode->SwCntntNode::GetAttr(RES_UL_SPACE) );
+ pSet->Put( pTxtNode->SwCntntNode::GetAttr(RES_LR_SPACE) );
+ pSet->Put( pTxtNode->SwCntntNode::GetAttr(RES_PARATR_ADJUST) );
+
+ tAccParaPropValMap aSupplementalAttrSeq;
+ {
+// const SfxItemPropertySet& rPropSet =
+// aSwMapProvider.GetPropertyMap( PROPERTY_MAP_ACCESSIBILITY_TEXT_ATTRIBUTE );
+// const SfxItemPropertyMap* pPropMap( rPropSet.getPropertyMap() );
+ const SfxItemPropertyMapEntry* pPropMap(
+ aSwMapProvider.GetPropertyMapEntries( PROPERTY_MAP_ACCESSIBILITY_TEXT_ATTRIBUTE ) );
+ while ( pPropMap->pName )
+ {
+ const SfxPoolItem* pItem = pSet->GetItem( pPropMap->nWID );
+ if ( pItem )
+ {
+ uno::Any aVal;
+ pItem->QueryValue( aVal, pPropMap->nMemberId );
+
+ PropertyValue rPropVal;
+ rPropVal.Name = OUString::createFromAscii( pPropMap->pName );
+ rPropVal.Value = aVal;
+ rPropVal.Handle = -1;
+ rPropVal.State = beans::PropertyState_DEFAULT_VALUE;
+
+ aSupplementalAttrSeq[rPropVal.Name] = rPropVal;
+ }
+
+ ++pPropMap;
+ }
+ }
+
+ const OUString* pSupplementalAttrs = aRequestedAttributes.getConstArray();
+ const sal_Int32 nSupplementalLength = aRequestedAttributes.getLength();
+
+ for( sal_Int32 index = 0; index < nSupplementalLength; ++index )
+ {
+ tAccParaPropValMap::const_iterator const aIter = aSupplementalAttrSeq.find( pSupplementalAttrs[index] );
+ if ( aIter != aSupplementalAttrSeq.end() )
+ {
+ rSupplementalAttrSeq[ aIter->first ] = aIter->second;
+ }
+ }
+}
+
+void SwAccessibleParagraph::_correctValues( const sal_Int32 nIndex,
+ uno::Sequence< PropertyValue >& rValues)
+{
+ PropertyValue ChangeAttr, ChangeAttrColor;
+
+ const SwRedline* pRedline = GetRedlineAtIndex( nIndex );
+ if ( pRedline )
+ {
+
+ const SwModuleOptions *pOpt = SW_MOD()->GetModuleConfig();
+ AuthorCharAttr aChangeAttr;
+ if ( pOpt )
+ {
+ switch( pRedline->GetType())
+ {
+ case nsRedlineType_t::REDLINE_INSERT:
+ aChangeAttr = pOpt->GetInsertAuthorAttr();
+ break;
+ case nsRedlineType_t::REDLINE_DELETE:
+ aChangeAttr = pOpt->GetDeletedAuthorAttr();
+ break;
+ case nsRedlineType_t::REDLINE_FORMAT:
+ aChangeAttr = pOpt->GetFormatAuthorAttr();
+ break;
+ }
+ }
+ switch( aChangeAttr.nItemId )
+ {
+ case SID_ATTR_CHAR_WEIGHT:
+ ChangeAttr.Name = OUString::createFromAscii( GetPropName( UNO_NAME_CHAR_WEIGHT).pName );
+ ChangeAttr.Value <<= awt::FontWeight::BOLD;
+ break;
+ case SID_ATTR_CHAR_POSTURE:
+ ChangeAttr.Name = OUString::createFromAscii( GetPropName( UNO_NAME_CHAR_POSTURE).pName );
+ ChangeAttr.Value <<= awt::FontSlant_ITALIC; //char posture
+ break;
+ case SID_ATTR_CHAR_STRIKEOUT:
+ ChangeAttr.Name = OUString::createFromAscii( GetPropName( UNO_NAME_CHAR_STRIKEOUT).pName );
+ ChangeAttr.Value <<= awt::FontStrikeout::SINGLE; //char strikeout
+ break;
+ case SID_ATTR_CHAR_UNDERLINE:
+ ChangeAttr.Name = OUString::createFromAscii( GetPropName( UNO_NAME_CHAR_UNDERLINE).pName );
+ ChangeAttr.Value <<= aChangeAttr.nAttr; //underline line
+ break;
+ }
+ if( aChangeAttr.nColor != COL_NONE )
+ {
+ if( aChangeAttr.nItemId == SID_ATTR_BRUSH )
+ {
+ ChangeAttrColor.Name = OUString::createFromAscii( GetPropName( UNO_NAME_CHAR_BACK_COLOR).pName );
+ if( aChangeAttr.nColor == COL_TRANSPARENT )//char backcolor
+ ChangeAttrColor.Value <<= COL_BLUE;
+ else
+ ChangeAttrColor.Value <<= aChangeAttr.nColor;
+ }
+ else
+ {
+ ChangeAttrColor.Name = OUString::createFromAscii( GetPropName( UNO_NAME_CHAR_COLOR ).pName );
+ if( aChangeAttr.nColor == COL_TRANSPARENT )//char color
+ ChangeAttrColor.Value <<= COL_BLUE;
+ else
+ ChangeAttrColor.Value <<= aChangeAttr.nColor;
+ }
+ }
+ }
+
+ PropertyValue* pValues = rValues.getArray();
+
+ const SwTxtNode* pTxtNode( GetTxtNode() );
+
+ sal_Int32 nValues = rValues.getLength();
+ for (sal_Int32 i = 0; i < nValues; ++i)
+ {
+ PropertyValue& rValue = pValues[i];
+
+ if (rValue.Name.compareTo( ChangeAttr.Name )==0)
+ {
+ rValue.Value = ChangeAttr.Value;
+ continue;
+ }
+
+ if (rValue.Name.compareTo( ChangeAttrColor.Name )==0)
+ {
+ rValue.Value = ChangeAttr.Value;
+ continue;
+ }
+
+ //back color
+ if (rValue.Name.compareTo(::rtl::OUString::createFromAscii( GetPropName( UNO_NAME_CHAR_BACK_COLOR ).pName ) )==0)
+ {
+ uno::Any &anyChar = rValue.Value;
+ sal_uInt32 crBack = static_cast<sal_uInt32>( reinterpret_cast<sal_uIntPtr>(anyChar.pReserved));
+ if (COL_AUTO == crBack)
+ {
+ uno::Reference<XAccessibleComponent> xComponent(this);
+ if (xComponent.is())
+ {
+ crBack = (sal_uInt32)xComponent->getBackground();
+ }
+ rValue.Value <<= crBack;
+ }
+ continue;
+ }
+
+ //char color
+ if (rValue.Name.compareTo(::rtl::OUString::createFromAscii( GetPropName( UNO_NAME_CHAR_COLOR ).pName ) )==0)
+ {
+ if( GetPortionData().IsInGrayPortion( nIndex ) )
+ rValue.Value <<= SwViewOption::GetFieldShadingsColor().GetColor();
+ uno::Any &anyChar = rValue.Value;
+ sal_uInt32 crChar = static_cast<sal_uInt32>( reinterpret_cast<sal_uIntPtr>(anyChar.pReserved));
+
+ if( COL_AUTO == crChar )
+ {
+ uno::Reference<XAccessibleComponent> xComponent(this);
+ if (xComponent.is())
+ {
+ Color cr(xComponent->getBackground());
+ crChar = cr.IsDark() ? COL_WHITE : COL_BLACK;
+ rValue.Value <<= crChar;
+ }
+ }
+ continue;
+ }
+
+ // UnderLine
+ if (rValue.Name.compareTo(::rtl::OUString::createFromAscii( GetPropName( UNO_NAME_CHAR_UNDERLINE ).pName ) )==0)
+ {
+ //misspelled word
+ SwCrsrShell* pCrsrShell = GetCrsrShell();
+ if( pCrsrShell != NULL && pCrsrShell->GetViewOptions() && pCrsrShell->GetViewOptions()->IsOnlineSpell())
+ {
+ const SwWrongList* pWrongList = pTxtNode->GetWrong();
+ if( NULL != pWrongList )
+ {
+ xub_StrLen nBegin = nIndex;
+ xub_StrLen nLen = 1;
+ if( pWrongList->InWrongWord(nBegin,nLen) && !pTxtNode->IsSymbol(nBegin) )
+ {
+ rValue.Value <<= (sal_uInt16)UNDERLINE_WAVE;
+ }
+ }
+ }
+ continue;
+ }
+
+ // UnderLineColor
+ if (rValue.Name.compareTo(::rtl::OUString::createFromAscii( GetPropName( UNO_NAME_CHAR_UNDERLINE_COLOR ).pName ) )==0)
+ {
+ //misspelled word
+ SwCrsrShell* pCrsrShell = GetCrsrShell();
+ if( pCrsrShell != NULL && pCrsrShell->GetViewOptions() && pCrsrShell->GetViewOptions()->IsOnlineSpell())
+ {
+ const SwWrongList* pWrongList = pTxtNode->GetWrong();
+ if( NULL != pWrongList )
+ {
+ xub_StrLen nBegin = nIndex;
+ xub_StrLen nLen = 1;
+ if( pWrongList->InWrongWord(nBegin,nLen) && !pTxtNode->IsSymbol(nBegin) )
+ {
+ rValue.Value <<= (sal_Int32)0x00ff0000;
+ continue;
+ }
+ }
+ }
+
+ uno::Any &anyChar = rValue.Value;
+ sal_uInt32 crUnderline = static_cast<sal_uInt32>( reinterpret_cast<sal_uIntPtr>(anyChar.pReserved));
+ if ( COL_AUTO == crUnderline )
+ {
+ uno::Reference<XAccessibleComponent> xComponent(this);
+ if (xComponent.is())
+ {
+ Color cr(xComponent->getBackground());
+ crUnderline = cr.IsDark() ? COL_WHITE : COL_BLACK;
+ rValue.Value <<= crUnderline;
+ }
+ }
+
+ continue;
+ }
+
+ //tab stop
+ if (rValue.Name.compareTo(::rtl::OUString::createFromAscii( GetPropName( UNO_NAME_TABSTOPS ).pName ) )==0)
+ {
+ com::sun::star::uno::Sequence< ::com::sun::star::style::TabStop > tabs = GetCurrentTabStop( nIndex );
+ if( !tabs.hasElements() )
+ {
+ tabs.realloc(1);
+ ::com::sun::star::style::TabStop ts;
+ com::sun::star::awt::Rectangle rc0 = getCharacterBounds(0);
+ com::sun::star::awt::Rectangle rc1 = getCharacterBounds(nIndex);
+ if( rc1.X - rc0.X >= 48 )
+ ts.Position = (rc1.X - rc0.X) - (rc1.X - rc0.X - 48)% 47 + 47;
+ else
+ ts.Position = 48;
+ ts.DecimalChar = ' ';
+ ts.FillChar = ' ';
+ ts.Alignment = ::com::sun::star::style::TabAlign_LEFT;
+ tabs[0] = ts;
+ }
+ rValue.Value <<= tabs;
+ continue;
+ }
+
+ //number bullet
+ if (rValue.Name.compareTo(::rtl::OUString::createFromAscii( GetPropName( UNO_NAME_NUMBERING_RULES ).pName ) )==0)
+ {
+ if ( pTxtNode->HasBullet() || pTxtNode->HasNumber() )
+ {
+ uno::Any aVal;
+ SwNumRule* pNumRule = pTxtNode->GetNumRule();
+ if (pNumRule)
+ {
+ uno::Reference< container::XIndexReplace > xNum = new SwXNumberingRules(*pNumRule);
+ aVal.setValue(&xNum, ::getCppuType((const uno::Reference< container::XIndexReplace >*)0));
+ }
+ rValue.Value <<= aVal;
+ }
+ continue;
+ }
+
+ //footnote & endnote
+ if (rValue.Name.compareTo(::rtl::OUString::createFromAscii( GetPropName( UNO_NAME_CHAR_ESCAPEMENT ).pName ) )==0)
+ {
+ if ( GetPortionData().IsIndexInFootnode(nIndex) )
+ {
+ const OUString sEscapmentName = OUString::createFromAscii( GetPropName( UNO_NAME_CHAR_ESCAPEMENT ).pName );
+ rValue.Value <<= (sal_Int32)101;
+ }
+ continue;
+ }
+ }
+}
+//-----IAccessibility2 Implementation 2009
awt::Rectangle SwAccessibleParagraph::getCharacterBounds(
sal_Int32 nIndex )
@@ -1971,6 +2978,12 @@ sal_Bool SwAccessibleParagraph::setSelection( sal_Int32 nStartIndex, sal_Int32 n
/*accessibility::*/TextSegment aResult;
aResult.SegmentStart = -1;
aResult.SegmentEnd = -1;
+ //IAccessibility2 Implementation 2009-----
+ //If nIndex = 0, then nobefore text so return -1 directly.
+ if( nIndex == 0 )
+ return aResult;
+ //Tab will be return when call WORDTYPE
+ //-----IAccessibility2 Implementation 2009
// get starting pos
i18n::Boundary aBound;
@@ -1985,22 +2998,47 @@ sal_Bool SwAccessibleParagraph::setSelection( sal_Int32 nStartIndex, sal_Int32 n
}
// now skip to previous word
- sal_Bool bWord = sal_False;
- while( !bWord )
+ //IAccessibility2 Implementation 2009-----
+ if (nTextType==2 || nTextType == 3)
{
- nIndex = min( nIndex, aBound.startPos ) - 1;
- if( nIndex >= 0 )
- bWord = GetTextBoundary( aBound, rText, nIndex, nTextType );
- else
- break; // exit if beginning of string is reached
+ i18n::Boundary preBound = aBound;
+ while(preBound.startPos==aBound.startPos && nIndex > 0)
+ {
+ nIndex = min( nIndex, preBound.startPos ) - 1;
+ if( nIndex < 0 ) break;
+ GetTextBoundary( preBound, rText, nIndex, nTextType );
+ }
+ //if (nIndex>0)
+ if (nIndex>=0)
+ //Tab will be return when call WORDTYPE
+ {
+ aResult.SegmentText = rText.copy( preBound.startPos, preBound.endPos - preBound.startPos );
+ aResult.SegmentStart = preBound.startPos;
+ aResult.SegmentEnd = preBound.endPos;
+ }
}
-
- if ( bWord )
+ else
{
- aResult.SegmentText = rText.copy( aBound.startPos, aBound.endPos - aBound.startPos );
- aResult.SegmentStart = aBound.startPos;
- aResult.SegmentEnd = aBound.endPos;
- };
+ sal_Bool bWord = sal_False;
+ while( !bWord )
+ {
+ nIndex = min( nIndex, aBound.startPos ) - 1;
+ if( nIndex >= 0 )
+ {
+ bWord = GetTextBoundary( aBound, rText, nIndex, nTextType );
+ }
+ else
+ break; // exit if beginning of string is reached
+ }
+
+ if (bWord && nIndex<rText.getLength())
+ {
+ aResult.SegmentText = rText.copy( aBound.startPos, aBound.endPos - aBound.startPos );
+ aResult.SegmentStart = aBound.startPos;
+ aResult.SegmentEnd = aBound.endPos;
+ }
+ }
+ //-----IAccessibility2 Implementation 2009
return aResult;
}
@@ -2041,6 +3079,66 @@ sal_Bool SwAccessibleParagraph::setSelection( sal_Int32 nStartIndex, sal_Int32 n
aResult.SegmentStart = aBound.startPos;
aResult.SegmentEnd = aBound.endPos;
}
+
+/*
+ //IAccessibility2 Implementation 2009-----
+ sal_Bool bWord = sal_False;
+ bWord = GetTextBoundary( aBound, rText, nIndex, nTextType );
+
+ if (nTextType==2)
+ {
+ Boundary nexBound=aBound;
+
+ // real current word
+ if( nIndex <= aBound.endPos && nIndex >= aBound.startPos )
+ {
+ while(nexBound.endPos==aBound.endPos&&nIndex<rText.getLength())
+ {
+ // nIndex = max( (sal_Int32)(nIndex), nexBound.endPos) + 1;
+ nIndex = max( (sal_Int32)(nIndex), nexBound.endPos) ;
+ const sal_Unicode* pStr = rText.getStr();
+ if (pStr)
+ {
+ if( pStr[nIndex] == sal_Unicode(' ') )
+ nIndex++;
+ }
+ if( nIndex < rText.getLength() )
+ {
+ bWord = GetTextBoundary( nexBound, rText, nIndex, nTextType );
+ }
+ }
+ }
+
+ if (bWord && nIndex<rText.getLength())
+ {
+ aResult.SegmentText = rText.copy( nexBound.startPos, nexBound.endPos - nexBound.startPos );
+ aResult.SegmentStart = nexBound.startPos;
+ aResult.SegmentEnd = nexBound.endPos;
+ }
+
+ }
+ else
+ {
+ bWord = sal_False;
+ while( !bWord )
+ {
+ nIndex = max( (sal_Int32)(nIndex+1), aBound.endPos );
+ if( nIndex < rText.getLength() )
+ {
+ bWord = GetTextBoundary( aBound, rText, nIndex, nTextType );
+ }
+ else
+ break; // exit if end of string is reached
+ }
+ if (bWord && nIndex<rText.getLength())
+ {
+ aResult.SegmentText = rText.copy( aBound.startPos, aBound.endPos - aBound.startPos );
+ aResult.SegmentStart = aBound.startPos;
+ aResult.SegmentEnd = aBound.endPos;
+ }
+ }
+ //-----IAccessibility2 Implementation 2009
+*/
return aResult;
}
@@ -2153,16 +3251,6 @@ sal_Bool SwAccessibleParagraph::replaceText(
throw lang::IndexOutOfBoundsException();
}
-struct IndexCompare
-{
- const PropertyValue* pValues;
- IndexCompare( const PropertyValue* pVals ) : pValues(pVals) {}
- bool operator() ( const sal_Int32& a, const sal_Int32& b ) const
- {
- return (pValues[a].Name < pValues[b].Name) ? true : false;
- }
-};
-
sal_Bool SwAccessibleParagraph::setAttributes(
sal_Int32 nStartIndex,
@@ -2368,6 +3456,16 @@ sal_Int32 SAL_CALL SwAccessibleParagraph::getHyperLinkCount()
nCount++;
}
+ //IAccessibility2 Implementation 2009-----
+ /* Can't fin the function "GetTOCFirstWordEndIndex" declaration in sym2.0 (Added by yanjun)
+ if( GetTOXSortTabBase() )
+ {
+ SwTxtNode* pNode = const_cast<SwTxtNode*>(GetTxtNode());
+ if(pNode && pNode->GetTOCFirstWordEndIndex() > 0)
+ nCount++;
+ }
+ */
+ //-----IAccessibility2 Implementation 2009
return nCount;
}
@@ -2382,8 +3480,163 @@ uno::Reference< XAccessibleHyperlink > SAL_CALL
// --> OD 2007-06-27 #i77108# - provide hyperlinks also in editable documents.
// if( !IsEditableState() )
- // <--
+ const SwTxtFrm *pTxtFrm = static_cast<const SwTxtFrm*>( GetFrm() );
+ SwHyperlinkIter_Impl aHIter( pTxtFrm );
+ //SwAccessibleAutoRecognizerHelper_Impl aARHelper( pTxtFrm );
+ sal_Int32 nARCount = 0;
+ sal_Int32 nARIndex = 0;
+ sal_Int32 nTIndex = -1;
+ sal_Int32 nTOCEndIndex = -1;
+ SwTxtNode* pNode = NULL;
+ SwTOXSortTabBase* pTBase = GetTOXSortTabBase();
+ if( pTBase )
+ {
+ pNode = const_cast<SwTxtNode*>(GetTxtNode());
+ }
+ nTOCEndIndex = -1;
+ //if(pNode)
+ // nTOCEndIndex = pNode->GetTOCFirstWordEndIndex();
+ SwTxtAttr* pHt = (SwTxtAttr*)(aHIter.next());
+ while( (nLinkIndex < getHyperLinkCount()) && nTIndex < nLinkIndex)
{
+ // no candidates, exit
+ //if( (!pHt) && (nARIndex >= nARCount) && nTOCEndIndex <= 0)
+ // break;
+
+ sal_Int32 nHStt = -1;
+ sal_Int32 nAStt = -1;
+ sal_Bool bH = sal_False;
+ sal_Bool bA = sal_False;
+
+
+ if( pHt )
+ nHStt = *pHt->GetStart();
+ if( nARIndex < nARCount )
+ {
+ /*
+ sal_Int32 nAEnd;
+ aARHelper.getPosition( nARIndex, nAStt, nAEnd );
+ */
+ }
+ sal_Bool bTOC = sal_False;
+ // Inside TOC & get the first link
+ if( pTBase && nTIndex == -1 )
+ {
+ nTIndex++;
+ bTOC = sal_True;
+ }
+ else
+ {
+ if( nHStt >=0 && nAStt >=0 )
+ { // both hyperlink and smart tag available
+ nTIndex++;
+ if( nHStt <= nAStt )
+ bH = sal_True;
+ else
+ bA = sal_True;
+ }
+ else if( nHStt >= 0 )
+ { // only hyperlink available
+ nTIndex++;
+ bH = sal_True;
+ }
+ else if( nAStt >= 0 )
+ { // only smart tag available
+ nTIndex++;
+ bA = sal_True;
+ }
+ }
+
+ if( nTIndex == nLinkIndex )
+ { // found
+ if( bH )
+ { // it's a hyperlink
+ if( pHt )
+ {
+// const SwField* pFFld = pHt->GetFld().GetFld();
+ {
+ if( !pHyperTextData )
+ pHyperTextData = new SwAccessibleHyperTextData;
+ SwAccessibleHyperTextData::iterator aIter =
+ pHyperTextData ->find( pHt );
+ if( aIter != pHyperTextData->end() )
+ {
+ xRet = (*aIter).second;
+ }
+ if( !xRet.is() )
+ {
+ {
+ const sal_Int32 nTmpHStt= GetPortionData().GetAccessiblePosition(
+ max( aHIter.startIdx(), *pHt->GetStart() ) );
+ const sal_Int32 nTmpHEnd= GetPortionData().GetAccessiblePosition(
+ min( aHIter.endIdx(), *pHt->GetAnyEnd() ) );
+ xRet = new SwAccessibleHyperlink( aHIter.getCurrHintPos(),
+ this, nTmpHStt, nTmpHEnd );
+ }
+ if( aIter != pHyperTextData->end() )
+ {
+ (*aIter).second = xRet;
+ }
+ else
+ {
+ SwAccessibleHyperTextData::value_type aEntry( pHt, xRet );
+ pHyperTextData->insert( aEntry );
+ }
+ }
+ }
+ }
+ }
+ else if( bTOC )
+ {
+ //xRet = new SwAccessibleTOCLink( this );
+ }
+ else if( bA )
+ {
+ /*
+ // it's a smart tag
+ if( !pAutoRecognizerData )
+ pAutoRecognizerData = new SwAccessibleAutoRecognizerData;
+ SwAccessibleAutoRecognizerData::iterator aIter =
+ pAutoRecognizerData ->find( nARIndex );
+ if( aIter != pAutoRecognizerData->end() )
+ {
+ xRet = (*aIter).second;
+ }
+ if( !xRet.is() )
+ {
+ sal_Int32 nAStt = 0;
+ sal_Int32 nAEnd = 0;
+ //aARHelper.getPosition( nARIndex, nAStt, nAEnd );
+ xRet = new SwAccessibleAutoRecognizer( this, nAStt, nAEnd );
+ if( aIter != pAutoRecognizerData->end() )
+ {
+ (*aIter).second = xRet;
+ }
+ else
+ {
+ SwAccessibleAutoRecognizerData::value_type aEntry( nARIndex, xRet );
+ pAutoRecognizerData->insert( aEntry );
+ }
+ }
+ */
+ }
+ break;
+ }
+
+ // iterate next
+ if( bH )
+ // iterate next hyperlink
+ pHt = (SwTxtAttr*)(aHIter.next());
+ else if( bA )
+ // iterate next smart tag
+ nARIndex++;
+ else if(bTOC)
+ continue;
+ else
+ // no candidate, exit
+ break;
+ }
+ /*
const SwTxtFrm *pTxtFrm = static_cast<const SwTxtFrm*>( GetFrm() );
SwHyperlinkIter_Impl aHIter( pTxtFrm );
while( nLinkIndex-- )
@@ -2420,7 +3673,7 @@ uno::Reference< XAccessibleHyperlink > SAL_CALL
}
}
}
-
+ */
if( !xRet.is() )
throw lang::IndexOutOfBoundsException();
@@ -2459,10 +3712,23 @@ sal_Int32 SAL_CALL SwAccessibleParagraph::getHyperLinkIndex( sal_Int32 nCharInde
if( pHt )
nRet = nPos;
-
}
+ //IAccessibility2 Implementation 2009-----
+ /* Added by yanjun for acc miagration
+ if( nRet == -1 && GetTOXSortTabBase() )
+ {
+ SwTxtNode* pNode = const_cast<SwTxtNode*>(GetTxtNode());
+ if( nCharIndex >= 0 && nCharIndex < pNode->GetTOCFirstWordEndIndex())
+ nRet = 0;
+ }
+ */
- return nRet;
+ if (nRet == -1)
+ throw lang::IndexOutOfBoundsException();
+ else
+ return nRet;
+ //return nRet;
+ //-----IAccessibility2 Implementation 2009
}
// --> OD 2008-05-26 #i71360#
@@ -2491,6 +3757,203 @@ sal_Int32 SAL_CALL SwAccessibleParagraph::getTextMarkupCount( sal_Int32 nTextMar
return pTextMarkupHelper->getTextMarkupCount( nTextMarkupType );
}
+//IAccessibility2 Implementation 2009-----
+//MSAA Extension Implementation in app module
+sal_Bool SAL_CALL SwAccessibleParagraph::scrollToPosition( const ::com::sun::star::awt::Point&, sal_Bool )
+ throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
+{
+ return sal_False;
+}
+
+sal_Int32 SAL_CALL SwAccessibleParagraph::getSelectedPortionCount( )
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ sal_Int32 nSeleted = 0;
+ SwPaM* pCrsr = GetCursor( true );
+ if( pCrsr != NULL )
+ {
+ // get SwPosition for my node
+ const SwTxtNode* pNode = GetTxtNode();
+ sal_uLong nHere = pNode->GetIndex();
+
+ // iterate over ring
+ SwPaM* pRingStart = pCrsr;
+ do
+ {
+ // ignore, if no mark
+ if( pCrsr->HasMark() )
+ {
+ // check whether nHere is 'inside' pCrsr
+ SwPosition* pStart = pCrsr->Start();
+ sal_uLong nStartIndex = pStart->nNode.GetIndex();
+ SwPosition* pEnd = pCrsr->End();
+ sal_uLong nEndIndex = pEnd->nNode.GetIndex();
+ if( ( nHere >= nStartIndex ) &&
+ ( nHere <= nEndIndex ) )
+ {
+ nSeleted++;
+ }
+ // else: this PaM doesn't point to this paragraph
+ }
+ // else: this PaM is collapsed and doesn't select anything
+
+ // next PaM in ring
+ pCrsr = static_cast<SwPaM*>( pCrsr->GetNext() );
+ }
+ while( pCrsr != pRingStart );
+ }
+ return nSeleted;
+
+}
+
+sal_Int32 SAL_CALL SwAccessibleParagraph::getSeletedPositionStart( sal_Int32 nSelectedPortionIndex )
+ throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException)
+{
+ vos::OGuard aGuard(Application::GetSolarMutex());
+
+ CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
+
+ sal_Int32 nStart, nEnd;
+ /*sal_Bool bSelected = */GetSelectionAtIndex(nSelectedPortionIndex, nStart, nEnd );
+ return nStart;
+}
+
+sal_Int32 SAL_CALL SwAccessibleParagraph::getSeletedPositionEnd( sal_Int32 nSelectedPortionIndex )
+ throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException)
+{
+ vos::OGuard aGuard(Application::GetSolarMutex());
+
+ CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
+
+ sal_Int32 nStart, nEnd;
+ /*sal_Bool bSelected = */GetSelectionAtIndex(nSelectedPortionIndex, nStart, nEnd );
+ return nEnd;
+}
+
+sal_Bool SAL_CALL SwAccessibleParagraph::removeSelection( sal_Int32 selectionIndex )
+ throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException)
+{
+ if(selectionIndex < 0) return sal_False;
+
+ sal_Bool bRet = sal_False;
+ sal_Int32 nSelected = selectionIndex;
+
+ // get the selection, and test whether it affects our text node
+ SwPaM* pCrsr = GetCursor( true );
+// SwPaM* pFirst = pCrsr;
+ SwPaM* pPrev = pCrsr;
+
+ if( pCrsr != NULL )
+ {
+ // get SwPosition for my node
+ const SwTxtNode* pNode = GetTxtNode();
+ sal_uLong nHere = pNode->GetIndex();
+
+ // iterate over ring
+ SwPaM* pRingStart = pCrsr;
+ do
+ {
+ // ignore, if no mark
+ if( pCrsr->HasMark() )
+ {
+ // check whether nHere is 'inside' pCrsr
+ SwPosition* pStart = pCrsr->Start();
+ sal_uLong nStartIndex = pStart->nNode.GetIndex();
+ SwPosition* pEnd = pCrsr->End();
+ sal_uLong nEndIndex = pEnd->nNode.GetIndex();
+ if( ( nHere >= nStartIndex ) &&
+ ( nHere <= nEndIndex ) )
+ {
+ if( nSelected == 0 )
+ {
+ pCrsr->MoveTo((Ring*)0);
+ delete pCrsr;
+ bRet = sal_True;
+ }
+ else
+ {
+ nSelected--;
+ }
+ }
+ }
+ // else: this PaM is collapsed and doesn't select anything
+ pPrev = pCrsr;
+ pCrsr = static_cast<SwPaM*>( pCrsr->GetNext() );
+ }
+ while( !bRet && (pCrsr != pRingStart) );
+ }
+ return sal_True;
+}
+
+sal_Int32 SAL_CALL SwAccessibleParagraph::addSelection( sal_Int32, sal_Int32 startOffset, sal_Int32 endOffset)
+ throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException)
+{
+ vos::OGuard aGuard(Application::GetSolarMutex());
+
+ CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
+
+ // parameter checking
+ sal_Int32 nLength = GetString().getLength();
+ if ( ! IsValidRange( startOffset, endOffset, nLength ) )
+ {
+ throw lang::IndexOutOfBoundsException();
+ }
+
+ sal_Int32 nSelectedCount = getSelectedPortionCount();
+ for ( sal_Int32 i = nSelectedCount ; i >= 0 ; i--)
+ {
+ sal_Int32 nStart, nEnd;
+ sal_Bool bSelected = GetSelectionAtIndex(i, nStart, nEnd );
+ if(bSelected)
+ {
+ if(nStart <= nEnd )
+ {
+ if (( startOffset>=nStart && startOffset <=nEnd ) || //startOffset in a selection
+ ( endOffset>=nStart && endOffset <=nEnd ) || //endOffset in a selection
+ ( startOffset <= nStart && endOffset >=nEnd) || //start and end include the old selection
+ ( startOffset >= nStart && endOffset <=nEnd) )
+ {
+ removeSelection(i);
+ }
+
+ }
+ else
+ {
+ if (( startOffset>=nEnd && startOffset <=nStart ) || //startOffset in a selection
+ ( endOffset>=nEnd && endOffset <=nStart ) || //endOffset in a selection
+ ( startOffset <= nStart && endOffset >=nEnd) || //start and end include the old selection
+ ( startOffset >= nStart && endOffset <=nEnd) )
+
+ {
+ removeSelection(i);
+ }
+ }
+ }
+
+ }
+
+ sal_Bool bRet = sal_False;
+
+ // get cursor shell
+ SwCrsrShell* pCrsrShell = GetCrsrShell();
+ if( pCrsrShell != NULL )
+ {
+ // create pam for selection
+ pCrsrShell->StartAction();
+// SwTxtNode* pNode = const_cast<SwTxtNode*>( GetTxtNode() );
+ SwPaM* aPaM = pCrsrShell->CreateCrsr();
+ aPaM->SetMark();
+ aPaM->GetPoint()->nContent = GetPortionData().GetModelPosition(startOffset);
+ aPaM->GetMark()->nContent = GetPortionData().GetModelPosition(endOffset);
+ //pCrsrShell->ShowCrsr();
+ pCrsrShell->EndAction();
+ // set PaM at cursor shell
+ //bRet = Select( aPaM );
+ }
+
+ return bRet;
+}
+//-----IAccessibility2 Implementation 2009
/*accessibility::*/TextSegment SAL_CALL
SwAccessibleParagraph::getTextMarkup( sal_Int32 nTextMarkupIndex,
@@ -2672,3 +4135,267 @@ void SwAccessibleParagraph::Modify( const SfxPoolItem* pOld, const SfxPoolItem*
CheckRegistration( pOld, pNew );
}
// <--
+
+//IAccessibility2 Implementation 2009-----
+sal_Bool SwAccessibleParagraph::GetSelectionAtIndex(
+ sal_Int32& nIndex, sal_Int32& nStart, sal_Int32& nEnd)
+{
+ if(nIndex < 0) return sal_False;
+
+
+ sal_Bool bRet = sal_False;
+ nStart = -1;
+ nEnd = -1;
+ sal_Int32 nSelected = nIndex;
+
+ // get the selection, and test whether it affects our text node
+ SwPaM* pCrsr = GetCursor( true );
+ if( pCrsr != NULL )
+ {
+ // get SwPosition for my node
+ const SwTxtNode* pNode = GetTxtNode();
+ sal_uLong nHere = pNode->GetIndex();
+
+ // iterate over ring
+ SwPaM* pRingStart = pCrsr;
+ do
+ {
+ // ignore, if no mark
+ if( pCrsr->HasMark() )
+ {
+ // check whether nHere is 'inside' pCrsr
+ SwPosition* pStart = pCrsr->Start();
+ sal_uLong nStartIndex = pStart->nNode.GetIndex();
+ SwPosition* pEnd = pCrsr->End();
+ sal_uLong nEndIndex = pEnd->nNode.GetIndex();
+ if( ( nHere >= nStartIndex ) &&
+ ( nHere <= nEndIndex ) )
+ {
+ if( nSelected == 0 )
+ {
+ // translate start and end positions
+
+ // start position
+ sal_Int32 nLocalStart = -1;
+ if( nHere > nStartIndex )
+ {
+ // selection starts in previous node:
+ // then our local selection starts with the paragraph
+ nLocalStart = 0;
+ }
+ else
+ {
+ DBG_ASSERT( nHere == nStartIndex,
+ "miscalculated index" );
+
+ // selection starts in this node:
+ // then check whether it's before or inside our part of
+ // the paragraph, and if so, get the proper position
+ sal_uInt16 nCoreStart = pStart->nContent.GetIndex();
+ if( nCoreStart <
+ GetPortionData().GetFirstValidCorePosition() )
+ {
+ nLocalStart = 0;
+ }
+ else if( nCoreStart <=
+ GetPortionData().GetLastValidCorePosition() )
+ {
+ DBG_ASSERT(
+ GetPortionData().IsValidCorePosition(
+ nCoreStart ),
+ "problem determining valid core position" );
+
+ nLocalStart =
+ GetPortionData().GetAccessiblePosition(
+ nCoreStart );
+ }
+ }
+
+ // end position
+ sal_Int32 nLocalEnd = -1;
+ if( nHere < nEndIndex )
+ {
+ // selection ends in following node:
+ // then our local selection extends to the end
+ nLocalEnd = GetPortionData().GetAccessibleString().
+ getLength();
+ }
+ else
+ {
+ DBG_ASSERT( nHere == nStartIndex,
+ "miscalculated index" );
+
+ // selection ends in this node: then select everything
+ // before our part of the node
+ sal_uInt16 nCoreEnd = pEnd->nContent.GetIndex();
+ if( nCoreEnd >
+ GetPortionData().GetLastValidCorePosition() )
+ {
+ // selection extends beyond out part of this para
+ nLocalEnd = GetPortionData().GetAccessibleString().
+ getLength();
+ }
+ else if( nCoreEnd >=
+ GetPortionData().GetFirstValidCorePosition() )
+ {
+ // selection is inside our part of this para
+ DBG_ASSERT(
+ GetPortionData().IsValidCorePosition(
+ nCoreEnd ),
+ "problem determining valid core position" );
+
+ nLocalEnd = GetPortionData().GetAccessiblePosition(
+ nCoreEnd );
+ }
+ }
+
+ if( ( nLocalStart != -1 ) && ( nLocalEnd != -1 ) )
+ {
+ nStart = nLocalStart;
+ nEnd = nLocalEnd;
+ bRet = sal_True;
+ }
+ } // if hit the index
+ else
+ {
+ nSelected--;
+ }
+ }
+ // else: this PaM doesn't point to this paragraph
+ }
+ // else: this PaM is collapsed and doesn't select anything
+
+ // next PaM in ring
+ pCrsr = static_cast<SwPaM*>( pCrsr->GetNext() );
+ }
+ while( !bRet && (pCrsr != pRingStart) );
+ }
+ // else: nocursor -> no selection
+
+ if( bRet )
+ {
+ sal_Int32 nCaretPos = GetCaretPos();
+ if( nStart == nCaretPos )
+ {
+ sal_Int32 tmp = nStart;
+ nStart = nEnd;
+ nEnd = tmp;
+ }
+ }
+ return bRet;
+}
+
+sal_Int16 SAL_CALL SwAccessibleParagraph::getAccessibleRole (void) throw (::com::sun::star::uno::RuntimeException)
+{
+ //Get the real heading level, Heading1 ~ Heading10
+ if (nHeadingLevel > 0)
+ {
+ return AccessibleRole::HEADING;
+ }
+ else
+ {
+ return AccessibleRole::PARAGRAPH;
+ }
+}
+
+// End Add
+
+
+/* This funcion is already defined in accpara.cxx(Added by yanjun)
+sal_Int32 SAL_CALL SwAccessibleParagraph::getBackground()
+ throw (::com::sun::star::uno::RuntimeException)
+{
+// Test Code
+// Sequence<OUString> seNames(1);
+// OUString* pStrings = seNames.getArray();
+// pStrings[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("ParaBackColor"));
+//
+// Sequence<Any> aAnys(1);
+// Reference<XMultiPropertySet> xPortion = CreateUnoPortion( 0, 0 );
+// aAnys = xPortion->getPropertyValues( seNames );
+// const Any* pAnys = aAnys.getConstArray();
+//
+// sal_uInt32 crColorT=0;
+// pAnys[0] >>= crColorT;
+// End Test Code
+
+ const SvxBrushItem &rBack = GetFrm()->GetAttrSet()->GetBackground();
+ sal_uInt32 crBack = rBack.GetColor().GetColor();
+
+ if (COL_AUTO == crBack)
+ {
+ Reference<XAccessible> xAccDoc = getAccessibleParent();
+ if (xAccDoc.is())
+ {
+ Reference<XAccessibleComponent> xCompoentDoc(xAccDoc,UNO_QUERY);
+ if (xCompoentDoc.is())
+ {
+ crBack = (sal_uInt32)xCompoentDoc->getBackground();
+ }
+ }
+ }
+ return crBack;
+}
+*/
+
+//Get the real heading level, Heading1 ~ Heading10
+sal_Int32 SwAccessibleParagraph::GetRealHeadingLevel()
+{
+ uno::Reference< ::com::sun::star::beans::XPropertySet > xPortion = CreateUnoPortion( 0, 0 );
+ ::rtl::OUString pString = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParaStyleName"));
+ uno::Any styleAny = xPortion->getPropertyValue( pString );
+ ::rtl::OUString sValue;
+ if (styleAny >>= sValue)
+ {
+ //Modified by yanjun for acc migration
+ sal_Int32 length = sValue.getLength/*GetCharCount*/();
+ if (length == 9 || length == 10)
+ {
+ ::rtl::OUString headStr = sValue.copy(0, 7);
+ if (headStr.equals(::rtl::OUString::createFromAscii("Heading")))
+ {
+ ::rtl::OUString intStr = sValue.copy(8);
+ sal_Int32 headingLevel = intStr.toInt32(10);
+ return headingLevel;
+ }
+ }
+ }
+ return -1;
+}
+
+uno::Any SAL_CALL SwAccessibleParagraph::getExtendedAttributes()
+ throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException)
+{
+ uno::Any Ret;
+ ::rtl::OUString strHeading(::rtl::OUString::createFromAscii("heading-level:"));
+ if( nHeadingLevel >= 0 )
+ strHeading += OUString::valueOf(nHeadingLevel, 10);
+ strHeading += OUString::createFromAscii(";");
+
+ Ret <<= strHeading;
+
+ return Ret;
+}
+
+//Tab will be return when call WORDTYPE
+sal_Bool SwAccessibleParagraph::tabCharInWord( sal_Int32 nIndex, i18n::Boundary& aBound)
+{
+ sal_Bool bFind = sal_False;
+ if( aBound.startPos != nIndex)
+ {
+ OUString tabStr;
+ if(aBound.startPos>nIndex)
+ tabStr = GetString().copy(nIndex,(aBound.startPos - nIndex) );
+
+ sal_Unicode tabChar('\t');
+ sal_Int32 tabIndex = tabStr.indexOf(tabChar);
+ if( tabIndex > -1 )
+ {
+ aBound.startPos = nIndex + tabIndex ;
+ aBound.endPos = aBound.startPos + 1;
+ bFind = sal_True;
+ }
+ }
+ return bFind;
+}
+//-----IAccessibility2 Implementation 2009
diff --git a/sw/source/core/access/accpara.hxx b/sw/source/core/access/accpara.hxx
index 782ecfbefe5a..1de219d9e2bf 100644
--- a/sw/source/core/access/accpara.hxx
+++ b/sw/source/core/access/accpara.hxx
@@ -29,6 +29,11 @@
#include <com/sun/star/accessibility/XAccessibleHypertext.hpp>
#include <com/sun/star/accessibility/XAccessibleTextMarkup.hpp>
#include <com/sun/star/accessibility/XAccessibleMultiLineText.hpp>
+//IAccessibility2 Implementation 2009-----
+#include <com/sun/star/accessibility/XAccessibleTextSelection.hpp>
+#include <txmsrt.hxx>
+#include <com/sun/star/accessibility/XAccessibleExtendedAttributes.hpp>
+//-----IAccessibility2 Implementation 2009
#include <com/sun/star/accessibility/XAccessibleTextAttributes.hpp>
#include <hash_map>
#include <accselectionhelper.hxx>
@@ -36,11 +41,13 @@
#include <calbck.hxx>
// <--
+class SwField;
class SwTxtFrm;
class SwTxtNode;
class SwPaM;
class SwAccessiblePortionData;
class SwAccessibleHyperTextData;
+class SwRedline; //IAccessibility2 Implementation 2009
class SwXTextPortion;
// --> OD 2010-02-19 #i108125#
class SwParaChangeTrackingInfo;
@@ -50,6 +57,7 @@ namespace rtl { class OUString; }
namespace com { namespace sun { namespace star {
namespace i18n { struct Boundary; }
namespace accessibility { class XAccessibleHyperlink; }
+ namespace style { class TabStop; }
} } }
typedef ::std::hash_map< ::rtl::OUString,
@@ -67,7 +75,11 @@ class SwAccessibleParagraph :
public com::sun::star::accessibility::XAccessibleHypertext,
public com::sun::star::accessibility::XAccessibleTextMarkup,
public com::sun::star::accessibility::XAccessibleMultiLineText,
- public ::com::sun::star::accessibility::XAccessibleTextAttributes
+ public ::com::sun::star::accessibility::XAccessibleTextAttributes,
+ //IAccessibility2 Implementation 2009-----
+ public com::sun::star::accessibility::XAccessibleTextSelection,
+ public com::sun::star::accessibility::XAccessibleExtendedAttributes
+ //-----IAccessibility2 Implementation 2009
{
friend class SwAccessibleHyperlink;
@@ -86,6 +98,9 @@ class SwAccessibleParagraph :
// mutex)
sal_Bool bIsHeading; // protected by base classes mutex
+ //IAccessibility2 Implementation 2009-----
+ sal_Int32 nHeadingLevel;
+ //-----IAccessibility2 Implementation 2009
// implementation for XAccessibleSelection
SwAccessibleSelectionHelper aSelectionHelper;
@@ -144,6 +159,10 @@ class SwAccessibleParagraph :
}
}
+ //IAccessibility2 Implementation 2009-----
+ const SwRedline* GetRedlineAtIndex( sal_Int32 nPos );
+ String GetFieldTypeNameAtIndex(sal_Int32 nIndex);
+ //-----IAccessibility2 Implementation 2009
// --> OD 2006-07-13 #i63870#
void _getDefaultAttributesImpl(
const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aRequestedAttributes,
@@ -154,9 +173,22 @@ class SwAccessibleParagraph :
const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aRequestedAttributes,
tAccParaPropValMap& rRunAttrSeq );
// <--
+ // IAccessibility2 Implementation 2009----
+ void _getSupplementalAttributesImpl(
+ const sal_Int32 nIndex,
+ const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aRequestedAttributes,
+ tAccParaPropValMap& rSupplementalAttrSeq );
-public:
+ void _correctValues(
+ const sal_Int32 nIndex,
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rValues );
+ // ----IAccessibility2 Implementation 2009
+public:
+ //IAccessibility2 Implementation 2009-----
+ SwTOXSortTabBase* GetTOXSortTabBase();
+ short GetTOCLevel();
+ //-----IAccessibility2 Implementation 2009
sal_Bool IsHeading() const;
protected:
@@ -241,6 +273,15 @@ public:
virtual sal_Bool HasCursor(); // required by map to remember that object
+ //IAccessibility2 Implementation 2009-----
+ com::sun::star::uno::Sequence< ::com::sun::star::style::TabStop > GetCurrentTabStop( sal_Int32 nIndex );
+ virtual sal_Int16 SAL_CALL getAccessibleRole (void) throw (::com::sun::star::uno::RuntimeException);
+ //-----IAccessibility2 Implementation 2009
+ // --> OD 2010-02-19 #i108125#
+ // MT: Solved merge conflict - seems this was removed between 101 and 103?
+ // virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew);
+ // <--
+
//===== XAccessibleContext ==============================================
/// Return this object's description.
@@ -406,7 +447,29 @@ public:
::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::uno::RuntimeException);
// <--
-
+ //IAccessibility2 Implementation 2009-----
+ //====== XAccessibleTextSelection ======================================
+ virtual sal_Bool SAL_CALL scrollToPosition( const ::com::sun::star::awt::Point& aPoint, sal_Bool isLeftTop )
+ throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getSelectedPortionCount( )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getSeletedPositionStart( sal_Int32 nSelectedPortionIndex )
+ throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getSeletedPositionEnd( sal_Int32 nSelectedPortionIndex )
+ throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL removeSelection( sal_Int32 selectionIndex )
+ throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL addSelection( sal_Int32 selectionIndex, sal_Int32 startOffset, sal_Int32 endOffset)
+ throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ //===== XAccessibleExtendedAttributes ==============================================
+ virtual ::com::sun::star::uno::Any SAL_CALL getExtendedAttributes()
+ throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) ;
+ sal_Bool GetSelectionAtIndex(sal_Int32& nIndex, sal_Int32& nStart, sal_Int32& nEnd);
+ sal_Int32 GetRealHeadingLevel();
+ //===== XAccessibleComponent ============================================
+ sal_Bool m_bLastHasSelection;
+ sal_Bool tabCharInWord(sal_Int32 nIndex, com::sun::star::i18n::Boundary& aBound);
+ //-----IAccessibility2 Implementation 2009
// --> OD 2008-05-29 #i89175#
//===== XAccessibleMultiLineText ========================================
virtual sal_Int32 SAL_CALL getLineNumberAtIndex( sal_Int32 nIndex )
diff --git a/sw/source/core/access/accportions.cxx b/sw/source/core/access/accportions.cxx
index 2d50e6f0d08a..64d6daba5cae 100644
--- a/sw/source/core/access/accportions.cxx
+++ b/sw/source/core/access/accportions.cxx
@@ -64,6 +64,10 @@
using namespace ::com::sun::star;
+//IAccessibility2 Implementation 2009-----
+//#include "accnote.hxx"
+//-----IAccessibility2 Implementation 2009
+
using rtl::OUString;
using rtl::OUStringBuffer;
using i18n::Boundary;
@@ -140,6 +144,13 @@ void SwAccessiblePortionData::Text(sal_uInt16 nLength, sal_uInt16 nType)
bLastIsSpecial = sal_False;
}
+//IAccessibility2 Implementation 2009-----
+void SwAccessiblePortionData::SetAttrFieldType( sal_uInt16 nAttrFldType )
+{
+ aAttrFieldType.push_back(nAttrFldType);
+ return;
+}
+//-----IAccessibility2 Implementation 2009
void SwAccessiblePortionData::Special(
sal_uInt16 nLength, const String& rText, sal_uInt16 nType)
@@ -156,11 +167,46 @@ void SwAccessiblePortionData::Special(
switch( nType )
{
case POR_POSTITS:
- case POR_FLYCNT:
- case POR_GRFNUM:
+ //IAccessibility2 Implementation 2009-----
sDisplay = String(sal_Unicode(0xfffc));
break;
+ case POR_FLYCNT:
+ sDisplay = String(sal_Unicode(0xfffc));
+ break;
+ case POR_GRFNUM:
+ case POR_BULLET:
+ break;
+ case POR_FLD:
+ //Added by yanjun for 6854
+ case POR_HIDDEN:
+ case POR_COMBINED:
+ case POR_ISOREF:
+ //End
+ {
+ //When the filed content is empty, input a special character.
+ if (rText.Len() == 0)
+ sDisplay = String(sal_Unicode(0xfffc));
+ else
+ sDisplay = rText;
+ aFieldPosition.push_back(aBuffer.getLength());
+ aFieldPosition.push_back(aBuffer.getLength() + rText.Len());
+ break;
+ }
+ case POR_FTNNUM:
+ {
+ break;
+ }
+ case POR_FTN:
+ {
+ sDisplay = rText;
+ sal_Int32 nStart=aBuffer.getLength();
+ sal_Int32 nEnd=nStart + rText.Len();
+ m_vecPairPos.push_back(std::make_pair(nStart,nEnd));
+ break;
+ }
+ //-----IAccessibility2 Implementation 2009
+ break;
case POR_NUMBER:
{
OUStringBuffer aTmpBuffer( rText.Len() + 1 );
@@ -280,6 +326,7 @@ sal_Bool SwAccessiblePortionData::IsGrayPortionType( sal_uInt16 nType ) const
case POR_NUMBER:
case POR_FLD:
case POR_URL:
+ case POR_INPUTFLD:
case POR_ISOTOX:
case POR_TOX:
case POR_HIDDEN:
@@ -675,6 +722,37 @@ sal_uInt16 SwAccessiblePortionData::FillSpecialPos(
return static_cast<sal_uInt16>( nModelPos );
}
+//IAccessibility2 Implementation 2009-----
+sal_uInt16 SwAccessiblePortionData::GetAttrFldType( sal_Int32 nPos )
+{
+ if( aFieldPosition.size() < 2 ) return sal_False;
+ sal_Int32 nFieldIndex = 0;
+ for( size_t i = 0; i < aFieldPosition.size() - 1; i += 2 )
+ {
+ if( nPos < aFieldPosition[ i + 1 ] && nPos >= aFieldPosition[ i ] )
+ {
+ return aAttrFieldType[nFieldIndex];
+ }
+ nFieldIndex++ ;
+ }
+ return 0;
+}
+
+sal_Bool SwAccessiblePortionData::FillBoundaryIFDateField( com::sun::star::i18n::Boundary& rBound, const sal_Int32 nPos )
+{
+ if( aFieldPosition.size() < 2 ) return sal_False;
+ for( size_t i = 0; i < aFieldPosition.size() - 1; i += 2 )
+ {
+ if( nPos < aFieldPosition[ i + 1 ] && nPos >= aFieldPosition[ i ] )
+ {
+ rBound.startPos = aFieldPosition[i];
+ rBound.endPos = aFieldPosition[i + 1];
+ return sal_True;
+ }
+ }
+ return sal_False;
+}
+//-----IAccessibility2 Implementation 2009
void SwAccessiblePortionData::AdjustAndCheck(
sal_Int32 nPos,
size_t& nPortionNo,
@@ -738,6 +816,50 @@ sal_Bool SwAccessiblePortionData::IsValidCorePosition( sal_uInt16 nPos ) const
( nPos <= aModelPositions[ aModelPositions.size()-1 ] );
}
+//IAccessibility2 Implementation 2009-----
+sal_Bool SwAccessiblePortionData::IsZeroCorePositionData()
+{
+ if( aModelPositions.size() < 1 ) return sal_True;
+ return aModelPositions[0] == 0 && aModelPositions[aModelPositions.size()-1] == 0;
+}
+
+sal_Bool SwAccessiblePortionData::IsIndexInFootnode(sal_Int32 nIndex)
+{
+ VEC_PAIR_POS::iterator vi =m_vecPairPos.begin();
+ for (;vi != m_vecPairPos.end() ; ++vi)
+ {
+ const PAIR_POS &pairPos = *vi;
+ if(nIndex >= pairPos.first && nIndex < pairPos.second )
+ {
+ return sal_True;
+ }
+ }
+ return sal_False;
+}
+
+sal_Bool SwAccessiblePortionData::IsInGrayPortion( sal_Int32 nPos )
+{
+// return IsGrayPortion( FindBreak( aAccessiblePositions, nPos ) );
+ return IsPortionAttrSet( FindBreak( aAccessiblePositions, nPos ),
+ PORATTR_GRAY );
+}
+
+sal_Int32 SwAccessiblePortionData::GetFieldIndex(sal_Int32 nPos)
+{
+ sal_Int32 nIndex = -1;
+ if( aFieldPosition.size() >= 2 )
+ {
+ for( sal_Int32 i = 0; i < aFieldPosition.size() - 1; i += 2 )
+ {
+ if( nPos <= aFieldPosition[ i + 1 ] && nPos >= aFieldPosition[ i ] )
+ {
+ nIndex = i/2;
+ break;
+ }
+ }
+ }
+ return nIndex;
+}
sal_uInt16 SwAccessiblePortionData::GetFirstValidCorePosition() const
{
return static_cast<sal_uInt16>( aModelPositions[0] );
diff --git a/sw/source/core/access/accportions.hxx b/sw/source/core/access/accportions.hxx
index 1ecab653f3e2..a068f27458b4 100644
--- a/sw/source/core/access/accportions.hxx
+++ b/sw/source/core/access/accportions.hxx
@@ -61,6 +61,10 @@ class SwAccessiblePortionData : public SwPortionHandler
Positions_t aLineBreaks; /// position of line breaks
Positions_t aModelPositions; /// position of portion breaks in the model
Positions_t aAccessiblePositions; /// portion breaks in sAccessibleString
+ //IAccessibility2 Implementation 2009-----
+ Positions_t aFieldPosition;
+ //-----IAccessibility2 Implementation 2009
+ Positions_t aAttrFieldType;
typedef std::vector<sal_uInt8> PortionAttrs_t;
PortionAttrs_t aPortionAttrs; /// additional portion attributes
@@ -104,7 +108,15 @@ public:
virtual void Skip(sal_uInt16 nLength);
virtual void Finish();
+ //IAccessibility2 Implementation 2009-----
+ virtual void SetAttrFieldType( sal_uInt16 nAttrFldType );
+ sal_Bool FillBoundaryIFDateField( com::sun::star::i18n::Boundary& rBound, const sal_Int32 nPos );
+ sal_Bool IsIndexInFootnode(sal_Int32 nIndex);
+ sal_Bool IsInGrayPortion( sal_Int32 nPos );
+ sal_Int32 GetFieldIndex(sal_Int32 nPos);
+ //-----IAccessibility2 Implementation 2009
+ sal_Bool IsZeroCorePositionData();
// access to the portion data
/// get the text string, as presented by the layout
@@ -149,6 +161,7 @@ public:
void GetAttributeBoundary( com::sun::star::i18n::Boundary& rBound,
sal_Int32 nPos ) const;
+ sal_uInt16 GetAttrFldType( sal_Int32 nPos );
/// Convert start and end positions into core positions.
/// @returns true if 'special' portions are included either completely
/// or not at all. This can be used to test whether editing
@@ -164,6 +177,12 @@ public:
sal_Bool IsValidCorePosition( sal_uInt16 nPos ) const;
sal_uInt16 GetFirstValidCorePosition() const;
sal_uInt16 GetLastValidCorePosition() const;
+ //IAccessibility2 Implementation 2009-----
+private:
+ typedef std::pair<sal_Int32,sal_Int32> PAIR_POS;
+ typedef std::vector<PAIR_POS> VEC_PAIR_POS;
+ VEC_PAIR_POS m_vecPairPos;
+ //-----IAccessibility2 Implementation 2009
};
diff --git a/sw/source/core/access/accpreview.cxx b/sw/source/core/access/accpreview.cxx
index f67165600906..da9dab6dd725 100644
--- a/sw/source/core/access/accpreview.cxx
+++ b/sw/source/core/access/accpreview.cxx
@@ -32,6 +32,11 @@
#endif
#include <accpreview.hxx>
+//IAccessibility2 Implementation 2009-----
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLESTATETYPE_HPP_
+#include <com/sun/star/accessibility/AccessibleStateType.hpp>
+#endif
+//-----IAccessibility2 Implementation 2009
const sal_Char sServiceName[] = "com.sun.star.text.AccessibleTextDocumentPageView";
const sal_Char sImplementationName[] = "com.sun.star.comp.Writer.SwAccessibleDocumentPageView";
@@ -54,7 +59,9 @@ using ::rtl::OUString;
SwAccessiblePreview::SwAccessiblePreview( SwAccessibleMap *pMp ) :
SwAccessibleDocumentBase( pMp )
{
- SetName( GetResource( STR_ACCESS_DOC_NAME ) );
+ //IAccessibility2 Implementation 2009-----
+ SetName( GetResource( STR_ACCESS_PREVIEW_DOC_NAME ) );
+ //-----IAccessibility2 Implementation 2009
}
SwAccessiblePreview::~SwAccessiblePreview()
@@ -98,3 +105,21 @@ Sequence< sal_Int8 > SAL_CALL SwAccessiblePreview::getImplementationId()
}
return aId;
}
+//IAccessibility2 Implementation 2009-----
+OUString SAL_CALL SwAccessiblePreview::getAccessibleDescription (void) throw (com::sun::star::uno::RuntimeException)
+{
+ return GetResource( STR_ACCESS_PREVIEW_DOC_NAME );
+}
+
+OUString SAL_CALL SwAccessiblePreview::getAccessibleName (void) throw (::com::sun::star::uno::RuntimeException)
+{
+ OUString sName = SwAccessibleDocumentBase::getAccessibleName();
+ sName += OUString::createFromAscii(" ");
+ sName += GetResource( STR_ACCESS_PREVIEW_DOC_SUFFIX );
+ return sName;
+}
+void SwAccessiblePreview::_InvalidateFocus()
+{
+ FireStateChangedEvent( ::com::sun::star::accessibility::AccessibleStateType::FOCUSED, sal_True );
+}
+//-----IAccessibility2 Implementation 2009
diff --git a/sw/source/core/access/accpreview.hxx b/sw/source/core/access/accpreview.hxx
index 215db22f653d..4907240c8d6a 100644
--- a/sw/source/core/access/accpreview.hxx
+++ b/sw/source/core/access/accpreview.hxx
@@ -66,6 +66,12 @@ public:
//====== XTypeProvider ====================================================
virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
+
+ //IAccessibility2 Implementation 2009-----
+ ::rtl::OUString SAL_CALL getAccessibleDescription (void) throw (com::sun::star::uno::RuntimeException);
+ ::rtl::OUString SAL_CALL getAccessibleName (void) throw (::com::sun::star::uno::RuntimeException);
+ virtual void _InvalidateFocus();
+ //-----IAccessibility2 Implementation 2009
};
#endif
diff --git a/sw/source/core/access/accselectionhelper.cxx b/sw/source/core/access/accselectionhelper.cxx
index 0a651f3b5d42..9be9421fffd6 100644
--- a/sw/source/core/access/accselectionhelper.cxx
+++ b/sw/source/core/access/accselectionhelper.cxx
@@ -38,6 +38,14 @@
#include <flyfrm.hxx>
+//IAccessibility2 Implementation 2009-----
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/accessibility/AccessibleStateType.hpp>
+#include <com/sun/star/accessibility/XAccessibleStateSet.hpp>
+#include <fmtanchr.hxx>
+//-----IAccessibility2 Implementation 2009
+
+using namespace ::com::sun::star::accessibility;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -111,6 +119,43 @@ void SwAccessibleSelectionHelper::selectAccessibleChild(
// return bRet;
}
+//IAccessibility2 Implementation 2009-----
+//When the selected state of the SwFrmOrObj is setted, return true.
+static sal_Bool lcl_getSelectedState(const SwAccessibleChild& aChild,
+ SwAccessibleContext* pContext,
+ SwAccessibleMap* pMap)
+{
+ Reference< XAccessible > xAcc;
+ if ( aChild.GetSwFrm() )
+ {
+ xAcc = pMap->GetContext( aChild.GetSwFrm(), sal_False );
+ }
+ else if ( aChild.GetDrawObject() )
+ {
+ xAcc = pMap->GetContext( aChild.GetDrawObject(), pContext, sal_False );
+ }
+
+ if( xAcc.is() )
+ {
+ Reference< XAccessibleContext > pRContext = xAcc->getAccessibleContext();
+ if(!pRContext.is())
+ return sal_False;
+ Reference<XAccessibleStateSet> pRStateSet = pRContext->getAccessibleStateSet();
+ if( pRStateSet.is() )
+ {
+ Sequence<short> pStates = pRStateSet->getStates();
+ long count = pStates.getLength();
+ for( int i = 0; i < count; i++ )
+ {
+ if( pStates[i] == AccessibleStateType::SELECTED)
+ return sal_True;
+ }
+ }
+ }
+ return sal_False;
+}
+//-----IAccessibility2 Implementation 2009
+
sal_Bool SwAccessibleSelectionHelper::isAccessibleChildSelected(
sal_Int32 nChildIndex )
throw ( lang::IndexOutOfBoundsException,
@@ -137,6 +182,14 @@ sal_Bool SwAccessibleSelectionHelper::isAccessibleChildSelected(
{
bRet = pFEShell->IsObjSelected( *aChild.GetDrawObject() );
}
+ //IAccessibility2 Implementation 2009-----
+ //If the SwFrmOrObj is not selected directly in the UI, we should check whether it is selected in the selection cursor.
+ if( !bRet )
+ {
+ if( lcl_getSelectedState( aChild, &rContext, rContext.GetMap() ) == sal_True)
+ bRet = sal_True;
+ }
+ //-----IAccessibility2 Implementation 2009
}
return bRet;
@@ -194,11 +247,11 @@ sal_Int32 SwAccessibleSelectionHelper::getSelectedAccessibleChildCount( )
const SwFlyFrm* pFlyFrm = pFEShell->GetCurrFlyFrm();
if( pFlyFrm )
{
- if( rContext.GetParent( SwAccessibleChild(pFlyFrm), rContext.IsInPagePreview()) ==
- rContext.GetFrm() )
- {
+ //IAccessibility2 Implementation 2009-----
+ //if( rContext.GetParent( SwAccessibleChild(pFlyFrm), rContext.IsInPagePreview()) ==
+ // rContext.GetFrm() )
nCount = 1;
- }
+ //-----IAccessibility2 Implementation 2009
}
else
{
@@ -226,6 +279,26 @@ sal_Int32 SwAccessibleSelectionHelper::getSelectedAccessibleChildCount( )
}
}
}
+ //IAccessibility2 Implementation 2009-----
+ //If the SwFrmOrObj is not selected directly in the UI,
+ //we should check whether it is selected in the selection cursor.
+ if( nCount == 0 )
+ {
+ ::std::list< SwAccessibleChild > aChildren;
+ rContext.GetChildren( *(rContext.GetMap()), aChildren );
+ ::std::list< SwAccessibleChild >::const_iterator aIter =
+ aChildren.begin();
+ ::std::list< SwAccessibleChild >::const_iterator aEndIter =
+ aChildren.end();
+ while( aIter != aEndIter )
+ {
+ const SwAccessibleChild& aChild = *aIter;
+ if( lcl_getSelectedState( aChild, &rContext, rContext.GetMap() ) )
+ nCount++;
+ ++aIter;
+ }
+ }
+ //-----IAccessibility2 Implementation 2009
}
return nCount;
}
@@ -249,12 +322,28 @@ Reference<XAccessible> SwAccessibleSelectionHelper::getSelectedAccessibleChild(
const SwFlyFrm *pFlyFrm = pFEShell->GetCurrFlyFrm();
if( pFlyFrm )
{
- if( 0 == nSelectedChildIndex &&
- rContext.GetParent( SwAccessibleChild(pFlyFrm), rContext.IsInPagePreview()) ==
- rContext.GetFrm() )
+ //IAccessibility2 Implementation 2009-----
+ if( 0 == nSelectedChildIndex )
{
- aChild = pFlyFrm;
+ if(rContext.GetParent( SwAccessibleChild(pFlyFrm), rContext.IsInPagePreview()) == rContext.GetFrm() )
+ {
+ aChild = pFlyFrm;
+ }
+ else
+ {
+ const SwFrmFmt *pFrmFmt = pFlyFrm->GetFmt();
+ if (pFrmFmt)
+ {
+ const SwFmtAnchor& pAnchor = pFrmFmt->GetAnchor();
+ if( pAnchor.GetAnchorId() == FLY_AS_CHAR )
+ {
+ const SwFrm *pParaFrm = rContext.GetParent( SwAccessibleChild(pFlyFrm), rContext.IsInPagePreview() );
+ aChild = pParaFrm;
+ }
+ }
+ }
}
+ //-----IAccessibility2 Implementation 2009
}
else
{
diff --git a/sw/source/core/access/acctable.cxx b/sw/source/core/access/acctable.cxx
index 60567153326f..3da5bec89c29 100644
--- a/sw/source/core/access/acctable.cxx
+++ b/sw/source/core/access/acctable.cxx
@@ -49,9 +49,14 @@
#include <accmap.hxx>
#include <access.hrc>
#include <acctable.hxx>
-
+#include <rowfrm.hxx>
+#include <layfrm.hxx>
#include <com/sun/star/accessibility/XAccessibleText.hpp>
+#include <editeng/brshitem.hxx>
+#include <swatrset.hxx>
+#include <frmatr.hxx>
+
using namespace ::com::sun::star;
using namespace ::com::sun::star::accessibility;
using ::rtl::OUString;
@@ -67,6 +72,8 @@ typedef ::std::set < sal_Int32, Int32Less_Impl > Int32Set_Impl;
typedef ::std::pair < sal_Int32, sal_Int32 > Int32Pair_Impl;
typedef ::std::list < Int32Pair_Impl > Int32PairList_Impl;
+const int SELECTION_WITH_NUM =10;
+
class SwAccTableSelHander_Impl
{
public:
@@ -88,6 +95,10 @@ class SwAccessibleTableData_Impl
bool mbOnlyTableColumnHeader;
void CollectData( const SwFrm *pFrm );
+ //IAccessibility2 Implementation 2009-----
+ void CollectColumnHeaderData( const SwFrm *pFrm );
+ void CollectRowHeaderData( const SwFrm *pFrm );
+ //-----IAccessibility2 Implementation 2009
void CollectExtents( const SwFrm *pFrm );
sal_Bool FindCell( const Point& rPos, const SwFrm *pFrm ,
@@ -182,6 +193,99 @@ void SwAccessibleTableData_Impl::CollectData( const SwFrm *pFrm )
}
}
+//IAccessibility2 Implementation 2009-----
+void SwAccessibleTableData_Impl::CollectRowHeaderData( const SwFrm *pFrm )
+{
+ const SwAccessibleChildSList aList( *pFrm, mrAccMap );
+ SwAccessibleChildSList::const_iterator aIter( aList.begin() );
+ SwAccessibleChildSList::const_iterator aEndIter( aList.end() );
+ while( aIter != aEndIter )
+ {
+ const SwAccessibleChild& rLower = *aIter;
+ const SwFrm *pLower = rLower.GetSwFrm();
+ if( pLower )
+ {
+ if( pLower->IsRowFrm() )
+ {
+
+ const SwTableLine* pLine = ((SwRowFrm*)pLower)->GetTabLine();
+ while( pLine->GetUpper() )
+ pLine = pLine->GetUpper()->GetUpper();
+
+ // Headerline?
+ //if(mpTabFrm->GetTable()->GetTabLines()[ 0 ] != pLine)
+ //return ;
+
+ maRows.insert( pLower->Frm().Top() - maTabFrmPos.Y() );
+
+ CollectRowHeaderData( pLower );
+
+
+ }
+ else if( pLower->IsCellFrm() &&
+ rLower.IsAccessible( mbIsInPagePreview ) )
+ {
+ //Added by yanjun. Can't find the "GetRowHeaderFlag" function(Need vefiry).
+ //if(((SwCellFrm*)pLower)->GetRowHeaderFlag())
+ // maColumns.insert( pLower->Frm().Left() - maTabFrmPos.X() );
+ }
+ else
+ {
+ CollectRowHeaderData( pLower );
+ }
+ }
+ ++aIter;
+ }
+}
+//-----IAccessibility2 Implementation 2009
+
+void SwAccessibleTableData_Impl::CollectColumnHeaderData( const SwFrm *pFrm )
+{
+ const SwAccessibleChildSList aList( *pFrm, mrAccMap );
+ SwAccessibleChildSList::const_iterator aIter( aList.begin() );
+ SwAccessibleChildSList::const_iterator aEndIter( aList.end() );
+ while( aIter != aEndIter )
+ {
+ const SwAccessibleChild& rLower = *aIter;
+ const SwFrm *pLower = rLower.GetSwFrm();
+ if( pLower )
+ {
+ if( pLower->IsRowFrm() )
+ {
+
+ const SwTableLine* pLine = ((SwRowFrm*)pLower)->GetTabLine();
+ while( pLine->GetUpper() )
+ pLine = pLine->GetUpper()->GetUpper();
+
+ // Headerline?
+ //if(mpTabFrm->GetTable()->GetTabLines()[ 0 ] != pLine)
+ //return ;
+
+ //if the current line is now header line, then return ;
+ sal_Int16 iCurrentRowIndex = mpTabFrm->GetTable()->GetTabLines().GetPos( pLine);
+ if(iCurrentRowIndex >= mpTabFrm->GetTable()->_GetRowsToRepeat())
+ return ;
+
+ maRows.insert( pLower->Frm().Top() - maTabFrmPos.Y() );
+
+ CollectColumnHeaderData( pLower );
+
+
+ }
+ else if( pLower->IsCellFrm() &&
+ rLower.IsAccessible( mbIsInPagePreview ) )
+ {
+ maColumns.insert( pLower->Frm().Left() - maTabFrmPos.X() );
+ }
+ else
+ {
+ CollectColumnHeaderData( pLower );
+ }
+ }
+ ++aIter;
+ }
+}
+//-----IAccessibility2 Implementation 2009
void SwAccessibleTableData_Impl::CollectExtents( const SwFrm *pFrm )
{
const SwAccessibleChildSList aList( *pFrm, mrAccMap );
@@ -396,7 +500,11 @@ const SwFrm *SwAccessibleTableData_Impl::GetCellAtPos(
inline sal_Int32 SwAccessibleTableData_Impl::GetRowCount() const
{
- return static_cast< sal_Int32 >( maRows.size() );
+ //IAccessibility2 Implementation 2009-----
+ sal_Int32 count = static_cast< sal_Int32 >( maRows.size() ) ;
+ count = (count <=0)? 1:count;
+ //-----IAccessibility2 Implementation 2009
+ return count;
}
inline sal_Int32 SwAccessibleTableData_Impl::GetColumnCount() const
@@ -696,8 +804,12 @@ void SwAccessibleTable::GetStates(
::utl::AccessibleStateSetHelper& rStateSet )
{
SwAccessibleContext::GetStates( rStateSet );
-
+ //IAccessibility2 Implementation 2009-----
+ //Solution:Add resizable state to table
+ rStateSet.AddState( AccessibleStateType::RESIZABLE );
// MULTISELECTABLE
+ rStateSet.AddState( AccessibleStateType::MULTI_SELECTABLE );
+ //-----IAccessibility2 Implementation 2009
SwCrsrShell* pCrsrShell = GetCrsrShell();
if( pCrsrShell )
rStateSet.AddState( AccessibleStateType::MULTI_SELECTABLE );
@@ -727,6 +839,9 @@ SwAccessibleTable::SwAccessibleTable(
OUString sArg2( GetFormattedPageNumber() );
sDesc = GetResource( STR_ACCESS_TABLE_DESC, &sArg1, &sArg2 );
+ //IAccessibility2 Implementation 2009-----
+ UpdateTableData();
+ //-----IAccessibility2 Implementation 2009
}
SwAccessibleTable::~SwAccessibleTable()
@@ -784,8 +899,7 @@ void SwAccessibleTable::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew
case RES_OBJECTDYING:
// mba: it seems that this class intentionally does not call code in base class SwClient
- if( GetRegisteredIn() ==
- static_cast< SwModify *>( static_cast< const SwPtrMsgPoolItem * >( pOld )->pObject ) )
+ if( pOld && ( GetRegisteredIn() == static_cast< SwModify *>( static_cast< const SwPtrMsgPoolItem * >( pOld )->pObject ) ) )
GetRegisteredInNonConst()->Remove( this );
break;
@@ -809,6 +923,13 @@ uno::Any SwAccessibleTable::queryInterface( const uno::Type& rType )
uno::Reference<XAccessibleSelection> xSelection( this );
aRet <<= xSelection;
}
+ //IAccessibility2 Implementation 2009-----
+ else if ( rType == ::getCppuType((uno::Reference<XAccessibleTableSelection> *)0) )
+ {
+ uno::Reference<XAccessibleTableSelection> xTableExtent( this );
+ aRet <<= xTableExtent;
+ }
+ //-----IAccessibility2 Implementation 2009
else
{
aRet = SwAccessibleContext::queryInterface(rType);
@@ -981,6 +1102,9 @@ sal_Int32 SAL_CALL SwAccessibleTable::getAccessibleRowExtentAt(
CHECK_FOR_DEFUNC( XAccessibleTable )
+ //IAccessibility2 Implementation 2009-----
+ UpdateTableData();
+ //-----IAccessibility2 Implementation 2009
GetTableData().CheckRowAndCol( nRow, nColumn, this );
Int32Set_Impl::const_iterator aSttCol(
@@ -1011,6 +1135,9 @@ sal_Int32 SAL_CALL SwAccessibleTable::getAccessibleColumnExtentAt(
vos::OGuard aGuard(Application::GetSolarMutex());
CHECK_FOR_DEFUNC( XAccessibleTable )
+ //IAccessibility2 Implementation 2009-----
+ UpdateTableData();
+ //-----IAccessibility2 Implementation 2009
GetTableData().CheckRowAndCol( nRow, nColumn, this );
@@ -1045,6 +1172,25 @@ uno::Reference< XAccessibleTable > SAL_CALL
SwAccessibleTable::getAccessibleColumnHeaders( )
throw (uno::RuntimeException)
{
+// MT IA2: Which one should win nowadys???
+/*
+ // IA2 version:
+ uno::Reference< XAccessibleTable > xRet;
+ SwTabFrm* pTabFrm =( SwTabFrm*)( GetFrm() );
+ if (pTabFrm)
+ {
+ if(pTabFrm->GetTable()->_GetRowsToRepeat() > 0)
+ {
+ //for errata table header
+ SwAccessibleTableData_Impl *mpHeadTableData = new SwAccessibleTableData_Impl( pTabFrm, sal_False, sal_True);
+ //for errata table header
+ SwAccessibleTable *pHeadAccessibleTable = new SwAccessibleTable(GetMap(),pTabFrm);
+ pHeadAccessibleTable->SetTableData(mpHeadTableData);
+ xRet = pHeadAccessibleTable;
+ }
+ }
+ return xRet;
+*/
// --> OD 2010-03-10 #i87532#
// assure that return accesible object is empty, if no column header exists.
SwAccessibleTableColHeaders* pTableColHeaders =
@@ -1346,6 +1492,15 @@ void SwAccessibleTable::InvalidatePosOrSize( const SwRect& rOldBox )
{
vos::OGuard aGuard(Application::GetSolarMutex());
+ //IAccessibility2 Implementation 2009-----
+ //need to update children
+ SwAccessibleTableData_Impl *pNewTableData = CreateNewTableData();
+ if( !pNewTableData->CompareExtents( GetTableData() ) )
+ {
+ delete mpTableData;
+ mpTableData = pNewTableData;
+ FireTableChangeEvent(*mpTableData);
+ }
if( HasTableData() )
GetTableData().SetTablePos( GetFrm()->Frm().Pos() );
@@ -1402,6 +1557,34 @@ void SwAccessibleTable::InvalidateChildPosOrSize( const SwAccessibleChild& rChil
// <--
if( !pNewTableData->CompareExtents( GetTableData() ) )
{
+ //IAccessibility2 Implementation 2009-----
+ if(pNewTableData->GetRowCount()!= mpTableData->GetRowCount())
+ {
+ Int32Set_Impl::const_iterator aSttCol( GetTableData().GetColumnIter( 0 ) );
+ Int32Set_Impl::const_iterator aSttRow( GetTableData().GetRowIter( 1 ) );
+ const SwFrm *pCellFrm = GetTableData().GetCellAtPos( *aSttCol, *aSttRow, sal_False );
+ Int32Set_Impl::const_iterator aSttCol2( pNewTableData->GetColumnIter( 0 ) );
+ Int32Set_Impl::const_iterator aSttRow2( pNewTableData->GetRowIter( 0 ) );
+ const SwFrm *pCellFrm2 = pNewTableData->GetCellAtPos( *aSttCol2, *aSttRow2, sal_False );
+
+ if(pCellFrm == pCellFrm2)
+ {
+ AccessibleTableModelChange aModelChange;
+ aModelChange.Type = AccessibleTableModelChangeType::UPDATE;
+ aModelChange.FirstRow = 0;
+ aModelChange.LastRow = mpTableData->GetRowCount() - 1;
+ aModelChange.FirstColumn = 0;
+ aModelChange.LastColumn = mpTableData->GetColumnCount() - 1;
+
+ AccessibleEventObject aEvent;
+ aEvent.EventId = AccessibleEventId::TABLE_COLUMN_HEADER_CHANGED;
+ aEvent.NewValue <<= aModelChange;
+
+ FireAccessibleEvent( aEvent );
+ }
+ }
+ else
+ //-----IAccessibility2 Implementation 2009
FireTableChangeEvent( GetTableData() );
ClearTableData();
mpTableData = pNewTableData;
@@ -1674,6 +1857,153 @@ void SAL_CALL SwAccessibleTable::deselectAccessibleChild(
pCrsrShell->EndAction();
}
+//IAccessibility2 Implementation 2009-----
+void SwAccessibleTable::SetTableData(SwAccessibleTableData_Impl* mpNewTableData)
+{
+ mpTableData = mpNewTableData;
+}
+
+sal_Int32 SAL_CALL SwAccessibleTable::getBackground()
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ const SvxBrushItem &rBack = GetFrm()->GetAttrSet()->GetBackground();
+ sal_uInt32 crBack = rBack.GetColor().GetColor();
+
+ if (COL_AUTO == crBack)
+ {
+ uno::Reference<XAccessible> xAccDoc = getAccessibleParent();
+ if (xAccDoc.is())
+ {
+ uno::Reference<XAccessibleComponent> xCompoentDoc(xAccDoc,uno::UNO_QUERY);
+ if (xCompoentDoc.is())
+ {
+ crBack = (sal_uInt32)xCompoentDoc->getBackground();
+ }
+ }
+ }
+ return crBack;
+}
+
+void SwAccessibleTable::FireSelectionEvent( )
+{
+ AccessibleEventObject aEvent;
+
+ aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_REMOVE;
+
+// int nRemove = m_vecCellRemove.size();
+// int nAdd = m_vecCellAdd.size();
+
+ VEC_CELL::iterator vi = m_vecCellRemove.begin();
+ for (; vi != m_vecCellRemove.end() ; ++vi)
+ {
+ SwAccessibleContext *pAccCell = const_cast<SwAccessibleContext *>(*vi);
+ OSL_ASSERT(pAccCell != NULL );
+ pAccCell->FireAccessibleEvent(aEvent);
+ }
+
+ if (m_vecCellAdd.size() <= SELECTION_WITH_NUM)
+ {
+ aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_ADD;
+ vi = m_vecCellAdd.begin();
+ for (; vi != m_vecCellAdd.end() ; ++vi)
+ {
+ SwAccessibleContext *pAccCell = const_cast<SwAccessibleContext *>(*vi);
+ OSL_ASSERT(pAccCell != NULL );
+ pAccCell->FireAccessibleEvent(aEvent);
+ }
+ return ;
+ }
+ else
+ {
+ aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_WITHIN;
+ FireAccessibleEvent(aEvent);
+ }
+}
+
+void SwAccessibleTable::ClearSelectionCellCache()
+{
+ m_vecCellAdd.clear();
+ m_vecCellRemove.clear();
+}
+
+void SwAccessibleTable::AddSelectionCell(const SwAccessibleContext* pAccCell ,sal_Bool bAddOrRemove)
+{
+ if (bAddOrRemove)
+ {
+ m_vecCellAdd.push_back(pAccCell);
+ }
+ else
+ {
+ m_vecCellRemove.push_back(pAccCell);
+ }
+}
+
+//===== XAccessibleTableSelection ============================================
+sal_Bool SAL_CALL SwAccessibleTable::selectRow( sal_Int32 row )
+ throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
+{
+ if( isAccessibleColumnSelected( row ) )
+ return sal_True;
+
+ long lCol, lColumnCount, lChildIndex;
+ lColumnCount = getAccessibleColumnCount();
+ for(lCol = 0; lCol < lColumnCount; lCol ++)
+ {
+ lChildIndex = getAccessibleIndex(row, lCol);
+ selectAccessibleChild(lChildIndex);
+ }
+
+ return sal_True;
+}
+sal_Bool SAL_CALL SwAccessibleTable::selectColumn( sal_Int32 column )
+ throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
+{
+ if( isAccessibleColumnSelected( column ) )
+ return sal_True;
+
+ long lRow, lRowCount, lChildIndex;
+ lRowCount = getAccessibleRowCount();
+
+ for(lRow = 0; lRow < lRowCount; lRow ++)
+ {
+ lChildIndex = getAccessibleIndex(lRow, column);
+ selectAccessibleChild(lChildIndex);
+ }
+ return sal_True;
+}
+sal_Bool SAL_CALL SwAccessibleTable::unselectRow( sal_Int32 row )
+ throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
+{
+ if( isAccessibleSelected( row , 0 ) && isAccessibleSelected( row , getAccessibleColumnCount()-1 ) )
+ {
+ SwCrsrShell* pCrsrShell = GetCrsrShell();
+ if( pCrsrShell != NULL )
+ {
+ pCrsrShell->StartAction();
+ pCrsrShell->ClearMark();
+ pCrsrShell->EndAction();
+ return sal_True;
+ }
+ }
+ return sal_True;
+}
+sal_Bool SAL_CALL SwAccessibleTable::unselectColumn( sal_Int32 column )
+ throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
+{
+ if( isAccessibleSelected( 0 , column ) && isAccessibleSelected( getAccessibleRowCount()-1,column))
+ {
+ SwCrsrShell* pCrsrShell = GetCrsrShell();
+ if( pCrsrShell != NULL )
+ {
+ pCrsrShell->StartAction();
+ pCrsrShell->ClearMark();
+ pCrsrShell->EndAction();
+ return sal_True;
+ }
+ }
+ return sal_True;
+}
+//-----IAccessibility2 Implementation 2009
// --> OD 2007-06-28 #i77106#
// implementation of class <SwAccessibleTableColHeaders>
SwAccessibleTableColHeaders::SwAccessibleTableColHeaders( SwAccessibleMap *pMap2,
diff --git a/sw/source/core/access/acctable.hxx b/sw/source/core/access/acctable.hxx
index 3c68ac1868f0..908908b7b789 100644
--- a/sw/source/core/access/acctable.hxx
+++ b/sw/source/core/access/acctable.hxx
@@ -23,6 +23,12 @@
#ifndef _ACCTABLE_HXX
#define _ACCTABLE_HXX
#include <com/sun/star/accessibility/XAccessibleTable.hpp>
+//IAccessibility2 Implementation 2009-----
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_XAccessibleTableSelection_HPP_
+#include <com/sun/star/accessibility/XAccessibleTableSelection.hpp>
+#endif
+#include <vector>
+//-----IAccessibility2 Implementation 2009
#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
#include <acccontext.hxx>
@@ -40,6 +46,7 @@ class SwAccessibleTable :
public SwAccessibleContext,
public ::com::sun::star::accessibility::XAccessibleTable,
public ::com::sun::star::accessibility::XAccessibleSelection,
+ public ::com::sun::star::accessibility::XAccessibleTableSelection,
public SwClient
{
SwAccessibleTableData_Impl *mpTableData; // the table's data, prot by Sol-Mutex
@@ -85,6 +92,9 @@ protected:
// Is table data evailable?
sal_Bool HasTableData() const { return (mpTableData != 0); }
+ //IAccessibility2 Implementation 2009-----
+ void SetTableData(SwAccessibleTableData_Impl* mpNewTableData) ;
+ //-----IAccessibility2 Implementation 2009
virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
public:
@@ -187,7 +197,17 @@ public:
virtual sal_Int32 SAL_CALL getAccessibleColumn( sal_Int32 nChildIndex )
throw (::com::sun::star::lang::IndexOutOfBoundsException,
::com::sun::star::uno::RuntimeException);
-
+ //IAccessibility2 Implementation 2009-----
+ //===== XAccessibleTableSelection ============================================
+ virtual sal_Bool SAL_CALL selectRow( sal_Int32 row )
+ throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) ;
+ virtual sal_Bool SAL_CALL selectColumn( sal_Int32 column )
+ throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) ;
+ virtual sal_Bool SAL_CALL unselectRow( sal_Int32 row )
+ throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) ;
+ virtual sal_Bool SAL_CALL unselectColumn( sal_Int32 column )
+ throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) ;
+ //-----IAccessibility2 Implementation 2009
//===== XServiceInfo ====================================================
/** Returns an identifier for the implementation of this object.
@@ -254,6 +274,17 @@ public:
throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
::com::sun::star::uno::RuntimeException );
+ //IAccessibility2 Implementation 2009-----
+ //===== XAccessibleComponent ============================================
+ sal_Int32 SAL_CALL getBackground()
+ throw (::com::sun::star::uno::RuntimeException);
+ typedef std::vector<const SwAccessibleContext*> VEC_CELL;
+ VEC_CELL m_vecCellAdd;
+ VEC_CELL m_vecCellRemove;
+ void FireSelectionEvent( );
+ void ClearSelectionCellCache();
+ void AddSelectionCell(const SwAccessibleContext* ,sal_Bool bAddOrRemove);
+ //-----IAccessibility2 Implementation 2009
};
inline SwAccessibleTableData_Impl& SwAccessibleTable::GetTableData()
diff --git a/sw/source/core/access/acctextframe.cxx b/sw/source/core/access/acctextframe.cxx
index 893a45a8b4d0..0fedef797a63 100644
--- a/sw/source/core/access/acctextframe.cxx
+++ b/sw/source/core/access/acctextframe.cxx
@@ -44,6 +44,11 @@
// <--
#include "acctextframe.hxx"
+//IAccessibility2 Implementation 2009-----
+#ifndef _DOC_HXX
+#include <doc.hxx>
+#endif
+//-----IAccessibility2 Implementation 2009
using namespace ::com::sun::star;
using namespace ::com::sun::star::accessibility;
using ::rtl::OUString;
@@ -152,6 +157,125 @@ void SwAccessibleTextFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem *
}
}
+//IAccessibility2 Implementation 2009-----
+//===== XInterface ==========================================================
+
+com::sun::star::uno::Any SAL_CALL
+ SwAccessibleTextFrame::queryInterface (const com::sun::star::uno::Type & rType)
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ ::com::sun::star::uno::Any aReturn = SwAccessibleContext::queryInterface (rType);
+ if ( ! aReturn.hasValue())
+ aReturn = ::cppu::queryInterface (rType,
+ static_cast< ::com::sun::star::accessibility::XAccessibleSelection* >(this)
+ );
+ return aReturn;
+}
+
+
+
+
+void SAL_CALL
+ SwAccessibleTextFrame::acquire (void)
+ throw ()
+{
+ SwAccessibleContext::acquire ();
+}
+
+void SAL_CALL
+ SwAccessibleTextFrame::release (void)
+ throw ()
+{
+ SwAccessibleContext::release ();
+}
+
+//
+//===== XAccessibleSelection ============================================
+//
+
+//--------------------------------------------------------------------------------
+void SAL_CALL SwAccessibleTextFrame::selectAccessibleChild( sal_Int32 )
+ throw ( lang::IndexOutOfBoundsException, uno::RuntimeException )
+{
+ DBG_ASSERT( false, "<SwAccessibleTextFrame::selectAccessibleChild( sal_Int32 )> - missing implementation" );
+}
+
+//----------------------------------------------------------------------------------
+sal_Bool SAL_CALL SwAccessibleTextFrame::isAccessibleChildSelected( sal_Int32 nChildIndex )
+ throw (lang::IndexOutOfBoundsException, uno::RuntimeException )
+{
+ uno::Reference<XAccessible> xAcc = getAccessibleChild( nChildIndex );
+ uno::Reference<XAccessibleContext> xContext;
+ if( xAcc.is() )
+ xContext = xAcc->getAccessibleContext();
+
+ if( xContext.is() )
+ {
+ if( xContext->getAccessibleRole() == AccessibleRole::PARAGRAPH )
+ {
+ uno::Reference< ::com::sun::star::accessibility::XAccessibleText >
+ xText(xAcc, uno::UNO_QUERY);
+ if( xText.is() )
+ {
+ if( xText->getSelectionStart() >= 0 ) return sal_True;
+ }
+ }
+ }
+
+ return sal_False;
+}
+
+//---------------------------------------------------------------------
+void SAL_CALL SwAccessibleTextFrame::clearAccessibleSelection( )
+ throw ( uno::RuntimeException )
+{
+ DBG_ASSERT( false, "<SwAccessibleTextFrame::clearAccessibleSelection( )> - missing implementation" );
+}
+
+//-------------------------------------------------------------------------
+void SAL_CALL SwAccessibleTextFrame::selectAllAccessibleChildren( )
+ throw ( uno::RuntimeException )
+{
+ DBG_ASSERT( false, "<SwAccessibleTextFrame::selectAllAccessibleChildren( )> - missing implementation" );
+}
+
+//----------------------------------------------------------------------------
+sal_Int32 SAL_CALL SwAccessibleTextFrame::getSelectedAccessibleChildCount()
+ throw ( uno::RuntimeException )
+{
+ sal_Int32 nCount = 0;
+ sal_Int32 TotalCount = getAccessibleChildCount();
+ for( sal_Int32 i = 0; i < TotalCount; i++ )
+ if( isAccessibleChildSelected(i) ) nCount++;
+
+ return nCount;
+}
+
+//--------------------------------------------------------------------------------------
+uno::Reference<XAccessible> SAL_CALL SwAccessibleTextFrame::getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex )
+ throw ( lang::IndexOutOfBoundsException, uno::RuntimeException)
+{
+ if ( nSelectedChildIndex > getSelectedAccessibleChildCount() )
+ throw lang::IndexOutOfBoundsException();
+ sal_Int32 i1, i2;
+ for( i1 = 0, i2 = 0; i1 < getAccessibleChildCount(); i1++ )
+ if( isAccessibleChildSelected(i1) )
+ {
+ if( i2 == nSelectedChildIndex )
+ return getAccessibleChild( i1 );
+ i2++;
+ }
+ return uno::Reference<XAccessible>();
+}
+
+//----------------------------------------------------------------------------------
+void SAL_CALL SwAccessibleTextFrame::deselectAccessibleChild( sal_Int32 )
+ throw ( lang::IndexOutOfBoundsException, uno::RuntimeException )
+{
+ DBG_ASSERT( false, "<SwAccessibleTextFrame::selectAllAccessibleChildren( sal_Int32 )> - missing implementation" );
+}
+//-----IAccessibility2 Implementation 2009
+
// --> OD 2009-07-14 #i73249#
OUString SAL_CALL SwAccessibleTextFrame::getAccessibleName (void)
throw (uno::RuntimeException)
@@ -168,15 +292,29 @@ OUString SAL_CALL SwAccessibleTextFrame::getAccessibleName (void)
return SwAccessibleFrameBase::getAccessibleName();
}
// <--
+
OUString SAL_CALL SwAccessibleTextFrame::getAccessibleDescription (void)
throw (uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
CHECK_FOR_DEFUNC( XAccessibleContext )
+ /* MT: I guess msDesc is correct noadays?
+ //IAccessibility2 Implementation 2009-----
+ OUString longDesc;
+ const SwFlyFrmFmt* pFlyFmt = GetShell()->GetDoc()->FindFlyByName( GetName(), 0);
+ if( pFlyFmt )
+ {
+ longDesc = OUString( pFlyFmt->GetDescription() );
+ }
+ if( longDesc.getLength() > 0 )
+ return GetName() + OUString(' ') + longDesc;
+ else
+ return GetName();
+ //-----IAccessibility2 Implementation 2009
+ */
return msDesc;
-
}
OUString SAL_CALL SwAccessibleTextFrame::getImplementationName()
diff --git a/sw/source/core/access/acctextframe.hxx b/sw/source/core/access/acctextframe.hxx
index 0af8b806da89..0f51f82c5a26 100644
--- a/sw/source/core/access/acctextframe.hxx
+++ b/sw/source/core/access/acctextframe.hxx
@@ -24,13 +24,18 @@
#define _ACCTEXTFRAME_HXX
#include "accframebase.hxx"
+//IAccessibility2 Implementation 2009-----
+#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
+//-----IAccessibility2 Implementation 2009
+
class SwFlyFrm;
namespace utl { class AccessibleRelationSetHelper; }
namespace com { namespace star {
namespace accessibility { struct AccessibleRelation; }
} }
-class SwAccessibleTextFrame : public SwAccessibleFrameBase
+class SwAccessibleTextFrame : public SwAccessibleFrameBase,
+ public ::com::sun::star::accessibility::XAccessibleSelection
{
private:
// --> OD 2009-07-14 #i73249#
@@ -48,6 +53,43 @@ public:
SwAccessibleTextFrame( SwAccessibleMap* pInitMap, const SwFlyFrm* pFlyFrm );
+ //IAccessibility2 Implementation 2009-----
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
+ ::com::sun::star::uno::Type const & rType )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw ();
+ virtual void SAL_CALL release() throw ();
+ //===== XAccessibleSelection ============================================
+ virtual void SAL_CALL selectAccessibleChild(
+ sal_Int32 nChildIndex )
+ throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual sal_Bool SAL_CALL isAccessibleChildSelected(
+ sal_Int32 nChildIndex )
+ throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
+ ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL clearAccessibleSelection( )
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL selectAllAccessibleChildren( )
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+ virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( )
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild(
+ sal_Int32 nSelectedChildIndex )
+ throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
+ ::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL deselectAccessibleChild(
+ sal_Int32 nSelectedChildIndex )
+ throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
+ ::com::sun::star::uno::RuntimeException );
+ //-----IAccessibility2 Implementation 2009
+
//===== XAccessibleContext ==============================================
// --> OD 2009-07-14 #i73249#
diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx
index 56eb9f0522df..3509bc4dfdb8 100644
--- a/sw/source/core/attr/format.cxx
+++ b/sw/source/core/attr/format.cxx
@@ -255,7 +255,9 @@ SwFmt::~SwFmt()
}
else
{
- while( GetDepends() )
+ //IAccessibility2 Implementation 2009-----
+ while( GetDepends() && pParentFmt)
+ //-----IAccessibility2 Implementation 2009
{
SwFmtChg aOldFmt(this);
SwFmtChg aNewFmt(pParentFmt);
diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx
index 6a5d2e46e4c2..31dedef94112 100644
--- a/sw/source/core/bastyp/init.cxx
+++ b/sw/source/core/bastyp/init.cxx
@@ -315,7 +315,7 @@ SfxItemInfo __FAR_DATA aSlotTab[] =
{ 0, 0 }, // RES_TXTATR_CHARFMT
{ SID_ATTR_CHAR_CJK_RUBY, 0 }, // RES_TXTATR_CJK_RUBY
{ 0, SFX_ITEM_POOLABLE }, // RES_TXTATR_UNKNOWN_CONTAINER
- { 0, SFX_ITEM_POOLABLE }, // RES_TXTATR_DUMMY5
+ { 0, 0 }, // RES_TXTATR_INPUTFIELD
{ 0, 0 }, // RES_TXTATR_FIELD
{ 0, 0 }, // RES_TXTATR_FLYCNT
@@ -528,8 +528,9 @@ void _InitCore()
aAttrTab[ RES_TXTATR_CHARFMT- POOLATTR_BEGIN ] = new SwFmtCharFmt( 0 );
aAttrTab[ RES_TXTATR_CJK_RUBY - POOLATTR_BEGIN ] = new SwFmtRuby( aEmptyStr );
aAttrTab[ RES_TXTATR_UNKNOWN_CONTAINER - POOLATTR_BEGIN ] = new SvXMLAttrContainerItem( RES_TXTATR_UNKNOWN_CONTAINER );
+ aAttrTab[ RES_TXTATR_INPUTFIELD - POOLATTR_BEGIN ] = new SwFmtFld( RES_TXTATR_INPUTFIELD );
- aAttrTab[ RES_TXTATR_FIELD- POOLATTR_BEGIN ] = new SwFmtFld;
+ aAttrTab[ RES_TXTATR_FIELD- POOLATTR_BEGIN ] = new SwFmtFld( RES_TXTATR_FIELD );
aAttrTab[ RES_TXTATR_FLYCNT - POOLATTR_BEGIN ] = new SwFmtFlyCnt( 0 );
aAttrTab[ RES_TXTATR_FTN - POOLATTR_BEGIN ] = new SwFmtFtn;
@@ -538,7 +539,6 @@ void _InitCore()
aAttrTab[ RES_TXTATR_DUMMY3 - POOLATTR_BEGIN ] = new SfxBoolItem( RES_TXTATR_DUMMY3 );
aAttrTab[ RES_TXTATR_DUMMY1 - POOLATTR_BEGIN ] = new SfxBoolItem( RES_TXTATR_DUMMY1 );
aAttrTab[ RES_TXTATR_DUMMY2 - POOLATTR_BEGIN ] = new SfxBoolItem( RES_TXTATR_DUMMY2 );
- aAttrTab[ RES_TXTATR_DUMMY5 - POOLATTR_BEGIN ] = new SfxBoolItem( RES_TXTATR_DUMMY5 );
// TextAttr - Dummies
aAttrTab[ RES_CHRATR_BIDIRTL - POOLATTR_BEGIN ] = new SfxInt16Item( RES_CHRATR_BIDIRTL, sal_Int16(-1) );
diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx
index 3223d4139f81..b07fafbc0fc6 100644
--- a/sw/source/core/crsr/callnk.cxx
+++ b/sw/source/core/crsr/callnk.cxx
@@ -138,7 +138,7 @@ SwCallLink::~SwCallLink()
for( n = 0; n < rHts.Count(); n++ )
{
const SwTxtAttr* pHt = rHts[ n ];
- pEnd = pHt->GetEnd();
+ pEnd = pHt->End();
nStart = *pHt->GetStart();
// nur Start oder Start und Ende gleich, dann immer
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 872d6569c819..992e1d22db0e 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -421,6 +421,66 @@ sal_Bool SwCrsrShell::LeftRight( sal_Bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMo
}
return bRet;
}
+//IAccessibility2 Implementation 2009-----
+void SwCrsrShell::FirePageChangeEvent(sal_uInt16 nOldPage, sal_uInt16 nNewPage)
+{
+#ifdef ACCESSIBLE_LAYOUT
+ if( Imp()->IsAccessible() )
+ Imp()->FirePageChangeEvent( nOldPage, nNewPage );
+#endif
+}
+
+void SwCrsrShell::FireColumnChangeEvent(sal_uInt16 nOldColumn, sal_uInt16 nNewColumn)
+{
+#ifdef ACCESSIBLE_LAYOUT
+ if( Imp()->IsAccessible() )
+ Imp()->FireColumnChangeEvent( nOldColumn, nNewColumn);
+#endif
+}
+
+
+void SwCrsrShell::FireSectionChangeEvent(sal_uInt16 nOldSection, sal_uInt16 nNewSection)
+{
+#ifdef ACCESSIBLE_LAYOUT
+ if( Imp()->IsAccessible() )
+ Imp()->FireSectionChangeEvent( nOldSection, nNewSection );
+#endif
+}
+bool SwCrsrShell::bColumnChange()
+{
+
+ sal_uInt16 nCurrCol = 0;
+ SwFrm* pCurrFrm = GetCurrFrm(sal_False);
+
+ if (pCurrFrm == NULL)
+ {
+ return sal_False;
+ }
+
+ SwFrm* pCurrCol=((SwFrm*)pCurrFrm)->FindColFrm();
+
+ while(pCurrCol== NULL && pCurrFrm!=NULL )
+ {
+ SwLayoutFrm* pParent = pCurrFrm->GetUpper();
+ if(pParent!=NULL)
+ {
+ pCurrCol=((SwFrm*)pParent)->FindColFrm();
+ pCurrFrm = (SwFrm*)pParent;
+ }
+ else
+ {
+ break;
+ }
+ }
+ if(oldColFrm == pCurrCol)
+ return sal_False;
+ else
+ {
+ oldColFrm = pCurrCol;
+ return sal_True;
+ }
+}
+//-----IAccessibility2 Implementation 2009
// --> OD 2008-04-02 #refactorlists#
void SwCrsrShell::MarkListLevel( const String& sListId,
@@ -899,8 +959,10 @@ void SwCrsrShell::SwapPam()
// Ansonsten wird er auf die gewaehlte SSelection gesetzt.
-sal_Bool SwCrsrShell::ChgCurrPam( const Point & rPt,
- sal_Bool bTstOnly, sal_Bool bTstHit )
+sal_Bool SwCrsrShell::ChgCurrPam(
+ const Point & rPt,
+ sal_Bool bTstOnly,
+ sal_Bool bTstHit )
{
SET_CURR_SHELL( this );
@@ -1351,9 +1413,7 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd )
return; // wenn nicht, dann kein Update !!
}
- // --> OD 2005-12-14 #i27301#
SwNotifyAccAboutInvalidTextSelections aInvalidateTextSelections( *this );
- // <--
if ( bIgnoreReadonly )
{
@@ -2086,6 +2146,7 @@ void SwCrsrShell::ShowCrsr()
if( !bBasicHideCrsr )
{
bSVCrsrVis = sal_True;
+ pCurCrsr->SetShowTxtInputFldOverlay( true );
UpdateCrsr();
}
}
@@ -2098,6 +2159,7 @@ void SwCrsrShell::HideCrsr()
bSVCrsrVis = sal_False;
// evt. die sel. Bereiche aufheben !!
SET_CURR_SHELL( this );
+ pCurCrsr->SetShowTxtInputFldOverlay( false );
pVisCrsr->Hide();
}
}
@@ -2599,6 +2661,9 @@ SwCrsrShell::SwCrsrShell( SwCrsrShell& rShell, Window *pInitWin )
// UpdateCrsr( 0 );
// OD 11.02.2003 #100556#
mbMacroExecAllowed = rShell.IsMacroExecAllowed();
+ //IAccessibility2 Implementation 2009-----
+ oldColFrm = NULL;
+ //-----IAccessibility2 Implementation 2009
}
@@ -2936,38 +3001,34 @@ sal_Bool SwCrsrShell::FindValidCntntNode( sal_Bool bOnlyText )
}
-void SwCrsrShell::NewCoreSelection()
-{
-}
-
-
sal_Bool SwCrsrShell::IsCrsrReadonly() const
{
if ( GetViewOptions()->IsReadonly() ||
- // --> FME 2004-06-29 #114856# Formular view
- GetViewOptions()->IsFormView() )
- // <--
+ GetViewOptions()->IsFormView() ) // Formular view
{
SwFrm *pFrm = GetCurrFrm( sal_False );
const SwFlyFrm* pFly;
const SwSection* pSection;
if( pFrm && pFrm->IsInFly() &&
- (pFly = pFrm->FindFlyFrm())->GetFmt()->GetEditInReadonly().GetValue() &&
- pFly->Lower() &&
- !pFly->Lower()->IsNoTxtFrm() &&
- !GetDrawView()->areSdrObjectsSelected() )
+ (pFly = pFrm->FindFlyFrm())->GetFmt()->GetEditInReadonly().GetValue() &&
+ pFly->Lower() &&
+ !pFly->Lower()->IsNoTxtFrm() &&
+ !GetDrawView()->areSdrObjectsSelected() )
{
return sal_False;
}
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // edit in readonly sections
else if ( pFrm && pFrm->IsInSct() &&
- 0 != ( pSection = pFrm->FindSctFrm()->GetSection() ) &&
- pSection->IsEditInReadonlyFlag() )
+ 0 != ( pSection = pFrm->FindSctFrm()->GetSection() ) &&
+ pSection->IsEditInReadonlyFlag() )
+ {
+ return sal_False;
+ }
+ else if ( !IsMultiSelection() && CrsrInsideInputFld() )
{
return sal_False;
}
- // <--
return sal_True;
}
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index c27ec28cd874..34f06860285b 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -40,7 +40,7 @@
#include <pam.hxx>
#include <ndtxt.hxx>
#include <fldbas.hxx>
-#include <swtable.hxx> // SwTxtFld
+#include <swtable.hxx>
#include <docary.hxx>
#include <txtfld.hxx>
#include <fmtfld.hxx>
@@ -56,7 +56,7 @@
#include <docfld.hxx>
#include <expfld.hxx>
#include <reffld.hxx>
-#include <flddat.hxx> // SwTxtFld
+#include <flddat.hxx>
#include <cellatr.hxx>
#include <swundo.hxx>
#include <redline.hxx>
@@ -619,73 +619,84 @@ const SwTOXMark& SwCrsrShell::GotoTOXMark( const SwTOXMark& rStart,
// springe zum naechsten / vorherigen FeldTypen
-void lcl_MakeFldLst( _SetGetExpFlds& rLst, const SwFieldType& rFldType,
- sal_uInt16 nSubType, sal_Bool bInReadOnly,
- sal_Bool bChkInpFlag = sal_False )
+void lcl_MakeFldLst(
+ _SetGetExpFlds& rLst,
+ const SwFieldType& rFldType,
+ const bool bInReadOnly,
+ const bool bChkInpFlag = false )
{
// es muss immer der 1. Frame gesucht werden
Point aPt;
- SwTxtFld* pTxtFld;
+ SwTxtFld* pTxtFld = NULL;
SwIterator<SwFmtFld,SwFieldType> aIter(rFldType);
- bool bSubType = nSubType != USHRT_MAX;
for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() )
- if( 0 != ( pTxtFld = pFmtFld->GetTxtFld() ) &&
- ( !bChkInpFlag || ((SwSetExpField*)pTxtFld->GetFmtFld().GetField())
- ->GetInputFlag() ) &&
- (!bSubType || (pFmtFld->GetField()->GetSubType()
- & 0xff ) == nSubType ))
+ {
+ pTxtFld = pFmtFld->GetTxtFld();
+ if ( pTxtFld != NULL
+ && ( !bChkInpFlag
+ || ((SwSetExpField*)pTxtFld->GetFmtFld().GetField())->GetInputFlag() ) )
{
- SwCntntFrm* pCFrm;
const SwTxtNode& rTxtNode = pTxtFld->GetTxtNode();
- if( 0 != ( pCFrm = rTxtNode.getLayoutFrm( rTxtNode.GetDoc()->GetCurrentLayout(), &aPt, 0, sal_False )) &&
- ( bInReadOnly || !pCFrm->IsProtected() ))
+ const SwCntntFrm* pCFrm =
+ rTxtNode.getLayoutFrm( rTxtNode.GetDoc()->GetCurrentLayout(), &aPt, 0, sal_False );
+ if ( pCFrm != NULL
+ && ( bInReadOnly || !pCFrm->IsProtected() ) )
{
- _SetGetExpFld* pNew = new _SetGetExpFld(
- SwNodeIndex( rTxtNode ), pTxtFld );
+ _SetGetExpFld* pNew = new _SetGetExpFld( SwNodeIndex( rTxtNode ), pTxtFld );
pNew->SetBodyPos( *pCFrm );
rLst.Insert( pNew );
}
}
+ }
}
-sal_Bool SwCrsrShell::MoveFldType( const SwFieldType* pFldType, sal_Bool bNext,
- sal_uInt16 nSubType, sal_uInt16 nResType )
+sal_Bool SwCrsrShell::MoveFldType(
+ const SwFieldType* pFldType,
+ const bool bNext,
+ const sal_uInt16 nResType,
+ const bool bAddSetExpressionFldsToInputFlds )
{
// sortierte Liste aller Felder
_SetGetExpFlds aSrtLst( 64 );
- if (pFldType)
+ if ( pFldType )
{
if( RES_INPUTFLD != pFldType->Which() && !pFldType->GetDepends() )
+ {
return sal_False;
+ }
// Modify-Object gefunden, trage alle Felder ins Array ein
- ::lcl_MakeFldLst( aSrtLst, *pFldType, nSubType, IsReadOnlyAvailable() );
+ ::lcl_MakeFldLst( aSrtLst, *pFldType, ( IsReadOnlyAvailable() ? true : false ) );
- if( RES_INPUTFLD == pFldType->Which() )
+ if( RES_INPUTFLD == pFldType->Which() && bAddSetExpressionFldsToInputFlds )
{
// es gibt noch versteckte InputFelder in den SetExp. Feldern
const SwFldTypes& rFldTypes = *pDoc->GetFldTypes();
const sal_uInt16 nSize = rFldTypes.Count();
-
- // Alle Typen abklappern
for( sal_uInt16 i=0; i < nSize; ++i )
- if( RES_SETEXPFLD == ( pFldType = rFldTypes[ i ] )->Which() )
- ::lcl_MakeFldLst( aSrtLst, *pFldType, nSubType,
- IsReadOnlyAvailable(), sal_True );
+ {
+ pFldType = rFldTypes[ i ];
+ if ( RES_SETEXPFLD == pFldType->Which() )
+ {
+ ::lcl_MakeFldLst( aSrtLst, *pFldType, ( IsReadOnlyAvailable() ? true : false ), true );
+ }
+ }
}
}
else
{
const SwFldTypes& rFldTypes = *pDoc->GetFldTypes();
const sal_uInt16 nSize = rFldTypes.Count();
-
- // Alle Typen abklappern
for( sal_uInt16 i=0; i < nSize; ++i )
- if( nResType == ( pFldType = rFldTypes[ i ] )->Which() )
- ::lcl_MakeFldLst( aSrtLst, *pFldType, nSubType,
- IsReadOnlyAvailable() );
+ {
+ pFldType = rFldTypes[ i ];
+ if( nResType == pFldType->Which() )
+ {
+ ::lcl_MakeFldLst( aSrtLst, *pFldType, ( IsReadOnlyAvailable() ? true : false ) );
+ }
+ }
}
// keine Felder gefunden?
@@ -704,12 +715,11 @@ sal_Bool SwCrsrShell::MoveFldType( const SwFieldType* pFldType, sal_Bool bNext,
SwTxtNode* pTNd = rPos.nNode.GetNode().GetTxtNode();
ASSERT( pTNd, "Wo ist mein CntntNode?" );
- SwTxtFld * pTxtFld = static_cast<SwTxtFld *>(
- pTNd->GetTxtAttrForCharAt(rPos.nContent.GetIndex(),
- RES_TXTATR_FIELD));
- sal_Bool bDelFld = 0 == pTxtFld;
+ SwTxtFld * pTxtFld = pTNd->GetFldTxtAttrAt( rPos.nContent.GetIndex(), true );
+ const bool bDelFld = ( pTxtFld == NULL );
if( bDelFld )
{
+ // create dummy for the search
SwFmtFld* pFmtFld = new SwFmtFld( SwDateTimeField(
(SwDateTimeFieldType*)pDoc->GetSysFldType( RES_DATETIMEFLD ) ) );
@@ -717,7 +727,12 @@ sal_Bool SwCrsrShell::MoveFldType( const SwFieldType* pFldType, sal_Bool bNext,
pTxtFld->ChgTxtNode( pTNd );
}
- _SetGetExpFld aSrch( rPos.nNode, pTxtFld, &rPos.nContent );
+ SwIndex aSearchIdx( rPos.nContent );
+ if ( !bDelFld && pTxtFld->HasContent() )
+ {
+ aSearchIdx = *(pTxtFld->GetStart());
+ }
+ _SetGetExpFld aSrch( rPos.nNode, pTxtFld, &aSearchIdx );
if( rPos.nNode.GetIndex() < pDoc->GetNodes().GetEndOfExtras().GetIndex() )
{
// auch beim Einsammeln wird nur der erste Frame benutzt!
@@ -743,7 +758,9 @@ sal_Bool SwCrsrShell::MoveFldType( const SwFieldType* pFldType, sal_Bool bNext,
return sal_False; // weiter nach vorne geht nicht
}
else if( bNext ? nPos >= aSrtLst.Count() : !nPos--)
+ {
return sal_False;
+ }
}
const _SetGetExpFld& rFnd = **( aSrtLst.GetData() + nPos );
@@ -784,6 +801,128 @@ sal_Bool SwCrsrShell::GotoFld( const SwFmtFld& rFld )
}
+SwTxtFld * SwCrsrShell::GetTxtFldAtPos(
+ const SwPosition* pPos,
+ const bool bIncludeInputFldAtStart ) const
+{
+ SwTxtFld* pTxtFld = NULL;
+
+ SwTxtNode * const pNode = pPos->nNode.GetNode().GetTxtNode();
+ if ( pNode != NULL )
+ {
+ pTxtFld = pNode->GetFldTxtAttrAt( pPos->nContent.GetIndex(), bIncludeInputFldAtStart );
+ }
+
+ return pTxtFld;
+}
+
+
+SwField* SwCrsrShell::GetFieldAtCrsr(
+ const SwPaM* pCrsr,
+ const bool bIncludeInputFldAtStart ) const
+{
+ SwField* pFieldAtCrsr = NULL;
+
+ SwTxtFld* pTxtFld = GetTxtFldAtPos( pCrsr->Start(), bIncludeInputFldAtStart );
+ if ( pTxtFld != NULL
+ && pCrsr->Start()->nNode == pCrsr->End()->nNode )
+ {
+ const xub_StrLen nTxtFldLength =
+ pTxtFld->End() != NULL
+ ? *(pTxtFld->End()) - *(pTxtFld->GetStart())
+ : 1;
+ if ( ( pCrsr->End()->nContent.GetIndex() - pCrsr->Start()->nContent.GetIndex() ) <= nTxtFldLength )
+ {
+ pFieldAtCrsr = (SwField*)pTxtFld->GetFmtFld().GetField();
+ }
+ }
+
+ return pFieldAtCrsr;
+}
+
+
+SwField* SwCrsrShell::GetCurFld( const bool bIncludeInputFldAtStart ) const
+{
+ SwPaM* pCrsr = GetCrsr();
+ if ( pCrsr->GetNext() != pCrsr )
+ {
+ // multi selection not handled.
+ return NULL;
+ }
+
+ SwField* pCurFld = GetFieldAtCrsr( pCrsr, bIncludeInputFldAtStart );;
+ if ( pCurFld != NULL
+ && RES_TABLEFLD == pCurFld->GetTyp()->Which() )
+ {
+ // TabellenFormel ? wandel internen in externen Namen um
+ const SwTableNode* pTblNd = IsCrsrInTbl();
+ ((SwTblField*)pCurFld)->PtrToBoxNm( pTblNd ? &pTblNd->GetTable() : 0 );
+ }
+
+ return pCurFld;
+}
+
+
+bool SwCrsrShell::CrsrInsideInputFld() const
+{
+ bool bCrsrInsideInputFld = false;
+
+ const SwPaM* pCrsr = GetCrsr();
+ const SwPaM* pFirst = pCrsr;
+ do
+ {
+ bCrsrInsideInputFld = dynamic_cast<const SwInputField*>(GetFieldAtCrsr( pCrsr, false )) != NULL;
+
+ pCrsr = static_cast<SwPaM*>(pCrsr->GetNext());
+ } while ( !bCrsrInsideInputFld
+ && pCrsr != pFirst );
+
+ return bCrsrInsideInputFld;
+}
+
+
+bool SwCrsrShell::PosInsideInputFld( const SwPosition& rPos ) const
+{
+ return dynamic_cast<const SwTxtInputFld*>(GetTxtFldAtPos( &rPos, false )) != NULL;
+}
+
+
+bool SwCrsrShell::DocPtInsideInputFld( const Point& rDocPt ) const
+{
+ SwPosition aPos( *(GetCrsr()->Start()) );
+ Point aDocPt( rDocPt );
+ if ( GetLayout()->GetCrsrOfst( &aPos, aDocPt ) )
+ {
+ return PosInsideInputFld( aPos );
+ }
+ return false;
+}
+
+
+xub_StrLen SwCrsrShell::StartOfInputFldAtPos( const SwPosition& rPos ) const
+{
+ const SwTxtInputFld* pTxtInputFld = dynamic_cast<const SwTxtInputFld*>(GetTxtFldAtPos( &rPos, true ));
+ if ( pTxtInputFld == NULL )
+ {
+ ASSERT( false, "<SwEditShell::StartOfInputFldAtPos(..)> - no Input Field at given position" );
+ return 0;
+ }
+ return *(pTxtInputFld->GetStart());
+}
+
+
+xub_StrLen SwCrsrShell::EndOfInputFldAtPos( const SwPosition& rPos ) const
+{
+ const SwTxtInputFld* pTxtInputFld = dynamic_cast<const SwTxtInputFld*>(GetTxtFldAtPos( &rPos, true ));
+ if ( pTxtInputFld == NULL )
+ {
+ ASSERT( false, "<SwEditShell::EndOfInputFldAtPos(..)> - no Input Field at given position" );
+ return 0;
+ }
+ return *(pTxtInputFld->End());
+}
+
+
void SwCrsrShell::GotoOutline( sal_uInt16 nIdx )
{
SwCursor* pCrsr = getShellCrsr( true );
@@ -1029,7 +1168,8 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
pTxtNd = aPos.nNode.GetNode().GetTxtNode();
const SwNodes& rNds = GetDoc()->GetNodes();
- if( pTxtNd && SwContentAtPos::SW_OUTLINE & rCntntAtPos.eCntntAtPos
+ if( pTxtNd
+ && SwContentAtPos::SW_OUTLINE & rCntntAtPos.eCntntAtPos
&& rNds.GetOutLineNds().Count() )
{
const SwTxtNode* pONd = pTxtNd->FindOutlineNodeOfLevel( MAXLEVEL-1);
@@ -1040,16 +1180,13 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
bRet = sal_True;
}
}
- // --> FME 2005-05-13 #i43742# New function: SW_CONTENT_CHECK
- else if ( SwContentAtPos::SW_CONTENT_CHECK & rCntntAtPos.eCntntAtPos &&
- bCrsrFoundExact )
+ else if ( SwContentAtPos::SW_CONTENT_CHECK & rCntntAtPos.eCntntAtPos
+ && bCrsrFoundExact )
{
bRet = sal_True;
}
- // <--
- // #i23726#
- else if( pTxtNd &&
- SwContentAtPos::SW_NUMLABEL & rCntntAtPos.eCntntAtPos)
+ else if( pTxtNd
+ && SwContentAtPos::SW_NUMLABEL & rCntntAtPos.eCntntAtPos)
{
bRet = aTmpState.bInNumPortion;
rCntntAtPos.aFnd.pNode = pTxtNd;
@@ -1062,8 +1199,9 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
{
if( !aTmpState.bPosCorr )
{
- if( !bRet && SwContentAtPos::SW_SMARTTAG & rCntntAtPos.eCntntAtPos
- && !aTmpState.bFtnNoInfo )
+ if ( !bRet
+ && SwContentAtPos::SW_SMARTTAG & rCntntAtPos.eCntntAtPos
+ && !aTmpState.bFtnNoInfo )
{
const SwWrongList* pSmartTagList = pTxtNd->GetSmartTags();
xub_StrLen nCurrent = aPos.nContent.GetIndex();
@@ -1090,22 +1228,14 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
pCurCrsr->DeleteMark();
*pCurCrsr->GetPoint() = aPos;
- if( pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
- nsSwCursorSelOverFlags::SELOVER_TOGGLE) )
+ if( pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION | nsSwCursorSelOverFlags::SELOVER_TOGGLE) )
bRet = sal_False;
else
UpdateCrsr();
}
if( bRet )
{
-// rCntntAtPos.sStr = pTxtNd->GetExpandTxt(
-// *pTxtAttr->GetStart(),
-// *pTxtAttr->GetEnd() - *pTxtAttr->GetStart(),
-// sal_False );
-
-// rCntntAtPos.aFnd.pAttr = &pTxtAttr->GetAttr();
rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_SMARTTAG;
-// rCntntAtPos.pFndTxtAttr = pTxtAttr;
if( pFldRect && 0 != ( pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt ) ) )
pFrm->GetCharRect( *pFldRect, aPos, &aTmpState );
@@ -1113,19 +1243,21 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
}
}
- if( !bRet && ( SwContentAtPos::SW_FIELD | SwContentAtPos::SW_CLICKFIELD )
- & rCntntAtPos.eCntntAtPos && !aTmpState.bFtnNoInfo )
+ if ( !bRet
+ && ( SwContentAtPos::SW_FIELD | SwContentAtPos::SW_CLICKFIELD ) & rCntntAtPos.eCntntAtPos
+ && !aTmpState.bFtnNoInfo )
{
- pTxtAttr = pTxtNd->GetTxtAttrForCharAt(
- aPos.nContent.GetIndex(), RES_TXTATR_FIELD );
- const SwField* pFld = pTxtAttr
- ? pTxtAttr->GetFmtFld().GetField()
- : 0;
- if( SwContentAtPos::SW_CLICKFIELD & rCntntAtPos.eCntntAtPos &&
- pFld && !pFld->HasClickHdl() )
+ pTxtAttr = pTxtNd->GetFldTxtAttrAt( aPos.nContent.GetIndex() );
+ const SwField* pFld = pTxtAttr != NULL
+ ? pTxtAttr->GetFmtFld().GetField()
+ : 0;
+ if ( SwContentAtPos::SW_CLICKFIELD & rCntntAtPos.eCntntAtPos
+ && pFld && !pFld->HasClickHdl() )
+ {
pFld = 0;
+ }
- if( pFld )
+ if ( pFld )
{
if( pFldRect && 0 != ( pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt ) ) )
pFrm->GetCharRect( *pFldRect, aPos, &aTmpState );
@@ -1141,14 +1273,14 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
// Click-Felder in geschuetzten Bereichen zulassen
// Nur Platzhalter geht nicht!
if( SwContentAtPos::SW_FIELD & rCntntAtPos.eCntntAtPos
- || RES_JUMPEDITFLD == pFld->Which() )
+ || RES_JUMPEDITFLD == pFld->Which() )
pFld = 0;
}
else
UpdateCrsr();
}
else if( RES_TABLEFLD == pFld->Which() &&
- ((SwTblField*)pFld)->IsIntrnlName() )
+ ((SwTblField*)pFld)->IsIntrnlName() )
{
// erzeuge aus der internen (fuer CORE)
// die externe (fuer UI) Formel
@@ -1167,16 +1299,16 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
}
}
- if( !bRet && SwContentAtPos::SW_FORMCTRL & rCntntAtPos.eCntntAtPos )
- {
- IDocumentMarkAccess* pMarksAccess = GetDoc()->getIDocumentMarkAccess( );
- sw::mark::IFieldmark* pFldBookmark = pMarksAccess->getFieldmarkFor( aPos );
- if( bCrsrFoundExact && pTxtNd && pFldBookmark) {
- rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_FORMCTRL;
- rCntntAtPos.aFnd.pFldmark = pFldBookmark;
- bRet=sal_True;
- }
- }
+ if( !bRet && SwContentAtPos::SW_FORMCTRL & rCntntAtPos.eCntntAtPos )
+ {
+ IDocumentMarkAccess* pMarksAccess = GetDoc()->getIDocumentMarkAccess( );
+ sw::mark::IFieldmark* pFldBookmark = pMarksAccess->getFieldmarkFor( aPos );
+ if( bCrsrFoundExact && pTxtNd && pFldBookmark) {
+ rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_FORMCTRL;
+ rCntntAtPos.aFnd.pFldmark = pFldBookmark;
+ bRet=sal_True;
+ }
+ }
if( !bRet && SwContentAtPos::SW_FTN & rCntntAtPos.eCntntAtPos )
{
@@ -1194,7 +1326,7 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_FTN;
}
else if ( 0 != ( pTxtAttr = pTxtNd->GetTxtAttrForCharAt(
- aPos.nContent.GetIndex(), RES_TXTATR_FTN )) )
+ aPos.nContent.GetIndex(), RES_TXTATR_FTN )) )
{
bRet = sal_True;
if( bSetCrsr )
@@ -1203,14 +1335,14 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
SwCrsrSaveState aSaveState( *pCurCrsr );
pCurCrsr->GetPoint()->nNode = *((SwTxtFtn*)pTxtAttr)->GetStartNode();
SwCntntNode* pCNd = GetDoc()->GetNodes().GoNextSection(
- &pCurCrsr->GetPoint()->nNode,
- sal_True, !IsReadOnlyAvailable() );
+ &pCurCrsr->GetPoint()->nNode,
+ sal_True, !IsReadOnlyAvailable() );
if( pCNd )
{
pCurCrsr->GetPoint()->nContent.Assign( pCNd, 0 );
if( pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
- nsSwCursorSelOverFlags::SELOVER_TOGGLE ))
+ nsSwCursorSelOverFlags::SELOVER_TOGGLE ))
bRet = sal_False;
else
UpdateCrsr();
@@ -1231,9 +1363,9 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
}
}
- if( !bRet && ( SwContentAtPos::SW_TOXMARK |
- SwContentAtPos::SW_REFMARK ) &
- rCntntAtPos.eCntntAtPos && !aTmpState.bFtnNoInfo )
+ if( !bRet
+ && ( SwContentAtPos::SW_TOXMARK | SwContentAtPos::SW_REFMARK ) & rCntntAtPos.eCntntAtPos
+ && !aTmpState.bFtnNoInfo )
{
pTxtAttr = 0;
if( SwContentAtPos::SW_TOXMARK & rCntntAtPos.eCntntAtPos )
@@ -1268,8 +1400,7 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
SwCrsrSaveState aSaveState( *pCurCrsr );
pCurCrsr->DeleteMark();
*pCurCrsr->GetPoint() = aPos;
- if( pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
- nsSwCursorSelOverFlags::SELOVER_TOGGLE ) )
+ if( pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION | nsSwCursorSelOverFlags::SELOVER_TOGGLE ) )
bRet = sal_False;
else
UpdateCrsr();
@@ -1277,19 +1408,18 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
if( bRet )
{
- const xub_StrLen* pEnd = pTxtAttr->GetEnd();
+ const xub_StrLen* pEnd = pTxtAttr->End();
if( pEnd )
- rCntntAtPos.sStr = pTxtNd->GetExpandTxt(
- *pTxtAttr->GetStart(),
- *pEnd - *pTxtAttr->GetStart() );
+ rCntntAtPos.sStr =
+ pTxtNd->GetExpandTxt( *pTxtAttr->GetStart(), *pEnd - *pTxtAttr->GetStart() );
else if( RES_TXTATR_TOXMARK == pTxtAttr->Which())
- rCntntAtPos.sStr = pTxtAttr->GetTOXMark().
- GetAlternativeText();
+ rCntntAtPos.sStr =
+ pTxtAttr->GetTOXMark().GetAlternativeText();
rCntntAtPos.eCntntAtPos =
RES_TXTATR_TOXMARK == pTxtAttr->Which()
- ? SwContentAtPos::SW_TOXMARK
- : SwContentAtPos::SW_REFMARK;
+ ? SwContentAtPos::SW_TOXMARK
+ : SwContentAtPos::SW_REFMARK;
rCntntAtPos.pFndTxtAttr = pTxtAttr;
rCntntAtPos.aFnd.pAttr = &pTxtAttr->GetAttr();
@@ -1299,8 +1429,9 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
}
}
- if( !bRet && SwContentAtPos::SW_INETATTR & rCntntAtPos.eCntntAtPos
- && !aTmpState.bFtnNoInfo )
+ if ( !bRet
+ && SwContentAtPos::SW_INETATTR & rCntntAtPos.eCntntAtPos
+ && !aTmpState.bFtnNoInfo )
{
pTxtAttr = pTxtNd->GetTxtAttrAt(
aPos.nContent.GetIndex(), RES_TXTATR_INETFMT);
@@ -1315,7 +1446,7 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
pCurCrsr->DeleteMark();
*pCurCrsr->GetPoint() = aPos;
if( pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
- nsSwCursorSelOverFlags::SELOVER_TOGGLE) )
+ nsSwCursorSelOverFlags::SELOVER_TOGGLE) )
bRet = sal_False;
else
UpdateCrsr();
@@ -1323,8 +1454,8 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
if( bRet )
{
rCntntAtPos.sStr = pTxtNd->GetExpandTxt(
- *pTxtAttr->GetStart(),
- *pTxtAttr->GetEnd() - *pTxtAttr->GetStart() );
+ *pTxtAttr->GetStart(),
+ *pTxtAttr->GetEnd() - *pTxtAttr->GetStart() );
rCntntAtPos.aFnd.pAttr = &pTxtAttr->GetAttr();
rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_INETATTR;
@@ -1352,12 +1483,12 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
}
}
- if( !bRet && (
- SwContentAtPos::SW_TABLEBOXFML & rCntntAtPos.eCntntAtPos
+ if( !bRet
+ && ( SwContentAtPos::SW_TABLEBOXFML & rCntntAtPos.eCntntAtPos
#ifdef DBG_UTIL
- || SwContentAtPos::SW_TABLEBOXVALUE & rCntntAtPos.eCntntAtPos
+ || SwContentAtPos::SW_TABLEBOXVALUE & rCntntAtPos.eCntntAtPos
#endif
- ))
+ ) )
{
const SwTableNode* pTblNd;
const SwTableBox* pBox;
@@ -1365,15 +1496,15 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
const SfxPoolItem* pItem;
if( pSttNd && 0 != ( pTblNd = pTxtNd->FindTableNode()) &&
0 != ( pBox = pTblNd->GetTable().GetTblBox(
- pSttNd->GetIndex() )) &&
+ pSttNd->GetIndex() )) &&
#ifdef DBG_UTIL
( SFX_ITEM_SET == pBox->GetFrmFmt()->GetItemState(
- RES_BOXATR_FORMULA, sal_False, &pItem ) ||
- SFX_ITEM_SET == pBox->GetFrmFmt()->GetItemState(
- RES_BOXATR_VALUE, sal_False, &pItem ))
+ RES_BOXATR_FORMULA, sal_False, &pItem ) ||
+ SFX_ITEM_SET == pBox->GetFrmFmt()->GetItemState(
+ RES_BOXATR_VALUE, sal_False, &pItem ))
#else
SFX_ITEM_SET == pBox->GetFrmFmt()->GetItemState(
- RES_BOXATR_FORMULA, sal_False, &pItem )
+ RES_BOXATR_FORMULA, sal_False, &pItem )
#endif
)
{
@@ -1405,7 +1536,7 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_TABLEBOXVALUE;
else
#endif
- ((SwTblBoxFormula*)pItem)->PtrToBoxNm( &pTblNd->GetTable() );
+ ((SwTblBoxFormula*)pItem)->PtrToBoxNm( &pTblNd->GetTable() );
bRet = sal_True;
if( bSetCrsr )
@@ -1414,7 +1545,7 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
SwCrsrSaveState aSaveState( *pCurCrsr );
*pCurCrsr->GetPoint() = aPos;
if( pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
- nsSwCursorSelOverFlags::SELOVER_TOGGLE) )
+ nsSwCursorSelOverFlags::SELOVER_TOGGLE) )
bRet = sal_False;
else
UpdateCrsr();
@@ -1439,7 +1570,7 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
{
xub_StrLen n = aPos.nContent.GetIndex();
SfxItemSet aSet( GetDoc()->GetAttrPool(), POOLATTR_BEGIN,
- POOLATTR_END - 1 );
+ POOLATTR_END - 1 );
if( pTxtNd->GetpSwpHints() )
{
for( sal_uInt16 i = 0; i < pTxtNd->GetSwpHints().Count(); ++i )
@@ -1449,12 +1580,12 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
if( nAttrStart > n ) // ueber den Bereich hinaus
break;
- if( 0 != pHt->GetEnd() && (
+ if( 0 != pHt->End() && (
( nAttrStart < n &&
- ( pHt->DontExpand() ? n < *pHt->GetEnd()
- : n <= *pHt->GetEnd() )) ||
+ ( pHt->DontExpand() ? n < *pHt->End()
+ : n <= *pHt->End() )) ||
( n == nAttrStart &&
- ( nAttrStart == *pHt->GetEnd() || !n ))) )
+ ( nAttrStart == *pHt->End() || !n ))) )
{
aSet.Put( pHt->GetAttr() );
}
@@ -1473,18 +1604,18 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
pTxtNd->SwCntntNode::GetAttr( aSet );
rCntntAtPos.sStr.AssignAscii(
- RTL_CONSTASCII_STRINGPARAM( "Pos: (" ));
+ RTL_CONSTASCII_STRINGPARAM( "Pos: (" ));
rCntntAtPos.sStr += String::CreateFromInt32( aPos.nNode.GetIndex());
rCntntAtPos.sStr += ':';
rCntntAtPos.sStr += String::CreateFromInt32( aPos.nContent.GetIndex());
rCntntAtPos.sStr += ')';
rCntntAtPos.sStr.AppendAscii(
- RTL_CONSTASCII_STRINGPARAM( "\nAbs.Vorl.: " ));
+ RTL_CONSTASCII_STRINGPARAM( "\nAbs.Vorl.: " ));
rCntntAtPos.sStr += pTxtNd->GetFmtColl()->GetName();
if( pTxtNd->GetCondFmtColl() )
rCntntAtPos.sStr.AppendAscii(
- RTL_CONSTASCII_STRINGPARAM( "\nBed.Vorl.: " ))
- += pTxtNd->GetCondFmtColl()->GetName();
+ RTL_CONSTASCII_STRINGPARAM( "\nBed.Vorl.: " ))
+ += pTxtNd->GetCondFmtColl()->GetName();
if( aSet.Count() )
{
@@ -1497,11 +1628,11 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
{
String aStr;
GetDoc()->GetAttrPool().GetPresentation( *pItem,
- SFX_ITEM_PRESENTATION_COMPLETE,
- SFX_MAPUNIT_CM, aStr );
+ SFX_ITEM_PRESENTATION_COMPLETE,
+ SFX_MAPUNIT_CM, aStr );
if( sAttrs.Len() )
sAttrs.AppendAscii(
- RTL_CONSTASCII_STRINGPARAM( ", " ));
+ RTL_CONSTASCII_STRINGPARAM( ", " ));
sAttrs += aStr;
}
if( aIter.IsAtEnd() )
@@ -1513,8 +1644,8 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
if( rCntntAtPos.sStr.Len() )
rCntntAtPos.sStr += '\n';
rCntntAtPos.sStr.AppendAscii(
- RTL_CONSTASCII_STRINGPARAM( "Attr: " ) )
- += sAttrs;
+ RTL_CONSTASCII_STRINGPARAM( "Attr: " ) )
+ += sAttrs;
}
}
bRet = sal_True;
@@ -1532,7 +1663,6 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
return bRet;
}
-// --> OD 2008-06-19 #i90516#
const SwPostItField* SwCrsrShell::GetPostItFieldAtCursor() const
{
const SwPostItField* pPostItFld = 0;
@@ -1543,9 +1673,8 @@ const SwPostItField* SwCrsrShell::GetPostItFieldAtCursor() const
const SwTxtNode* pTxtNd = pCursorPos->nNode.GetNode().GetTxtNode();
if ( pTxtNd )
{
- SwTxtAttr* pTxtAttr = pTxtNd->GetTxtAttrForCharAt(
- pCursorPos->nContent.GetIndex(), RES_TXTATR_FIELD );
- const SwField* pFld = pTxtAttr ? pTxtAttr->GetFmtFld().GetField() : 0;
+ SwTxtAttr* pTxtAttr = pTxtNd->GetFldTxtAttrAt( pCursorPos->nContent.GetIndex() );
+ const SwField* pFld = pTxtAttr != NULL ? pTxtAttr->GetFmtFld().GetField() : 0;
if ( pFld && pFld->Which()== RES_POSTITFLD )
{
pPostItFld = static_cast<const SwPostItField*>(pFld);
@@ -1555,7 +1684,6 @@ const SwPostItField* SwCrsrShell::GetPostItFieldAtCursor() const
return pPostItFld;
}
-// <--
// befindet sich der Node in einem geschuetzten Bereich?
sal_Bool SwContentAtPos::IsInProtectSect() const
@@ -1624,17 +1752,44 @@ bool SwContentAtPos::IsInRTLText()const
return bRet;
}
-sal_Bool SwCrsrShell::SelectTxtAttr( sal_uInt16 nWhich, sal_Bool bExpand,
- const SwTxtAttr* pTxtAttr )
+
+sal_Bool SwCrsrShell::SelectTxt( const xub_StrLen nStart,
+ const xub_StrLen nEnd )
+{
+ SET_CURR_SHELL( this );
+ sal_Bool bRet = sal_False;
+
+ SwCallLink aLk( *this );
+ SwCrsrSaveState aSaveState( *pCurCrsr );
+
+ SwPosition& rPos = *pCurCrsr->GetPoint();
+ pCurCrsr->DeleteMark();
+ rPos.nContent = nStart;
+ pCurCrsr->SetMark();
+ rPos.nContent = nEnd;
+
+ if( !pCurCrsr->IsSelOvr() )
+ {
+ UpdateCrsr();
+ bRet = sal_True;
+ }
+
+ return bRet;
+}
+
+
+sal_Bool SwCrsrShell::SelectTxtAttr( sal_uInt16 nWhich,
+ sal_Bool bExpand,
+ const SwTxtAttr* pTxtAttr )
{
SET_CURR_SHELL( this );
sal_Bool bRet = sal_False;
if( !IsTableMode() )
{
- SwPosition& rPos = *pCurCrsr->GetPoint();
if( !pTxtAttr )
{
+ SwPosition& rPos = *pCurCrsr->GetPoint();
SwTxtNode* pTxtNd = rPos.nNode.GetNode().GetTxtNode();
pTxtAttr = (pTxtNd)
? pTxtNd->GetTxtAttrAt(rPos.nContent.GetIndex(),
@@ -1645,20 +1800,8 @@ sal_Bool SwCrsrShell::SelectTxtAttr( sal_uInt16 nWhich, sal_Bool bExpand,
if( pTxtAttr )
{
- SwCallLink aLk( *this ); // Crsr-Moves ueberwachen,
- SwCrsrSaveState aSaveState( *pCurCrsr );
-
- pCurCrsr->DeleteMark();
- rPos.nContent = *pTxtAttr->GetStart();
- pCurCrsr->SetMark();
- const xub_StrLen* pEnd = pTxtAttr->GetEnd();
- rPos.nContent = pEnd ? *pEnd : *pTxtAttr->GetStart() + 1;
-
- if( !pCurCrsr->IsSelOvr() )
- {
- UpdateCrsr();
- bRet = sal_True;
- }
+ const xub_StrLen* pEnd = pTxtAttr->End();
+ bRet = SelectTxt( *pTxtAttr->GetStart(), ( pEnd ? *pEnd : *pTxtAttr->GetStart() + 1 ) );
}
}
return bRet;
@@ -2177,7 +2320,7 @@ sal_Bool SwCrsrShell::SelectNxtPrvHyperlink( sal_Bool bNext )
aCmpPos.GetPosOfContent( *pCurCrsr->GetPoint() );
pCurCrsr->DeleteMark();
pCurCrsr->SetMark();
- pCurCrsr->GetPoint()->nContent = *pFndAttr->SwTxtAttr::GetEnd();
+ pCurCrsr->GetPoint()->nContent = *pFndAttr->End();
if( !pCurCrsr->IsInProtectTable() && !pCurCrsr->IsSelOvr() )
{
diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx
index 9d2c2f1697ef..09c3e4da7c8e 100644
--- a/sw/source/core/crsr/findattr.cxx
+++ b/sw/source/core/crsr/findattr.cxx
@@ -154,7 +154,7 @@ sal_Bool lcl_Search( const SwTxtNode& rTxtNd, SwPaM& rPam,
if( pTxtHt->Which() == rCmpItem.Which() &&
( !bValue || CmpAttr( pTxtHt->GetAttr(), rCmpItem )))
{
- lcl_SetAttrPam( rPam, *pTxtHt->GetStart(), pTxtHt->GetEnd(), bForward );
+ lcl_SetAttrPam( rPam, *pTxtHt->GetStart(), pTxtHt->End(), bForward );
return sal_True;
}
return sal_False;
@@ -902,7 +902,7 @@ sal_Bool SwPaM::Find( const SfxPoolItem& rAttr, sal_Bool bValue, SwMoveFn fnMove
const SwPaM *pRegion, sal_Bool bInReadOnly )
{
// stelle fest welches Attribut gesucht wird:
- sal_uInt16 nWhich = rAttr.Which();
+ const sal_uInt16 nWhich = rAttr.Which();
int bCharAttr = isCHRATR(nWhich) || isTXTATR(nWhich);
SwPaM* pPam = MakeRegion( fnMove, pRegion );
diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index 74cca2655f14..eee273145425 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -57,9 +57,10 @@ using namespace util;
String *ReplaceBackReferences( const SearchOptions& rSearchOpt, SwPaM* pPam );
+
String& lcl_CleanStr(
const SwTxtNode& rNd,
- xub_StrLen nStart,
+ const xub_StrLen nStart,
xub_StrLen& rEnde,
SvULongs& rArr,
String& rRet,
@@ -125,7 +126,6 @@ String& lcl_CleanStr(
const SwTxtAttr* pHt = (*pHts)[n];
if ( pHt->HasDummyChar() && (nStt >= nStart) )
{
- //JP 17.05.00: Task 75806 ask for ">=" and not for ">"
switch( pHt->Which() )
{
case RES_TXTATR_FLYCNT:
@@ -136,14 +136,6 @@ String& lcl_CleanStr(
case RES_TXTATR_META:
case RES_TXTATR_METAFIELD:
{
- // JP 06.05.98: mit Bug 50100 werden sie als Trenner erwuenscht und nicht
- // mehr zum Wort dazu gehoerend.
- // MA 23.06.98: mit Bug 51215 sollen sie konsequenterweise auch am
- // Satzanfang und -ende ignoriert werden wenn sie Leer sind.
- // Dazu werden sie schlicht entfernt. Fuer den Anfang entfernen
- // wir sie einfach.
- // Fuer das Ende merken wir uns die Ersetzungen und entferenen
- // hinterher alle am Stringende (koenten ja 'normale' 0x7f drinstehen
sal_Bool bEmpty = RES_TXTATR_FIELD != pHt->Which() ||
!(static_cast<SwTxtFld const*>(pHt)
->GetFmtFld().GetField()->ExpandField(true).Len());
@@ -171,9 +163,9 @@ String& lcl_CleanStr(
if ( bNewSoftHyphen )
{
- rArr.Insert( nAkt, rArr.Count() );
+ rArr.Insert( nAkt, rArr.Count() );
--rEnde;
- rRet.Erase( nAkt, 1 );
+ rRet.Erase( nAkt, 1 );
++nSoftHyphen;
}
}
@@ -203,8 +195,8 @@ xub_StrLen GetPostIt(xub_StrLen aCount,const SwpHints *pHts)
{
aIndex++;
const SwTxtAttr* pTxtAttr = (*pHts)[i];
- if ( (pTxtAttr->Which()==RES_TXTATR_FIELD) &&
- (pTxtAttr->GetFmtFld().GetField()->Which()==RES_POSTITFLD))
+ if ( (pTxtAttr->Which()==RES_TXTATR_FIELD)
+ && (pTxtAttr->GetFmtFld().GetField()->Which()==RES_POSTITFLD))
{
aCount--;
if (!aCount)
@@ -216,8 +208,8 @@ xub_StrLen GetPostIt(xub_StrLen aCount,const SwpHints *pHts)
for (xub_StrLen i = aIndex; i <pHts->Count();i++)
{
const SwTxtAttr* pTxtAttr = (*pHts)[i];
- if ( (pTxtAttr->Which()==RES_TXTATR_FIELD) &&
- (pTxtAttr->GetFmtFld().GetField()->Which()==RES_POSTITFLD))
+ if ( (pTxtAttr->Which()==RES_TXTATR_FIELD)
+ && (pTxtAttr->GetFmtFld().GetField()->Which()==RES_POSTITFLD))
break;
else
aIndex++;
@@ -309,10 +301,10 @@ sal_uInt8 SwPaM::Find( const SearchOptions& rSearchOpt, sal_Bool bSearchInNotes
for (xub_StrLen i = 0; i <pHts->Count();i++)
{
- xub_StrLen aPos = *(*pHts)[i]->GetStart();
+ const xub_StrLen aPos = *(*pHts)[i]->GetStart();
const SwTxtAttr* pTxtAttr = (*pHts)[i];
- if ( (pTxtAttr->Which()==RES_TXTATR_FIELD) &&
- (pTxtAttr->GetFmtFld().GetField()->Which()==RES_POSTITFLD))
+ if ( (pTxtAttr->Which()==RES_TXTATR_FIELD)
+ && (pTxtAttr->GetFmtFld().GetField()->Which()==RES_POSTITFLD))
{
if ( (aPos >= nStart) && (aPos <= nEnde) )
aNumberPostits++;
diff --git a/sw/source/core/crsr/overlayrangesoutline.cxx b/sw/source/core/crsr/overlayrangesoutline.cxx
new file mode 100644
index 000000000000..3859463f772c
--- /dev/null
+++ b/sw/source/core/crsr/overlayrangesoutline.cxx
@@ -0,0 +1,117 @@
+/**************************************************************
+*
+* 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.
+*
+*************************************************************/
+
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_sw.hxx"
+
+#include <overlayrangesoutline.hxx>
+#include <svx/sdr/overlay/overlaymanager.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <basegfx/polygon/b2dpolypolygoncutter.hxx>
+#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace
+{
+ // combine ranges geometrically to a single, ORed polygon
+ basegfx::B2DPolyPolygon impCombineRangesToPolyPolygon(const std::vector< basegfx::B2DRange >& rRanges)
+ {
+ const sal_uInt32 nCount(rRanges.size());
+ basegfx::B2DPolyPolygon aRetval;
+
+ for(sal_uInt32 a(0); a < nCount; a++)
+ {
+ const basegfx::B2DPolygon aDiscretePolygon(basegfx::tools::createPolygonFromRect(rRanges[a]));
+
+ if(0 == a)
+ {
+ aRetval.append(aDiscretePolygon);
+ }
+ else
+ {
+ aRetval = basegfx::tools::solvePolygonOperationOr(aRetval, basegfx::B2DPolyPolygon(aDiscretePolygon));
+ }
+ }
+
+ return aRetval;
+ }
+}
+
+namespace sw
+{
+ namespace overlay
+ {
+ drawinglayer::primitive2d::Primitive2DSequence OverlayRangesOutline::createOverlayObjectPrimitive2DSequence()
+ {
+ drawinglayer::primitive2d::Primitive2DSequence aRetval;
+ const sal_uInt32 nCount(getRanges().size());
+
+ if( nCount )
+ {
+ const basegfx::BColor aRGBColor(getBaseColor().getBColor());
+ const basegfx::B2DPolyPolygon aPolyPolygon(impCombineRangesToPolyPolygon(getRanges()));
+ const drawinglayer::primitive2d::Primitive2DReference aOutline(
+ new drawinglayer::primitive2d::PolyPolygonHairlinePrimitive2D(
+ aPolyPolygon,
+ aRGBColor));
+
+ aRetval.realloc(1);
+ aRetval[0] = aOutline;
+ }
+
+ return aRetval;
+ }
+
+ OverlayRangesOutline::OverlayRangesOutline(
+ const Color& rColor,
+ const std::vector< basegfx::B2DRange >& rRanges )
+ : sdr::overlay::OverlayObject(rColor)
+ , maRanges(rRanges)
+ {
+ // no AA for highlight overlays
+ allowAntiAliase(false);
+ }
+
+ OverlayRangesOutline::~OverlayRangesOutline()
+ {
+ if( getOverlayManager() )
+ {
+ getOverlayManager()->remove(*this);
+ }
+ }
+
+ void OverlayRangesOutline::setRanges(const std::vector< basegfx::B2DRange >& rNew)
+ {
+ if(rNew != maRanges)
+ {
+ maRanges = rNew;
+ objectChange();
+ }
+ }
+ } // end of namespace overlay
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/sw/source/core/crsr/overlayrangesoutline.hxx b/sw/source/core/crsr/overlayrangesoutline.hxx
new file mode 100644
index 000000000000..58a2bbb4b60c
--- /dev/null
+++ b/sw/source/core/crsr/overlayrangesoutline.hxx
@@ -0,0 +1,70 @@
+/**************************************************************
+ *
+ * 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 _SW_OVERLAY_OVERLAYRANGESOUTLINE_HXX
+#define _SW_OVERLAY_OVERLAYRANGESOUTLINE_HXX
+
+#include <svx/sdr/overlay/overlayobject.hxx>
+#include <basegfx/range/b2drange.hxx>
+
+#include <vector>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sw
+{
+ namespace overlay
+ {
+ class OverlayRangesOutline : public sdr::overlay::OverlayObject
+ {
+ protected:
+ // geometry of overlay
+ std::vector< basegfx::B2DRange > maRanges;
+
+ // geometry creation for OverlayObject
+ virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
+
+ public:
+ OverlayRangesOutline(
+ const Color& rColor,
+ const std::vector< basegfx::B2DRange >& rRanges );
+
+ virtual ~OverlayRangesOutline();
+
+ // data read access
+ inline const std::vector< basegfx::B2DRange >& getRanges() const
+ {
+ return maRanges;
+ }
+
+ // data write access
+ void setRanges(const std::vector< basegfx::B2DRange >& rNew);
+ };
+ } // end of namespace overlay
+} // end of namespace sw
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SW_OVERLAY_OVERLAYRANGESOUTLINE_HXX
+
+// eof
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index bd8c05c5bcaa..9dd182a3a1a9 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -56,6 +56,7 @@
#include <mdiexp.hxx> // ...Percent()
#include <statstr.hrc> // ResId fuer Statusleiste
#include <redline.hxx> // SwRedline
+#include <txatbase.hxx>
using namespace ::com::sun::star::i18n;
@@ -238,18 +239,16 @@ sal_Bool SwCursor::IsSelOvr( int eFlags )
return sal_True;
}
-// neu: Bereiche ueberpruefen
-// Anfang
- if( pSavePos->nNode != GetPoint()->nNode.GetIndex() &&
- //JP 28.10.97: Bug 45129 - im UI-ReadOnly ist alles erlaubt
- ( !pDoc->GetDocShell() || !pDoc->GetDocShell()->IsReadOnlyUI() ))
+ if( pSavePos->nNode != GetPoint()->nNode.GetIndex()
+ && ( !pDoc->GetDocShell()
+ || !pDoc->GetDocShell()->IsReadOnlyUI() ) )
{
// teste doch mal die neuen Sections:
SwNodeIndex& rPtIdx = GetPoint()->nNode;
const SwSectionNode* pSectNd = rPtIdx.GetNode().FindSectionNode();
if( pSectNd &&
((bSkipOverHiddenSections && pSectNd->GetSection().IsHiddenFlag() ) ||
- (bSkipOverProtectSections && pSectNd->GetSection().IsProtectFlag() )))
+ (bSkipOverProtectSections && pSectNd->GetSection().IsProtectFlag() )))
{
if( 0 == ( nsSwCursorSelOverFlags::SELOVER_CHANGEPOS & eFlags ) )
{
@@ -263,18 +262,18 @@ sal_Bool SwCursor::IsSelOvr( int eFlags )
xub_StrLen nCntntPos = pSavePos->nCntnt;
int bGoNxt = pSavePos->nNode < rPtIdx.GetIndex();
SwCntntNode* pCNd = bGoNxt
- ? rNds.GoNextSection( &rPtIdx, bSkipOverHiddenSections, bSkipOverProtectSections)
- : rNds.GoPrevSection( &rPtIdx, bSkipOverHiddenSections, bSkipOverProtectSections);
+ ? rNds.GoNextSection( &rPtIdx, bSkipOverHiddenSections, bSkipOverProtectSections)
+ : rNds.GoPrevSection( &rPtIdx, bSkipOverHiddenSections, bSkipOverProtectSections);
if( !pCNd && ( nsSwCursorSelOverFlags::SELOVER_ENABLEREVDIREKTION & eFlags ))
{
bGoNxt = !bGoNxt;
pCNd = bGoNxt ? rNds.GoNextSection( &rPtIdx, bSkipOverHiddenSections, bSkipOverProtectSections)
- : rNds.GoPrevSection( &rPtIdx, bSkipOverHiddenSections, bSkipOverProtectSections);
+ : rNds.GoPrevSection( &rPtIdx, bSkipOverHiddenSections, bSkipOverProtectSections);
}
int bIsValidPos = 0 != pCNd;
sal_Bool bValidNodesRange = bIsValidPos &&
- ::CheckNodesRange( rPtIdx, aIdx, sal_True );
+ ::CheckNodesRange( rPtIdx, aIdx, sal_True );
if( !bValidNodesRange )
{
rPtIdx = pSavePos->nNode;
@@ -297,15 +296,15 @@ sal_Bool SwCursor::IsSelOvr( int eFlags )
GetPoint()->nContent.Assign( pCNd, nTmpPos );
if( !bIsValidPos || !bValidNodesRange ||
// sollten wir in einer Tabelle gelandet sein?
- IsInProtectTable( sal_True ) )
- return sal_True;
+ IsInProtectTable( sal_True ) )
+ return sal_True;
}
// oder sollte eine geschuetzte Section innerhalb der Selektion liegen?
if( HasMark() && bSkipOverProtectSections)
{
sal_uLong nSttIdx = GetMark()->nNode.GetIndex(),
- nEndIdx = GetPoint()->nNode.GetIndex();
+ nEndIdx = GetPoint()->nNode.GetIndex();
if( nEndIdx <= nSttIdx )
{
sal_uLong nTmp = nSttIdx;
@@ -339,22 +338,20 @@ sal_Bool SwCursor::IsSelOvr( int eFlags )
}
}
-// Ende
-// neu: Bereiche ueberpruefen
const SwNode* pNd = &GetPoint()->nNode.GetNode();
if( pNd->IsCntntNode() && !dynamic_cast<SwUnoCrsr*>(this) )
{
const SwCntntFrm* pFrm = ((SwCntntNode*)pNd)->getLayoutFrm( pDoc->GetCurrentLayout() );
- if( pFrm && pFrm->IsValid() && 0 == pFrm->Frm().Height() &&
- 0 != ( nsSwCursorSelOverFlags::SELOVER_CHANGEPOS & eFlags ) )
+ if( pFrm && pFrm->IsValid()
+ && 0 == pFrm->Frm().Height()
+ && 0 != ( nsSwCursorSelOverFlags::SELOVER_CHANGEPOS & eFlags ) )
{
// skip to the next / prev valid paragraph with a layout
SwNodeIndex& rPtIdx = GetPoint()->nNode;
int bGoNxt = pSavePos->nNode < rPtIdx.GetIndex();
- while( 0 != ( pFrm = ( bGoNxt ? pFrm->GetNextCntntFrm()
- : pFrm->GetPrevCntntFrm() )) &&
- 0 == pFrm->Frm().Height() )
+ while( 0 != ( pFrm = ( bGoNxt ? pFrm->GetNextCntntFrm() : pFrm->GetPrevCntntFrm() ))
+ && 0 == pFrm->Frm().Height() )
;
// --> LIJIAN/FME 2007-11-27 #i72394# skip to prev /next valid paragraph
@@ -382,7 +379,7 @@ sal_Bool SwCursor::IsSelOvr( int eFlags )
xub_StrLen nTmpPos = bGoNxt ? 0 : pCNd->Len();
GetPoint()->nContent.Assign( pCNd, nTmpPos );
- // sollten wir in einer Tabelle gelandet sein?
+ // sollten wir in einer Tabelle gelandet sein?
if( IsInProtectTable( sal_True ) )
pFrm = 0;
}
@@ -416,25 +413,74 @@ sal_Bool SwCursor::IsSelOvr( int eFlags )
return sal_True; // ohne Frames geht gar nichts!
}
- const SwTableNode* pPtNd = pNd->FindTableNode();
-
- if( (pNd = &GetMark()->nNode.GetNode())->IsCntntNode() &&
- !((SwCntntNode*)pNd)->getLayoutFrm( pDoc->GetCurrentLayout() ) && !dynamic_cast<SwUnoCrsr*>(this) )
+ if( (pNd = &GetMark()->nNode.GetNode())->IsCntntNode()
+ && !((SwCntntNode*)pNd)->getLayoutFrm( pDoc->GetCurrentLayout() )
+ && !dynamic_cast<SwUnoCrsr*>(this) )
{
DeleteMark();
RestoreSavePos();
return sal_True; // ohne Frames geht gar nichts!
}
- const SwTableNode* pMrkNd = pNd->FindTableNode();
+ // assure that selection is only inside an InputField or contains the InputField completely
+ {
+ const SwTxtAttr* pInputFldTxtAttrAtPoint = NULL;
+ SwTxtNode* pTxtNdAtPoint = GetPoint()->nNode.GetNode().GetTxtNode();
+ if ( pTxtNdAtPoint != NULL )
+ {
+ pInputFldTxtAttrAtPoint =
+ pTxtNdAtPoint->GetTxtAttrAt( GetPoint()->nContent.GetIndex(), RES_TXTATR_INPUTFIELD, SwTxtNode::PARENT );
+ }
+
+ const SwTxtAttr* pInputFldTxtAttrAtMark = NULL;
+ SwTxtNode* pTxtNdAtMark = GetMark()->nNode.GetNode().GetTxtNode();
+ if ( pTxtNdAtMark != NULL )
+ {
+ pInputFldTxtAttrAtMark =
+ pTxtNdAtMark->GetTxtAttrAt( GetMark()->nContent.GetIndex(), RES_TXTATR_INPUTFIELD, SwTxtNode::PARENT );
+ }
+
+ if ( pInputFldTxtAttrAtPoint != pInputFldTxtAttrAtMark )
+ {
+ const sal_uLong nRefNodeIdx =
+ ( nsSwCursorSelOverFlags::SELOVER_TOGGLE & eFlags )
+ ? pSavePos->nNode
+ : GetMark()->nNode.GetIndex();
+ const xub_StrLen nRefContentIdx =
+ ( nsSwCursorSelOverFlags::SELOVER_TOGGLE & eFlags )
+ ? pSavePos->nCntnt
+ : GetMark()->nContent.GetIndex();
+ const bool bIsForwardSelection =
+ nRefNodeIdx < GetPoint()->nNode.GetIndex()
+ || ( nRefNodeIdx == GetPoint()->nNode.GetIndex()
+ && nRefContentIdx < GetPoint()->nContent.GetIndex() );
+
+ if ( pInputFldTxtAttrAtPoint != NULL )
+ {
+ const xub_StrLen nNewPointPos =
+ bIsForwardSelection ? *(pInputFldTxtAttrAtPoint->End()) : *(pInputFldTxtAttrAtPoint->GetStart());
+ GetPoint()->nContent.Assign( pTxtNdAtPoint, nNewPointPos );
+ }
+
+ if ( pInputFldTxtAttrAtMark != NULL )
+ {
+ const xub_StrLen nNewMarkPos =
+ bIsForwardSelection ? *(pInputFldTxtAttrAtMark->GetStart()) : *(pInputFldTxtAttrAtMark->End());
+ GetMark()->nContent.Assign( pTxtNdAtMark, nNewMarkPos );
+ }
+ }
+ }
+ const SwTableNode* pPtNd = pNd->FindTableNode();
+ const SwTableNode* pMrkNd = pNd->FindTableNode();
// beide in keinem oder beide im gleichen TableNode
if( ( !pMrkNd && !pPtNd ) || pPtNd == pMrkNd )
return sal_False;
// in unterschiedlichen Tabellen oder nur Mark in der Tabelle
if( ( pPtNd && pMrkNd ) || pMrkNd )
- { // dann lasse das nicht zu, alte Pos zurueck
+ {
+ // dann lasse das nicht zu, alte Pos zurueck
RestoreSavePos();
// Crsr bleibt an der alten Position
return sal_True;
@@ -446,8 +492,8 @@ sal_Bool SwCursor::IsSelOvr( int eFlags )
if( nsSwCursorSelOverFlags::SELOVER_CHANGEPOS & eFlags )
{
sal_Bool bSelTop = GetPoint()->nNode.GetIndex() <
- (( nsSwCursorSelOverFlags::SELOVER_TOGGLE & eFlags ) ? pSavePos->nNode
- : GetMark()->nNode.GetIndex());
+ (( nsSwCursorSelOverFlags::SELOVER_TOGGLE & eFlags ) ? pSavePos->nNode
+ : GetMark()->nNode.GetIndex());
do {
// in Schleife fuer Tabelle hinter Tabelle
@@ -478,7 +524,7 @@ sal_Bool SwCursor::IsSelOvr( int eFlags )
if( pMyNd->IsCntntNode() && // ist es ein ContentNode ??
::CheckNodesRange( GetMark()->nNode,
- GetPoint()->nNode, sal_True ))
+ GetPoint()->nNode, sal_True ))
{
// TABLE IN TABLE
const SwTableNode* pOuterTableNd = pMyNd->FindTableNode();
@@ -503,7 +549,8 @@ sal_Bool SwCursor::IsSelOvr( int eFlags )
RestoreSavePos();
return sal_True; // Crsr bleibt an der alten Position
}
- return sal_False; // was bleibt noch ??
+
+ return sal_False;
}
#if defined( UNX )
@@ -1850,7 +1897,7 @@ sal_Bool SwCursor::UpDown( sal_Bool bUp, sal_uInt16 nCnt,
}
pFrm->GetCrsrOfst( GetPoint(), aPt, &eTmpState );
}
- bRet = sal_True;
+ bRet = !IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE | nsSwCursorSelOverFlags::SELOVER_CHANGEPOS );
}
else
*GetPoint() = aOldPos;
@@ -1870,8 +1917,10 @@ sal_Bool SwCursor::LeftRightMargin( sal_Bool bLeft, sal_Bool bAPI )
if ( pFrm )
SetCrsrBidiLevel( pFrm->IsRightToLeft() ? 1 : 0 );
- return pFrm && (bLeft ? pFrm->LeftMargin( this ) :
- pFrm->RightMargin( this, bAPI ) );
+ SwCrsrSaveState aSave( *this );
+ return pFrm
+ && (bLeft ? pFrm->LeftMargin( this ) : pFrm->RightMargin( this, bAPI ) )
+ && !IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE | nsSwCursorSelOverFlags::SELOVER_CHANGEPOS );
}
sal_Bool SwCursor::IsAtLeftRightMargin( sal_Bool bLeft, sal_Bool bAPI ) const
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index 53069c7694f4..97e3e62d464d 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -42,12 +42,13 @@
#include <viewimp.hxx>
#include <dview.hxx>
#include <rootfrm.hxx>
-#include <txtfrm.hxx> // SwTxtFrm
+#include <txtfrm.hxx>
#include <docary.hxx>
#include <extinput.hxx>
#include <ndtxt.hxx>
+#include <txtfld.hxx>
#include <scriptinfo.hxx>
-#include <mdiexp.hxx> // GetSearchDialog
+#include <mdiexp.hxx>
#ifndef _COMCORE_HRC
#include <comcore.hrc> // ResId fuer Abfrage wenn zu Search & Replaces
#endif
@@ -56,6 +57,9 @@
#include <svx/sdrpaintwindow.hxx>
#include <vcl/svapp.hxx>
#include <svx/sdr/overlay/overlayselection.hxx>
+#include <overlayrangesoutline.hxx>
+
+#include <boost/scoped_ptr.hpp>
extern void SwCalcPixStatics( OutputDevice *pOut );
@@ -510,9 +514,11 @@ void SwVisCrsr::_SetPosAndShow()
//////////////////////////////////////////////////////////////////////////////
SwSelPaintRects::SwSelPaintRects( const SwCrsrShell& rCSh )
-: SwRects( 0 ),
- pCShell( &rCSh ),
- mpCursorOverlay(0)
+ : SwRects( 0 )
+ , pCShell( &rCSh )
+ , mpCursorOverlay( 0 )
+ , mbShowTxtInputFldOverlay( true )
+ , mpTxtInputFldOverlay( NULL )
{
}
@@ -536,6 +542,14 @@ void SwSelPaintRects::swapContent(SwSelPaintRects& rSwap)
sdr::overlay::OverlayObject* pTempOverlay = getCursorOverlay();
setCursorOverlay(rSwap.getCursorOverlay());
rSwap.setCursorOverlay(pTempOverlay);
+
+ const bool bTempShowTxtInputFldOverlay = mbShowTxtInputFldOverlay;
+ mbShowTxtInputFldOverlay = rSwap.mbShowTxtInputFldOverlay;
+ rSwap.mbShowTxtInputFldOverlay = bTempShowTxtInputFldOverlay;
+
+ sw::overlay::OverlayRangesOutline* pTempTxtInputFldOverlay = mpTxtInputFldOverlay;
+ mpTxtInputFldOverlay = rSwap.mpTxtInputFldOverlay;
+ rSwap.mpTxtInputFldOverlay = pTempTxtInputFldOverlay;
}
void SwSelPaintRects::Hide()
@@ -546,6 +560,12 @@ void SwSelPaintRects::Hide()
mpCursorOverlay = 0;
}
+ if ( mpTxtInputFldOverlay != NULL )
+ {
+ delete mpTxtInputFldOverlay;
+ mpTxtInputFldOverlay = NULL;
+ }
+
SwRects::Remove( 0, Count() );
}
@@ -605,9 +625,78 @@ void SwSelPaintRects::Show()
pTargetOverlay->add(*mpCursorOverlay);
}
}
+
+ HighlightInputFld();
+ }
+}
+
+
+void SwSelPaintRects::HighlightInputFld()
+{
+ std::vector< basegfx::B2DRange > aInputFldRanges;
+
+ if ( mbShowTxtInputFldOverlay )
+ {
+ SwTxtInputFld* pCurTxtInputFldAtCrsr =
+ dynamic_cast<SwTxtInputFld*>(GetShell()->GetTxtFldAtPos( GetShell()->GetCrsr()->Start(), false ));
+ if ( pCurTxtInputFldAtCrsr != NULL )
+ {
+ SwTxtNode* pTxtNode = pCurTxtInputFldAtCrsr->GetpTxtNode();
+ ::boost::scoped_ptr<SwShellCrsr> pCrsrForInputTxtFld(
+ new SwShellCrsr( *GetShell(), SwPosition( *pTxtNode, *(pCurTxtInputFldAtCrsr->GetStart()) ) ) );
+ pCrsrForInputTxtFld->SetMark();
+ pCrsrForInputTxtFld->GetMark()->nNode = *pTxtNode;
+ pCrsrForInputTxtFld->GetMark()->nContent.Assign( pTxtNode, *(pCurTxtInputFldAtCrsr->End()) );
+
+ pCrsrForInputTxtFld->FillRects();
+
+ for( sal_uInt16 a(0); a < pCrsrForInputTxtFld->Count(); ++a )
+ {
+ const SwRect aNextRect((*pCrsrForInputTxtFld)[a]);
+ const Rectangle aPntRect(aNextRect.SVRect());
+
+ aInputFldRanges.push_back(basegfx::B2DRange(
+ aPntRect.Left(), aPntRect.Top(),
+ aPntRect.Right() + 1, aPntRect.Bottom() + 1));
+ }
+ }
+ }
+
+ if ( aInputFldRanges.size() > 0 )
+ {
+ if ( mpTxtInputFldOverlay != NULL )
+ {
+ mpTxtInputFldOverlay->setRanges( aInputFldRanges );
+ }
+ else
+ {
+ SdrView* pView = (SdrView*)GetShell()->GetDrawView();
+ SdrPaintWindow* pCandidate = pView->GetPaintWindow(0);
+ sdr::overlay::OverlayManager* pTargetOverlay = pCandidate->GetOverlayManager();
+
+ if(pTargetOverlay)
+ {
+ // use system's hilight color with decreased luminance as highlight color
+ const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
+ Color aHighlight(aSvtOptionsDrawinglayer.getHilightColor());
+ aHighlight.DecreaseLuminance( 128 );
+
+ mpTxtInputFldOverlay = new sw::overlay::OverlayRangesOutline( aHighlight, aInputFldRanges );
+ pTargetOverlay->add( *mpTxtInputFldOverlay );
+ }
+ }
+ }
+ else
+ {
+ if ( mpTxtInputFldOverlay != NULL )
+ {
+ delete mpTxtInputFldOverlay;
+ mpTxtInputFldOverlay = NULL;
+ }
}
}
+
void SwSelPaintRects::Invalidate( const SwRect& rRect )
{
sal_uInt16 nSz = Count();
@@ -675,24 +764,38 @@ void SwSelPaintRects::Get1PixelInLogic( const ViewShell& rSh,
/* */
-SwShellCrsr::SwShellCrsr( const SwCrsrShell& rCShell, const SwPosition &rPos )
- : SwCursor(rPos,0,false), SwSelPaintRects(rCShell), pPt(SwPaM::GetPoint())
+SwShellCrsr::SwShellCrsr(
+ const SwCrsrShell& rCShell,
+ const SwPosition &rPos )
+ : SwCursor(rPos,0,false)
+ , SwSelPaintRects(rCShell)
+ , pPt(SwPaM::GetPoint())
{}
-SwShellCrsr::SwShellCrsr( const SwCrsrShell& rCShell, const SwPosition &rPos,
- const Point& rPtPos, SwPaM* pRing )
- : SwCursor(rPos, pRing, false), SwSelPaintRects(rCShell), aMkPt(rPtPos),
- aPtPt(rPtPos), pPt(SwPaM::GetPoint())
+SwShellCrsr::SwShellCrsr(
+ const SwCrsrShell& rCShell,
+ const SwPosition &rPos,
+ const Point& rPtPos,
+ SwPaM* pRing )
+ : SwCursor(rPos, pRing, false)
+ , SwSelPaintRects(rCShell)
+ , aMkPt(rPtPos)
+ , aPtPt(rPtPos)
+ , pPt(SwPaM::GetPoint())
{}
SwShellCrsr::SwShellCrsr( SwShellCrsr& rICrsr )
- : SwCursor(rICrsr), SwSelPaintRects(*rICrsr.GetShell()),
- aMkPt(rICrsr.GetMkPos()), aPtPt(rICrsr.GetPtPos()), pPt(SwPaM::GetPoint())
+ : SwCursor(rICrsr)
+ , SwSelPaintRects(*rICrsr.GetShell())
+ , aMkPt(rICrsr.GetMkPos())
+ , aPtPt(rICrsr.GetPtPos())
+ , pPt(SwPaM::GetPoint())
{}
-SwShellCrsr::~SwShellCrsr() {}
+SwShellCrsr::~SwShellCrsr()
+{}
bool SwShellCrsr::IsReadOnlyAvailable() const
@@ -717,7 +820,7 @@ void SwShellCrsr::FillRects()
GetPoint()->nNode.GetNode().GetCntntNode()->getLayoutFrm( GetShell()->GetLayout() ) &&
(GetMark()->nNode == GetPoint()->nNode ||
(GetMark()->nNode.GetNode().IsCntntNode() &&
- GetMark()->nNode.GetNode().GetCntntNode()->getLayoutFrm( GetShell()->GetLayout() ) ) ))
+ GetMark()->nNode.GetNode().GetCntntNode()->getLayoutFrm( GetShell()->GetLayout() ) ) ))
GetShell()->GetLayout()->CalcFrmRects( *this, GetShell()->IsTableMode() ); //swmod 071107//swmod 071225
}
diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx
index 2906a6b42c26..7743f4aed000 100644
--- a/sw/source/core/doc/dbgoutsw.cxx
+++ b/sw/source/core/doc/dbgoutsw.cxx
@@ -170,7 +170,7 @@ map<sal_uInt16,String,CompareUShort> & GetItemWhichMap()
aItemWhichMap[RES_TXTATR_REFMARK] = String("TXTATR_REFMARK", RTL_TEXTENCODING_ASCII_US);
aItemWhichMap[RES_TXTATR_TOXMARK] = String("TXTATR_TOXMARK", RTL_TEXTENCODING_ASCII_US);
aItemWhichMap[RES_TXTATR_CHARFMT] = String("TXTATR_CHARFMT", RTL_TEXTENCODING_ASCII_US);
- aItemWhichMap[RES_TXTATR_DUMMY5] = String("TXTATR_DUMMY5", RTL_TEXTENCODING_ASCII_US);
+ aItemWhichMap[RES_TXTATR_INPUTFIELD] = String("TXTATR_INPUTFIELD", RTL_TEXTENCODING_ASCII_US);
aItemWhichMap[RES_TXTATR_CJK_RUBY] = String("TXTATR_CJK_RUBY", RTL_TEXTENCODING_ASCII_US);
aItemWhichMap[RES_TXTATR_UNKNOWN_CONTAINER] = String("TXTATR_UNKNOWN_CONTAINER", RTL_TEXTENCODING_ASCII_US);
aItemWhichMap[RES_TXTATR_META] = String("TXTATR_META", RTL_TEXTENCODING_ASCII_US);
@@ -320,7 +320,7 @@ const String lcl_dbg_out(const SwTxtAttr & rAttr)
aStr += String::CreateFromInt32(*rAttr.GetStart());
aStr += String("->", RTL_TEXTENCODING_ASCII_US);
- aStr += String::CreateFromInt32(*rAttr.GetEnd());
+ aStr += String::CreateFromInt32(*rAttr.End());
aStr += String(" ", RTL_TEXTENCODING_ASCII_US);
aStr += lcl_dbg_out(rAttr.GetAttr());
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 04ad4e595720..aefd4a07c723 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -260,9 +260,8 @@ void SwDoc::set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value)
if (pOutlineRule)
{
pOutlineRule->Validate();
- // --> OD 2005-10-21 - counting of phantoms depends on <IsOldNumbering()>
+ // counting of phantoms depends on <IsOldNumbering()>
pOutlineRule->SetCountPhantoms( !mbOldNumbering );
- // <--
}
}
break;
@@ -304,30 +303,31 @@ void SwDoc::set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value)
mbDoNotCaptureDrawObjsOnPage = value;
break;
- // --> OD 2006-08-25 #i68949#
case CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAME:
mbClipAsCharacterAnchoredWriterFlyFrames = value;
break;
- // <--
+
case UNIX_FORCE_ZERO_EXT_LEADING:
mbUnixForceZeroExtLeading = value;
break;
+
case PROTECT_FORM:
- mbProtectForm = value;
- break;
+ mbProtectForm = value;
+ break;
case USE_OLD_PRINTER_METRICS:
mbOldPrinterMetrics = value;
break;
+
case TABS_RELATIVE_TO_INDENT:
mbTabRelativeToIndent = value;
break;
- // --> OD 2008-06-05 #i89181#
+
case TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST:
mbTabAtLeftIndentForParagraphsInList = value;
break;
- // <--
- // COMPATIBILITY FLAGS END
+
+ // COMPATIBILITY FLAGS END
case BROWSE_MODE: //can be used temporary (load/save) when no ViewShell is avaiable
mbLastBrowseMode = value;
@@ -2707,24 +2707,21 @@ String SwDoc::GetPaMDescr(const SwPaM & rPam) const
return aResult;
}
-// -> #111840#
-SwField * SwDoc::GetField(const SwPosition & rPos)
+SwField * SwDoc::GetFieldAtPos(const SwPosition & rPos)
{
- SwTxtFld * const pAttr = GetTxtFld(rPos);
+ SwTxtFld * const pAttr = GetTxtFldAtPos(rPos);
return (pAttr) ? const_cast<SwField *>( pAttr->GetFmtFld().GetField() ) : 0;
}
-SwTxtFld * SwDoc::GetTxtFld(const SwPosition & rPos)
+SwTxtFld * SwDoc::GetTxtFldAtPos(const SwPosition & rPos)
{
SwTxtNode * const pNode = rPos.nNode.GetNode().GetTxtNode();
- return (pNode)
- ? static_cast<SwTxtFld*>( pNode->GetTxtAttrForCharAt(
- rPos.nContent.GetIndex(), RES_TXTATR_FIELD) )
+ return (pNode != NULL)
+ ? pNode->GetFldTxtAttrAt( rPos.nContent.GetIndex(), true )
: 0;
}
-// <- #111840#
bool SwDoc::ContainsHiddenChars() const
{
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 5923143cb1e1..11ba2b1db128 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -1501,7 +1501,7 @@ lcl_CalcBreaks( ::std::vector<xub_StrLen> & rBreaks, SwPaM const & rPam )
if ((CH_TXTATR_INWORD == c) || (CH_TXTATR_BREAKWORD == c))
{
SwTxtAttr const * const pAttr( pTxtNode->GetTxtAttrForCharAt(i) );
- if (pAttr && pAttr->GetEnd() && (*pAttr->GetEnd() > nEnd))
+ if (pAttr && pAttr->End() && (*pAttr->End() > nEnd))
{
ASSERT(pAttr->HasDummyChar(), "GetTxtAttrForCharAt broken?");
rBreaks.push_back(i);
@@ -1686,7 +1686,7 @@ bool SwDoc::DeleteRangeImplImpl(SwPaM & rPam)
break;
if( nMkCntPos == *pAttr->GetStart() &&
- 0 != (pEndIdx = pAttr->GetEnd()) &&
+ 0 != (pEndIdx = pAttr->End()) &&
*pEndIdx == *pAttr->GetStart() )
pTxtNd->DestroyAttr( pHts->Cut( n ) );
}
diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index be10fcefe9a7..f6e2ede98500 100644
--- a/sw/source/core/doc/docfld.cxx
+++ b/sw/source/core/doc/docfld.cxx
@@ -751,8 +751,10 @@ void SwDoc::SetNewFldLst(bool bFlag)
// der StartIndex kann optional mit angegeben werden (z.B. wenn dieser
// zuvor schon mal erfragt wurde - ist sonst eine virtuelle Methode !!)
-_SetGetExpFld::_SetGetExpFld( const SwNodeIndex& rNdIdx, const SwTxtFld* pFld,
- const SwIndex* pIdx )
+_SetGetExpFld::_SetGetExpFld(
+ const SwNodeIndex& rNdIdx,
+ const SwTxtFld* pFld,
+ const SwIndex* pIdx )
{
eSetGetExpFldType = TEXTFIELD;
CNTNT.pTxtFld = pFld;
@@ -902,6 +904,15 @@ void _SetGetExpFld::SetBodyPos( const SwCntntFrm& rFrm )
}
}
+sal_Bool _SetGetExpFld::operator==( const _SetGetExpFld& rFld ) const
+{
+ return nNode == rFld.nNode
+ && nCntnt == rFld.nCntnt
+ && ( !CNTNT.pTxtFld
+ || !rFld.CNTNT.pTxtFld
+ || CNTNT.pTxtFld == rFld.CNTNT.pTxtFld );
+}
+
sal_Bool _SetGetExpFld::operator<( const _SetGetExpFld& rFld ) const
{
if( nNode < rFld.nNode || ( nNode == rFld.nNode && nCntnt < rFld.nCntnt ))
@@ -2712,17 +2723,12 @@ bool SwDoc::UpdateFld(SwTxtFld * pDstTxtFld, SwField & rSrcFld,
SwPosition aPosition( pDstTxtFld->GetTxtNode() );
aPosition.nContent = *pDstTxtFld->GetStart();
- SwUndo *const pUndo( new SwUndoFieldFromDoc(
- aPosition, *pDstFld, rSrcFld, pMsgHnt, bUpdateFlds) );
+ SwUndo *const pUndo( new SwUndoFieldFromDoc( aPosition, *pDstFld, rSrcFld, pMsgHnt, bUpdateFlds) );
GetIDocumentUndoRedo().AppendUndo(pUndo);
}
- // Das gefundene Feld wird angepasst ...
- //pDstFld->ChangeFormat( rSrcFld.GetFormat() );
- //pDstFld->SetLanguage( rSrcFld.GetLanguage() );
-
SwField * pNewFld = rSrcFld.CopyField();
- pDstFmtFld->SetFld(pNewFld);
+ pDstFmtFld->SetField(pNewFld);
switch( nFldWhich )
{
@@ -2798,7 +2804,7 @@ bool SwDoc::PutValueToField(const SwPosition & rPos,
const Any& rVal, sal_uInt16 nWhich)
{
Any aOldVal;
- SwField * pField = GetField(rPos);
+ SwField * pField = GetFieldAtPos(rPos);
if (GetIDocumentUndoRedo().DoesUndo() &&
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index f674ab056c81..6b0bad3f4e42 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -183,14 +183,14 @@ sal_Bool lcl_RstTxtAttr( const SwNodePtr& rpNd, void* pArgs )
// fuers Undo alle Attribute sichern
SwRegHistory aRHst( *pTxtNode, pPara->pHistory );
pTxtNode->GetpSwpHints()->Register( &aRHst );
- pTxtNode->RstAttr( aSt, nEnd - aSt.GetIndex(), pPara->nWhich,
- pPara->pDelSet, pPara->bInclRefToxMark );
+ pTxtNode->RstTxtAttr( aSt, nEnd - aSt.GetIndex(), pPara->nWhich,
+ pPara->pDelSet, pPara->bInclRefToxMark );
if( pTxtNode->GetpSwpHints() )
pTxtNode->GetpSwpHints()->DeRegister();
}
else
- pTxtNode->RstAttr( aSt, nEnd - aSt.GetIndex(), pPara->nWhich,
- pPara->pDelSet, pPara->bInclRefToxMark );
+ pTxtNode->RstTxtAttr( aSt, nEnd - aSt.GetIndex(), pPara->nWhich,
+ pPara->pDelSet, pPara->bInclRefToxMark );
}
return sal_True;
}
@@ -399,7 +399,7 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
if (pURLAttr && pURLAttr->GetINetFmt().GetValue().Len())
{
nMkPos = *pURLAttr->GetStart();
- nPtPos = *pURLAttr->GetEnd();
+ nPtPos = *pURLAttr->End();
}
else
{
@@ -549,11 +549,15 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
// Einfuegen der Hints nach Inhaltsformen;
// wird in SwDoc::Insert(..., SwFmtHint &rHt) benutzt
-static bool
-lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
-//Modify here for #119405, by easyfan, 2012-05-24
- const SetAttrMode nFlags, SwUndoAttr *const pUndo,bool bExpandCharToPara=false)
-//End of modification, by easyfan
+static bool lcl_InsAttr(
+ SwDoc *const pDoc,
+ const SwPaM &rRg,
+ const SfxItemSet& rChgSet,
+ const SetAttrMode nFlags,
+ SwUndoAttr *const pUndo,
+ //Modify here for #119405, by easyfan, 2012-05-24
+ const bool bExpandCharToPara=false)
+ //End of modification, by easyfan
{
// teil die Sets auf (fuer Selektion in Nodes)
const SfxItemSet* pCharSet = 0;
@@ -609,9 +613,7 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
SfxItemSet* pTmpOtherItemSet = new SfxItemSet( pDoc->GetAttrPool(),
RES_PARATR_BEGIN, RES_PARATR_END-1,
- // --> OD 2008-02-25 #refactorlists#
RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END-1,
- // <--
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
RES_GRFATR_BEGIN, RES_GRFATR_END-1,
RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
@@ -639,7 +641,6 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
SwTxtNode * pTxtNd = pNode->GetTxtNode();
SwNumRule * pNumRule = pTxtNd->GetNumRule();
- // --> OD 2005-10-24 #126346# - make code robust:
if ( !pNumRule )
{
ASSERT( false,
@@ -647,7 +648,6 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
DELETECHARSETS
return false;
}
- // <--
SwNumFmt aNumFmt = pNumRule->Get(static_cast<sal_uInt16>(pTxtNd->GetActualListLevel()));
SwCharFmt * pCharFmt =
@@ -665,7 +665,6 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
DELETECHARSETS
return true;
}
- // <- #i27615#
const SwIndex& rSt = pStt->nContent;
@@ -708,6 +707,7 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
RES_TXTATR_REFMARK, RES_TXTATR_TOXMARK,
RES_TXTATR_META, RES_TXTATR_METAFIELD,
RES_TXTATR_CJK_RUBY, RES_TXTATR_CJK_RUBY,
+ RES_TXTATR_INPUTFIELD, RES_TXTATR_INPUTFIELD,
0 );
aTxtSet.Put( rChgSet );
@@ -860,7 +860,7 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
if (pURLAttr && pURLAttr->GetINetFmt().GetValue().Len())
{
nMkPos = *pURLAttr->GetStart();
- nPtPos = *pURLAttr->GetEnd();
+ nPtPos = *pURLAttr->End();
}
else
{
@@ -894,12 +894,12 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
// fuers Undo alle Attribute sichern
SwRegHistory aRHst( *pTxtNd, pHistory );
pTxtNd->GetpSwpHints()->Register( &aRHst );
- pTxtNd->RstAttr( aSt, nPtPos, 0, pCharSet );
+ pTxtNd->RstTxtAttr( aSt, nPtPos, 0, pCharSet );
if( pTxtNd->GetpSwpHints() )
pTxtNd->GetpSwpHints()->DeRegister();
}
else
- pTxtNd->RstAttr( aSt, nPtPos, 0, pCharSet );
+ pTxtNd->RstTxtAttr( aSt, nPtPos, 0, pCharSet );
}
// the SwRegHistory inserts the attribute into the TxtNode!
@@ -981,7 +981,7 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
if (pCurrentNd)
{
- pCurrentNd->TryCharSetExpandToNum(*pCharSet);
+ pCurrentNd->TryCharSetExpandToNum(*pCharSet);
}
}
@@ -1089,7 +1089,6 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
++nNodes;
}
- //Modify here for #119405, by easyfan, 2012-05-24
//The data parameter flag: bExpandCharToPara, comes from the data member of SwDoc,
//Which is set in SW MS word Binary filter WW8ImplRreader. With this flag on, means that
//current setting attribute set is a character range properties set and comes from a MS word
@@ -1111,23 +1110,22 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
if (pCurrentNd)
{
- pCurrentNd->TryCharSetExpandToNum(*pCharSet);
+ pCurrentNd->TryCharSetExpandToNum(*pCharSet);
}
}
}
- //End of modification, by easyfan
DELETECHARSETS
return (nNodes != 0) || bRet;
}
-//Modify here for #119405, by chengjh, 2012-08-16
-//Add a para for the char attribute exp...
-bool SwDoc::InsertPoolItem( const SwPaM &rRg, const SfxPoolItem &rHt,
- const SetAttrMode nFlags, bool bExpandCharToPara)
-//End
+bool SwDoc::InsertPoolItem(
+ const SwPaM &rRg,
+ const SfxPoolItem &rHt,
+ const SetAttrMode nFlags,
+ const bool bExpandCharToPara)
{
SwDataChanged aTmp( rRg, 0 );
SwUndoAttr* pUndoAttr = 0;
@@ -1139,9 +1137,7 @@ bool SwDoc::InsertPoolItem( const SwPaM &rRg, const SfxPoolItem &rHt,
SfxItemSet aSet( GetAttrPool(), rHt.Which(), rHt.Which() );
aSet.Put( rHt );
- //Modify here for #119405, by easyfan, 2012-05-24
- bool bRet = lcl_InsAttr( this, rRg, aSet, nFlags, pUndoAttr,bExpandCharToPara );
- //End of modification, by easyfan
+ const bool bRet = lcl_InsAttr( this, rRg, aSet, nFlags, pUndoAttr,bExpandCharToPara );
if (GetIDocumentUndoRedo().DoesUndo())
{
@@ -1149,7 +1145,9 @@ bool SwDoc::InsertPoolItem( const SwPaM &rRg, const SfxPoolItem &rHt,
}
if( bRet )
+ {
SetModified();
+ }
return bRet;
}
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index 1363bd83534c..dcfb772cdd21 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -1417,8 +1417,8 @@ lcl_InsertLabel(SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
pNewSet->Put( SwFmtSurround( SURROUND_NONE ) );
pNewSet->Put( SvxOpaqueItem( RES_OPAQUE, sal_True ) );
- pNewSet->Put( SwFmtVertOrient( text::VertOrientation::TOP ) );
- pNewSet->Put( SwFmtHoriOrient( text::HoriOrientation::CENTER ) );
+ pNewSet->Put( SwFmtVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME ) );
+ pNewSet->Put( SwFmtHoriOrient( 0, text::HoriOrientation::CENTER, text::RelOrientation::FRAME ) );
aFrmSize = pOldFmt->GetFrmSize();
aFrmSize.SetWidthPercent( 100 );
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index f5229baa2c6a..29d95c8b209f 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -1011,7 +1011,6 @@ void SwDoc::SetNumRule( const SwPaM& rPam,
}
}
- // --> OD 2008-03-17 #refactorlists#
if ( bSetItem )
{
if ( bCreateNewList )
@@ -1030,22 +1029,18 @@ void SwDoc::SetNumRule( const SwPaM& rPam,
"<SwDoc::SetNumRule(..)> - could not create new list. Serious defect -> please inform OD." );
sListId = pNewList->GetListId();
}
- InsertPoolItem( rPam,
- SfxStringItem( RES_PARATR_LIST_ID, sListId ), 0 );
+ InsertPoolItem( rPam, SfxStringItem( RES_PARATR_LIST_ID, sListId ), 0 );
}
else if ( sContinuedListId.Len() > 0 )
{
// apply given list id
- InsertPoolItem( rPam,
- SfxStringItem( RES_PARATR_LIST_ID, sContinuedListId ), 0 );
+ InsertPoolItem( rPam, SfxStringItem( RES_PARATR_LIST_ID, sContinuedListId ), 0 );
}
}
- // <--
if ( ! rPam.HasMark())
{
SwTxtNode * pTxtNd = rPam.GetPoint()->nNode.GetNode().GetTxtNode();
- // --> OD 2006-10-19 #134160#
// consider case that the PaM doesn't denote a text node - e.g. it denotes a graphic node
if ( pTxtNd )
{
@@ -1054,15 +1049,13 @@ void SwDoc::SetNumRule( const SwPaM& rPam,
if (pRule && pRule->GetName() == pNew->GetName())
{
bSetItem = sal_False;
- // --> OD 2008-06-02 #refactorlists#
if ( !pTxtNd->IsInList() )
{
pTxtNd->AddToList();
}
- // <--
}
- // --> OD 2005-10-26 #b6340308# - only clear numbering attribute at
- // text node, if at paragraph style the new numbering rule is found.
+ // only clear numbering attribute at text node,
+ // if at paragraph style the new numbering rule is found.
else if ( !pRule )
{
SwTxtFmtColl* pColl = pTxtNd->GetTxtColl();
@@ -1076,25 +1069,19 @@ void SwDoc::SetNumRule( const SwPaM& rPam,
}
}
}
- // <--
}
- // <--
}
- // --> OD 2009-08-18 #i103817#
if ( bSetItem )
- // <--
{
InsertPoolItem( rPam, SwNumRuleItem( pNew->GetName() ), 0 );
}
- // --> OD 2008-02-08 #newlistlevelattrs#
if ( bResetIndentAttrs &&
pNew && pNew->Get( 0 ).GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
{
SvUShortsSort aResetAttrsArray;
aResetAttrsArray.Insert( RES_LR_SPACE );
- // --> OD 2010-10-05 #i114929#
// On a selection setup a corresponding Point-and-Mark in order to get
// the indentation attribute reset on all paragraphs touched by the selection
if ( rPam.HasMark() &&
@@ -1110,9 +1097,7 @@ void SwDoc::SetNumRule( const SwPaM& rPam,
{
ResetAttrs( rPam, sal_False, &aResetAttrsArray );
}
- // <--
}
- // <--
if (GetIDocumentUndoRedo().DoesUndo())
{
@@ -1128,7 +1113,6 @@ void SwDoc::SetCounted(const SwPaM & rPam, bool bCounted)
{
SvUShortsSort aResetAttrsArray;
aResetAttrsArray.Insert( RES_PARATR_LIST_ISCOUNTED );
- // --> OD 2010-10-05 #i114929#
// On a selection setup a corresponding Point-and-Mark in order to get
// the list-is-counted attribute reset on all paragraphs touched by the selection
if ( rPam.HasMark() &&
@@ -1144,12 +1128,10 @@ void SwDoc::SetCounted(const SwPaM & rPam, bool bCounted)
{
ResetAttrs( rPam, sal_False, &aResetAttrsArray );
}
- // <--
}
else
{
- InsertPoolItem( rPam,
- SfxBoolItem( RES_PARATR_LIST_ISCOUNTED, sal_False ), 0 );
+ InsertPoolItem( rPam, SfxBoolItem( RES_PARATR_LIST_ISCOUNTED, sal_False ), 0 );
}
}
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 5a8501f3df4c..4407d4825283 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -2979,8 +2979,8 @@ void SwRedlineExtraData_Format::Reject( SwPaM& rPam ) const
// eigentlich muesste hier das Attribut zurueck gesetzt werden!!!
for( sal_uInt16 n = 0, nEnd = aWhichIds.Count(); n < nEnd; ++n )
{
- pDoc->InsertPoolItem( rPam, *GetDfltAttr( aWhichIds[ n ] ),
- nsSetAttrMode::SETATTR_DONTEXPAND );
+ pDoc->InsertPoolItem(
+ rPam, *GetDfltAttr( aWhichIds[ n ] ), nsSetAttrMode::SETATTR_DONTEXPAND );
}
pDoc->SetRedlineMode_intern( eOld );
diff --git a/sw/source/core/doc/docruby.cxx b/sw/source/core/doc/docruby.cxx
index d5417f5897e7..77430d8737e8 100644
--- a/sw/source/core/doc/docruby.cxx
+++ b/sw/source/core/doc/docruby.cxx
@@ -173,8 +173,8 @@ sal_uInt16 SwDoc::SetRubyList( const SwPaM& rPam, const SwRubyList& rList,
InsertString( aPam, pEntry->GetText() );
aPam.SetMark();
aPam.GetMark()->nContent -= pEntry->GetText().Len();
- InsertPoolItem( aPam, pEntry->GetRubyAttr(),
- nsSetAttrMode::SETATTR_DONTEXPAND );
+ InsertPoolItem(
+ aPam, pEntry->GetRubyAttr(), nsSetAttrMode::SETATTR_DONTEXPAND );
}
else
break;
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 12f98950ef21..6986430c1e3f 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -155,7 +155,7 @@ sal_uInt16 SwDoc::GetCurTOXMark( const SwPosition& rPos,
if( ( nSttIdx = *pHt->GetStart() ) < nAktPos )
{
// pruefe Ende mit ab
- if( 0 == ( pEndIdx = pHt->GetEnd() ) ||
+ if( 0 == ( pEndIdx = pHt->End() ) ||
*pEndIdx <= nAktPos )
continue; // weiter suchen
}
@@ -260,7 +260,7 @@ const SwTOXMark& SwDoc::GotoTOXMark( const SwTOXMark& rCurTOXMark,
const SwTOXMark* pTOXMark;
const SwCntntFrm* pCFrm;
Point aPt;
- for( sal_Int32 nMark=0; nMark<aMarks.Count(); nMark++ )
+ for( sal_uInt16 nMark=0; nMark<aMarks.Count(); nMark++ )
{
pTOXMark = aMarks[nMark];
if( pTOXMark != &rCurTOXMark &&
@@ -2105,7 +2105,7 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd,
for(sal_uInt16 nHintIdx = 0; nHintIdx < pHints->GetStartCount(); nHintIdx++)
{
SwTxtAttr* pAttr = pHints->GetStart(nHintIdx);
- xub_StrLen nTmpEnd = pAttr->GetEnd() ? *pAttr->GetEnd() : 0;
+ const xub_StrLen nTmpEnd = pAttr->End() ? *pAttr->End() : 0;
if( nStartPos >= *pAttr->GetStart() &&
(nStartPos + 2) <= nTmpEnd &&
pAttr->Which() == RES_TXTATR_CHARFMT)
diff --git a/sw/source/core/doc/tblcpy.cxx b/sw/source/core/doc/tblcpy.cxx
index 4536a56c47d2..ee7030f20caa 100644
--- a/sw/source/core/doc/tblcpy.cxx
+++ b/sw/source/core/doc/tblcpy.cxx
@@ -1029,7 +1029,11 @@ sal_Bool SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
// loesche die Frames
aFndBox.SetTableLines( *this );
- aFndBox.DelFrms( *this );
+ //IAccessibility2 Implementation 2009-----
+ //Solution:Not dispose accessible table
+ //aFndBox.DelFrms( *this );
+ aFndBox.DelFrms( *this,sal_False );
+ //-----IAccessibility2 Implementation 2009
if( 1 == rCpyTbl.GetTabSortBoxes().Count() )
{
diff --git a/sw/source/core/doc/visiturl.cxx b/sw/source/core/doc/visiturl.cxx
index 99eb3e3d2b79..65314c6f3228 100644
--- a/sw/source/core/doc/visiturl.cxx
+++ b/sw/source/core/doc/visiturl.cxx
@@ -86,7 +86,7 @@ void SwURLStateChanged::Notify( SfxBroadcaster& , const SfxHint& rHint )
const_cast<SwTxtINetFmt*>(pTxtAttr)->SetVisitedValid( false );
const SwTxtAttr* pAttr = pTxtAttr;
SwUpdateAttr aUpdateAttr( *pAttr->GetStart(),
- *pAttr->GetEnd(),
+ *pAttr->End(),
RES_FMT_CHG );
((SwTxtNode*)pTxtNd)->ModifyNotification( &aUpdateAttr, &aUpdateAttr );
}
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index a0bcd7e9874a..7b49226de30b 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -1039,7 +1039,9 @@ SwCntntNode::~SwCntntNode()
// der Abhaengikeitsliste raus!
// Daher muessen alle Frames in der Abhaengigkeitsliste geloescht werden.
if( GetDepends() )
- DelFrms();
+ //IAccessibility2 Implementation 2009-----
+ DelFrms(sal_True, sal_False);
+ //-----IAccessibility2 Implementation 2009
if( pCondColl )
delete pCondColl;
@@ -1366,12 +1368,82 @@ void SwCntntNode::MakeFrms( SwCntntNode& rNode )
*/
-void SwCntntNode::DelFrms()
+//IAccessibility2 Implementation 2009-----
+//Solution:Add a input param to identify if the acc table should be disposed.
+//add a flag(bNeedDel) to indicate whether to del corresponding frm even in doc loading process,
+//void SwCntntNode::DelFrms()
+void SwCntntNode::DelFrms( sal_Bool bNeedDel, sal_Bool bIsDisposeAccTable )
+//-----IAccessibility2 Implementation 2009
{
if( !GetDepends() )
return;
- SwCntntFrm::DelFrms(*this);
+ SwClientIter aIter( *this );
+
+ for(SwClient* pCandidate = aIter.SwClientIter_First(); pCandidate; pCandidate = aIter.SwClientIter_Next() )
+ {
+ SwCntntFrm* pFrm = dynamic_cast< SwCntntFrm* >(pCandidate);
+
+ if(!pFrm)
+ {
+ continue;
+ }
+
+ // --> OD 2005-12-01 #i27138#
+ // notify accessibility paragraphs objects about changed
+ // CONTENT_FLOWS_FROM/_TO relation.
+ // Relation CONTENT_FLOWS_FROM for current next paragraph will change
+ // and relation CONTENT_FLOWS_TO for current previous paragraph will change.
+ if ( pFrm->IsTxtFrm() )
+ {
+ ViewShell* pViewShell( pFrm->getRootFrm()->GetCurrShell() );
+ if ( pViewShell && pViewShell->GetLayout() &&
+ pViewShell->GetLayout()->IsAnyShellAccessible() )
+ {
+ pViewShell->InvalidateAccessibleParaFlowRelation(
+ dynamic_cast<SwTxtFrm*>(pFrm->FindNextCnt( true )),
+ dynamic_cast<SwTxtFrm*>(pFrm->FindPrevCnt( true )) );
+ }
+ }
+ // <--
+ if( pFrm->HasFollow() )
+ pFrm->GetFollow()->_SetIsFollow( pFrm->IsFollow() );
+ if( pFrm->IsFollow() )
+ {
+ SwCntntFrm* pMaster = (SwTxtFrm*)pFrm->FindMaster();
+ pMaster->SetFollow( pFrm->GetFollow() );
+ pFrm->_SetIsFollow( sal_False );
+ }
+ pFrm->SetFollow( 0 );//Damit er nicht auf dumme Gedanken kommt.
+ //Andernfalls kann es sein, dass ein Follow
+ //vor seinem Master zerstoert wird, der Master
+ //greift dann ueber den ungueltigen
+ //Follow-Pointer auf fremdes Memory zu.
+ //Die Kette darf hier zerknauscht werden, weil
+ //sowieso alle zerstoert werden.
+ if( pFrm->GetUpper() && pFrm->IsInFtn() && !pFrm->GetIndNext() &&
+ !pFrm->GetIndPrev() )
+ {
+ SwFtnFrm *pFtn = pFrm->FindFtnFrm();
+ ASSERT( pFtn, "You promised a FtnFrm?" );
+ SwCntntFrm* pCFrm;
+ if( !pFtn->GetFollow() && !pFtn->GetMaster() &&
+ 0 != ( pCFrm = pFtn->GetRefFromAttr()) && pCFrm->IsFollow() )
+ {
+ ASSERT( pCFrm->IsTxtFrm(), "NoTxtFrm has Footnote?" );
+ ((SwTxtFrm*)pCFrm->FindMaster())->Prepare( PREP_FTN_GONE );
+ }
+ }
+ //IAccessibility2 Implementation 2009-----
+ //Solution:Set acc table dispose state
+ pFrm->SetAccTableDispose( bIsDisposeAccTable );
+ //End Added
+ pFrm->Cut();
+ //Solution:Set acc table dispose state to default value
+ pFrm->SetAccTableDispose( sal_True );
+ //-----IAccessibility2 Implementation 2009
+ delete pFrm;
+ }
if( IsTxtNode() )
{
((SwTxtNode*)this)->SetWrong( NULL );
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index 70019e459b48..f0905dc02f84 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -180,10 +180,7 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz,
if ( rNd.IsTxtNode() )
{
SwTxtNode* pTxtNode = rNd.GetTxtNode();
- // --> OD 2008-03-13 #refactorlists#
-// pTxtNode->UnregisterNumber();
pTxtNode->RemoveFromList();
- // <--
//if ( pTxtNode->GetTxtColl()->GetOutlineLevel() != NO_NUMBERING )//#outline level,zhaojianwei
if ( pTxtNode->GetAttrOutlineLevel() != 0 )//<-end,zhaojianwei
@@ -199,10 +196,7 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz,
if( rNd.IsTxtNode() )
{
SwTxtNode& rTxtNd = (SwTxtNode&)rNd;
- // --> OD 2008-03-13 #refactorlists#
-// rTxtNd.SyncNumberAndNumRule();
rTxtNd.AddToList();
- // <--
if( bInsOutlineIdx &&
//NO_NUMBERING != rTxtNd.GetTxtColl()->GetOutlineLevel() )//#outline level,zhaojianwei
@@ -273,10 +267,7 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz,
// Numerierungen auch aktualisiert werden.
pTxtNd->InvalidateNumRule();
- // --> OD 2008-03-13 #refactorlists#
-// pTxtNd->UnregisterNumber();
pTxtNd->RemoveFromList();
- // <--
}
RemoveNode( rDelPos.GetIndex(), 1, sal_False ); // Indizies verschieben !!
@@ -298,10 +289,7 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz,
rNds.pOutlineNds->Insert( pTxtNd );
}
- // --> OD 2008-03-13 #refactorlists#
-// pTxtNd->SyncNumberAndNumRule();
pTxtNd->AddToList();
- // <--
// Sonderbehandlung fuer die Felder!
if( pHts && pHts->Count() )
@@ -316,9 +304,9 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz,
switch ( pAttr->Which() )
{
case RES_TXTATR_FIELD:
+ case RES_TXTATR_INPUTFIELD:
{
- SwTxtFld* pTxtFld =
- static_cast<SwTxtFld*>(pAttr);
+ SwTxtFld* pTxtFld = static_cast<SwTxtFld*>(pAttr);
rNds.GetDoc()->InsDelFldInFldLst( !bToUndo, *pTxtFld );
const SwFieldType* pTyp = pTxtFld->GetFmtFld().GetField()->GetTyp();
@@ -909,6 +897,17 @@ sal_Bool SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
break;
case ND_TEXTNODE:
+ //IAccessibility2 Implementation 2009-----
+ //Solution:Add special function to text node.
+ {
+ if( bNewFrms && pAktNode->GetCntntNode() )
+ ((SwCntntNode*)pAktNode)->DelFrms( sal_False );
+ pAktNode->pStartOfSection = aSttNdStack[ nLevel ];
+ nInsPos++;
+ aRg.aEnd--;
+ }
+ break;
+ //-----IAccessibility2 Implementation 2009
case ND_GRFNODE:
case ND_OLENODE:
{
diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx
index 4983cc04e431..8a51c96d779f 100644
--- a/sw/source/core/draw/dview.cxx
+++ b/sw/source/core/draw/dview.cxx
@@ -1079,7 +1079,7 @@ void SwDrawView::ReplaceMarkedDrawVirtObjs( SdrMarkView& _rMarkView )
{
SdrObject* pRefObj = &(static_cast<SwDrawVirtObj*>(pMarkObj)->ReferencedObj());
- if ( !_rMarkView.IsObjMarked( *pRefObj ) )
+ if ( !_rMarkView.isSdrObjectSelected( *pRefObj ) )
{
_rMarkView.MarkObj( *pRefObj );
}
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx
index a3fc31f1f51c..399880615a0b 100644
--- a/sw/source/core/edit/acorrect.cxx
+++ b/sw/source/core/edit/acorrect.cxx
@@ -518,7 +518,7 @@ void SwDontExpandItem::RestoreDontExpandItems( const SwPosition& rPos )
if( nAttrStart > nStart ) // ueber den Bereich hinaus
break;
- if( 0 != ( pAttrEnd = pHt->GetEnd() ) &&
+ if( 0 != ( pAttrEnd = pHt->End() ) &&
( ( nAttrStart < nStart &&
( pHt->DontExpand() ? nStart < *pAttrEnd
: nStart <= *pAttrEnd )) ||
diff --git a/sw/source/core/edit/edatmisc.cxx b/sw/source/core/edit/edatmisc.cxx
index 58aaa0dae3d3..f6ab9dafffc0 100644
--- a/sw/source/core/edit/edatmisc.cxx
+++ b/sw/source/core/edit/edatmisc.cxx
@@ -127,7 +127,7 @@ const SfxPoolItem& SwEditShell::GetDefault( sal_uInt16 nFmtHint ) const
}
-void SwEditShell::SetAttr( const SfxPoolItem& rHint, sal_uInt16 nFlags )
+void SwEditShell::SetAttrItem( const SfxPoolItem& rHint, sal_uInt16 nFlags )
{
SET_CURR_SHELL( this );
StartAllAction();
@@ -157,7 +157,7 @@ void SwEditShell::SetAttr( const SfxPoolItem& rHint, sal_uInt16 nFlags )
}
-void SwEditShell::SetAttr( const SfxItemSet& rSet, sal_uInt16 nFlags )
+void SwEditShell::SetAttrSet( const SfxItemSet& rSet, sal_uInt16 nFlags )
{
SET_CURR_SHELL( this );
StartAllAction();
diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx
index 55c093d22a04..37bd0ab3d03c 100644
--- a/sw/source/core/edit/edattr.cxx
+++ b/sw/source/core/edit/edattr.cxx
@@ -242,9 +242,8 @@ bool SwEditShell::SetCurFtn( const SwFmtFtn& rFillFtn )
SwPaM* pCrsr = GetCrsr(), *pFirst = pCrsr;
do {
- bChgd |= pDoc->SetCurFtn( *pCrsr, rFillFtn.GetNumStr(),
- rFillFtn.GetNumber(),
- rFillFtn.IsEndNote() );
+ bChgd |=
+ pDoc->SetCurFtn( *pCrsr, rFillFtn.GetNumStr(), rFillFtn.GetNumber(), rFillFtn.IsEndNote() );
} while( pFirst != ( pCrsr = (SwPaM*)pCrsr->GetNext() ));
@@ -423,7 +422,6 @@ sal_Bool lcl_IsNoEndTxtAttrAtPos( const SwTxtNode& rTNd, xub_StrLen nPos,
{
bRet = sal_False;
- // --> OD 2008-03-19 #refactorlists#
if ( rTNd.IsInList() )
{
ASSERT( rTNd.GetNumRule(),
@@ -435,19 +433,19 @@ sal_Bool lcl_IsNoEndTxtAttrAtPos( const SwTxtNode& rTNd, xub_StrLen nPos,
//other place in dev env...
if ( pNumRule )
{
- //End
- const SwNumFmt &rNumFmt = pNumRule->Get( static_cast<sal_uInt16>(rTNd.GetActualListLevel()) );
- if( SVX_NUM_BITMAP != rNumFmt.GetNumberingType() )
- {
- if ( SVX_NUM_CHAR_SPECIAL == rNumFmt.GetNumberingType() )
- sExp = rNumFmt.GetBulletChar();
- else
- sExp = rTNd.GetNumString();
+ //End
+ const SwNumFmt &rNumFmt = pNumRule->Get( static_cast<sal_uInt16>(rTNd.GetActualListLevel()) );
+ if( SVX_NUM_BITMAP != rNumFmt.GetNumberingType() )
+ {
+ if ( SVX_NUM_CHAR_SPECIAL == rNumFmt.GetNumberingType() )
+ sExp = rNumFmt.GetBulletChar();
+ else
+ sExp = rTNd.GetNumString();
}
- //Modified for i119959,2012.6.12
- //Under this scenario,this pointer is null,but on win,it doesn't crash immediately
- //it exits with exception,and associated memory will have problem which leads to crash problem in
- //other place in dev env...
+ //Modified for i119959,2012.6.12
+ //Under this scenario,this pointer is null,but on win,it doesn't crash immediately
+ //it exits with exception,and associated memory will have problem which leads to crash problem in
+ //other place in dev env...
}
//End
}
diff --git a/sw/source/core/edit/edfld.cxx b/sw/source/core/edit/edfld.cxx
index c29454bf3d7a..5ae8f562b7c7 100644
--- a/sw/source/core/edit/edfld.cxx
+++ b/sw/source/core/edit/edfld.cxx
@@ -28,7 +28,6 @@
#include <unotools/charclass.hxx>
#include <editsh.hxx>
#include <fldbas.hxx>
-#include <ndtxt.hxx> // GetCurFld
#include <doc.hxx>
#include <docary.hxx>
#include <fmtfld.hxx>
@@ -228,65 +227,15 @@ void SwEditShell::Insert2(SwField& rFld, const bool bForceExpandHints)
? nsSetAttrMode::SETATTR_FORCEHINTEXPAND
: nsSetAttrMode::SETATTR_DEFAULT;
- FOREACHPAM_START(this) // fuer jeden PaM
- bool bSuccess(GetDoc()->InsertPoolItem(*PCURCRSR, aFld, nInsertFlags));
+ FOREACHPAM_START(this)
+ const bool bSuccess(GetDoc()->InsertPoolItem(*PCURCRSR, aFld, nInsertFlags));
ASSERT( bSuccess, "Doc->Insert(Field) failed");
(void) bSuccess;
- FOREACHPAM_END() // fuer jeden PaM
+ FOREACHPAM_END()
EndAllAction();
}
-/*************************************************************************
-|*
-|* SwEditShell::GetCurFld()
-|*
-|* Beschreibung Stehen die PaMs auf Feldern ?
-|* Quelle: edtfrm.cxx:
-|*
-*************************************************************************/
-
-inline SwTxtFld *GetDocTxtFld( const SwPosition* pPos )
-{
- SwTxtNode * const pNode = pPos->nNode.GetNode().GetTxtNode();
- return (pNode)
- ? static_cast<SwTxtFld*>( pNode->GetTxtAttrForCharAt(
- pPos->nContent.GetIndex(), RES_TXTATR_FIELD ))
- : 0;
-}
-
-SwField* SwEditShell::GetCurFld() const
-{
- // Wenn es keine Selektionen gibt, gilt der Wert der aktuellen
- // Cursor-Position.
-
- SwPaM* pCrsr = GetCrsr();
- SwTxtFld *pTxtFld = GetDocTxtFld( pCrsr->Start() );
- SwField *pCurFld = NULL;
-
- /* #108536# Field was only recognized if no selection was
- present. Now it is recognized if either the cursor is in the
- field or the selection spans exactly over the field. */
- if( pTxtFld &&
- pCrsr->GetNext() == pCrsr &&
- pCrsr->Start()->nNode == pCrsr->End()->nNode &&
- (pCrsr->End()->nContent.GetIndex() -
- pCrsr->Start()->nContent.GetIndex()) <= 1)
- {
- pCurFld = (SwField*)pTxtFld->GetFmtFld().GetField();
- // TabellenFormel ? wandel internen in externen Namen um
- if( RES_TABLEFLD == pCurFld->GetTyp()->Which() )
- {
- const SwTableNode* pTblNd = IsCrsrInTbl();
- ((SwTblField*)pCurFld)->PtrToBoxNm( pTblNd ? &pTblNd->GetTable() : 0 );
- }
-
- }
-
- /* #108536# removed handling of multi-selections */
-
- return pCurFld;
-}
/*************************************************************************
@@ -299,18 +248,28 @@ SwField* SwEditShell::GetCurFld() const
*************************************************************************/
SwTxtFld* lcl_FindInputFld( SwDoc* pDoc, SwField& rFld )
{
- // suche das Feld ueber seine Addresse. Muss fuer InputFelder in
- // geschuetzten Feldern erfolgen
SwTxtFld* pTFld = 0;
- if( RES_INPUTFLD == rFld.Which() || ( RES_SETEXPFLD == rFld.Which() &&
- ((SwSetExpField&)rFld).GetInputFlag() ) )
+ if( RES_INPUTFLD == rFld.Which() )
+ {
+ const SfxPoolItem* pItem = NULL;
+ const sal_uInt32 nMaxItems =
+ pDoc->GetAttrPool().GetItemCount2( RES_TXTATR_INPUTFIELD );
+ for( sal_uInt32 n = 0; n < nMaxItems; ++n )
+ if( 0 != (pItem = pDoc->GetAttrPool().GetItem2( RES_TXTATR_INPUTFIELD, n ) )
+ && ((SwFmtFld*)pItem)->GetField() == &rFld )
+ {
+ pTFld = ((SwFmtFld*)pItem)->GetTxtFld();
+ break;
+ }
+ }
+ else if( RES_SETEXPFLD == rFld.Which()
+ && ((SwSetExpField&)rFld).GetInputFlag() )
{
- const SfxPoolItem* pItem;
- sal_uInt32 n, nMaxItems =
+ const SfxPoolItem* pItem = NULL;
+ const sal_uInt32 nMaxItems =
pDoc->GetAttrPool().GetItemCount2( RES_TXTATR_FIELD );
- for( n = 0; n < nMaxItems; ++n )
- if( 0 != (pItem =
- pDoc->GetAttrPool().GetItem2( RES_TXTATR_FIELD, n ) )
+ for( sal_uInt32 n = 0; n < nMaxItems; ++n )
+ if( 0 != (pItem = pDoc->GetAttrPool().GetItem2( RES_TXTATR_FIELD, n ) )
&& ((SwFmtFld*)pItem)->GetField() == &rFld )
{
pTFld = ((SwFmtFld*)pItem)->GetTxtFld();
@@ -339,14 +298,9 @@ void SwEditShell::UpdateFlds( SwField &rFld )
SwTxtFld *pTxtFld;
SwFmtFld *pFmtFld;
-// if( pCrsr->GetNext() == pCrsr && !pCrsr->HasMark() &&
-// ( 0 != ( pTxtFld = GetDocTxtFld( pCrsr->Start() ) ) ||
-// 0 != ( pTxtFld = lcl_FindInputFld( GetDoc(), rFld ) ) ) &&
-// ( pFmtFld = (SwFmtFld*)&pTxtFld->GetFld())->GetFld()
-// ->GetTyp()->Which() == rFld.GetTyp()->Which() )
if ( pCrsr->GetNext() == pCrsr && !pCrsr->HasMark())
{
- pTxtFld = GetDocTxtFld(pCrsr->Start());
+ pTxtFld = GetTxtFldAtPos( pCrsr->Start(), true );
if (!pTxtFld) // #i30221#
pTxtFld = lcl_FindInputFld( GetDoc(), rFld);
@@ -361,7 +315,8 @@ void SwEditShell::UpdateFlds( SwField &rFld )
sal_Bool bOkay = sal_True;
sal_Bool bTblSelBreak = sal_False;
- SwMsgPoolItem aHint( RES_TXTATR_FIELD ); // Such-Hint
+ SwMsgPoolItem aFldHint( RES_TXTATR_FIELD );
+ SwMsgPoolItem aInputFldHint( RES_TXTATR_INPUTFIELD );
FOREACHPAM_START(this) // fuer jeden PaM
if( PCURCRSR->HasMark() && bOkay ) // ... mit Selektion
{
@@ -382,13 +337,14 @@ void SwEditShell::UpdateFlds( SwField &rFld )
// Suche nach SwTxtFld ...
while( bOkay
&& pCurStt->nContent != pCurEnd->nContent
- && aPam.Find( aHint, sal_False, fnMoveForward, &aCurPam ) )
+ && ( aPam.Find( aFldHint, sal_False, fnMoveForward, &aCurPam )
+ || aPam.Find( aInputFldHint, sal_False, fnMoveForward, &aCurPam ) ) )
{
// wenn nur ein Pam mehr als ein Feld enthaelt ...
if( aPam.Start()->nContent != pCurStt->nContent )
bOkay = sal_False;
- if( 0 != (pTxtFld = GetDocTxtFld( pCurStt )) )
+ if( 0 != (pTxtFld = GetTxtFldAtPos( pCurStt, true )) )
{
pFmtFld = (SwFmtFld*)&pTxtFld->GetFmtFld();
pCurFld = pFmtFld->GetField();
diff --git a/sw/source/core/edit/edfldexp.cxx b/sw/source/core/edit/edfldexp.cxx
index 6e6dd1cc91ed..49d8f454c035 100644
--- a/sw/source/core/edit/edfldexp.cxx
+++ b/sw/source/core/edit/edfldexp.cxx
@@ -31,7 +31,6 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <doc.hxx>
#include <docary.hxx>
-#include <ndtxt.hxx> // GetCurFld
#include <txtfld.hxx>
#include <fmtfld.hxx>
#include <edimp.hxx>
diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx
index 81c0f3b1ef9e..2e7260e4df60 100644
--- a/sw/source/core/edit/editsh.cxx
+++ b/sw/source/core/edit/editsh.cxx
@@ -785,7 +785,7 @@ sal_Bool SwEditShell::InsertURL( const SwFmtINetFmt& rFmt, const String& rStr, s
else
bInsTxt = sal_False;
- SetAttr( rFmt );
+ SetAttrItem( rFmt );
if (bInsTxt && !IsCrsrPtAtEnd())
SwapPam();
if(!bKeepSelection)
@@ -815,7 +815,7 @@ sal_uInt16 SwEditShell::GetINetAttrs( SwGetINetAttrs& rArr )
{
SwTxtINetFmt& rAttr = *pFnd;
String sTxt( pTxtNd->GetExpandTxt( *rAttr.GetStart(),
- *rAttr.GetEnd() - *rAttr.GetStart() ) );
+ *rAttr.End() - *rAttr.GetStart() ) );
sTxt.EraseAllChars( 0x0a );
sTxt.EraseLeadingChars().EraseTrailingChars();
diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx
index c22f261a82e0..6b3830afebb2 100644
--- a/sw/source/core/edit/edlingu.cxx
+++ b/sw/source/core/edit/edlingu.cxx
@@ -1382,13 +1382,13 @@ void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions,
pDoc->DeleteAndJoin(*pCrsr);
// ... and apply language if necessary
if(aCurrentNewPortion->eLanguage != aCurrentOldPortion->eLanguage)
- SetAttr( SvxLanguageItem(aCurrentNewPortion->eLanguage, nLangWhichId), nLangWhichId );
+ SetAttrItem( SvxLanguageItem(aCurrentNewPortion->eLanguage, nLangWhichId), nLangWhichId );
pDoc->InsertString(*pCrsr, aCurrentNewPortion->sText);
}
else if(aCurrentNewPortion->eLanguage != aCurrentOldPortion->eLanguage)
{
//apply language
- SetAttr( SvxLanguageItem(aCurrentNewPortion->eLanguage, nLangWhichId), nLangWhichId );
+ SetAttrItem( SvxLanguageItem(aCurrentNewPortion->eLanguage, nLangWhichId), nLangWhichId );
}
else if( aCurrentNewPortion->bIgnoreThisError )
{
@@ -1429,7 +1429,7 @@ void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions,
GetCurAttr( aSet );
const SvxLanguageItem& rLang = static_cast<const SvxLanguageItem& >(aSet.Get(nLangWhichId));
if(rLang.GetLanguage() != aCurrentNewPortion->eLanguage)
- SetAttr( SvxLanguageItem(aCurrentNewPortion->eLanguage, nLangWhichId) );
+ SetAttrItem( SvxLanguageItem(aCurrentNewPortion->eLanguage, nLangWhichId) );
//insert the new string
pDoc->InsertString(*pCrsr, aCurrentNewPortion->sText);
diff --git a/sw/source/core/edit/ednumber.cxx b/sw/source/core/edit/ednumber.cxx
index 743834791f73..857bba8acdf8 100644
--- a/sw/source/core/edit/ednumber.cxx
+++ b/sw/source/core/edit/ednumber.cxx
@@ -209,7 +209,7 @@ sal_Bool SwEditShell::SelectionHasNumber() const
return bResult;
}
-//Sym3_879 add a new function to determine number on/off status
+//add a new function to determine number on/off status
sal_Bool SwEditShell::SelectionHasBullet() const
{
sal_Bool bResult = HasBullet();
@@ -731,7 +731,6 @@ sal_Bool SwEditShell::IsNoNum( sal_Bool bChkStart ) const
return bResult;
}
-// --> OD 2008-02-29 #refactorlists# - removed <pHasChilds>
sal_uInt8 SwEditShell::GetNumLevel() const
{
// gebe die akt. Ebene zurueck, auf der sich der Point vom Cursor befindet
@@ -741,22 +740,18 @@ sal_uInt8 SwEditShell::GetNumLevel() const
SwPaM* pCrsr = GetCrsr();
const SwTxtNode* pTxtNd = pCrsr->GetNode()->GetTxtNode();
- // --> FME 2005-09-12 #124972# Made code robust:
ASSERT( pTxtNd, "GetNumLevel() without text node" )
if ( !pTxtNd )
return nLevel;
- // <--
const SwNumRule* pRule = pTxtNd->GetNumRule();
if(pRule)
{
- // --> OD 2008-05-09 #refactorlists#
const int nListLevelOfTxtNode( pTxtNd->GetActualListLevel() );
if ( nListLevelOfTxtNode >= 0 )
{
nLevel = static_cast<sal_uInt8>( nListLevelOfTxtNode );
}
- // <--
}
return nLevel;
@@ -784,21 +779,16 @@ void SwEditShell::SetCurNumRule( const SwNumRule& rRule,
SwPamRanges aRangeArr( *pCrsr );
SwPaM aPam( *pCrsr->GetPoint() );
for( sal_uInt16 n = 0; n < aRangeArr.Count(); ++n )
- {
+ {
aRangeArr.SetPam( n, aPam );
- // --> OD 2008-02-08 #newlistlevelattrs#
- // --> OD 2008-03-17 #refactorlists#
GetDoc()->SetNumRule( aPam, rRule,
bCreateNewList, sContinuedListId,
sal_True, bResetIndentAttrs );
- // <--
GetDoc()->SetCounted( aPam, true );
- }
+ }
}
else
{
- // --> OD 2008-02-08 #newlistlevelattrs#
- // --> OD 2008-03-17 #refactorlists#
GetDoc()->SetNumRule( *pCrsr, rRule,
bCreateNewList, sContinuedListId,
sal_True, bResetIndentAttrs );
diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx
index 5771a33f910b..8fa4676aa2a8 100644
--- a/sw/source/core/edit/edtox.cxx
+++ b/sw/source/core/edit/edtox.cxx
@@ -84,8 +84,8 @@ void SwEditShell::Insert(const SwTOXMark& rMark)
}
else if( *pEnd != *pStt )
{
- GetDoc()->InsertPoolItem( *PCURCRSR, rMark,
- nsSetAttrMode::SETATTR_DONTEXPAND );
+ GetDoc()->InsertPoolItem(
+ *PCURCRSR, rMark, nsSetAttrMode::SETATTR_DONTEXPAND );
}
FOREACHPAM_END()
diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx
index 67c533925e80..253e9aaf3b22 100644
--- a/sw/source/core/fields/expfld.cxx
+++ b/sw/source/core/fields/expfld.cxx
@@ -976,12 +976,162 @@ void SwSetExpField::SetPar2(const String& rStr)
}
}
+
+sal_Bool SwSetExpField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+{
+ sal_Int32 nTmp32 = 0;
+ sal_Int16 nTmp16 = 0;
+ String sTmp;
+ switch( nWhichId )
+ {
+ case FIELD_PROP_BOOL2:
+ if(*(sal_Bool*)rAny.getValue())
+ nSubType &= ~nsSwExtendedSubType::SUB_INVISIBLE;
+ else
+ nSubType |= nsSwExtendedSubType::SUB_INVISIBLE;
+ break;
+ case FIELD_PROP_FORMAT:
+ rAny >>= nTmp32;
+ SetFormat(nTmp32);
+ break;
+ case FIELD_PROP_USHORT2:
+ {
+ rAny >>= nTmp16;
+ if(nTmp16 <= SVX_NUMBER_NONE )
+ SetFormat(nTmp16);
+ else {
+ //exception(wrong_value)
+ ;
+ }
+ }
+ break;
+ case FIELD_PROP_USHORT1:
+ rAny >>= nTmp16;
+ nSeqNo = nTmp16;
+ break;
+ case FIELD_PROP_PAR1:
+ SetPar1( SwStyleNameMapper::GetUIName(
+ ::GetString( rAny, sTmp ), nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL ) );
+ break;
+ case FIELD_PROP_PAR2:
+ {
+ OUString uTmp;
+ rAny >>= uTmp;
+ //I18N - if the formula contains only "TypeName+1"
+ //and it's one of the initially created sequence fields
+ //then the localized names has to be replaced by a programmatic name
+ OUString sMyFormula = SwXFieldMaster::LocalizeFormula(*this, uTmp, sal_False);
+ SetFormula( sMyFormula );
+ }
+ break;
+ case FIELD_PROP_DOUBLE:
+ {
+ double fVal = 0.0;
+ rAny >>= fVal;
+ SetValue(fVal);
+ }
+ break;
+ case FIELD_PROP_SUBTYPE:
+ nTmp32 = lcl_APIToSubType(rAny);
+ if(nTmp32 >= 0)
+ SetSubType(static_cast<sal_uInt16>((GetSubType() & 0xff00) | nTmp32));
+ break;
+ case FIELD_PROP_PAR3:
+ ::GetString( rAny, aPText );
+ break;
+ case FIELD_PROP_BOOL3:
+ if(*(sal_Bool*) rAny.getValue())
+ nSubType |= nsSwExtendedSubType::SUB_CMD;
+ else
+ nSubType &= (~nsSwExtendedSubType::SUB_CMD);
+ break;
+ case FIELD_PROP_BOOL1:
+ SetInputFlag(*(sal_Bool*) rAny.getValue());
+ break;
+ case FIELD_PROP_PAR4:
+ ChgExpStr( ::GetString( rAny, sTmp ));
+ break;
+ default:
+ return SwField::PutValue(rAny, nWhichId);
+ }
+ return sal_True;
+}
+
+
+sal_Bool SwSetExpField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+{
+ switch( nWhichId )
+ {
+ case FIELD_PROP_BOOL2:
+ {
+ sal_Bool bVal = 0 == (nSubType & nsSwExtendedSubType::SUB_INVISIBLE);
+ rAny.setValue(&bVal, ::getBooleanCppuType());
+ }
+ break;
+ case FIELD_PROP_FORMAT:
+ rAny <<= (sal_Int32)GetFormat();
+ break;
+ case FIELD_PROP_USHORT2:
+ rAny <<= (sal_Int16)GetFormat();
+ break;
+ case FIELD_PROP_USHORT1:
+ rAny <<= (sal_Int16)nSeqNo;
+ break;
+ case FIELD_PROP_PAR1:
+ rAny <<= OUString ( SwStyleNameMapper::GetProgName(GetPar1(), nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL ) );
+ break;
+ case FIELD_PROP_PAR2:
+ {
+ //I18N - if the formula contains only "TypeName+1"
+ //and it's one of the initially created sequence fields
+ //then the localized names has to be replaced by a programmatic name
+ OUString sMyFormula = SwXFieldMaster::LocalizeFormula(*this, GetFormula(), sal_True);
+ rAny <<= OUString( sMyFormula );
+ }
+ break;
+ case FIELD_PROP_DOUBLE:
+ rAny <<= (double)GetValue();
+ break;
+ case FIELD_PROP_SUBTYPE:
+ {
+ sal_Int16 nRet = 0;
+ nRet = lcl_SubTypeToAPI(GetSubType() & 0xff);
+ rAny <<= nRet;
+ }
+ break;
+ case FIELD_PROP_PAR3:
+ rAny <<= OUString( aPText );
+ break;
+ case FIELD_PROP_BOOL3:
+ {
+ sal_Bool bTmp = 0 != (nSubType & nsSwExtendedSubType::SUB_CMD);
+ rAny.setValue(&bTmp, ::getBooleanCppuType());
+ }
+ break;
+ case FIELD_PROP_BOOL1:
+ {
+ sal_Bool bTmp = GetInputFlag();
+ rAny.setValue(&bTmp, ::getBooleanCppuType());
+ }
+ break;
+ case FIELD_PROP_PAR4:
+ rAny <<= rtl::OUString(GetExpStr());
+ break;
+ default:
+ return SwField::QueryValue(rAny, nWhichId);
+ }
+ return sal_True;
+}
+
+
+
/*--------------------------------------------------------------------
Beschreibung: Eingabefeld Type
---------------------------------------------------------------------*/
SwInputFieldType::SwInputFieldType( SwDoc* pD )
- : SwFieldType( RES_INPUTFLD ), pDoc( pD )
+ : SwFieldType( RES_INPUTFLD )
+ , pDoc( pD )
{
}
@@ -995,10 +1145,57 @@ SwFieldType* SwInputFieldType::Copy() const
Beschreibung: Eingabefeld
--------------------------------------------------------------------*/
-SwInputField::SwInputField(SwInputFieldType* pTyp, const String& rContent,
- const String& rPrompt, sal_uInt16 nSub, sal_uLong nFmt) :
- SwField(pTyp, nFmt), aContent(rContent), aPText(rPrompt), nSubType(nSub)
+SwInputField::SwInputField( SwInputFieldType* pFieldType,
+ const String& rContent,
+ const String& rPrompt,
+ sal_uInt16 nSub,
+ sal_uLong nFmt,
+ bool bIsFormField )
+ : SwField( pFieldType, nFmt, LANGUAGE_SYSTEM, false )
+ , aContent(rContent)
+ , aPText(rPrompt)
+ , nSubType(nSub)
+ , mpFmtFld( NULL )
+ , mbIsFormField( bIsFormField )
+{
+}
+
+SwInputField::~SwInputField()
+{
+}
+
+
+void SwInputField::SetFmtFld( SwFmtFld& rFmtFld )
{
+ mpFmtFld = &rFmtFld;
+}
+
+SwFmtFld* SwInputField::GetFmtFld()
+{
+ return mpFmtFld;
+}
+
+
+const String& SwInputField::getContent() const
+{
+ return aContent;
+}
+
+void SwInputField::applyFieldContent( const String& rNewFieldContent )
+{
+ if ( (nSubType & 0x00ff) == INP_TXT )
+ {
+ aContent = rNewFieldContent;
+ }
+ else if( (nSubType & 0x00ff) == INP_USR )
+ {
+ SwUserFieldType* pUserTyp = static_cast<SwUserFieldType*>(
+ static_cast<SwInputFieldType*>(GetTyp())->GetDoc()->GetFldType( RES_USERFLD, getContent(), false ) );
+ if( pUserTyp )
+ {
+ pUserTyp->SetContent( rNewFieldContent );
+ }
+ }
}
String SwInputField::GetFieldName() const
@@ -1008,18 +1205,24 @@ String SwInputField::GetFieldName() const
{
aStr += GetTyp()->GetName();
aStr += ' ';
- aStr += aContent;
+ aStr += getContent();
}
return aStr;
}
SwField* SwInputField::Copy() const
{
- SwInputField* pFld = new SwInputField((SwInputFieldType*)GetTyp(), aContent,
- aPText, GetSubType(), GetFormat());
+ SwInputField* pFld =
+ new SwInputField(
+ static_cast<SwInputFieldType*>(GetTyp()),
+ getContent(),
+ aPText,
+ GetSubType(),
+ GetFormat(),
+ mbIsFormField );
- pFld->SetHelp(aHelp);
- pFld->SetToolTip(aToolTip);
+ pFld->SetHelp( aHelp );
+ pFld->SetToolTip( aToolTip );
pFld->SetAutomaticLanguage(IsAutomaticLanguage());
return pFld;
@@ -1028,26 +1231,35 @@ SwField* SwInputField::Copy() const
String SwInputField::Expand() const
{
String sRet;
- if((nSubType & 0x00ff) == INP_TXT)
- sRet = aContent;
-
+ if ( (nSubType & 0x00ff) == INP_TXT )
+ {
+ sRet = getContent();
+ }
else if( (nSubType & 0x00ff) == INP_USR )
{
- SwUserFieldType* pUserTyp = (SwUserFieldType*)
- ((SwInputFieldType*)GetTyp())->GetDoc()->
- GetFldType( RES_USERFLD, aContent, false );
+ SwUserFieldType* pUserTyp = static_cast<SwUserFieldType*>(
+ static_cast<SwInputFieldType*>(GetTyp())->GetDoc()->GetFldType( RES_USERFLD, getContent(), false ) );
if( pUserTyp )
sRet = pUserTyp->GetContent();
}
return sRet;
}
+
+bool SwInputField::isFormField() const
+{
+ return mbIsFormField
+ || aHelp.Len() > 0
+ || aToolTip.Len() > 0;
+}
+
+
sal_Bool SwInputField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
{
case FIELD_PROP_PAR1:
- rAny <<= OUString( aContent );
+ rAny <<= OUString( getContent() );
break;
case FIELD_PROP_PAR2:
rAny <<= OUString( aPText );
@@ -1069,7 +1281,9 @@ sal_Bool SwInputField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
switch( nWhichId )
{
case FIELD_PROP_PAR1:
- ::GetString( rAny, aContent );
+ {
+ ::GetString( rAny, aContent );
+ }
break;
case FIELD_PROP_PAR2:
::GetString( rAny, aPText );
@@ -1085,9 +1299,7 @@ sal_Bool SwInputField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
}
return sal_True;
}
-/*--------------------------------------------------------------------
- Beschreibung: Bedingung setzen
- --------------------------------------------------------------------*/
+
void SwInputField::SetPar1(const String& rStr)
{
@@ -1096,12 +1308,9 @@ void SwInputField::SetPar1(const String& rStr)
const String& SwInputField::GetPar1() const
{
- return aContent;
+ return getContent();
}
-/*--------------------------------------------------------------------
- Beschreibung: True/False Text
- --------------------------------------------------------------------*/
void SwInputField::SetPar2(const String& rStr)
{
@@ -1133,11 +1342,6 @@ String SwInputField::GetToolTip() const
return aToolTip;
}
-sal_Bool SwInputField::isFormField() const
-{
- return aHelp.Len() > 0 || aToolTip.Len() > 0;
-}
-
sal_uInt16 SwInputField::GetSubType() const
{
return nSubType;
@@ -1148,150 +1352,3 @@ void SwInputField::SetSubType(sal_uInt16 nSub)
nSubType = nSub;
}
-sal_Bool SwSetExpField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
-{
- switch( nWhichId )
- {
- case FIELD_PROP_BOOL2:
- {
- sal_Bool bVal = 0 == (nSubType & nsSwExtendedSubType::SUB_INVISIBLE);
- rAny.setValue(&bVal, ::getBooleanCppuType());
- }
- break;
- case FIELD_PROP_FORMAT:
- rAny <<= (sal_Int32)GetFormat();
- break;
- case FIELD_PROP_USHORT2:
- rAny <<= (sal_Int16)GetFormat();
- break;
- case FIELD_PROP_USHORT1:
- rAny <<= (sal_Int16)nSeqNo;
- break;
- case FIELD_PROP_PAR1:
- rAny <<= OUString ( SwStyleNameMapper::GetProgName(GetPar1(), nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL ) );
- break;
- case FIELD_PROP_PAR2:
- {
- //I18N - if the formula contains only "TypeName+1"
- //and it's one of the initially created sequence fields
- //then the localized names has to be replaced by a programmatic name
- OUString sMyFormula = SwXFieldMaster::LocalizeFormula(*this, GetFormula(), sal_True);
- rAny <<= OUString( sMyFormula );
- }
- break;
- case FIELD_PROP_DOUBLE:
- rAny <<= (double)GetValue();
- break;
- case FIELD_PROP_SUBTYPE:
- {
- sal_Int16 nRet = 0;
- nRet = lcl_SubTypeToAPI(GetSubType() & 0xff);
- rAny <<= nRet;
- }
- break;
- case FIELD_PROP_PAR3:
- rAny <<= OUString( aPText );
- break;
- case FIELD_PROP_BOOL3:
- {
- sal_Bool bTmp = 0 != (nSubType & nsSwExtendedSubType::SUB_CMD);
- rAny.setValue(&bTmp, ::getBooleanCppuType());
- }
- break;
- case FIELD_PROP_BOOL1:
- {
- sal_Bool bTmp = GetInputFlag();
- rAny.setValue(&bTmp, ::getBooleanCppuType());
- }
- break;
- case FIELD_PROP_PAR4:
- rAny <<= rtl::OUString(GetExpStr());
- break;
- default:
- return SwField::QueryValue(rAny, nWhichId);
- }
- return sal_True;
-}
-
-sal_Bool SwSetExpField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
-{
- sal_Int32 nTmp32 = 0;
- sal_Int16 nTmp16 = 0;
- String sTmp;
- switch( nWhichId )
- {
- case FIELD_PROP_BOOL2:
- if(*(sal_Bool*)rAny.getValue())
- nSubType &= ~nsSwExtendedSubType::SUB_INVISIBLE;
- else
- nSubType |= nsSwExtendedSubType::SUB_INVISIBLE;
- break;
- case FIELD_PROP_FORMAT:
- rAny >>= nTmp32;
- SetFormat(nTmp32);
- break;
- case FIELD_PROP_USHORT2:
- {
- rAny >>= nTmp16;
- if(nTmp16 <= SVX_NUMBER_NONE )
- SetFormat(nTmp16);
- else {
- //exception(wrong_value)
- ;
- }
- }
- break;
- case FIELD_PROP_USHORT1:
- rAny >>= nTmp16;
- nSeqNo = nTmp16;
- break;
- case FIELD_PROP_PAR1:
- SetPar1( SwStyleNameMapper::GetUIName(
- ::GetString( rAny, sTmp ), nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL ) );
- break;
- case FIELD_PROP_PAR2:
- {
- OUString uTmp;
- rAny >>= uTmp;
- //I18N - if the formula contains only "TypeName+1"
- //and it's one of the initially created sequence fields
- //then the localized names has to be replaced by a programmatic name
- OUString sMyFormula = SwXFieldMaster::LocalizeFormula(*this, uTmp, sal_False);
- SetFormula( sMyFormula );
- }
- break;
- case FIELD_PROP_DOUBLE:
- {
- double fVal = 0.0;
- rAny >>= fVal;
- SetValue(fVal);
- }
- break;
- case FIELD_PROP_SUBTYPE:
- nTmp32 = lcl_APIToSubType(rAny);
- if(nTmp32 >= 0)
- SetSubType(static_cast<sal_uInt16>((GetSubType() & 0xff00) | nTmp32));
- break;
- case FIELD_PROP_PAR3:
- ::GetString( rAny, aPText );
- break;
- case FIELD_PROP_BOOL3:
- if(*(sal_Bool*) rAny.getValue())
- nSubType |= nsSwExtendedSubType::SUB_CMD;
- else
- nSubType &= (~nsSwExtendedSubType::SUB_CMD);
- break;
- case FIELD_PROP_BOOL1:
- SetInputFlag(*(sal_Bool*) rAny.getValue());
- break;
- case FIELD_PROP_PAR4:
- ChgExpStr( ::GetString( rAny, sTmp ));
- break;
- default:
- return SwField::PutValue(rAny, nWhichId);
- }
- return sal_True;
-}
-
-
-
diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx
index 2c70ae22f362..506de16f17e3 100644
--- a/sw/source/core/fields/fldbas.cxx
+++ b/sw/source/core/fields/fldbas.cxx
@@ -180,13 +180,19 @@ sal_Bool SwFieldType::PutValue( const uno::Any& , sal_uInt16 )
Felder sind n-mal vorhanden, Feldtypen nur einmal
--------------------------------------------------------------------*/
-SwField::SwField(SwFieldType* pTyp, sal_uInt32 nFmt, sal_uInt16 nLng) :
- nLang(nLng),
- bIsAutomaticLanguage(sal_True),
- nFormat(nFmt)
+SwField::SwField(
+ SwFieldType* pTyp,
+ sal_uInt32 nFmt,
+ sal_uInt16 nLng,
+ bool bUseFieldValueCache )
+ : m_Cache()
+ , m_bUseFieldValueCache( bUseFieldValueCache )
+ , nLang( nLng )
+ , bIsAutomaticLanguage( sal_True )
+ , nFormat( nFmt )
+ , pType( pTyp )
{
ASSERT( pTyp, "SwField: ungueltiger SwFieldType" );
- pType = pTyp;
}
SwField::~SwField()
@@ -425,11 +431,16 @@ sal_Bool SwField::IsFixed() const
String SwField::ExpandField(bool const bCached) const
{
- if (!bCached) // #i85766# do not expand fields in clipboard documents
+ if ( m_bUseFieldValueCache )
{
- m_Cache = Expand();
+ if (!bCached) // #i85766# do not expand fields in clipboard documents
+ {
+ m_Cache = Expand();
+ }
+ return m_Cache;
}
- return m_Cache;
+
+ return Expand();
}
SwField * SwField::CopyField() const
@@ -438,6 +449,8 @@ SwField * SwField::CopyField() const
// #i85766# cache expansion of source (for clipboard)
// use this->cache, not this->Expand(): only text formatting calls Expand()
pNew->m_Cache = m_Cache;
+ pNew->m_bUseFieldValueCache = m_bUseFieldValueCache;
+
return pNew;
}
diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index 2996950307ab..3820a0ca1492 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -277,7 +277,6 @@ String SwGetRefField::GetFieldName() const
return aStr;
}
-// --> OD 2007-09-07 #i81002# - parameter <pFldTxtAttr> added
void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr )
{
sTxt.Erase();
@@ -285,8 +284,7 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr )
SwDoc* pDoc = ((SwGetRefFieldType*)GetTyp())->GetDoc();
sal_uInt16 nStt = USHRT_MAX;
sal_uInt16 nEnd = USHRT_MAX;
- SwTxtNode* pTxtNd = SwGetRefFieldType::FindAnchor( pDoc, sSetRefName,
- nSubType, nSeqNo, &nStt, &nEnd );
+ SwTxtNode* pTxtNd = SwGetRefFieldType::FindAnchor( pDoc, sSetRefName, nSubType, nSeqNo, &nStt, &nEnd );
if ( !pTxtNd )
{
sTxt = ViewShell::GetShellRes()->aGetRefFld_RefItemNotFound;
@@ -314,8 +312,7 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr )
case REF_ONLYCAPTION:
{
- const SwTxtAttr* const pTxtAttr =
- pTxtNd->GetTxtAttrForCharAt(nStt, RES_TXTATR_FIELD);
+ const SwTxtAttr* const pTxtAttr = pTxtNd->GetTxtAttrForCharAt(nStt, RES_TXTATR_FIELD);
if( pTxtAttr )
nStt = SwGetExpField::GetReferenceTextPos(
pTxtAttr->GetFmtFld(), *pDoc );
@@ -423,32 +420,29 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr )
case REF_UPDOWN:
{
- // --> OD 2007-09-07 #i81002#
// simplified: use parameter <pFldTxtAttr>
if( !pFldTxtAttr || !pFldTxtAttr->GetpTxtNode() )
break;
- LocaleDataWrapper aLocaleData(
- ::comphelper::getProcessServiceFactory(),
- SvxCreateLocale( GetLanguage() ) );
+ LocaleDataWrapper aLocaleData( ::comphelper::getProcessServiceFactory(), SvxCreateLocale( GetLanguage() ) );
// erstmal ein "Kurz" - Test - falls beide im selben
// Node stehen!
if( pFldTxtAttr->GetpTxtNode() == pTxtNd )
{
sTxt = nStt < *pFldTxtAttr->GetStart()
- ? aLocaleData.getAboveWord()
- : aLocaleData.getBelowWord();
+ ? aLocaleData.getAboveWord()
+ : aLocaleData.getBelowWord();
break;
}
- sTxt = ::IsFrameBehind( *pFldTxtAttr->GetpTxtNode(), *pFldTxtAttr->GetStart(),
- *pTxtNd, nStt )
- ? aLocaleData.getAboveWord()
- : aLocaleData.getBelowWord();
+ sTxt =
+ ::IsFrameBehind( *pFldTxtAttr->GetpTxtNode(), *pFldTxtAttr->GetStart(), *pTxtNd, nStt )
+ ? aLocaleData.getAboveWord()
+ : aLocaleData.getBelowWord();
}
break;
- // --> OD 2007-08-24 #i81002#
+
case REF_NUMBER:
case REF_NUMBER_NO_CONTEXT:
case REF_NUMBER_FULL_CONTEXT:
@@ -459,7 +453,7 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr )
}
}
break;
- // <--
+
default:
DBG_ERROR("<SwGetRefField::UpdateField(..)> - unknown format type");
}
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index 5a899698ad2a..f85fd91e5c59 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -121,8 +121,12 @@ sal_Bool lcl_SetNewFlyPos( const SwNode& rNode, SwFmtAnchor& rAnchor,
return bRet;
}
-sal_Bool lcl_FindAnchorPos( SwDoc& rDoc, const Point& rPt, const SwFrm& rFrm,
- SfxItemSet& rSet )
+sal_Bool lcl_FindAnchorPos(
+ SwEditShell& rEditShell,
+ SwDoc& rDoc,
+ const Point& rPt,
+ const SwFrm& rFrm,
+ SfxItemSet& rSet )
{
sal_Bool bRet = sal_True;
SwFmtAnchor aNewAnch( (SwFmtAnchor&)rSet.Get( RES_ANCHOR ) );
@@ -163,6 +167,13 @@ sal_Bool lcl_FindAnchorPos( SwDoc& rDoc, const Point& rPt, const SwFrm& rFrm,
else
pCNd->MakeEndIndex( &aPos.nContent );
}
+ else
+ {
+ if ( rEditShell.PosInsideInputFld( aPos ) )
+ {
+ aPos.nContent = rEditShell.StartOfInputFldAtPos( aPos );
+ }
+ }
}
aNewAnch.SetAnchor( &aPos );
}
@@ -208,7 +219,10 @@ sal_Bool lcl_FindAnchorPos( SwDoc& rDoc, const Point& rPt, const SwFrm& rFrm,
//
//! also used in unoframe.cxx
//
-sal_Bool lcl_ChkAndSetNewAnchor( const SwFlyFrm& rFly, SfxItemSet& rSet )
+sal_Bool lcl_ChkAndSetNewAnchor(
+ SwEditShell& rEditShell,
+ const SwFlyFrm& rFly,
+ SfxItemSet& rSet )
{
const SwFrmFmt& rFmt = *rFly.GetFmt();
const SwFmtAnchor &rOldAnch = rFmt.GetAnchor();
@@ -228,7 +242,7 @@ sal_Bool lcl_ChkAndSetNewAnchor( const SwFlyFrm& rFly, SfxItemSet& rSet )
"Unerlaubter Ankerwechsel in Head/Foot." );
#endif
- return ::lcl_FindAnchorPos( *pDoc, rFly.Frm().Pos(), rFly, rSet );
+ return ::lcl_FindAnchorPos( rEditShell, *pDoc, rFly.Frm().Pos(), rFly, rSet );
}
void SwFEShell::SelectFlyFrm( SwFlyFrm& rFrm, sal_Bool bNew )
@@ -455,7 +469,7 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt )
// --> OD 2004-07-16 #i28701#
SwAnchoredObject* pAnchoredObj = ::findConnectionToSdrObject( pObj )->GetAnchoredObj( pObj );
SwFrmFmt& rFmt = pAnchoredObj->GetFrmFmt();
- RndStdIds nAnchorId = rFmt.GetAnchor().GetAnchorId();
+ const RndStdIds nAnchorId = rFmt.GetAnchor().GetAnchorId();
if ( FLY_AS_CHAR == nAnchorId )
return aRet;
@@ -494,18 +508,20 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt )
pFooterOrHeader = pCntnt->FindFooterOrHeader();
}
- //Ausgehend von der linken oberen Ecke des Fly den
- //dichtesten SwFlyFrm suchen.
- SwCntntFrm *pTxtFrm;
+ SwCntntFrm *pTxtFrm = NULL;
{
SwCrsrMoveState aState( MV_SETONLYTEXT );
SwPosition aPos( GetDoc()->GetNodes().GetEndOfExtras() );
Point aTmpPnt( rAbsPos );
GetLayout()->GetCrsrOfst( &aPos, aTmpPnt, &aState );
- pTxtFrm = aPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( GetLayout(),0,&aPos,sal_False );
+ if ( nAnchorId != FLY_AT_CHAR
+ || !PosInsideInputFld( aPos ) )
+ {
+ pTxtFrm = aPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( GetLayout(),0,&aPos,sal_False );
+ }
}
- const SwFrm *pNewAnch;
- if( pTxtFrm )
+ const SwFrm *pNewAnch = NULL;
+ if( pTxtFrm != NULL )
{
if ( FLY_AT_PAGE == nAnchorId )
{
@@ -521,8 +537,6 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt )
}
}
}
- else
- pNewAnch = 0;
if( pNewAnch && !pNewAnch->IsProtected() )
{
@@ -562,6 +576,7 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt )
GetPhyPageNum() );
break;
}
+
case FLY_AT_FLY:
{
SwPosition aPos( *((SwFlyFrm*)pNewAnch)->GetFmt()->
@@ -569,26 +584,29 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt )
aAnch.SetAnchor( &aPos );
break;
}
+
case FLY_AT_CHAR:
- {
- SwPosition *pPos = (SwPosition*)aAnch.GetCntntAnchor();
- Point aTmpPnt( rAbsPos );
- if( pTxtFrm->GetCrsrOfst( pPos, aTmpPnt, NULL ) )
- {
- SwRect aTmpRect;
- pTxtFrm->GetCharRect( aTmpRect, *pPos );
- aRet = aTmpRect.Pos();
- }
- else
{
- pPos->nNode = *pTxtFrm->GetNode();
- pPos->nContent.Assign(0,0);
+ SwPosition *pPos = (SwPosition*)aAnch.GetCntntAnchor();
+ Point aTmpPnt( rAbsPos );
+ if( pTxtFrm->GetCrsrOfst( pPos, aTmpPnt, NULL ) )
+ {
+ SwRect aTmpRect;
+ pTxtFrm->GetCharRect( aTmpRect, *pPos );
+ aRet = aTmpRect.Pos();
+ }
+ else
+ {
+ pPos->nNode = *pTxtFrm->GetNode();
+ pPos->nContent.Assign(0,0);
+ }
+ break;
}
- break;
- }
default:
break;
+
}
+
if( bMoveIt )
{
StartAllAction();
@@ -969,7 +987,7 @@ void SwFEShell::InsertDrawObj( SdrObject& rDrawObj,
aRelativePos - aTopLeft + aAnchorPos));
}
- ::lcl_FindAnchorPos( *GetDoc(), rInsertPosition, *pFrm, rFlyAttrSet );
+ ::lcl_FindAnchorPos( *this, *GetDoc(), rInsertPosition, *pFrm, rFlyAttrSet );
}
// insert drawing object into the document creating a new <SwDrawFrmFmt> instance
SwDrawFrmFmt* pFmt = GetDoc()->Insert( aPam, rDrawObj, &rFlyAttrSet, 0 );
@@ -1166,7 +1184,7 @@ sal_Bool SwFEShell::SetFlyFrmAttr( SfxItemSet& rSet )
const Point aPt( pFly->Frm().Pos() );
if( SFX_ITEM_SET == rSet.GetItemState( RES_ANCHOR, sal_False ))
- ::lcl_ChkAndSetNewAnchor( *pFly, rSet );
+ ::lcl_ChkAndSetNewAnchor( *this, *pFly, rSet );
SwFlyFrmFmt* pFlyFmt = (SwFlyFrmFmt*)pFly->GetFmt();
if( GetDoc()->SetFlyFrmAttr( *pFlyFmt, rSet ))
@@ -1333,7 +1351,7 @@ void SwFEShell::SetFrmFmt( SwFrmFmt *pNewFmt, sal_Bool bKeepOrient, Point* pDocP
{
pSet = new SfxItemSet( GetDoc()->GetAttrPool(), aFrmFmtSetRange );
pSet->Put( *pItem );
- if( !::lcl_ChkAndSetNewAnchor( *pFly, *pSet ))
+ if( !::lcl_ChkAndSetNewAnchor( *this, *pFly, *pSet ))
delete pSet, pSet = 0;
}
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index fabe65d2f858..b3581c580ab6 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -1032,9 +1032,43 @@ sal_Bool SwFEShell::IsObjSelected( const SdrObject& rObj ) const
if ( IsFrmSelected() || !Imp()->HasDrawView() )
return sal_False;
else
- return Imp()->GetDrawView()->IsObjMarked(rObj);
+ return Imp()->GetDrawView()->isSdrObjectSelected(rObj);
}
+//IAccessibility2 Implementation 2009-----
+bool SwFEShell::IsObjSameLevelWithMarked(const SdrObject& rObj) const
+{
+ if(!Imp()->GetDrawView()->areSdrObjectsSelected())
+ {
+ return true;
+ }
+
+ const SdrObjectVector aSdrObjectVector(Imp()->GetDrawView()->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ if(aSdrObjectVector.empty())
+ {
+ OSL_ENSURE(false, "OOps, areSdrObjectsSelected is true, but SdrObjectVector is empty (!)");
+ }
+ else
+ {
+ const SdrObject& rFirstMarked = *aSdrObjectVector[0];
+
+ return rFirstMarked.GetParentSdrObject() == rObj.GetParentSdrObject();
+ }
+
+ return false;
+}
+
+SdrObject* SwFEShell::getSingleSelected() const
+{
+ if(Imp()->GetDrawView())
+ {
+ return Imp()->GetDrawView()->getSelectedIfSingle();
+ }
+
+ return 0;
+}
+//-----IAccessibility2 Implementation 2009
/*************************************************************************
|*
|* SwFEShell::EndTextEdit()
diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx
index 9691a676e7ee..2c6435301008 100644
--- a/sw/source/core/frmedt/tblsel.cxx
+++ b/sw/source/core/frmedt/tblsel.cxx
@@ -2255,7 +2255,11 @@ inline void UnsetFollow( SwFlowFrm *pTab )
pTab->bIsFollow = sal_False;
}
-void _FndBox::DelFrms( SwTable &rTable )
+//IAccessibility2 Implementation 2009-----
+//Solution:When bAccTableDispose is FALSE,the acc table should not be disposed.
+//void _FndBox::DelFrms( SwTable &rTable )
+void _FndBox::DelFrms( SwTable &rTable,sal_Bool bAccTableDispose )
+//-----IAccessibility2 Implementation 2009
{
//Alle Lines zwischen pLineBefore und pLineBehind muessen aus dem
//Layout ausgeschnitten und geloescht werden.
@@ -2373,9 +2377,14 @@ void _FndBox::DelFrms( SwTable &rTable )
// next turn.
((SwTabFrm*)pTabFrm)->SetFollowFlowLine( sal_False );
}
-
+ //IAccessibility2 Implementation 2009-----
+ //Solution:Set acc table dispose state
+ pFrm->SetAccTableDispose( bAccTableDispose );
pFrm->Cut();
+ //Solution:Set acc table dispose state to default value.
+ pFrm->SetAccTableDispose( sal_True );
delete pFrm;
+ //-----IAccessibility2 Implementation 2009
}
}
}
diff --git a/sw/source/core/inc/SwPortionHandler.hxx b/sw/source/core/inc/SwPortionHandler.hxx
index 34fcb94b6952..7d26954a150b 100644
--- a/sw/source/core/inc/SwPortionHandler.hxx
+++ b/sw/source/core/inc/SwPortionHandler.hxx
@@ -92,6 +92,10 @@ public:
* paragraph's portions have been processed.
*/
virtual void Finish() = 0;
+ //IAccessibility2 Implementation 2009-----
+ virtual void SetAttrFieldType( sal_uInt16 )
+ { return; }
+ //-----IAccessibility2 Implementation 2009
};
#endif
diff --git a/sw/source/core/inc/docfld.hxx b/sw/source/core/inc/docfld.hxx
index 691dc53f4234..7da844b24565 100644
--- a/sw/source/core/inc/docfld.hxx
+++ b/sw/source/core/inc/docfld.hxx
@@ -80,10 +80,7 @@ public:
_SetGetExpFld( const SwFlyFrmFmt& rFlyFmt, const SwPosition* pPos = 0 );
- sal_Bool operator==( const _SetGetExpFld& rFld ) const
- { return nNode == rFld.nNode && nCntnt == rFld.nCntnt &&
- ( !CNTNT.pTxtFld || !rFld.CNTNT.pTxtFld ||
- CNTNT.pTxtFld == rFld.CNTNT.pTxtFld ); }
+ sal_Bool operator==( const _SetGetExpFld& rFld ) const;
sal_Bool operator<( const _SetGetExpFld& rFld ) const;
const SwTxtFld* GetTxtFld() const
diff --git a/sw/source/core/inc/doctxm.hxx b/sw/source/core/inc/doctxm.hxx
index 6cc70f26606d..7c9f0a23bbe9 100644
--- a/sw/source/core/inc/doctxm.hxx
+++ b/sw/source/core/inc/doctxm.hxx
@@ -101,6 +101,9 @@ public:
void Update( const SfxItemSet* pAttr = 0,
const bool _bNewTOX = false ); // Formatieren
void UpdatePageNum(); // Seitennummern einfuegen
+//IAccessibility2 Implementation 2009-----
+ SwTOXSortTabBases* GetTOXSortTabBases() { return &aSortArr; }
+//-----IAccessibility2 Implementation 2009
sal_Bool SetPosAtStartEnd( SwPosition& rPos, sal_Bool bAtStart = sal_True ) const;
};
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 0c6867391d7b..9509bb5b3cf0 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -29,6 +29,11 @@
#include "calbck.hxx" // fuer SwClient
#include <svl/brdcst.hxx>
+//IAccessibility2 Implementation 2009-----
+#include <com/sun/star/style/TabStop.hpp>
+#include <comphelper/stlunosequence.hxx>
+using namespace ::com::sun::star;
+//-----IAccessibility2 Implementation 2009
class SwLayoutFrm;
class SwRootFrm;
class SwPageFrm;
@@ -292,6 +297,10 @@ class SwFrm: public SwClient, public SfxBroadcaster
//Cache fuer (Umrandungs-)Attribute.
static SwCache *pCache;
+ //IAccessibility2 Implementation 2009-----
+ //Solution:Member to identify if acc table should be disposed
+ sal_Bool bIfAccTableShouldDisposing;
+ //-----IAccessibility2 Implementation 2009
// --> OD 2006-05-10 #i65250#
// frame ID is now in general available - used for layout loop control
@@ -415,6 +424,12 @@ protected:
sal_Bool bRetouche: 1; //Der Frame ist fuer Retusche verantwortlich
//wenn sal_True.
public:
+ //IAccessibility2 Implementation 2009-----
+ virtual uno::Sequence< style::TabStop > GetTabStopInfo( SwTwips )
+ {
+ return uno::Sequence< style::TabStop >();
+ }
+ //-----IAccessibility2 Implementation 2009
sal_Bool bUnUsed2: 1;
protected:
sal_Bool bInfInvalid: 1; //InfoFlags sind Invalid.
@@ -767,6 +782,10 @@ public:
virtual Size ChgSize( const Size& aNewSize );
virtual void Cut() = 0;
+ //IAccessibility2 Implementation 2009-----
+ //Solution:Add a method to change the acc table dispose state.
+ void SetAccTableDispose( sal_Bool bDispose){ bIfAccTableShouldDisposing = bDispose;}
+ //-----IAccessibility2 Implementation 2009
virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 ) = 0;
void ValidateLineNum() { bValidLineNum = sal_True; }
diff --git a/sw/source/core/inc/rolbck.hxx b/sw/source/core/inc/rolbck.hxx
index a90ef2ee331f..fdbd37979496 100644
--- a/sw/source/core/inc/rolbck.hxx
+++ b/sw/source/core/inc/rolbck.hxx
@@ -403,11 +403,14 @@ public:
// helper methods for recording attribute in History
// used by Undo classes (Delete/Overwrite/Inserts)
- void CopyAttr( SwpHints* pHts, sal_uLong nNodeIdx, xub_StrLen nStart,
- xub_StrLen nEnd, bool bFields );
- // --> OD 2008-02-27 #refactorlists# - removed <rDoc>
+ void CopyAttr(
+ SwpHints* pHts,
+ const sal_uLong nNodeIdx,
+ const xub_StrLen nStart,
+ const xub_StrLen nEnd,
+ const bool bCopyFields );
+
void CopyFmtAttr( const SfxItemSet& rSet, sal_uLong nNodeIdx );
- // <--
};
#ifndef ROLBCK_HISTORY_ONLY
diff --git a/sw/source/core/inc/rootfrm.hxx b/sw/source/core/inc/rootfrm.hxx
index 3371e612ef7e..073bc99a9d6b 100644
--- a/sw/source/core/inc/rootfrm.hxx
+++ b/sw/source/core/inc/rootfrm.hxx
@@ -268,8 +268,9 @@ public:
// next page border
const SwPageFrm* GetPageAtPos( const Point& rPt, const Size* pSize = 0, bool bExtend = false ) const;
- //Der Crsr moechte die zu selektierenden Bereiche wissen.
- void CalcFrmRects( SwShellCrsr&, sal_Bool bIsTblSel );
+ void CalcFrmRects(
+ SwShellCrsr&,
+ const sal_Bool bIsTblSel );
// Calculates the cells included from the current selection
// false: There was no result because of an invalid layout
diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx
index c54e00ce4b6f..7fafafa3092b 100644
--- a/sw/source/core/inc/swfont.hxx
+++ b/sw/source/core/inc/swfont.hxx
@@ -126,16 +126,20 @@ public:
#define SW_SCRIPTS 3
class SwFont
-{ // CJK == Chinese, Japanese, Korean
- // CTL == Complex text layout ( Hebrew, Arabic )
- SwSubFont aSub[SW_SCRIPTS]; // Latin-, CJK- and CTL-font
- Color* pBackColor; // background color (i.e. at character styles)
- Color aUnderColor; // color of the underlining
- Color aOverColor; // color of the overlining
- sal_uInt8 nToxCnt; // Zaehlt die Schachtelungstiefe der Tox
- sal_uInt8 nRefCnt; // Zaehlt die Schachtelungstiefe der Refs
- sal_uInt8 m_nMetaCount; // count META/METAFIELD
- sal_uInt8 nActual; // actual font (Latin, CJK or CTL)
+{ // CJK == Chinese, Japanese, Korean
+ // CTL == Complex text layout ( Hebrew, Arabic )
+ SwSubFont aSub[SW_SCRIPTS]; // Latin-, CJK- and CTL-font
+
+ Color* pBackColor; // background color (i.e. at character styles)
+ Color aUnderColor; // color of the underlining
+ Color aOverColor; // color of the overlining
+
+ sal_uInt8 nToxCnt; // Zaehlt die Schachtelungstiefe der Tox
+ sal_uInt8 nRefCnt; // Zaehlt die Schachtelungstiefe der Refs
+ sal_uInt8 m_nMetaCount; // count META/METAFIELD
+ sal_uInt8 m_nInputFieldCount; // count INPUTFIELD
+
+ sal_uInt8 nActual; // actual font (Latin, CJK or CTL)
// Schalter fuer die Font-Extensions
sal_Bool bNoHyph :1; // SwTxtNoHyphenHere: keine Trennstelle
@@ -242,6 +246,9 @@ public:
inline sal_uInt8 &GetMeta() { return m_nMetaCount; }
inline sal_uInt8 GetMeta() const { return m_nMetaCount; }
inline bool IsMeta() const { return (0 != m_nMetaCount); }
+ inline sal_uInt8 &GetInputField() { return m_nInputFieldCount; }
+ inline sal_uInt8 GetInputField() const { return m_nInputFieldCount; }
+ inline bool IsInputField() const { return (0 != m_nInputFieldCount); }
inline void SetURL( const sal_Bool bURL );
inline sal_Bool IsURL() const { return bURL; }
inline void SetGreyWave( const sal_Bool bNew );
diff --git a/sw/source/core/inc/tabfrm.hxx b/sw/source/core/inc/tabfrm.hxx
index 85c87db2c767..3cb3a72aea10 100644
--- a/sw/source/core/inc/tabfrm.hxx
+++ b/sw/source/core/inc/tabfrm.hxx
@@ -33,8 +33,6 @@ class SwAttrSetChg;
class SwTabFrm: public SwLayoutFrm, public SwFlowFrm
{
- // OD 14.03.2003 #i11760# - adjustment, because of method signature change
- //darf mit den Flags spielen.
friend void CalcCntnt( SwLayoutFrm *pLay, bool bNoColl, bool bNoCalcFollow );
//Fuert Spezialbehandlung fuer _Get[Next|Prev]Leaf() durch.
@@ -44,22 +42,22 @@ class SwTabFrm: public SwLayoutFrm, public SwFlowFrm
SwTable* pTable;
sal_Bool bComplete :1; //Eintrage als Repaint ohne das CompletePaint
- //der Basisklasse gesetzt werden muss. Damit
- //sollen unertraegliche Tabellen-Repaints
- //vermieden werden.
+ //der Basisklasse gesetzt werden muss. Damit
+ //sollen unertraegliche Tabellen-Repaints
+ //vermieden werden.
sal_Bool bCalcLowers :1; //Im MakeAll auf jedenfall auch fuer Stabilitaet
- //des Inhaltes sorgen.
+ //des Inhaltes sorgen.
sal_Bool bLowersFormatted :1;//Kommunikation zwischen MakeAll und Layact
sal_Bool bLockBackMove :1; //BackMove-Test hat der Master erledigt.
sal_Bool bResizeHTMLTable :1; //Resize des HTMLTableLayout rufen im MakeAll
- //Zur Optimierung, damit dies nicht im
- //CntntFrm::Grow gerufen werden muss, denn dann
- //wird es ggf. fuer jede Zelle gerufen #47483#
+ //Zur Optimierung, damit dies nicht im
+ //CntntFrm::Grow gerufen werden muss, denn dann
+ //wird es ggf. fuer jede Zelle gerufen #47483#
sal_Bool bONECalcLowers :1; //Primaer fuer die StarONE-SS. Beim MakeAll werden
- //die Cntnts auf jedenfall per Calc() formatiert.
- //es finden keine zusaetzlichen Invalidierungen
- //statt und dieser Weg kann auch kaum garantien
- //geben.
+ //die Cntnts auf jedenfall per Calc() formatiert.
+ //es finden keine zusaetzlichen Invalidierungen
+ //statt und dieser Weg kann auch kaum garantien
+ //geben.
sal_Bool bHasFollowFlowLine :1; // Means that the first line in the follow
// is indented to contain content from a broken
@@ -76,7 +74,6 @@ class SwTabFrm: public SwLayoutFrm, public SwFlowFrm
// is necessary, in order to let the text
// flow into the FollowFlowLine
sal_Bool bRemoveFollowFlowLinePending :1;
- // --> OD 2004-10-04 #i26945#
sal_Bool bConsiderObjsForMinCellHeight :1; // Usually, the floating screen objects
// are considered on the calculation
// for the minimal cell height.
@@ -85,12 +82,10 @@ class SwTabFrm: public SwLayoutFrm, public SwFlowFrm
// screen object for the preparation
// of the re-calculation of the
// last table row.
- // <--
- // --> OD 2004-10-15 #i26945#
sal_Bool bObjsDoesFit :1; // For splitting table rows algorithm, this boolean
// indicates, if the floating screen objects fits
- // <--
- sal_Bool bDummy4 :1;
+
+ bool mbInRecalcLowerRow : 1;
//Split() spaltet den Frm an der angegebenen Stelle, es wird ein
//Follow erzeugt und aufgebaut und direkt hinter this gepastet.
@@ -98,8 +93,11 @@ class SwTabFrm: public SwLayoutFrm, public SwFlowFrm
bool Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowKeep );
bool Join();
- void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, sal_uInt8 &,
- SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 );
+ void _UpdateAttr(
+ const SfxPoolItem*,
+ const SfxPoolItem*, sal_uInt8 &,
+ SwAttrSetChg *pa = 0,
+ SwAttrSetChg *pb = 0 );
virtual sal_Bool ShouldBwdMoved( SwLayoutFrm *pNewUpper, sal_Bool bHead, sal_Bool &rReformat );
@@ -168,7 +166,15 @@ public:
sal_Bool IsRemoveFollowFlowLinePending() const { return bRemoveFollowFlowLinePending; }
void SetRemoveFollowFlowLinePending( sal_Bool bNew ) { bRemoveFollowFlowLinePending = bNew; }
- // --> OD 2004-10-04 #i26945#
+ bool IsInRecalcLowerRow() const
+ {
+ return mbInRecalcLowerRow;
+ }
+ void SetInRecalcLowerRow( bool bNew )
+ {
+ mbInRecalcLowerRow = bNew;
+ }
+
sal_Bool IsConsiderObjsForMinCellHeight() const
{
return bConsiderObjsForMinCellHeight;
@@ -177,8 +183,7 @@ public:
{
bConsiderObjsForMinCellHeight = _bNewConsiderObjsForMinCellHeight;
}
- // <--
- // --> OD 2004-10-04 #i26945#
+
sal_Bool DoesObjsFit() const
{
return bObjsDoesFit;
@@ -187,15 +192,16 @@ public:
{
bObjsDoesFit = _bNewObjsDoesFit;
}
- // <--
bool RemoveFollowFlowLine();
//
// End: New stuff for breaking table rows
//
- sal_Bool CalcFlyOffsets( SwTwips& rUpper, long& rLeftOffset,
- long& rRightOffset ) const;
+ sal_Bool CalcFlyOffsets(
+ SwTwips& rUpper,
+ long& rLeftOffset,
+ long& rRightOffset ) const;
SwTwips CalcHeightOfFirstContentLine() const;
@@ -204,12 +210,9 @@ public:
bool IsLayoutSplitAllowed() const;
- // --> collapsing borders FME 2005-05-27 #i29550#
bool IsCollapsingBorders() const;
- // used for collapsing border lines:
sal_uInt16 GetBottomLineSize() const;
- // <-- collapsing
DECL_FIXEDMEMPOOL_NEWDEL(SwTabFrm)
};
diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx
index 2898b1f6898d..2ac1146afaf9 100644
--- a/sw/source/core/inc/txtfrm.hxx
+++ b/sw/source/core/inc/txtfrm.hxx
@@ -26,7 +26,9 @@
#include <tools/mempool.hxx>
#include <tools/string.hxx>
#include "cntfrm.hxx"
-
+//IAccessibility2 Implementation 2009-----
+#include "com/sun/star/uno/Sequence.hxx"
+//-----IAccessibility2 Implementation 2009
#define STRSIZE(x) (sizeof(x)-1)
class SwCharRange;
@@ -229,6 +231,9 @@ protected:
public:
+ //IAccessibility2 Implementation 2009-----
+ com::sun::star::uno::Sequence< ::com::sun::star::style::TabStop > GetTabStopInfo( SwTwips CurrentPos );
+ //-----IAccessibility2 Implementation 2009
//public, weil der eine oder andere die Methode rufen darf um das
//Prepare zu sparen - mit Vorsicht zu geniessen!
void Init();
diff --git a/sw/source/core/inc/txttypes.hxx b/sw/source/core/inc/txttypes.hxx
index bac7ace26668..4f52fdedb9f9 100644
--- a/sw/source/core/inc/txttypes.hxx
+++ b/sw/source/core/inc/txttypes.hxx
@@ -51,6 +51,7 @@
#define POR_PARA 0x8002
#define POR_URL 0x8003
#define POR_HNG 0x8004
+#define POR_INPUTFLD 0x8005
#define POR_DROP 0x8080
#define POR_TOX 0x8089
diff --git a/sw/source/core/inc/viewimp.hxx b/sw/source/core/inc/viewimp.hxx
index 6f3edf5854ce..bfba5d15b9c8 100644
--- a/sw/source/core/inc/viewimp.hxx
+++ b/sw/source/core/inc/viewimp.hxx
@@ -279,6 +279,12 @@ public:
inline void AddAccessibleObj( const SdrObject *pObj );
+ //IAccessibility2 Implementation 2009-----
+ void FirePageChangeEvent(sal_uInt16 nOldPage, sal_uInt16 nNewPage);
+ void FireSectionChangeEvent(sal_uInt16 nOldSection, sal_uInt16 nNewSection);
+ void FireColumnChangeEvent(sal_uInt16 nOldColumn, sal_uInt16 nNewColumn);
+ //-----IAccessibility2 Implementation 2009
+
// Invalidate accessible frame's frame's content
void InvalidateAccessibleFrmContent( const SwFrm *pFrm );
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index b0dc8343504c..b82ff44e7f97 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -3295,3 +3295,19 @@ IMapObject* SwFrmFmt::GetIMapObject( const Point& rPoint,
return 0;
}
+sal_Bool SwFrmFmt::HasCaption() const
+{
+ if(pCaptionFmt != NULL && pCaptionFmt->GetDepends())
+ return sal_True;
+ return sal_False;
+}
+
+void SwFrmFmt::SetCaptionFmt(SwFrmFmt * pFmt)
+{
+ pCaptionFmt = pFmt;
+}
+
+SwFrmFmt* SwFrmFmt::GetCaptionFmt() const
+{
+ return pCaptionFmt;
+}
diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx
index 2f86c798d0d6..ae7c9dce15d3 100644
--- a/sw/source/core/layout/flycnt.cxx
+++ b/sw/source/core/layout/flycnt.cxx
@@ -47,26 +47,19 @@
#include <fmtornt.hxx>
#include <fmtfsize.hxx>
#include <fmtsrnd.hxx>
+#include <txatbase.hxx>
#include "tabfrm.hxx"
#include "flyfrms.hxx"
#include "crstate.hxx"
#include "sectfrm.hxx"
-// OD 29.10.2003 #113049#
#include <tocntntanchoredobjectposition.hxx>
-// OD 2004-05-24 #i28701#
#include <dcontact.hxx>
#include <sortedobjs.hxx>
-// --> OD 2005-09-29 #125370#,#125957#
#include <layouter.hxx>
-// <--
-// --> OD 2005-11-17 #i56300#
#include <objectformattertxtfrm.hxx>
-// <--
-// --> OD 2006-03-06 #125892#
#include <HandleAnchorNodeChg.hxx>
-// <--
using namespace ::com::sun::star;
@@ -1475,6 +1468,15 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
if( pCnt->GetCrsrOfst( pPos, aPt, &eTmpState )
&& pPos->nNode == *pCnt->GetNode() )
{
+ if ( pCnt->GetNode()->GetTxtNode() != NULL )
+ {
+ const SwTxtAttr* pTxtInputFld =
+ pCnt->GetNode()->GetTxtNode()->GetTxtAttrAt( pPos->nContent.GetIndex(), RES_TXTATR_INPUTFIELD, SwTxtNode::PARENT );
+ if ( pTxtInputFld != NULL )
+ {
+ pPos->nContent = *(pTxtInputFld->GetStart());
+ }
+ }
ResetLastCharRectHeight();
if( text::RelOrientation::CHAR == pFmt->GetVertOrient().GetRelationOrient() )
nY = LONG_MAX;
@@ -1493,7 +1495,6 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
pPos->nContent.Assign( pCnt->GetNode(), 0 );
}
- // --> OD 2006-02-27 #125892#
// handle change of anchor node:
// if count of the anchor frame also change, the fly frames have to be
// re-created. Thus, delete all fly frames except the <this> before the
@@ -1502,9 +1503,7 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
SwHandleAnchorNodeChg aHandleAnchorNodeChg( *pFmt, aAnch, this );
pFmt->GetDoc()->SetAttr( aAnch, *pFmt );
}
- // <--
}
- // --> OD 2004-06-30 #i28701# - use new method <GetPageFrm()>
else if ( pTmpPage && pTmpPage != GetPageFrm() )
GetPageFrm()->MoveFly( this, pTmpPage );
@@ -1515,8 +1514,7 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
GetFmt()->GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
if ( pOldPage != FindPageFrm() )
- ::Notify_Background( GetVirtDrawObj(), pOldPage, aOld, PREP_FLY_LEAVE,
- sal_False );
+ ::Notify_Background( GetVirtDrawObj(), pOldPage, aOld, PREP_FLY_LEAVE, sal_False );
}
// OD 2004-08-12 #i32795# - Note: method no longer used in <flyincnt.cxx>
diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx
index b865bb634f55..e1de7061a804 100644
--- a/sw/source/core/layout/laycache.cxx
+++ b/sw/source/core/layout/laycache.cxx
@@ -727,8 +727,8 @@ void lcl_ApplyWorkaroundForB6375613( SwFrm* p_pFirstFrmOnNewPage )
SwDoc* pDoc( pFirstTextFrmOnNewPage->GetTxtNode()->GetDoc() );
IDocumentContentOperations* pIDCO = pFirstTextFrmOnNewPage->GetTxtNode()->getIDocumentContentOperations();
const SwPaM aTmpPaM( *(pFirstTextFrmOnNewPage->GetTxtNode()) );
- pIDCO->InsertPoolItem( aTmpPaM,
- SvxFmtBreakItem( SVX_BREAK_PAGE_BEFORE, RES_BREAK ), 0 );
+ pIDCO->InsertPoolItem(
+ aTmpPaM, SvxFmtBreakItem( SVX_BREAK_PAGE_BEFORE, RES_BREAK ), 0 );
pFirstTextFrmOnNewPage->GetTxtNode()->UnlockModify();
uno::Reference< document::XDocumentInfoSupplier > xDoc(
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 7ffd245f41bd..a4d0b35067b9 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -95,10 +95,9 @@ SwTabFrm::SwTabFrm( SwTable &rTab, SwFrm* pSib ):
bComplete = bCalcLowers = bONECalcLowers = bLowersFormatted = bLockBackMove =
bResizeHTMLTable = bHasFollowFlowLine = bIsRebuildLastLine =
bRestrictTableGrowth = bRemoveFollowFlowLinePending = sal_False;
- // --> OD 2004-10-04 #i26945#
bConsiderObjsForMinCellHeight = sal_True;
bObjsDoesFit = sal_True;
- // <--
+ mbInRecalcLowerRow = false;
bFixSize = sal_False; //Nicht nochmal auf die Importfilter hereinfallen.
nType = FRMC_TAB;
@@ -128,10 +127,9 @@ SwTabFrm::SwTabFrm( SwTabFrm &rTab ) :
bLockJoin = bComplete = bONECalcLowers = bCalcLowers = bLowersFormatted = bLockBackMove =
bResizeHTMLTable = bHasFollowFlowLine = bIsRebuildLastLine =
bRestrictTableGrowth = bRemoveFollowFlowLinePending = sal_False;
- // --> OD 2004-10-04 #i26945#
bConsiderObjsForMinCellHeight = sal_True;
bObjsDoesFit = sal_True;
- // <--
+ mbInRecalcLowerRow = false;
bFixSize = sal_False; //Nicht nochmal auf die Importfilter hereinfallen.
nType = FRMC_TAB;
@@ -2076,7 +2074,7 @@ void SwTabFrm::MakeAll()
}
SwFrm *pPre;
if ( bKeep || (0 != (pPre = FindPrev()) &&
- pPre->GetAttrSet()->GetKeep().GetValue()) )
+ pPre->GetAttrSet()->GetKeep().GetValue()) )
{
bCalcLowers = sal_True;
}
@@ -2102,13 +2100,12 @@ void SwTabFrm::MakeAll()
SwHTMLTableLayout *pLayout = GetTable()->GetHTMLTableLayout();
if ( pLayout &&
- ((Prt().*fnRect->fnGetWidth)() != nOldPrtWidth ||
- (Frm().*fnRect->fnGetWidth)() != nOldFrmWidth) )
+ ((Prt().*fnRect->fnGetWidth)() != nOldPrtWidth ||
+ (Frm().*fnRect->fnGetWidth)() != nOldFrmWidth) )
{
delete pAccess;
bCalcLowers |= pLayout->Resize(
- pLayout->GetBrowseWidthByTabFrm( *this ), sal_False );
-// GetFmt()->GetDoc()->GetDocShell()->IsReadOnly() ? sal_False : sal_True );
+ pLayout->GetBrowseWidthByTabFrm( *this ), sal_False );
pAccess= new SwBorderAttrAccess( SwFrm::GetCache(), this );
pAttrs = pAccess->Get();
}
@@ -2161,8 +2158,7 @@ void SwTabFrm::MakeAll()
pHTMLLayout->GetBrowseWidthByTabFrm( *this ),
sal_False );
- pAccess= new SwBorderAttrAccess(
- SwFrm::GetCache(), this );
+ pAccess= new SwBorderAttrAccess( SwFrm::GetCache(), this );
pAttrs = pAccess->Get();
}
@@ -2173,27 +2169,10 @@ void SwTabFrm::MakeAll()
bLowersFormatted = sal_True;
if ( bKeep && KEEPTAB )
{
- // --> OD 2005-09-28 #b6329202#
- // Consider case that table is inside another table,
- // because it has to be avoided, that superior table
- // is formatted.
- // Thus, find next content, table or section
- // and, if a section is found, get its first
- // content.
-// SwFrm *pNxt = FindNextCnt();
-// if( pNxt && pNxt->IsInTab() )
-// pNxt = pNxt->FindTabFrm();
-// if ( pNxt )
-// {
-// pNxt->Calc();
-// if ( !GetNext() )
-// bValidPos = sal_False;
-// }
if ( 0 != lcl_FormatNextCntntForKeep( this ) && !GetNext() )
{
bValidPos = sal_False;
}
- // <--
}
}
}
@@ -2205,17 +2184,14 @@ void SwTabFrm::MakeAll()
// check, if calculation of table frame is ready.
- /// OD 23.10.2002 #103517# - Local variable <nDistanceToUpperPrtBottom>
- /// Introduce local variable and init it with the distance from the
- /// table frame bottom to the bottom of the upper printing area.
- /// Note: negative values denotes the situation that table frame doesn't
- /// fit in its upper.
-
+ // Local variable <nDistanceToUpperPrtBottom>
+ // Introduce local variable and init it with the distance from the
+ // table frame bottom to the bottom of the upper printing area.
+ // Note: negative values denotes the situation that table frame doesn't fit in its upper.
SwTwips nDistanceToUpperPrtBottom =
(Frm().*fnRect->fnBottomDist)( (GetUpper()->*fnRect->fnGetPrtBottom)());
- /// OD 23.10.2002 #103517# - In online layout try to grow upper of table
- /// frame, if table frame doesn't fit in its upper.
+ // In online layout try to grow upper of table frame, if table frame doesn't fit in its upper.
const ViewShell *pSh = getRootFrm()->GetCurrShell();
const bool bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode();
if ( nDistanceToUpperPrtBottom < 0 && bBrowseMode )
@@ -2223,8 +2199,7 @@ void SwTabFrm::MakeAll()
if ( GetUpper()->Grow( -nDistanceToUpperPrtBottom ) )
{
// upper is grown --> recalculate <nDistanceToUpperPrtBottom>
- nDistanceToUpperPrtBottom =
- (Frm().*fnRect->fnBottomDist)( (GetUpper()->*fnRect->fnGetPrtBottom)());
+ nDistanceToUpperPrtBottom = (Frm().*fnRect->fnBottomDist)( (GetUpper()->*fnRect->fnGetPrtBottom)());
}
}
@@ -2234,7 +2209,6 @@ void SwTabFrm::MakeAll()
// the table to be split! Only skip this if condition once.
if( nDistanceToUpperPrtBottom >= 0 && !bLastRowHasToMoveToFollow )
{
- // OD 23.10.2002 - translate german commentary
// If there is space left in the upper printing area, join as for trial
// at least one further row of an existing follow.
if ( !bSplit && GetFollow() )
@@ -2279,8 +2253,8 @@ void SwTabFrm::MakeAll()
//
SwRowFrm *pRow = GetFollow()->GetFirstNonHeadlineRow();
- //Der Follow wird leer und damit ueberfluessig.
- if ( !pRow )
+ //Der Follow wird leer und damit ueberfluessig.
+ if ( !pRow )
{
Join();
continue;
@@ -2301,8 +2275,10 @@ void SwTabFrm::MakeAll()
SwFrm* pNextRow = pRowToMove->GetNext();
if ( !pNextRow )
+ {
//Der Follow wird leer und damit ueberfluessig.
Join();
+ }
else
{
pRowToMove->Cut();
@@ -2311,8 +2287,7 @@ void SwTabFrm::MakeAll()
//Die Fussnoten verschieben!
if ( bMoveFtns )
- if ( ((SwLayoutFrm*)pRowToMove)->MoveLowerFtns(
- 0, pOldBoss, FindFtnBossFrm( sal_True ), sal_True ) )
+ if ( ((SwLayoutFrm*)pRowToMove)->MoveLowerFtns( 0, pOldBoss, FindFtnBossFrm( sal_True ), sal_True ) )
GetUpper()->Calc();
pRowToMove = pNextRow;
@@ -2472,7 +2447,11 @@ void SwTabFrm::MakeAll()
nDeadLine = (*fnRect->fnYInc)( nDeadLine,
GetUpper()->Grow( LONG_MAX, sal_True ) );
- ::lcl_RecalcRow( static_cast<SwRowFrm&>(*Lower()), nDeadLine );
+ {
+ SetInRecalcLowerRow( true );
+ ::lcl_RecalcRow( static_cast<SwRowFrm&>(*Lower()), nDeadLine );
+ SetInRecalcLowerRow( false );
+ }
bLowersFormatted = sal_True;
aNotify.SetLowersComplete( sal_True );
@@ -2630,10 +2609,8 @@ void SwTabFrm::MakeAll()
SwFrm* pNxt = ((SwFrm*)GetFollow())->FindNext();
if ( pNxt )
{
- // OD 26.08.2003 #i18103# - no formatting
- // of found next frame, if its a follow
- // section of the 'ColLocked' section,
- // the follow table is in.
+ // no formatting of found next frame, if its a follow
+ // section of the 'ColLocked' section, the follow table is in.
bool bCalcNxt = true;
if ( GetFollow()->IsInSct() && pNxt->IsSctFrm() )
{
@@ -2679,19 +2656,19 @@ void SwTabFrm::MakeAll()
if ( !bMovedFwd && !MoveFwd( bMakePage, sal_False ) )
bMakePage = sal_False;
- // --> FME 2004-06-09 #i29771# Reset bSplitError flag on change of upper
+ // Reset bSplitError flag on change of upper
if ( GetUpper() != pOldUpper )
{
bTryToSplit = true;
nUnSplitted = 5;
}
- // <--
SWREFRESHFN( this )
bMovedFwd = bCalcLowers = sal_True;
aNotify.SetLowersComplete( sal_False );
if ( IsFollow() )
- { //Um Oszillationen zu vermeiden sollte kein ungueltiger Master
+ {
+ //Um Oszillationen zu vermeiden sollte kein ungueltiger Master
//zurueckbleiben.
SwTabFrm *pTab = FindMaster();
if ( pTab->GetUpper() )
@@ -2711,16 +2688,17 @@ void SwTabFrm::MakeAll()
}
if ( bMovedBwd && GetUpper() )
+ {
//Beim zurueckfliessen wurde der Upper angeregt sich vollstaendig
//zu Painten, dass koennen wir uns jetzt nach dem hin und her
//fliessen sparen.
GetUpper()->ResetCompletePaint();
+ }
if ( bCalcLowers && IsValid() )
{
- // --> OD 2005-05-11 #i44910# - format of lower frames unnecessary
- // and can cause layout loops, if table doesn't fit and isn't
- // allowed to split.
+ // format of lower frames unnecessary and can cause layout loops,
+ // if table doesn't fit and isn't allowed to split.
SwTwips nDistToUpperPrtBottom =
(Frm().*fnRect->fnBottomDist)( (GetUpper()->*fnRect->fnGetPrtBottom)());
if ( nDistToUpperPrtBottom >= 0 || bTryToSplit )
@@ -2735,7 +2713,6 @@ void SwTabFrm::MakeAll()
ASSERT( false, "debug assertion: <SwTabFrm::MakeAll()> - format of table lowers suppressed by fix i44910" );
}
#endif
- // <--
}
} //while ( !bValidPos || !bValidSize || !bValidPrtArea )
@@ -4829,8 +4806,10 @@ SwTwips SwRowFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
SetCompletePaint();
SwTabFrm *pTab = FindTabFrm();
- if ( !pTab->IsRebuildLastLine() && pTab->IsFollow() &&
- this == pTab->GetFirstNonHeadlineRow() )
+ if ( !pTab->IsRebuildLastLine()
+ && pTab->IsFollow()
+ && this == pTab->GetFirstNonHeadlineRow()
+ && !pTab->IsInRecalcLowerRow() )
{
SwTabFrm* pMasterTab = const_cast< SwTabFrm* >( pTab->FindMaster() );
pMasterTab->InvalidatePos();
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index 0769c70a334b..a6f8abe57a28 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -2007,7 +2007,9 @@ inline void Sub( SwRegionRects& rRegion, const SwRect& rRect )
rRegion -= rRect;
}
-void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, sal_Bool bIsTblMode )
+void SwRootFrm::CalcFrmRects(
+ SwShellCrsr &rCrsr,
+ const sal_Bool bIsTblMode )
{
SwPosition *pStartPos = rCrsr.Start(),
*pEndPos = rCrsr.GetPoint() == pStartPos ? rCrsr.GetMark() : rCrsr.GetPoint();
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index 6ba2cce31cc6..bca2036605f7 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -96,6 +96,10 @@ SwFrm::SwFrm( SwModify *pMod, SwFrm* pSib ) :
pNext( 0 ),
pPrev( 0 ),
pDrawObjs( 0 )
+ //IAccessibility2 Implementation 2009-----
+ //Solution:Add a member to identify if the acc table should dispose
+ , bIfAccTableShouldDisposing( sal_False )
+ //-----IAccessibility2 Implementation 2009
, bInfBody( sal_False )
, bInfTab ( sal_False )
, bInfFly ( sal_False )
diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx
index f9e0375485dd..5b3216d0892f 100644
--- a/sw/source/core/ole/ndole.cxx
+++ b/sw/source/core/ole/ndole.cxx
@@ -794,6 +794,15 @@ void SwOLEObj::SetNode( SwOLENode* pNode )
}
}
+//IAccessibility2 Implementation 2009-----
+String SwOLEObj::GetStyleString()
+{
+ String strStyle;
+ if (xOLERef.is() && xOLERef.IsChart())
+ strStyle = xOLERef.GetChartType();
+ return strStyle;
+}
+//-----IAccessibility2 Implementation 2009
sal_Bool SwOLEObj::IsOleRef() const
{
return xOLERef.is();
diff --git a/sw/source/core/text/atrhndl.hxx b/sw/source/core/text/atrhndl.hxx
index c54129d2acf4..a46b64ef419f 100644
--- a/sw/source/core/text/atrhndl.hxx
+++ b/sw/source/core/text/atrhndl.hxx
@@ -25,7 +25,7 @@
#define _ATRHNDL_HXX
#define INITIAL_NUM_ATTR 3
-#define NUM_ATTRIBUTE_STACKS 40
+#define NUM_ATTRIBUTE_STACKS 41
#include <txatbase.hxx>
#include <swfntcch.hxx>
diff --git a/sw/source/core/text/atrstck.cxx b/sw/source/core/text/atrstck.cxx
index ad06d9fdc0b7..c3973a95a953 100644
--- a/sw/source/core/text/atrstck.cxx
+++ b/sw/source/core/text/atrstck.cxx
@@ -132,7 +132,7 @@ const sal_uInt8 StackPos[ static_cast<sal_uInt16>(RES_TXTATR_WITHEND_END) -
0, // RES_TXTATR_CHARFMT, // 49
39, // RES_TXTATR_CJK_RUBY, // 50
0, // RES_TXTATR_UNKNOWN_CONTAINER, // 51
- 0, // RES_TXTATR_DUMMY5 // 52
+ 40, // RES_TXTATR_INPUTFIELD // 52
};
/*************************************************************************
@@ -525,20 +525,21 @@ sal_Bool SwAttrHandler::Push( const SwTxtAttr& rAttr, const SfxPoolItem& rItem )
if ( RES_TXTATR_WITHEND_END <= rItem.Which() )
return sal_False;
- sal_uInt16 nStack = StackPos[ rItem.Which() ];
+ const sal_uInt16 nStack = StackPos[ rItem.Which() ];
// attributes originating from redlining have highest priority
// second priority are hyperlink attributes, which have a color replacement
const SwTxtAttr* pTopAttr = aAttrStack[ nStack ].Top();
- if ( !pTopAttr || rAttr.IsPriorityAttr() ||
- ( !pTopAttr->IsPriorityAttr() &&
- !lcl_ChgHyperLinkColor( *pTopAttr, rItem, mpShell, 0 ) ) )
+ if ( !pTopAttr
+ || rAttr.IsPriorityAttr()
+ || ( !pTopAttr->IsPriorityAttr()
+ && !lcl_ChgHyperLinkColor( *pTopAttr, rItem, mpShell, 0 ) ) )
{
aAttrStack[ nStack ].Push( rAttr );
return sal_True;
}
- sal_uInt16 nPos = aAttrStack[ nStack ].Count();
+ const sal_uInt16 nPos = aAttrStack[ nStack ].Count();
ASSERT( nPos, "empty stack?" );
aAttrStack[ nStack ].Insert( rAttr, nPos - 1 );
return sal_False;
@@ -688,6 +689,8 @@ void SwAttrHandler::ActivateTop( SwFont& rFnt, const sal_uInt16 nAttr )
bVertLayout
);
}
+ else if ( RES_TXTATR_INPUTFIELD == nAttr )
+ rFnt.GetInputField()--;
}
/*************************************************************************
@@ -935,6 +938,12 @@ void SwAttrHandler::FontChg(const SfxPoolItem& rItem, SwFont& rFnt, sal_Bool bPu
else
rFnt.GetMeta()--;
break;
+ case RES_TXTATR_INPUTFIELD :
+ if ( bPush )
+ rFnt.GetInputField()++;
+ else
+ rFnt.GetInputField()--;
+ break;
}
}
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index 57a0255fac2a..e733df9fecf0 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -57,6 +57,11 @@
#include <frmfmt.hxx> // SwFrmFmt
// OD 2004-05-24 #i28701#
#include <sortedobjs.hxx>
+//IAccessibility2 Implementation 2009-----
+#include <portab.hxx>
+#include <editeng/lrspitem.hxx>
+#include <editeng/tstpitem.hxx>
+//-----IAccessibility2 Implementation 2009
class FormatLevel
{
@@ -556,6 +561,47 @@ void SwTxtFrm::AdjustFrm( const SwTwips nChgHght, sal_Bool bHasToFit )
UNDO_SWAP( this )
}
+//IAccessibility2 Implementation 2009-----
+com::sun::star::uno::Sequence< ::com::sun::star::style::TabStop > SwTxtFrm::GetTabStopInfo( SwTwips CurrentPos )
+{
+ com::sun::star::uno::Sequence< ::com::sun::star::style::TabStop > tabs(1);
+ ::com::sun::star::style::TabStop ts;
+
+ SwTxtFormatInfo aInf( this );
+ SwTxtFormatter aLine( this, &aInf );
+ SwTxtCursor TxtCursor( this, &aInf );
+ const Point aCharPos( TxtCursor.GetTopLeft() );
+
+
+ SwTwips nRight = aLine.Right();
+ CurrentPos -= aCharPos.X();
+
+ // get current tab stop information stored in the Frm
+ const SvxTabStop *pTS = aLine.GetLineInfo().GetTabStop( CurrentPos, nRight );
+
+ if( !pTS )
+ {
+ return com::sun::star::uno::Sequence< ::com::sun::star::style::TabStop >();
+ }
+
+ // copy tab stop information into a Sequence, which only contains one element.
+ ts.Position = pTS->GetTabPos();
+ ts.DecimalChar = pTS->GetDecimal();
+ ts.FillChar = pTS->GetFill();
+ switch( pTS->GetAdjustment() )
+ {
+ case SVX_TAB_ADJUST_LEFT : ts.Alignment = ::com::sun::star::style::TabAlign_LEFT; break;
+ case SVX_TAB_ADJUST_CENTER : ts.Alignment = ::com::sun::star::style::TabAlign_CENTER; break;
+ case SVX_TAB_ADJUST_RIGHT : ts.Alignment = ::com::sun::star::style::TabAlign_RIGHT; break;
+ case SVX_TAB_ADJUST_DECIMAL: ts.Alignment = ::com::sun::star::style::TabAlign_DECIMAL; break;
+ case SVX_TAB_ADJUST_DEFAULT: ts.Alignment = ::com::sun::star::style::TabAlign_DEFAULT; break;
+ default: break; // prevent warning
+ }
+
+ tabs[0] = ts;
+ return tabs;
+}
+//-----IAccessibility2 Implementation 2009
/*************************************************************************
* SwTxtFrm::AdjustFollow()
*************************************************************************/
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 7f65234c4edc..b66cbe915f98 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -1278,27 +1278,37 @@ void SwTxtPaintInfo::DrawViewOpt( const SwLinePortion &rPor,
sal_Bool bDraw = sal_False;
switch( nWhich )
{
- case POR_FTN:
- case POR_QUOVADIS:
- case POR_NUMBER:
- case POR_FLD:
- case POR_URL:
- case POR_HIDDEN:
- case POR_TOX:
- case POR_REF:
- case POR_META:
- case POR_CONTROLCHAR:
- if ( !GetOpt().IsPagePreview() &&
- !GetOpt().IsReadonly() &&
- SwViewOption::IsFieldShadings() &&
- (POR_NUMBER != nWhich ||
- pFrm->GetTxtNode()->HasMarkedLabel())) // #i27615#
- bDraw = sal_True;
+ case POR_FTN:
+ case POR_QUOVADIS:
+ case POR_NUMBER:
+ case POR_FLD:
+ case POR_URL:
+ case POR_HIDDEN:
+ case POR_TOX:
+ case POR_REF:
+ case POR_META:
+ case POR_CONTROLCHAR:
+ if ( !GetOpt().IsPagePreview()
+ && !GetOpt().IsReadonly()
+ && SwViewOption::IsFieldShadings()
+ && ( POR_NUMBER != nWhich
+ || pFrm->GetTxtNode()->HasMarkedLabel())) // #i27615#
+ {
+ bDraw = sal_True;
+ }
+ break;
+ case POR_INPUTFLD:
+ // input field shading also in read-only mode
+ if ( !GetOpt().IsPagePreview()
+ && SwViewOption::IsFieldShadings() )
+ {
+ bDraw = sal_True;
+ }
break;
- case POR_TAB: if ( GetOpt().IsTab() ) bDraw = sal_True; break;
- case POR_SOFTHYPH: if ( GetOpt().IsSoftHyph() )bDraw = sal_True; break;
- case POR_BLANK: if ( GetOpt().IsHardBlank())bDraw = sal_True; break;
- default:
+ case POR_TAB: if ( GetOpt().IsTab() ) bDraw = sal_True; break;
+ case POR_SOFTHYPH: if ( GetOpt().IsSoftHyph() )bDraw = sal_True; break;
+ case POR_BLANK: if ( GetOpt().IsHardBlank())bDraw = sal_True; break;
+ default:
{
ASSERT( !this, "SwTxtPaintInfo::DrawViewOpt: don't know how to draw this" );
break;
@@ -1750,8 +1760,12 @@ sal_Bool SwTxtFormatInfo::LastKernPortion()
* class SwTxtSlot
*************************************************************************/
-SwTxtSlot::SwTxtSlot( const SwTxtSizeInfo *pNew, const SwLinePortion *pPor,
- bool bTxtLen, bool bExgLists, const sal_Char *pCh )
+SwTxtSlot::SwTxtSlot(
+ const SwTxtSizeInfo *pNew,
+ const SwLinePortion *pPor,
+ bool bTxtLen,
+ bool bExgLists,
+ const sal_Char *pCh )
: pOldTxt( 0 ),
pOldSmartTagList( 0 ),
pOldGrammarCheckList( 0 ),
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index d9897dee7866..eb1871f5fd8c 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -865,7 +865,13 @@ SwTxtPortion *SwTxtFormatter::WhichTxtPor( SwTxtFormatInfo &rInf ) const
{
SwTxtPortion *pPor = 0;
if( GetFnt()->IsTox() )
+ {
pPor = new SwToxPortion;
+ }
+ else if ( GetFnt()->IsInputField() )
+ {
+ pPor = new SwTxtInputFldPortion();
+ }
else
{
if( GetFnt()->IsRef() )
@@ -895,8 +901,10 @@ SwTxtPortion *SwTxtFormatter::WhichTxtPor( SwTxtFormatInfo &rInf ) const
else
{
pPor = new SwTxtPortion;
- if( GetFnt()->IsURL() )
+ if ( GetFnt()->IsURL() )
+ {
pPor->SetWhichPor( POR_URL );
+ }
}
}
}
@@ -1321,20 +1329,18 @@ SwLinePortion *SwTxtFormatter::NewPortion( SwTxtFormatInfo &rInf )
case CHAR_ZWSP: // zero width space
case CHAR_ZWNBSP : // word joiner
-// case CHAR_RLM : // right to left mark
-// case CHAR_LRM : // left to right mark
pPor = new SwControlCharPortion( cChar ); break;
case CH_TXTATR_BREAKWORD:
case CH_TXTATR_INWORD:
- if( rInf.HasHint( rInf.GetIdx() ) )
- {
- pPor = NewExtraPortion( rInf );
- break;
- }
- // No break
+ if( rInf.HasHint( rInf.GetIdx() ) )
+ {
+ pPor = NewExtraPortion( rInf );
+ break;
+ }
+ // No break
default :
- {
+ {
SwTabPortion* pLastTabPortion = rInf.GetLastTab();
if ( pLastTabPortion && cChar == rInf.GetTabDecimal() )
{
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index 774ed8cf5d79..0b888c9f8a6d 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -68,10 +68,7 @@ SwFldPortion *SwFldPortion::Clone( const XubString &rExpand ) const
{
pNewFnt = new SwFont( *pFnt );
}
- // --> OD 2009-11-25 #i107143#
- // pass placeholder property to created <SwFldPortion> instance.
SwFldPortion* pClone = new SwFldPortion( rExpand, pNewFnt, bPlaceHolder );
- // <--
pClone->SetNextOffset( nNextOffset );
pClone->m_bNoLength = this->m_bNoLength;
return pClone;
@@ -91,6 +88,9 @@ SwFldPortion::SwFldPortion( const XubString &rExpand, SwFont *pFont, sal_Bool bP
, m_bNoLength( sal_False )
{
SetWhichPor( POR_FLD );
+ //IAccessibility2 Implementation 2009-----
+ m_nAttrFldType = 0;
+ //-----IAccessibility2 Implementation 2009
}
SwFldPortion::SwFldPortion( const SwFldPortion& rFld )
@@ -394,20 +394,10 @@ sal_Bool SwFldPortion::Format( SwTxtFormatInfo &rInf )
case CHAR_HARDHYPHEN: // non-breaking hyphen
case CHAR_SOFTHYPHEN:
case CHAR_HARDBLANK:
- // --> FME 2006-01-11 #i59759# Erase additional control
- // characters from field string, otherwise we get stuck in
- // a loop.
case CHAR_ZWSP :
case CHAR_ZWNBSP :
- // case CHAR_RLM :
- // case CHAR_LRM :
- // <--
- // --> OD 2010-06-03 #i111750#
- // - Erasing further control characters from field string in
- // to avoid loop.
case CH_TXTATR_BREAKWORD:
case CH_TXTATR_INWORD:
- // <--
{
aNew.Erase( 0, 1 );
++nNextOfst;
@@ -481,6 +471,12 @@ sal_Bool SwFldPortion::GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) c
void SwFldPortion::HandlePortion( SwPortionHandler& rPH ) const
{
rPH.Special( GetLen(), aExpand, GetWhichPor() );
+ //IAccessibility2 Implementation 2009-----
+ if( GetWhichPor() == POR_FLD )
+ {
+ rPH.SetAttrFieldType(m_nAttrFldType);
+ }
+ //-----IAccessibility2 Implementation 2009
}
/*************************************************************************
diff --git a/sw/source/core/text/porfld.hxx b/sw/source/core/text/porfld.hxx
index 1c0ba2155abf..08482bf1d3bd 100644
--- a/sw/source/core/text/porfld.hxx
+++ b/sw/source/core/text/porfld.hxx
@@ -65,6 +65,9 @@ public:
SwFldPortion( const XubString &rExpand, SwFont *pFnt = 0, sal_Bool bPlaceHolder = sal_False );
~SwFldPortion();
+ //IAccessibility2 Implementation 2009-----
+ sal_uInt16 m_nAttrFldType;
+ //-----IAccessibility2 Implementation 2009
void TakeNextOffset( const SwFldPortion* pFld );
void CheckScript( const SwTxtSizeInfo &rInf );
inline sal_Bool HasFont() const { return 0 != pFnt; }
@@ -174,7 +177,6 @@ public:
class SwBulletPortion : public SwNumberPortion
{
public:
- // --> OD 2008-01-23 #newlistlevelattrs#
SwBulletPortion( const xub_Unicode cCh,
const XubString& rBulletFollowedBy,
SwFont *pFnt,
@@ -182,7 +184,6 @@ public:
const sal_Bool bCenter,
const KSHORT nMinDst,
const bool bLabelAlignmentPosAndSpaceModeActive );
- // <--
OUTPUT_OPERATOR
};
@@ -198,7 +199,6 @@ class SwGrfNumPortion : public SwNumberPortion
SwTwips nGrfHeight;
sal_Int16 eOrient;
public:
- // --> OD 2008-01-23 #newlistlevelattrs#
SwGrfNumPortion( SwFrm *pFrm,
const XubString& rGraphicFollowedBy,
const SvxBrushItem* pGrfBrush,
@@ -208,7 +208,6 @@ public:
const sal_Bool bCenter,
const KSHORT nMinDst,
const bool bLabelAlignmentPosAndSpaceModeActive );
- // <--
~SwGrfNumPortion();
virtual void Paint( const SwTxtPaintInfo &rInf ) const;
virtual sal_Bool Format( SwTxtFormatInfo &rInf );
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 9e11a943d60a..e0b0ee524360 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -2398,8 +2398,8 @@ void SwScriptInfo::CalcHiddenRanges( const SwTxtNode& rNode, MultiSelection& rHi
const SvxCharHiddenItem* pHiddenItem = static_cast<const SvxCharHiddenItem*>( CharFmt::GetItem( *pTxtAttr, RES_CHRATR_HIDDEN ) );
if( pHiddenItem )
{
- xub_StrLen nSt = *pTxtAttr->GetStart();
- xub_StrLen nEnd = *pTxtAttr->GetEnd();
+ const xub_StrLen nSt = *pTxtAttr->GetStart();
+ const xub_StrLen nEnd = *pTxtAttr->End();
if( nEnd > nSt )
{
Range aTmp( nSt, nEnd - 1 );
diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx
index 5125d26e1bbb..43201ac3c536 100644
--- a/sw/source/core/text/pormulti.cxx
+++ b/sw/source/core/text/pormulti.cxx
@@ -992,7 +992,7 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( xub_StrLen &rPos,
if( pRuby )
{ // The winner is ... a ruby attribute and so
// the end of the multiportion is the end of the ruby attribute.
- rPos = *pRuby->GetEnd();
+ rPos = *pRuby->End();
SwMultiCreator *pRet = new SwMultiCreator;
pRet->pItem = NULL;
pRet->pAttr = pRuby;
@@ -1018,7 +1018,7 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( xub_StrLen &rPos,
{
pRet->pItem = NULL;
pRet->pAttr = (*pHints)[n2Lines];
- aEnd.push_front( *pRet->pAttr->GetEnd() );
+ aEnd.push_front( *pRet->pAttr->End() );
if( pItem )
{
aEnd.front() = GetTxt().Len();
@@ -1094,8 +1094,8 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( xub_StrLen &rPos,
if( bTwo == bOn )
{ // .. with the same state, so the last attribute could
// be continued.
- if( aEnd.back() < *pTmp->GetEnd() )
- aEnd.back() = *pTmp->GetEnd();
+ if( aEnd.back() < *pTmp->End() )
+ aEnd.back() = *pTmp->End();
}
else
{ // .. with a different state.
@@ -1103,12 +1103,12 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( xub_StrLen &rPos,
// If this is smaller than the last on the stack, we put
// it on the stack. If it has the same endposition, the last
// could be removed.
- if( aEnd.back() > *pTmp->GetEnd() )
- aEnd.push_back( *pTmp->GetEnd() );
+ if( aEnd.back() > *pTmp->End() )
+ aEnd.push_back( *pTmp->End() );
else if( aEnd.size() > 1 )
aEnd.pop_back();
else
- aEnd.back() = *pTmp->GetEnd();
+ aEnd.back() = *pTmp->End();
}
}
}
@@ -1166,18 +1166,18 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( xub_StrLen &rPos,
{
if( bTwo == bOn )
{
- if( aEnd.back() < *pTmp->GetEnd() )
- aEnd.back() = *pTmp->GetEnd();
+ if( aEnd.back() < *pTmp->End() )
+ aEnd.back() = *pTmp->End();
}
else
{
bOn = bTwo;
- if( aEnd.back() > *pTmp->GetEnd() )
- aEnd.push_back( *pTmp->GetEnd() );
+ if( aEnd.back() > *pTmp->End() )
+ aEnd.push_back( *pTmp->End() );
else if( aEnd.size() > 1 )
aEnd.pop_back();
else
- aEnd.back() = *pTmp->GetEnd();
+ aEnd.back() = *pTmp->End();
}
}
}
@@ -1192,7 +1192,7 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( xub_StrLen &rPos,
{
pRet->pItem = NULL;
pRet->pAttr = (*pHints)[nRotate];
- aEnd.push_front( *pRet->pAttr->GetEnd() );
+ aEnd.push_front( *pRet->pAttr->End() );
if( pRotItem )
{
aEnd.front() = GetTxt().Len();
@@ -1237,18 +1237,18 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( xub_StrLen &rPos,
{
if( bTwo == bOn )
{
- if( aEnd.back() < *pTmp->GetEnd() )
- aEnd.back() = *pTmp->GetEnd();
+ if( aEnd.back() < *pTmp->End() )
+ aEnd.back() = *pTmp->End();
}
else
{
bOn = bTwo;
- if( aEnd.back() > *pTmp->GetEnd() )
- aEnd.push_back( *pTmp->GetEnd() );
+ if( aEnd.back() > *pTmp->End() )
+ aEnd.push_back( *pTmp->End() );
else if( aEnd.size() > 1 )
aEnd.pop_back();
else
- aEnd.back() = *pTmp->GetEnd();
+ aEnd.back() = *pTmp->End();
}
}
}
diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index 2839917e5da7..720025ac1830 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -715,6 +715,124 @@ void SwTxtPortion::HandlePortion( SwPortionHandler& rPH ) const
rPH.Text( GetLen(), GetWhichPor() );
}
+
+SwTxtInputFldPortion::SwTxtInputFldPortion()
+ : SwTxtPortion()
+ , mbContainsInputFieldStart( false )
+ , mbContainsInputFieldEnd( false )
+{
+ SetWhichPor( POR_INPUTFLD );
+}
+
+
+sal_Bool SwTxtInputFldPortion::Format( SwTxtFormatInfo &rInf )
+{
+ mbContainsInputFieldStart =
+ rInf.GetChar( rInf.GetIdx() ) == CH_TXT_ATR_INPUTFIELDSTART;
+ mbContainsInputFieldEnd =
+ rInf.GetChar( rInf.GetIdx() + rInf.GetLen() - 1 ) == CH_TXT_ATR_INPUTFIELDEND;
+
+ sal_Bool bRet = sal_False;
+ if ( rInf.GetLen() == 1
+ && ( mbContainsInputFieldStart || mbContainsInputFieldEnd ) )
+ {
+ Width( 0 );
+ }
+ else
+ {
+ SwTxtSlot aFormatTxt( &rInf, this, true, true, 0 );
+ if ( rInf.GetLen() == 0 )
+ {
+ Width( 0 );
+ }
+ else
+ {
+ bRet = SwTxtPortion::Format( rInf );
+
+ if ( mbContainsInputFieldEnd )
+ {
+ // adjust portion length accordingly, if complete text fits into the portion
+ if ( GetLen() == rInf.GetLen() )
+ {
+ SetLen( GetLen() + 1 );
+ }
+ }
+
+ if ( mbContainsInputFieldStart )
+ {
+ // adjust portion length accordingly
+ SetLen( GetLen() + 1 );
+ }
+ }
+ }
+
+ return bRet;
+}
+
+void SwTxtInputFldPortion::Paint( const SwTxtPaintInfo &rInf ) const
+{
+ if ( Width() )
+ {
+ rInf.DrawViewOpt( *this, POR_INPUTFLD );
+ static sal_Char sSpace = ' ';
+ SwTxtSlot aPaintTxt( &rInf, this, true, true,
+ ContainsOnlyDummyChars() ? &sSpace : 0 );
+ SwTxtPortion::Paint( rInf );
+ }
+}
+
+sal_Bool SwTxtInputFldPortion::GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const
+{
+ xub_StrLen nIdx = rInf.GetIdx();
+ xub_StrLen nLen = rInf.GetLen();
+ if ( rInf.GetChar( rInf.GetIdx() ) == CH_TXT_ATR_INPUTFIELDSTART )
+ {
+ ++nIdx;
+ --nLen;
+ }
+ if ( rInf.GetChar( rInf.GetIdx() + rInf.GetLen() - 1 ) == CH_TXT_ATR_INPUTFIELDEND )
+ {
+ --nLen;
+ }
+ rTxt = rInf.GetTxt().Copy( nIdx, nLen );
+
+ return sal_True;
+}
+
+
+SwPosSize SwTxtInputFldPortion::GetTxtSize( const SwTxtSizeInfo &rInf ) const
+{
+ SwTxtSlot aFormatTxt( &rInf, this, true, false, 0 );
+ if ( rInf.GetLen() == 0 )
+ {
+ return SwPosSize( 0, 0 );
+ }
+
+ return rInf.GetTxtSize();
+}
+
+
+KSHORT SwTxtInputFldPortion::GetViewWidth( const SwTxtSizeInfo &rInf ) const
+{
+ if( !Width()
+ && ContainsOnlyDummyChars()
+ && !rInf.GetOpt().IsPagePreview()
+ && !rInf.GetOpt().IsReadonly()
+ && SwViewOption::IsFieldShadings() )
+ {
+ return rInf.GetTxtSize( ' ' ).Width();
+ }
+
+ return SwTxtPortion::GetViewWidth( rInf );
+}
+
+bool SwTxtInputFldPortion::ContainsOnlyDummyChars() const
+{
+ return GetLen() <= 2
+ && mbContainsInputFieldStart
+ && mbContainsInputFieldEnd;
+}
+
/*************************************************************************
* class SwHolePortion
*************************************************************************/
diff --git a/sw/source/core/text/portxt.hxx b/sw/source/core/text/portxt.hxx
index 329055493d70..a778bff11583 100644
--- a/sw/source/core/text/portxt.hxx
+++ b/sw/source/core/text/portxt.hxx
@@ -62,6 +62,24 @@ public:
DECL_FIXEDMEMPOOL_NEWDEL(SwTxtPortion)
};
+
+class SwTxtInputFldPortion : public SwTxtPortion
+{
+public:
+ SwTxtInputFldPortion();
+
+ virtual sal_Bool Format( SwTxtFormatInfo &rInf );
+ virtual void Paint( const SwTxtPaintInfo &rInf ) const;
+ virtual KSHORT GetViewWidth( const SwTxtSizeInfo &rInf ) const;
+ virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const;
+ virtual SwPosSize GetTxtSize( const SwTxtSizeInfo &rInfo ) const;
+
+private:
+ bool mbContainsInputFieldStart;
+ bool mbContainsInputFieldEnd;
+ bool ContainsOnlyDummyChars() const;
+};
+
/*************************************************************************
* class SwHolePortion
*************************************************************************/
diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx
index 9c95883b7943..ccf2eeba6890 100644
--- a/sw/source/core/text/txtfld.cxx
+++ b/sw/source/core/text/txtfld.cxx
@@ -59,6 +59,14 @@
#include "fmtmeta.hxx" // lcl_NewMetaPortion
+//IAccessibility2 Implementation 2009-----
+#ifndef _REFFLD_HXX
+#include "reffld.hxx"
+#endif
+#ifndef _FLDDAT_HXX
+#include "flddat.hxx"
+#endif
+//-----IAccessibility2 Implementation 2009
/*************************************************************************
* SwTxtFormatter::NewFldPortion()
*************************************************************************/
@@ -90,7 +98,9 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf,
SwCharFmt* pChFmt = 0;
sal_Bool bNewFlyPor = sal_False,
bINet = sal_False;
-
+ //IAccessibility2 Implementation 2009-----
+ sal_uInt16 subType;
+ //-----IAccessibility2 Implementation 2009
// set language
((SwTxtFormatter*)this)->SeekAndChg( rInf );
if (pFld->GetLanguage() != GetFnt()->GetLanguage())
@@ -162,6 +172,10 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf,
: pFld->ExpandField(bInClipboard) );
pRet = new SwFldPortion( str );
}
+ //IAccessibility2 Implementation 2009-----
+ if(pRet)
+ ((SwFldPortion*)pRet)->m_nAttrFldType= ATTR_PAGECOOUNTFLD;
+ //-----IAccessibility2 Implementation 2009
break;
case RES_PAGENUMBERFLD:
@@ -188,6 +202,10 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf,
: pFld->ExpandField(bInClipboard) );
pRet = new SwFldPortion( str );
}
+ //IAccessibility2 Implementation 2009-----
+ if(pRet)
+ ((SwFldPortion*)pRet)->m_nAttrFldType= ATTR_PAGENUMBERFLD;
+ //-----IAccessibility2 Implementation 2009
break;
}
case RES_GETEXPFLD:
@@ -263,7 +281,40 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf,
bNewFlyPor = sal_True;
bPlaceHolder = sal_True;
break;
-
+ //IAccessibility2 Implementation 2009-----
+ case RES_GETREFFLD:
+ subType = ((SwGetRefField*)pFld)->GetSubType();
+ {
+ String const str( (bName)
+ ? pFld->GetFieldName()
+ : pFld->ExpandField(bInClipboard) );
+ pRet = new SwFldPortion(str);
+ }
+ if(pRet)
+ {
+ if( subType == REF_BOOKMARK )
+ ((SwFldPortion*)pRet)->m_nAttrFldType = ATTR_BOOKMARKFLD;
+ else if( subType == REF_SETREFATTR )
+ ((SwFldPortion*)pRet)->m_nAttrFldType = ATTR_SETREFATTRFLD;
+ break;
+ }
+ case RES_DATETIMEFLD:
+ subType = ((SwDateTimeField*)pFld)->GetSubType();
+ {
+ String const str( (bName)
+ ? pFld->GetFieldName()
+ : pFld->ExpandField(bInClipboard) );
+ pRet = new SwFldPortion(str);
+ }
+ if(pRet)
+ {
+ if( subType & DATEFLD )
+ ((SwFldPortion*)pRet)->m_nAttrFldType= ATTR_DATEFLD;
+ else if( subType & TIMEFLD )
+ ((SwFldPortion*)pRet)->m_nAttrFldType = ATTR_TIMEFLD;
+ break;
+ }
+ //-----IAccessibility2 Implementation 2009
default:
{
String const str( (bName)
@@ -369,9 +420,6 @@ SwLinePortion *SwTxtFormatter::NewExtraPortion( SwTxtFormatInfo &rInf )
SwLinePortion *pRet = 0;
if( !pHint )
{
-#if OSL_DEBUG_LEVEL > 1
-// aDbstream << "NewExtraPortion: hint not found?" << endl;
-#endif
pRet = new SwTxtPortion;
pRet->SetLen( 1 );
rInf.SetLen( 1 );
@@ -380,43 +428,40 @@ SwLinePortion *SwTxtFormatter::NewExtraPortion( SwTxtFormatInfo &rInf )
switch( pHint->Which() )
{
- case RES_TXTATR_FLYCNT :
+ case RES_TXTATR_FLYCNT :
{
pRet = NewFlyCntPortion( rInf, pHint );
break;
}
- case RES_TXTATR_FTN :
+ case RES_TXTATR_FTN :
{
pRet = NewFtnPortion( rInf, pHint );
break;
}
- case RES_TXTATR_FIELD :
+ case RES_TXTATR_FIELD :
{
pRet = NewFldPortion( rInf, pHint );
break;
}
- case RES_TXTATR_REFMARK :
+ case RES_TXTATR_REFMARK :
{
pRet = new SwIsoRefPortion;
break;
}
- case RES_TXTATR_TOXMARK :
+ case RES_TXTATR_TOXMARK :
{
pRet = new SwIsoToxPortion;
break;
}
- case RES_TXTATR_METAFIELD:
+ case RES_TXTATR_METAFIELD:
{
pRet = lcl_NewMetaPortion( *pHint, true );
break;
}
- default: ;
+ default: ;
}
if( !pRet )
{
-#if OSL_DEBUG_LEVEL > 1
-// aDbstream << "NewExtraPortion: unknown hint" << endl;
-#endif
const XubString aNothing;
pRet = new SwFldPortion( aNothing );
rInf.SetLen( 1 );
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index a58fceebc55f..9647364f9c6e 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -1329,16 +1329,6 @@ void SwTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
}
break;
-/* Seit dem neuen Blocksatz muessen wir immer neu formatieren:
- case RES_PARATR_ADJUST:
- {
- if( GetShell() )
- {
- Prepare( PREP_CLEAR );
- }
- break;
- }
-*/
// 6870: SwDocPosUpdate auswerten.
case RES_DOCPOS_UPDATE:
{
diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx
index abd205963c99..8945688013b5 100644
--- a/sw/source/core/tox/tox.cxx
+++ b/sw/source/core/tox/tox.cxx
@@ -240,7 +240,7 @@ String SwTOXMark::GetText() const
aStr = aAltText;
else if( pTxtAttr && pTxtAttr->GetpTxtNd() )
{
- xub_StrLen* pEndIdx = pTxtAttr->GetEnd();
+ const xub_StrLen* pEndIdx = pTxtAttr->GetEnd();
ASSERT( pEndIdx, "TOXMark ohne Mark!!");
if( pEndIdx )
{
diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx
index e531761e042c..764b8d6828a0 100644
--- a/sw/source/core/tox/txmsrt.cxx
+++ b/sw/source/core/tox/txmsrt.cxx
@@ -232,8 +232,8 @@ sal_Bool SwTOXSortTabBase::operator==( const SwTOXSortTabBase& rCmp )
{
// beide Pointer vorhanden -> vergleiche Text
// beide Pointer nicht vorhanden -> vergleiche AlternativText
- const xub_StrLen *pEnd = pTxtMark->GetEnd(),
- *pEndCmp = rCmp.pTxtMark->GetEnd();
+ const xub_StrLen* pEnd = pTxtMark->End();
+ const xub_StrLen* pEndCmp = rCmp.pTxtMark->End();
String sMyTxt;
String sMyTxtReading;
@@ -275,8 +275,8 @@ sal_Bool SwTOXSortTabBase::operator<( const SwTOXSortTabBase& rCmp )
if( *pTxtMark->GetStart() == *rCmp.pTxtMark->GetStart() )
{
- const xub_StrLen *pEnd = pTxtMark->GetEnd(),
- *pEndCmp = rCmp.pTxtMark->GetEnd();
+ const xub_StrLen* pEnd = pTxtMark->End();
+ const xub_StrLen* pEndCmp = rCmp.pTxtMark->End();
String sMyTxt;
String sMyTxtReading;
@@ -432,7 +432,7 @@ void SwTOXIndex::GetText_Impl( String& rTxt, String& rTxtReading ) const
void SwTOXIndex::FillText( SwTxtNode& rNd, const SwIndex& rInsPos, sal_uInt16 ) const
{
- const xub_StrLen* pEnd = pTxtMark->GetEnd();
+ const xub_StrLen* pEnd = pTxtMark->End();
String sTmp;
String sTmpReading;
if( pEnd && !pTxtMark->GetTOXMark().IsAlternativeText() &&
@@ -549,7 +549,7 @@ SwTOXContent::SwTOXContent( const SwTxtNode& rNd, const SwTxtTOXMark* pMark,
void SwTOXContent::GetText_Impl( String& rTxt, String& rTxtReading ) const
{
- const xub_StrLen* pEnd = pTxtMark->GetEnd();
+ const xub_StrLen* pEnd = pTxtMark->End();
if( pEnd && !pTxtMark->GetTOXMark().IsAlternativeText() )
{
rTxt = ((SwTxtNode*)aTOXSources[0].pNd)->GetExpandTxt(
@@ -564,7 +564,7 @@ void SwTOXContent::GetText_Impl( String& rTxt, String& rTxtReading ) const
void SwTOXContent::FillText( SwTxtNode& rNd, const SwIndex& rInsPos, sal_uInt16 ) const
{
- const xub_StrLen* pEnd = pTxtMark->GetEnd();
+ const xub_StrLen* pEnd = pTxtMark->End();
if( pEnd && !pTxtMark->GetTOXMark().IsAlternativeText() )
((SwTxtNode*)aTOXSources[0].pNd)->GetExpandTxt( rNd, &rInsPos,
*pTxtMark->GetStart(),
diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx
index feee13492942..52720547f481 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -48,13 +48,13 @@
*
****************************************************************************/
- // Konstruktor fuers Default vom Attribut-Pool
-SwFmtFld::SwFmtFld()
- : SfxPoolItem( RES_TXTATR_FIELD )
- , SwClient( 0 )
+// constructor for default item in attribute-pool
+SwFmtFld::SwFmtFld( sal_uInt16 nWhich )
+ : SfxPoolItem( nWhich )
+ , SwClient()
, SfxBroadcaster()
- , pField( 0 )
- , pTxtAttr( 0 )
+ , mpField( NULL )
+ , mpTxtFld( NULL )
{
}
@@ -62,10 +62,15 @@ SwFmtFld::SwFmtFld( const SwField &rFld )
: SfxPoolItem( RES_TXTATR_FIELD )
, SwClient( rFld.GetTyp() )
, SfxBroadcaster()
- , pField( 0 )
- , pTxtAttr( 0 )
+ , mpField( rFld.CopyField() )
+ , mpTxtFld( NULL )
{
- pField = rFld.CopyField();
+ // input field in-place editing
+ if ( GetField()->GetTyp()->Which() == RES_INPUTFLD )
+ {
+ SetWhich( RES_TXTATR_INPUTFIELD );
+ dynamic_cast<SwInputField*>(GetField())->SetFmtFld( *this );
+ }
}
// #i24434#
@@ -76,25 +81,31 @@ SwFmtFld::SwFmtFld( const SwFmtFld& rAttr )
: SfxPoolItem( RES_TXTATR_FIELD )
, SwClient()
, SfxBroadcaster()
- , pField( 0 )
- , pTxtAttr( 0 )
+ , mpField( NULL )
+ , mpTxtFld( NULL )
{
- if(rAttr.GetField())
+ if ( rAttr.GetField() )
{
rAttr.GetField()->GetTyp()->Add(this);
- pField = rAttr.GetField()->CopyField();
+ mpField = rAttr.GetField()->CopyField();
+ // input field in-place editing
+ if ( GetField()->GetTyp()->Which() == RES_INPUTFLD )
+ {
+ SetWhich( RES_TXTATR_INPUTFIELD );
+ dynamic_cast<SwInputField*>(GetField())->SetFmtFld( *this );
+ }
}
}
SwFmtFld::~SwFmtFld()
{
- SwFieldType* pType = pField ? pField->GetTyp() : 0;
+ SwFieldType* pType = mpField ? mpField->GetTyp() : 0;
if (pType && pType->Which() == RES_DBFLD)
pType = 0; // DB-Feldtypen zerstoeren sich selbst
Broadcast( SwFmtFldHint( this, SWFMTFLD_REMOVED ) );
- delete pField;
+ delete mpField;
// bei einige FeldTypen muessen wir den FeldTypen noch loeschen
if( pType && pType->IsLastDepend() )
@@ -131,22 +142,36 @@ void SwFmtFld::RegisterToFieldType( SwFieldType& rType )
// #111840#
-void SwFmtFld::SetFld(SwField * _pField)
+void SwFmtFld::SetField(SwField * _pField)
{
- if (NULL != pField)
- delete pField;
+ if (NULL != mpField)
+ delete mpField;
- pField = _pField;
+ mpField = _pField;
+ if ( GetField()->GetTyp()->Which() == RES_INPUTFLD )
+ {
+ dynamic_cast<SwInputField* >(GetField())->SetFmtFld( *this );
+ }
Broadcast( SwFmtFldHint( this, SWFMTFLD_CHANGED ) );
}
+void SwFmtFld::SetTxtFld( SwTxtFld& rTxtFld )
+{
+ mpTxtFld = &rTxtFld;
+}
+
+void SwFmtFld::ClearTxtFld()
+{
+ mpTxtFld = NULL;
+}
+
int SwFmtFld::operator==( const SfxPoolItem& rAttr ) const
{
ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
- return ( ( pField && ((SwFmtFld&)rAttr).GetField()
- && pField->GetTyp() == ((SwFmtFld&)rAttr).GetField()->GetTyp()
- && pField->GetFormat() == ((SwFmtFld&)rAttr).GetField()->GetFormat() ) )
- || ( !pField && !((SwFmtFld&)rAttr).GetField() );
+ return ( ( mpField && ((SwFmtFld&)rAttr).GetField()
+ && mpField->GetTyp() == ((SwFmtFld&)rAttr).GetField()->GetTyp()
+ && mpField->GetFormat() == ((SwFmtFld&)rAttr).GetField()->GetFormat() ) )
+ || ( !mpField && !((SwFmtFld&)rAttr).GetField() );
}
SfxPoolItem* SwFmtFld::Clone( SfxItemPool* ) const
@@ -156,7 +181,7 @@ SfxPoolItem* SwFmtFld::Clone( SfxItemPool* ) const
void SwFmtFld::SwClientNotify( const SwModify&, const SfxHint& rHint )
{
- if( !pTxtAttr )
+ if( !mpTxtFld )
return;
const SwFieldHint* pHint = dynamic_cast<const SwFieldHint*>( &rHint );
@@ -165,9 +190,9 @@ void SwFmtFld::SwClientNotify( const SwModify&, const SfxHint& rHint )
// replace field content by text
SwPaM* pPaM = pHint->GetPaM();
SwDoc* pDoc = pPaM->GetDoc();
- const SwTxtNode& rTxtNode = pTxtAttr->GetTxtNode();
+ const SwTxtNode& rTxtNode = mpTxtFld->GetTxtNode();
pPaM->GetPoint()->nNode = rTxtNode;
- pPaM->GetPoint()->nContent.Assign( (SwTxtNode*)&rTxtNode, *pTxtAttr->GetStart() );
+ pPaM->GetPoint()->nContent.Assign( (SwTxtNode*)&rTxtNode, *mpTxtFld->GetStart() );
String const aEntry( GetField()->ExpandField( pDoc->IsClipBoard() ) );
pPaM->SetMark();
@@ -179,14 +204,14 @@ void SwFmtFld::SwClientNotify( const SwModify&, const SfxHint& rHint )
void SwFmtFld::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
- if( !pTxtAttr )
+ if( !mpTxtFld )
return;
// don't do anything, especially not expand!
if( pNew && pNew->Which() == RES_OBJECTDYING )
return;
- SwTxtNode* pTxtNd = (SwTxtNode*)&pTxtAttr->GetTxtNode();
+ SwTxtNode* pTxtNd = (SwTxtNode*)&mpTxtFld->GetTxtNode();
ASSERT( pTxtNd, "wo ist denn mein Node?" );
if( pNew )
{
@@ -203,7 +228,7 @@ void SwFmtFld::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
// --> OD 2007-09-06 #i81002#
// ((SwGetRefField*)GetFld())->UpdateField();
- dynamic_cast<SwGetRefField*>(GetField())->UpdateField( pTxtAttr );
+ dynamic_cast<SwGetRefField*>(GetField())->UpdateField( mpTxtFld );
// <--
}
break;
@@ -243,14 +268,14 @@ void SwFmtFld::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
pType->GetValue( aCalc );
}
}
- pTxtAttr->Expand();
+ mpTxtFld->ExpandTxtFld();
}
sal_Bool SwFmtFld::GetInfo( SfxPoolItem& rInfo ) const
{
const SwTxtNode* pTxtNd;
if( RES_AUTOFMT_DOCNODE != rInfo.Which() ||
- !pTxtAttr || 0 == ( pTxtNd = pTxtAttr->GetpTxtNode() ) ||
+ !mpTxtFld || 0 == ( pTxtNd = mpTxtFld->GetpTxtNode() ) ||
&pTxtNd->GetNodes() != ((SwAutoFmtGetDocNode&)rInfo).pNodes )
return sal_True;
@@ -259,82 +284,68 @@ sal_Bool SwFmtFld::GetInfo( SfxPoolItem& rInfo ) const
}
-sal_Bool SwFmtFld::IsFldInDoc() const
+bool SwFmtFld::IsFldInDoc() const
{
- const SwTxtNode* pTxtNd;
- return pTxtAttr && 0 != ( pTxtNd = pTxtAttr->GetpTxtNode() ) &&
- pTxtNd->GetNodes().IsDocNodes();
+ return mpTxtFld != NULL
+ && mpTxtFld->IsFldInDoc();
}
sal_Bool SwFmtFld::IsProtect() const
{
- const SwTxtNode* pTxtNd;
- return pTxtAttr && 0 != ( pTxtNd = pTxtAttr->GetpTxtNode() ) &&
- pTxtNd->IsProtect();
+ return mpTxtFld != NULL
+ && mpTxtFld->GetpTxtNode() != NULL
+ && mpTxtFld->GetpTxtNode()->IsProtect();
}
-/*************************************************************************
-|*
-|* SwTxtFld::SwTxtFld()
-|*
-|* Beschreibung Attribut fuer automatischen Text, Ctor
-|* Ersterstellung BP 30.04.92
-|* Letzte Aenderung JP 15.08.94
-|*
-*************************************************************************/
-
-SwTxtFld::SwTxtFld(SwFmtFld & rAttr, xub_StrLen const nStartPos)
+
+
+
+SwTxtFld::SwTxtFld(
+ SwFmtFld & rAttr,
+ xub_StrLen const nStartPos )
: SwTxtAttr( rAttr, nStartPos )
, m_aExpand( rAttr.GetField()->ExpandField(true) )
- , m_pTxtNode( 0 )
+ , m_pTxtNode( NULL )
{
- rAttr.pTxtAttr = this;
+ rAttr.SetTxtFld( *this );
SetHasDummyChar(true);
}
SwTxtFld::~SwTxtFld( )
{
SwFmtFld & rFmtFld( static_cast<SwFmtFld &>(GetAttr()) );
- if (this == rFmtFld.pTxtAttr)
+ if ( this == rFmtFld.GetTxtFld() )
{
- rFmtFld.pTxtAttr = 0; // #i110140# invalidate!
+ rFmtFld.ClearTxtFld();
}
}
-/*************************************************************************
-|*
-|* SwTxtFld::Expand()
-|*
-|* Beschreibung exandiert das Feld und tauscht den Text im Node
-|* Ersterstellung BP 30.04.92
-|* Letzte Aenderung JP 15.08.94
-|*
-*************************************************************************/
-
-void SwTxtFld::Expand() const
+
+bool SwTxtFld::IsFldInDoc() const
+{
+ return GetpTxtNode() != NULL
+ && GetpTxtNode()->GetNodes().IsDocNodes();
+}
+
+void SwTxtFld::ExpandTxtFld() const
{
- // Wenn das expandierte Feld sich nicht veraendert hat, wird returnt
ASSERT( m_pTxtNode, "SwTxtFld: where is my TxtNode?" );
const SwField* pFld = GetFmtFld().GetField();
- XubString aNewExpand( pFld->ExpandField(m_pTxtNode->GetDoc()->IsClipBoard()) );
+ const XubString aNewExpand( pFld->ExpandField(m_pTxtNode->GetDoc()->IsClipBoard()) );
if( aNewExpand == m_aExpand )
{
// Bei Seitennummernfeldern
const sal_uInt16 nWhich = pFld->GetTyp()->Which();
- if( RES_CHAPTERFLD != nWhich && RES_PAGENUMBERFLD != nWhich &&
- RES_REFPAGEGETFLD != nWhich &&
- // --> FME 2005-05-23 #122919# Page count fields to not use aExpand
- // during formatting, therefore an invalidation of the text frame
- // has to be triggered even if aNewExpand == aExpand:
- ( RES_DOCSTATFLD != nWhich || DS_PAGE != static_cast<const SwDocStatField*>(pFld)->GetSubType() ) &&
- // <--
- ( RES_GETEXPFLD != nWhich || ((SwGetExpField*)pFld)->IsInBodyTxt() ) )
+ if ( RES_CHAPTERFLD != nWhich
+ && RES_PAGENUMBERFLD != nWhich
+ && RES_REFPAGEGETFLD != nWhich
+ // Page count fields to not use aExpand during formatting,
+ // therefore an invalidation of the text frame has to be triggered even if aNewExpand == aExpand:
+ && ( RES_DOCSTATFLD != nWhich || DS_PAGE != static_cast<const SwDocStatField*>(pFld)->GetSubType() )
+ && ( RES_GETEXPFLD != nWhich || ((SwGetExpField*)pFld)->IsInBodyTxt() ) )
{
- // BP: das muesste man noch optimieren!
- //JP 12.06.97: stimmt, man sollte auf jedenfall eine Status-
- // aenderung an die Frames posten
if( m_pTxtNode->CalcHiddenParaField() )
{
m_pTxtNode->ModifyNotification( 0, 0 );
@@ -345,15 +356,11 @@ void SwTxtFld::Expand() const
m_aExpand = aNewExpand;
- // 0, this for formatting
- m_pTxtNode->ModifyNotification( 0, const_cast<SwFmtFld*>( &GetFmtFld() ) );
+ const_cast<SwTxtFld*>(this)->NotifyContentChange( const_cast<SwFmtFld&>(GetFmtFld()) );
}
-/*************************************************************************
- * SwTxtFld::CopyFld()
- *************************************************************************/
-void SwTxtFld::CopyFld( SwTxtFld *pDest ) const
+void SwTxtFld::CopyTxtFld( SwTxtFld *pDest ) const
{
ASSERT( m_pTxtNode, "SwTxtFld: where is my TxtNode?" );
ASSERT( pDest->m_pTxtNode, "SwTxtFld: where is pDest's TxtNode?" );
@@ -361,8 +368,8 @@ void SwTxtFld::CopyFld( SwTxtFld *pDest ) const
IDocumentFieldsAccess* pIDFA = m_pTxtNode->getIDocumentFieldsAccess();
IDocumentFieldsAccess* pDestIDFA = pDest->m_pTxtNode->getIDocumentFieldsAccess();
- SwFmtFld& rFmtFld = (SwFmtFld&)pDest->GetFmtFld();
- const sal_uInt16 nFldWhich = rFmtFld.GetField()->GetTyp()->Which();
+ SwFmtFld& rDestFmtFld = (SwFmtFld&)pDest->GetFmtFld();
+ const sal_uInt16 nFldWhich = rDestFmtFld.GetField()->GetTyp()->Which();
if( pIDFA != pDestIDFA )
{
@@ -370,47 +377,54 @@ void SwTxtFld::CopyFld( SwTxtFld *pDest ) const
// der Feldtyp muss im neuen Dokument angemeldet werden.
// Z.B: Kopieren ins ClipBoard.
SwFieldType* pFldType;
- if( nFldWhich != RES_DBFLD && nFldWhich != RES_USERFLD &&
- nFldWhich != RES_SETEXPFLD && nFldWhich != RES_DDEFLD &&
- RES_AUTHORITY != nFldWhich )
+ if( nFldWhich != RES_DBFLD
+ && nFldWhich != RES_USERFLD
+ && nFldWhich != RES_SETEXPFLD
+ && nFldWhich != RES_DDEFLD
+ && RES_AUTHORITY != nFldWhich )
+ {
pFldType = pDestIDFA->GetSysFldType( nFldWhich );
+ }
else
- pFldType = pDestIDFA->InsertFldType( *rFmtFld.GetField()->GetTyp() );
+ {
+ pFldType = pDestIDFA->InsertFldType( *rDestFmtFld.GetField()->GetTyp() );
+ }
// Sonderbehandlung fuer DDE-Felder
if( RES_DDEFLD == nFldWhich )
{
- if( rFmtFld.GetTxtFld() )
- ((SwDDEFieldType*)rFmtFld.GetField()->GetTyp())->DecRefCnt();
+ if( rDestFmtFld.GetTxtFld() )
+ {
+ ((SwDDEFieldType*)rDestFmtFld.GetField()->GetTyp())->DecRefCnt();
+ }
((SwDDEFieldType*)pFldType)->IncRefCnt();
}
ASSERT( pFldType, "unbekannter FieldType" );
- pFldType->Add( &rFmtFld ); // ummelden
- rFmtFld.GetField()->ChgTyp( pFldType );
+ pFldType->Add( &rDestFmtFld ); // ummelden
+ rDestFmtFld.GetField()->ChgTyp( pFldType );
}
// Expressionfelder Updaten
- if( nFldWhich == RES_SETEXPFLD || nFldWhich == RES_GETEXPFLD ||
- nFldWhich == RES_HIDDENTXTFLD )
+ if( nFldWhich == RES_SETEXPFLD
+ || nFldWhich == RES_GETEXPFLD
+ || nFldWhich == RES_HIDDENTXTFLD )
{
SwTxtFld* pFld = (SwTxtFld*)this;
pDestIDFA->UpdateExpFlds( pFld, true );
}
// Tabellenfelder auf externe Darstellung
- else if( RES_TABLEFLD == nFldWhich &&
- ((SwTblField*)rFmtFld.GetField())->IsIntrnlName() )
+ else if( RES_TABLEFLD == nFldWhich
+ && ((SwTblField*)rDestFmtFld.GetField())->IsIntrnlName() )
{
// erzeuge aus der internen (fuer CORE) die externe (fuer UI) Formel
const SwTableNode* pTblNd = m_pTxtNode->FindTableNode();
if( pTblNd ) // steht in einer Tabelle
- ((SwTblField*)rFmtFld.GetField())->PtrToBoxNm( &pTblNd->GetTable() );
+ ((SwTblField*)rDestFmtFld.GetField())->PtrToBoxNm( &pTblNd->GetTable() );
}
}
-/* -----------------26.06.2003 13:54-----------------
- --------------------------------------------------*/
void SwTxtFld::NotifyContentChange(SwFmtFld& rFmtFld)
{
//if not in undo section notify the change
@@ -421,3 +435,83 @@ void SwTxtFld::NotifyContentChange(SwFmtFld& rFmtFld)
}
+// input field in-place editing
+SwTxtInputFld::SwTxtInputFld(
+ SwFmtFld & rAttr,
+ xub_StrLen const nStart,
+ xub_StrLen const nEnd )
+
+ : SwTxtFld( rAttr, nStart )
+ , m_nEnd( nEnd )
+{
+ SetHasDummyChar( false );
+ SetHasContent( true );
+
+ SetDontExpand( true );
+ SetLockExpandFlag( true );
+ SetDontExpandStartAttr( true );
+
+ SetNesting( true );
+}
+
+SwTxtInputFld::~SwTxtInputFld()
+{
+}
+
+xub_StrLen* SwTxtInputFld::GetEnd()
+{
+ return &m_nEnd;
+}
+
+void SwTxtInputFld::NotifyContentChange( SwFmtFld& rFmtFld )
+{
+ SwTxtFld::NotifyContentChange( rFmtFld );
+
+ UpdateTextNodeContent( GetFieldContent() );
+}
+
+const String SwTxtInputFld::GetFieldContent() const
+{
+ return GetFmtFld().GetField()->ExpandField(false);
+}
+
+void SwTxtInputFld::UpdateFieldContent()
+{
+ if ( IsFldInDoc()
+ && (*GetStart()) != (*End()) )
+ {
+ ASSERT( (*End()) - (*GetStart()) >= 2,
+ "<SwTxtInputFld::UpdateFieldContent()> - Are CH_TXT_ATR_INPUTFIELDSTART and/or CH_TXT_ATR_INPUTFIELDEND missing?" );
+ // skip CH_TXT_ATR_INPUTFIELDSTART character
+ const xub_StrLen nIdx = (*GetStart()) + 1;
+ // skip CH_TXT_ATR_INPUTFIELDEND character
+ const xub_StrLen nLen = static_cast<xub_StrLen>(std::max( 0, ( (*End()) - 1 - nIdx ) ));
+ const String aNewFieldContent = GetTxtNode().GetExpandTxt( nIdx, nLen );
+
+ const SwInputField* pInputFld = dynamic_cast<const SwInputField*>(GetFmtFld().GetField());
+ ASSERT( pInputFld != NULL,
+ "<SwTxtInputFld::GetContent()> - Missing <SwInputFld> instance!" );
+ if ( pInputFld != NULL )
+ {
+ const_cast<SwInputField*>(pInputFld)->applyFieldContent( aNewFieldContent );
+ }
+ }
+}
+
+void SwTxtInputFld::UpdateTextNodeContent( const String& rNewContent )
+{
+ if ( !IsFldInDoc() )
+ {
+ ASSERT( false, "<SwTxtInputFld::UpdateTextNodeContent(..)> - misusage as Input Field is not in document content." );
+ return;
+ }
+
+ ASSERT( (*End()) - (*GetStart()) >= 2,
+ "<SwTxtInputFld::UpdateTextNodeContent(..)> - Are CH_TXT_ATR_INPUTFIELDSTART and/or CH_TXT_ATR_INPUTFIELDEND missing?" );
+ // skip CH_TXT_ATR_INPUTFIELDSTART character
+ const xub_StrLen nIdx = (*GetStart()) + 1;
+ // skip CH_TXT_ATR_INPUTFIELDEND character
+ const xub_StrLen nDelLen = static_cast<xub_StrLen>(std::max( 0, ( (*End()) - 1 - nIdx ) ));
+ SwIndex aIdx( &GetTxtNode(), nIdx );
+ GetTxtNode().ReplaceText( aIdx, nDelLen, rNewContent );
+}
diff --git a/sw/source/core/txtnode/ndhints.cxx b/sw/source/core/txtnode/ndhints.cxx
index cd389440ffc2..9635fd988b9b 100644
--- a/sw/source/core/txtnode/ndhints.cxx
+++ b/sw/source/core/txtnode/ndhints.cxx
@@ -52,8 +52,8 @@ void DumpHints( const SwpHtStart &rHtStart,
((((aDbstream << '\t').WriteNumber( i )<< " [").WriteNumber( pHt->Which() )
<< ']' << '\t').WriteNumber( long( pHt ) )
<< '\t').WriteNumber( *pHt->GetStart() );
- if( pHt->GetEnd() )
- (aDbstream << " -> " ).WriteNumber( *pHt->GetEnd() );
+ if( pHt->End() )
+ (aDbstream << " -> " ).WriteNumber( *pHt->End() );
aDbstream << endl;
}
(aDbstream << "\tEnds:").WriteNumber( rHtEnd.Count() )<< endl;
@@ -62,8 +62,8 @@ void DumpHints( const SwpHtStart &rHtStart,
const SwTxtAttr *pHt = rHtEnd[i];
(((aDbstream << '\t').WriteNumber( i )<< " [").WriteNumber( pHt->Which() )
<< ']' << '\t' ).WriteNumber( long( pHt ) );
- if( pHt->GetEnd() )
- (aDbstream << '\t').WriteNumber( *pHt->GetEnd() )<< " <- ";
+ if( pHt->End() )
+ (aDbstream << '\t').WriteNumber( *pHt->End() )<< " <- ";
aDbstream.WriteNumber( *pHt->GetStart() )<< endl;
}
aDbstream << endl;
@@ -370,11 +370,11 @@ bool SwpHintsArray::Check() const
CHECK_ERR( 0 == i ||
( RES_TXTATR_CHARFMT != pHtLast->Which() && RES_TXTATR_AUTOFMT != pHtLast->Which() ) ||
( RES_TXTATR_CHARFMT != pHtThis->Which() && RES_TXTATR_AUTOFMT != pHtThis->Which() ) ||
- ( *pHtThis->GetStart() >= *pHtLast->GetEnd() ) ||
+ ( *pHtThis->GetStart() >= *pHtLast->End() ) ||
( ( ( (*pHtThis->GetStart() == *pHtLast->GetStart())
- && (*pHtThis->GetEnd() == *pHtLast->GetEnd())
+ && (*pHtThis->End() == *pHtLast->End())
) // same range
- || (*pHtThis->GetStart() == *pHtThis->GetEnd())
+ || (*pHtThis->GetStart() == *pHtThis->End())
)
&& ( (pHtThis->Which() != RES_TXTATR_AUTOFMT)
|| (pHtLast->Which() != RES_TXTATR_AUTOFMT)
@@ -392,8 +392,8 @@ bool SwpHintsArray::Check() const
if ( pOther->IsNesting() && (i != j) )
{
SwComparePosition cmp = ComparePosition(
- *pHtThis->GetStart(), *pHtThis->GetEnd(),
- *pOther->GetStart(), *pOther->GetEnd());
+ *pHtThis->GetStart(), *pHtThis->End(),
+ *pOther->GetStart(), *pOther->End());
CHECK_ERR( (POS_OVERLAP_BEFORE != cmp) &&
(POS_OVERLAP_BEHIND != cmp),
"HintsCheck: overlapping nesting hints!!!" );
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 14c459587f5d..8fa75a677c50 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -259,22 +259,16 @@ SwTxtNode::~SwTxtNode()
m_pSwpHints = 0;
for( sal_uInt16 j = pTmpHints->Count(); j; )
+ {
// erst muss das Attribut aus dem Array entfernt werden,
// denn sonst wuerde es sich selbst loeschen (Felder) !!!!
DestroyAttr( pTmpHints->GetTextHint( --j ) );
+ }
delete pTmpHints;
}
- // --> OD 2008-03-13 #refactorlists#
-// if ( mpNodeNum )
-// {
-// mpNodeNum->RemoveMe();
-// delete mpNodeNum;
-// mpNodeNum = 0L;
-// }
RemoveFromList();
- // <--
InitSwParaStatistics( false );
}
@@ -857,8 +851,11 @@ void SwTxtNode::NewAttrSet( SwAttrPool& rPool )
// override SwIndexReg::Update => text hints do not need SwIndex for start/end!
-void SwTxtNode::Update( SwIndex const & rPos, const xub_StrLen nChangeLen,
- const bool bNegative, const bool bDelete )
+void SwTxtNode::Update(
+ SwIndex const & rPos,
+ const xub_StrLen nChangeLen,
+ const bool bNegative,
+ const bool bDelete )
{
SetAutoCompleteWordDirty( sal_True );
@@ -872,6 +869,8 @@ void SwTxtNode::Update( SwIndex const & rPos, const xub_StrLen nChangeLen,
const xub_StrLen nChangeEnd = nChangePos + nChangeLen;
for ( sal_uInt16 n = 0; n < m_pSwpHints->Count(); ++n )
{
+ bool bTxtAttrChanged = false;
+ bool bStartOfTxtAttrChanged = false;
SwTxtAttr * const pHint = m_pSwpHints->GetTextHint(n);
xub_StrLen * const pStart = pHint->GetStart();
if ( *pStart > nChangePos )
@@ -884,6 +883,7 @@ void SwTxtNode::Update( SwIndex const & rPos, const xub_StrLen nChangeLen,
{
*pStart = nChangePos;
}
+ bStartOfTxtAttrChanged = true;
}
xub_StrLen * const pEnd = pHint->GetEnd();
@@ -899,6 +899,17 @@ void SwTxtNode::Update( SwIndex const & rPos, const xub_StrLen nChangeLen,
{
*pEnd = nChangePos;
}
+ bTxtAttrChanged = !bStartOfTxtAttrChanged;
+ }
+ }
+
+ if ( bTxtAttrChanged
+ && pHint->Which() == RES_TXTATR_INPUTFIELD )
+ {
+ SwTxtInputFld* pTxtInputFld = dynamic_cast<SwTxtInputFld*>(pHint);
+ if ( pTxtInputFld )
+ {
+ pTxtInputFld->UpdateFieldContent();
}
}
}
@@ -909,14 +920,15 @@ void SwTxtNode::Update( SwIndex const & rPos, const xub_StrLen nChangeLen,
{
bool bNoExp = false;
bool bResort = false;
- const sal_uInt16 coArrSz = static_cast<sal_uInt16>(RES_TXTATR_WITHEND_END) -
- static_cast<sal_uInt16>(RES_CHRATR_BEGIN);
+ const sal_uInt16 coArrSz =
+ static_cast<sal_uInt16>(RES_TXTATR_WITHEND_END) - static_cast<sal_uInt16>(RES_CHRATR_BEGIN);
sal_Bool aDontExp[ coArrSz ];
memset( &aDontExp, 0, coArrSz * sizeof(sal_Bool) );
for ( sal_uInt16 n = 0; n < m_pSwpHints->Count(); ++n )
{
+ bool bTxtAttrChanged = false;
SwTxtAttr * const pHint = m_pSwpHints->GetTextHint(n);
xub_StrLen * const pStart = pHint->GetStart();
xub_StrLen * const pEnd = pHint->GetEnd();
@@ -933,6 +945,7 @@ void SwTxtNode::Update( SwIndex const & rPos, const xub_StrLen nChangeLen,
if ( (*pEnd > nChangePos) || IsIgnoreDontExpand() )
{
*pEnd = *pEnd + nChangeLen;
+ bTxtAttrChanged = true;
}
else // *pEnd == nChangePos
{
@@ -975,26 +988,35 @@ void SwTxtNode::Update( SwIndex const & rPos, const xub_StrLen nChangeLen,
sal_uInt16 nCollCnt = pCollector->Count();
for( sal_uInt16 i = 0; i < nCollCnt; ++i )
{
- SwTxtAttr *pTmp = (*pCollector)[ i ];
- if( nWhich == pTmp->Which() )
- {
- pCollector->Remove( i );
- SwTxtAttr::Destroy( pTmp,
- GetDoc()->GetAttrPool() );
- break;
- }
+ SwTxtAttr *pTmp = (*pCollector)[ i ];
+ if( nWhich == pTmp->Which() )
+ {
+ pCollector->Remove( i );
+ SwTxtAttr::Destroy( pTmp, GetDoc()->GetAttrPool() );
+ break;
+ }
}
- SwTxtAttr * const pTmp = MakeTxtAttr( *GetDoc(),
- pHint->GetAttr(),
- nChangePos, nChangePos + nChangeLen);
+ SwTxtAttr * const pTmp =
+ MakeTxtAttr( *GetDoc(), pHint->GetAttr(), nChangePos, nChangePos + nChangeLen);
pCollector->C40_INSERT( SwTxtAttr, pTmp, pCollector->Count() );
}
else
{
*pEnd = *pEnd + nChangeLen;
+ bTxtAttrChanged = true;
}
}
}
+
+ if ( bTxtAttrChanged
+ && pHint->Which() == RES_TXTATR_INPUTFIELD )
+ {
+ SwTxtInputFld* pTxtInputFld = dynamic_cast<SwTxtInputFld*>(pHint);
+ if ( pTxtInputFld )
+ {
+ pTxtInputFld->UpdateFieldContent();
+ }
+ }
}
if ( bResort )
{
@@ -1047,10 +1069,9 @@ void SwTxtNode::Update( SwIndex const & rPos, const xub_StrLen nChangeLen,
}
const IDocumentMarkAccess* const pMarkAccess = getIDocumentMarkAccess();
- for(IDocumentMarkAccess::const_iterator_t ppMark =
- pMarkAccess->getMarksBegin();
- ppMark != pMarkAccess->getMarksEnd();
- ppMark++)
+ for ( IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getMarksBegin();
+ ppMark != pMarkAccess->getMarksEnd();
+ ppMark++ )
{
// Bookmarks must never grow to either side, when
// editing (directly) to the left or right (#i29942#)!
@@ -1184,9 +1205,11 @@ static bool lcl_GetTxtAttrParent(xub_StrLen const nIndex,
static void
lcl_GetTxtAttrs(
- ::std::vector<SwTxtAttr *> *const pVector, SwTxtAttr **const ppTxtAttr,
+ ::std::vector<SwTxtAttr *> *const pVector,
+ SwTxtAttr **const ppTxtAttr,
SwpHints *const pSwpHints,
- xub_StrLen const nIndex, RES_TXTATR const nWhich,
+ xub_StrLen const nIndex,
+ RES_TXTATR const nWhich,
enum SwTxtNode::GetTxtAttrMode const eMode)
{
sal_uInt16 const nSize = (pSwpHints) ? pSwpHints->Count() : 0;
@@ -1215,10 +1238,9 @@ lcl_GetTxtAttrs(
}
xub_StrLen const*const pEndIdx = pHint->GetEnd();
- ASSERT(pEndIdx || pHint->HasDummyChar(),
- "hint with no end and no dummy char?");
- // Wenn bExpand gesetzt ist, wird das Verhalten bei Eingabe
- // simuliert, d.h. der Start wuede verschoben, das Ende expandiert,
+ ASSERT(pEndIdx || pHint->HasDummyChar(), "hint with no end and no dummy char?");
+ // Wenn bExpand gesetzt ist, wird das Verhalten bei Eingabe
+ // simuliert, d.h. der Start wuede verschoben, das Ende expandiert,
bool const bContained( (pEndIdx)
? (*pMatchFunc)(nIndex, nHintStart, *pEndIdx)
: (nHintStart == nIndex) );
@@ -1263,7 +1285,8 @@ SwTxtNode::GetTxtAttrAt(xub_StrLen const nIndex, RES_TXTATR const nWhich,
|| (nWhich == RES_TXTATR_AUTOFMT)
|| (nWhich == RES_TXTATR_INETFMT)
|| (nWhich == RES_TXTATR_CJK_RUBY)
- || (nWhich == RES_TXTATR_UNKNOWN_CONTAINER),
+ || (nWhich == RES_TXTATR_UNKNOWN_CONTAINER)
+ || (nWhich == RES_TXTATR_INPUTFIELD ),
"GetTxtAttrAt() will give wrong result for this hint!");
SwTxtAttr * pRet(0);
@@ -1271,6 +1294,40 @@ SwTxtNode::GetTxtAttrAt(xub_StrLen const nIndex, RES_TXTATR const nWhich,
return pRet;
}
+const SwTxtInputFld* SwTxtNode::GetOverlappingInputFld( const SwTxtAttr& rTxtAttr ) const
+{
+ const SwTxtInputFld* pTxtInputFld = NULL;
+
+ pTxtInputFld = dynamic_cast<const SwTxtInputFld*>(GetTxtAttrAt( *(rTxtAttr.GetStart()), RES_TXTATR_INPUTFIELD, PARENT ));
+
+ if ( pTxtInputFld == NULL && rTxtAttr.End() != NULL )
+ {
+ pTxtInputFld = dynamic_cast<const SwTxtInputFld*>(GetTxtAttrAt( *(rTxtAttr.End()), RES_TXTATR_INPUTFIELD, PARENT ));
+ }
+
+ return pTxtInputFld;
+}
+
+SwTxtFld* SwTxtNode::GetFldTxtAttrAt(
+ const xub_StrLen nIndex,
+ const bool bIncludeInputFldAtStart ) const
+{
+ SwTxtFld* pTxtFld = NULL;
+
+ pTxtFld = dynamic_cast<SwTxtFld*>(GetTxtAttrForCharAt( nIndex, RES_TXTATR_FIELD ));
+ if ( pTxtFld == NULL )
+ {
+ pTxtFld =
+ dynamic_cast<SwTxtFld*>( GetTxtAttrAt(
+ nIndex,
+ RES_TXTATR_INPUTFIELD,
+ bIncludeInputFldAtStart ? DEFAULT : PARENT ));
+ }
+
+ return pTxtFld;
+}
+
+
/*************************************************************************
* CopyHint()
*************************************************************************/
@@ -1291,77 +1348,80 @@ SwCharFmt* lcl_FindCharFmt( const SwCharFmts* pCharFmts, const XubString& rName
return NULL;
}
-void lcl_CopyHint( const sal_uInt16 nWhich, const SwTxtAttr * const pHt,
- SwTxtAttr *const pNewHt, SwDoc *const pOtherDoc, SwTxtNode *const pDest )
+void lcl_CopyHint(
+ const sal_uInt16 nWhich,
+ const SwTxtAttr * const pHt,
+ SwTxtAttr *const pNewHt,
+ SwDoc *const pOtherDoc,
+ SwTxtNode *const pDest )
{
ASSERT( nWhich == pHt->Which(), "Falsche Hint-Id" );
switch( nWhich )
{
- // copy nodesarray section with footnote content
- case RES_TXTATR_FTN :
+ // copy nodesarray section with footnote content
+ case RES_TXTATR_FTN :
ASSERT(pDest, "lcl_CopyHint: no destination text node?");
- static_cast<const SwTxtFtn*>(pHt)->CopyFtn(
- *static_cast<SwTxtFtn*>(pNewHt), *pDest);
+ static_cast<const SwTxtFtn*>(pHt)->CopyFtn( *static_cast<SwTxtFtn*>(pNewHt), *pDest);
break;
- // Beim Kopieren von Feldern in andere Dokumente
- // muessen die Felder bei ihren neuen Feldtypen angemeldet werden.
+ // Beim Kopieren von Feldern in andere Dokumente
+ // muessen die Felder bei ihren neuen Feldtypen angemeldet werden.
- // TabellenFormel muessen relativ kopiert werden.
- case RES_TXTATR_FIELD :
+ // TabellenFormel muessen relativ kopiert werden.
+ case RES_TXTATR_FIELD :
+ case RES_TXTATR_INPUTFIELD :
+ {
+ if( pOtherDoc )
{
- const SwFmtFld& rFld = pHt->GetFmtFld();
- if( pOtherDoc )
- {
- static_cast<const SwTxtFld*>(pHt)->CopyFld(
- static_cast<SwTxtFld*>(pNewHt) );
- }
+ static_cast<const SwTxtFld*>(pHt)->CopyTxtFld( static_cast<SwTxtFld*>(pNewHt) );
+ }
- // Tabellenformel ??
- if( RES_TABLEFLD == rFld.GetField()->GetTyp()->Which()
- && static_cast<const SwTblField*>(rFld.GetField())->IsIntrnlName())
+ // Tabellenformel ??
+ const SwFmtFld& rFld = pHt->GetFmtFld();
+ if( RES_TABLEFLD == rFld.GetField()->GetTyp()->Which()
+ && static_cast<const SwTblField*>(rFld.GetField())->IsIntrnlName())
+ {
+ // wandel die interne in eine externe Formel um
+ const SwTableNode* const pDstTblNd =
+ static_cast<const SwTxtFld*>(pHt)->GetTxtNode().FindTableNode();
+ if( pDstTblNd )
{
- // wandel die interne in eine externe Formel um
- const SwTableNode* const pDstTblNd =
- static_cast<const SwTxtFld*>(pHt)->GetTxtNode().FindTableNode();
- if( pDstTblNd )
- {
- SwTblField* const pTblFld = const_cast<SwTblField*>(
- static_cast<const SwTblField*>(pNewHt->GetFmtFld().GetField()));
- pTblFld->PtrToBoxNm( &pDstTblNd->GetTable() );
- }
+ SwTblField* const pTblFld = const_cast<SwTblField*>(
+ static_cast<const SwTblField*>(pNewHt->GetFmtFld().GetField()));
+ pTblFld->PtrToBoxNm( &pDstTblNd->GetTable() );
}
}
- break;
+ }
+ break;
- case RES_TXTATR_TOXMARK :
- if( pOtherDoc && pDest && pDest->GetpSwpHints()
- && USHRT_MAX != pDest->GetpSwpHints()->GetPos( pNewHt ) )
- {
- // Beim Kopieren von TOXMarks(Client) in andere Dokumente
- // muss der Verzeichnis (Modify) ausgetauscht werden
- static_cast<SwTxtTOXMark*>(pNewHt)->CopyTOXMark( pOtherDoc );
- }
- break;
+ case RES_TXTATR_TOXMARK :
+ if( pOtherDoc && pDest && pDest->GetpSwpHints()
+ && USHRT_MAX != pDest->GetpSwpHints()->GetPos( pNewHt ) )
+ {
+ // Beim Kopieren von TOXMarks(Client) in andere Dokumente
+ // muss der Verzeichnis (Modify) ausgetauscht werden
+ static_cast<SwTxtTOXMark*>(pNewHt)->CopyTOXMark( pOtherDoc );
+ }
+ break;
- case RES_TXTATR_CHARFMT :
- // Wenn wir es mit einer Zeichenvorlage zu tun haben,
- // muessen wir natuerlich auch die Formate kopieren.
- if( pDest && pDest->GetpSwpHints()
- && USHRT_MAX != pDest->GetpSwpHints()->GetPos( pNewHt ) )
- {
- SwCharFmt* pFmt =
- static_cast<SwCharFmt*>(pHt->GetCharFmt().GetCharFmt());
+ case RES_TXTATR_CHARFMT :
+ // Wenn wir es mit einer Zeichenvorlage zu tun haben,
+ // muessen wir natuerlich auch die Formate kopieren.
+ if( pDest && pDest->GetpSwpHints()
+ && USHRT_MAX != pDest->GetpSwpHints()->GetPos( pNewHt ) )
+ {
+ SwCharFmt* pFmt =
+ static_cast<SwCharFmt*>(pHt->GetCharFmt().GetCharFmt());
- if( pFmt && pOtherDoc )
- {
- pFmt = pOtherDoc->CopyCharFmt( *pFmt );
- }
- const_cast<SwFmtCharFmt&>( static_cast<const SwFmtCharFmt&>(
- pNewHt->GetCharFmt() ) ).SetCharFmt( pFmt );
+ if( pFmt && pOtherDoc )
+ {
+ pFmt = pOtherDoc->CopyCharFmt( *pFmt );
}
- break;
- case RES_TXTATR_INETFMT :
+ const_cast<SwFmtCharFmt&>( static_cast<const SwFmtCharFmt&>(
+ pNewHt->GetCharFmt() ) ).SetCharFmt( pFmt );
+ }
+ break;
+ case RES_TXTATR_INETFMT :
{
// Wenn wir es mit benutzerdefinierten INet-Zeichenvorlagen
// zu tun haben, muessen wir natuerlich auch die Formate kopieren.
@@ -1369,7 +1429,7 @@ void lcl_CopyHint( const sal_uInt16 nWhich, const SwTxtAttr * const pHt,
&& USHRT_MAX != pDest->GetpSwpHints()->GetPos( pNewHt ) )
{
const SwDoc* const pDoc = static_cast<const SwTxtINetFmt*>(pHt)
- ->GetTxtNode().GetDoc();
+ ->GetTxtNode().GetDoc();
if ( pDoc )
{
const SwCharFmts* pCharFmts = pDoc->GetCharFmts();
@@ -1396,13 +1456,13 @@ void lcl_CopyHint( const sal_uInt16 nWhich, const SwTxtAttr * const pHt,
pINetHt->GetCharFmt();
break;
}
- case RES_TXTATR_META:
- case RES_TXTATR_METAFIELD:
- OSL_ENSURE(pNewHt, "copying Meta should not fail!");
- OSL_ENSURE(pDest && (CH_TXTATR_INWORD ==
- pDest->GetTxt().GetChar(*pNewHt->GetStart())),
- "missing CH_TXTATR?");
- break;
+ case RES_TXTATR_META:
+ case RES_TXTATR_METAFIELD:
+ OSL_ENSURE( pNewHt, "copying Meta should not fail!" );
+ OSL_ENSURE( pDest
+ && (CH_TXTATR_INWORD == pDest->GetTxt().GetChar(*pNewHt->GetStart())),
+ "missing CH_TXTATR?");
+ break;
}
}
@@ -1428,34 +1488,33 @@ void SwTxtNode::CopyAttr( SwTxtNode *pDest, const xub_StrLen nTxtStartIdx,
SwTxtAttr *const pHt = m_pSwpHints->GetTextHint(i);
xub_StrLen const nAttrStartIdx = *pHt->GetStart();
if ( nTxtStartIdx < nAttrStartIdx )
- break; // ueber das Textende, da nLen == 0
+ break; // ueber das Textende, da nLen == 0
const xub_StrLen *const pEndIdx = pHt->GetEnd();
if ( pEndIdx && !pHt->HasDummyChar() )
{
- if( ( *pEndIdx > nTxtStartIdx ||
- ( *pEndIdx == nTxtStartIdx &&
- nAttrStartIdx == nTxtStartIdx ) ) )
+ if ( ( *pEndIdx > nTxtStartIdx
+ || ( *pEndIdx == nTxtStartIdx
+ && nAttrStartIdx == nTxtStartIdx ) ) )
{
sal_uInt16 const nWhich = pHt->Which();
if ( RES_TXTATR_REFMARK != nWhich )
{
// attribute in the area => copy
- SwTxtAttr *const pNewHt = pDest->InsertItem(
- pHt->GetAttr(), nOldPos, nOldPos,
- nsSetAttrMode::SETATTR_IS_COPY);
+ SwTxtAttr *const pNewHt =
+ pDest->InsertItem( pHt->GetAttr(), nOldPos, nOldPos, nsSetAttrMode::SETATTR_IS_COPY);
if ( pNewHt )
{
lcl_CopyHint( nWhich, pHt, pNewHt,
- pOtherDoc, pDest );
+ pOtherDoc, pDest );
}
}
- else if( !pOtherDoc ? GetDoc()->IsCopyIsMove()
- : 0 == pOtherDoc->GetRefMark(
- pHt->GetRefMark().GetRefName() ) )
+ else if( !pOtherDoc
+ ? GetDoc()->IsCopyIsMove()
+ : 0 == pOtherDoc->GetRefMark( pHt->GetRefMark().GetRefName() ) )
{
- pDest->InsertItem( pHt->GetAttr(), nOldPos, nOldPos,
- nsSetAttrMode::SETATTR_IS_COPY);
+ pDest->InsertItem(
+ pHt->GetAttr(), nOldPos, nOldPos, nsSetAttrMode::SETATTR_IS_COPY);
}
}
}
@@ -1476,7 +1535,6 @@ void SwTxtNode::CopyAttr( SwTxtNode *pDest, const xub_StrLen nTxtStartIdx,
|* wird angehaengt
*************************************************************************/
-// --> OD 2008-11-18 #i96213#
// introduction of new optional parameter to control, if all attributes have to be copied.
void SwTxtNode::CopyText( SwTxtNode *const pDest,
const SwIndex &rStart,
@@ -1486,16 +1544,13 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
SwIndex aIdx( pDest, pDest->m_Text.Len() );
CopyText( pDest, aIdx, rStart, nLen, bForceCopyOfAllAttrs );
}
-// <--
-// --> OD 2008-11-18 #i96213#
// introduction of new optional parameter to control, if all attributes have to be copied.
void SwTxtNode::CopyText( SwTxtNode *const pDest,
const SwIndex &rDestStart,
const SwIndex &rStart,
xub_StrLen nLen,
const bool bForceCopyOfAllAttrs )
-// <--
{
xub_StrLen nTxtStartIdx = rStart.GetIndex();
xub_StrLen nDestStart = rDestStart.GetIndex(); // alte Pos merken
@@ -1557,26 +1612,23 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
if ( !nLen ) // string not longer?
return;
- SwDoc* const pOtherDoc = (pDest->GetDoc() != GetDoc()) ?
- pDest->GetDoc() : 0;
+ SwDoc* const pOtherDoc = (pDest->GetDoc() != GetDoc()) ? pDest->GetDoc() : 0;
// harte Absatz umspannende Attribute kopieren
if( HasSwAttrSet() )
{
// alle, oder nur die CharAttribute ?
- // --> OD 2008-11-18 #i96213#
- if ( !bForceCopyOfAllAttrs &&
- ( nDestStart ||
- pDest->HasSwAttrSet() ||
- nLen != pDest->GetTxt().Len() ) )
- // <--
+ if ( !bForceCopyOfAllAttrs
+ && ( nDestStart
+ || pDest->HasSwAttrSet()
+ || nLen != pDest->GetTxt().Len() ) )
{
SfxItemSet aCharSet( pDest->GetDoc()->GetAttrPool(),
- RES_CHRATR_BEGIN, RES_CHRATR_END-1,
- RES_TXTATR_INETFMT, RES_TXTATR_INETFMT,
- RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT,
- RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
- 0 );
+ RES_CHRATR_BEGIN, RES_CHRATR_END-1,
+ RES_TXTATR_INETFMT, RES_TXTATR_INETFMT,
+ RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT,
+ RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
+ 0 );
aCharSet.Put( *GetpSwAttrSet() );
if( aCharSet.Count() )
{
@@ -1590,7 +1642,7 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
}
bool const bUndoNodes = !pOtherDoc
- && GetDoc()->GetIDocumentUndoRedo().IsUndoNodes(GetNodes());
+ && GetDoc()->GetIDocumentUndoRedo().IsUndoNodes(GetNodes());
// Ende erst jetzt holen, weil beim Kopieren in sich selbst der
// Start-Index und alle Attribute vorher aktualisiert werden.
@@ -1611,11 +1663,11 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
SwpHts aRefMrkArr;
sal_uInt16 nDeletedDummyChars(0);
- //Achtung: kann ungueltig sein!!
+ //Achtung: kann ungueltig sein!!
for (sal_uInt16 n = 0; ( n < nSize ); ++n)
{
const xub_StrLen nAttrStartIdx = *(*m_pSwpHints)[n]->GetStart();
- if (!( nAttrStartIdx < nEnd))
+ if ( !( nAttrStartIdx < nEnd) )
break;
SwTxtAttr * const pHt = m_pSwpHints->GetTextHint(n);
@@ -1628,16 +1680,32 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
// erkennen und sammeln, nach dem kopieren Loeschen.
// Nimmt sein Zeichen mit ins Grab !!
// JP 14.08.95: Duerfen RefMarks gemovt werden?
- int bCopyRefMark = RES_TXTATR_REFMARK == nWhich && ( bUndoNodes ||
- (!pOtherDoc ? GetDoc()->IsCopyIsMove()
- : 0 == pOtherDoc->GetRefMark(
- pHt->GetRefMark().GetRefName() )));
+ const bool bCopyRefMark = RES_TXTATR_REFMARK == nWhich
+ && ( bUndoNodes
+ || ( !pOtherDoc
+ ? GetDoc()->IsCopyIsMove()
+ : 0 == pOtherDoc->GetRefMark( pHt->GetRefMark().GetRefName() ) ) );
- if( pEndIdx && RES_TXTATR_REFMARK == nWhich && !bCopyRefMark )
+ if ( pEndIdx
+ && RES_TXTATR_REFMARK == nWhich
+ && !bCopyRefMark )
{
continue;
}
+ // Input Fields are only copied, if completely covered by copied text
+ if ( nWhich == RES_TXTATR_INPUTFIELD )
+ {
+ ASSERT( pEndIdx != NULL,
+ "<SwTxtNode::CopyText(..)> - RES_TXTATR_INPUTFIELD without EndIndex!" );
+ if ( nAttrStartIdx < nTxtStartIdx
+ || ( pEndIdx != NULL
+ && *(pEndIdx) > nEnd ) )
+ {
+ continue;
+ }
+ }
+
xub_StrLen nAttrStt;
xub_StrLen nAttrEnd;
@@ -1650,8 +1718,8 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
// attribute with extent and the end is in the selection
nAttrStt = nDestStart;
nAttrEnd = (*pEndIdx > nEnd)
- ? rDestStart.GetIndex()
- : nDestStart + (*pEndIdx) - nTxtStartIdx;
+ ? rDestStart.GetIndex()
+ : nDestStart + (*pEndIdx) - nTxtStartIdx;
}
else
{
@@ -1665,8 +1733,8 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
if( pEndIdx )
{
nAttrEnd = *pEndIdx > nEnd
- ? rDestStart.GetIndex()
- : nDestStart + ( *pEndIdx - nTxtStartIdx );
+ ? rDestStart.GetIndex()
+ : nDestStart + ( *pEndIdx - nTxtStartIdx );
}
else
{
@@ -2284,7 +2352,7 @@ void SwTxtNode::EraseText(const SwIndex &rIdx, const xub_StrLen nCount,
// 1. The hint ends before the deletion end position or
// 2. The hint ends at the deletion end position and
// we are not in empty expand mode and
- // the hint is a [toxmark|refmark|ruby] text attribute
+ // the hint is a [toxmark|refmark|ruby|inputfield] text attribute
// 3. deleting exactly the dummy char of an hint with end and dummy
// char deletes the hint
if ( (*pHtEndIdx < nEndIdx)
@@ -2292,16 +2360,9 @@ void SwTxtNode::EraseText(const SwIndex &rIdx, const xub_StrLen nCount,
!(IDocumentContentOperations::INS_EMPTYEXPAND & nMode) &&
( (RES_TXTATR_TOXMARK == nWhich) ||
(RES_TXTATR_REFMARK == nWhich) ||
- // --> FME 2006-03-03 #i62668# Ruby text attribute must be
- // treated just like toxmark and refmarks
- (RES_TXTATR_CJK_RUBY == nWhich) ) )
- // <--
-#if 0
- || ( (nHintStart == nStartIdx) &&
- (nHintStart + 1 == nEndIdx)&&
-#else // generalize this to left-overlapped dummy char hints (see ASSERT)
+ (RES_TXTATR_CJK_RUBY == nWhich) ||
+ (RES_TXTATR_INPUTFIELD == nWhich) ) )
|| ( (nHintStart < nEndIdx) &&
-#endif
pHt->HasDummyChar() )
)
{
@@ -2354,10 +2415,9 @@ void SwTxtNode::GCAttr()
return;
bool bChanged = false;
- sal_uInt16 nMin = m_Text.Len(),
- nMax = 0;
- sal_Bool bAll = nMin != 0; // Bei leeren Absaetzen werden nur die
- // INet-Formate entfernt.
+ sal_uInt16 nMin = m_Text.Len();
+ sal_uInt16 nMax = 0;
+ const bool bAll = nMin != 0; // Bei leeren Absaetzen werden nur die INet-Formate entfernt.
for ( sal_uInt16 i = 0; m_pSwpHints && i < m_pSwpHints->Count(); ++i )
{
@@ -2426,84 +2486,7 @@ SwNumRule* SwTxtNode::_GetNumRule(sal_Bool bInParent) const
}
}
}
-
- // --> OD 2006-11-20 #i71764#
- // Document setting OUTLINE_LEVEL_YIELDS_OUTLINE_RULE has no influence
- // any more.
-// if ( !pRet &&
-// GetDoc()->get(IDocumentSettingAccess::OUTLINE_LEVEL_YIELDS_OUTLINE_RULE) &&
-// GetOutlineLevel() != NO_NUMBERING )
-// {
-// pRet = GetDoc()->GetOutlineNumRule();
-// }
- // <--
}
- // old code before tuning
-// // --> OD 2005-10-25 #126347#
-// // determine of numbering/bullet rule, which is set as a hard attribute
-// // at the text node
-// const SfxPoolItem* pItem( 0L );
-// if ( HasSwAttrSet() ) // does text node has hard attributes ?
-// {
-// if ( SFX_ITEM_SET !=
-// GetpSwAttrSet()->GetItemState( RES_PARATR_NUMRULE, sal_False, &pItem ) )
-// {
-// pItem = 0L;
-// }
-// // else: <pItem> contains the numbering/bullet attribute, which is
-// // hard set at the paragraph.
-
-// }
-// // <--
-// bool bNoNumRule = false;
-// if (pItem)
-// {
-// String sNumRuleName = static_cast<const SwNumRuleItem *>(pItem)->GetValue();
-// if (sNumRuleName.Len() > 0)
-// {
-// pRet = GetDoc()->FindNumRulePtr(sNumRuleName);
-// }
-// else // numbering is turned off by hard attribute
-// bNoNumRule = true;
-// }
-
-// if (! bNoNumRule)
-// {
-// if (! pRet && bInParent)
-// {
-// SwTxtFmtColl * pColl = GetTxtColl();
-
-// if (pColl)
-// {
-// const SwNumRuleItem & rItem = pColl->GetNumRule(sal_True);
-
-// pRet = const_cast<SwDoc *>(GetDoc())->
-// FindNumRulePtrWithPool(rItem.GetValue());
-// // --> OD 2005-10-13 #125993# - The outline numbering rule
-// // isn't allowed to be derived from a parent paragraph style
-// // to a derived one.
-// // Thus check, if the found outline numbering rule is directly
-// // set at the paragraph style <pColl>. If not, don't return
-// // the outline numbering rule.
-// if ( pRet && pRet == GetDoc()->GetOutlineNumRule() )
-// {
-// const SwNumRuleItem& rDirectItem = pColl->GetNumRule(sal_False);
-// SwNumRule* pNumRuleAtParaStyle = const_cast<SwDoc*>(GetDoc())->
-// FindNumRulePtrWithPool(rDirectItem.GetValue());
-// if ( !pNumRuleAtParaStyle )
-// {
-// pRet = 0L;
-// }
-// }
-// // <--
-// }
-// }
-
-// if (!pRet && GetDoc()->IsOutlineLevelYieldsOutlineRule() &&
-// GetOutlineLevel() != NO_NUMBERING)
-// pRet = GetDoc()->GetOutlineNumRule();
-// }
- // <--
return pRet;
}
@@ -2712,7 +2695,6 @@ SwCntntNode* SwTxtNode::AppendNode( const SwPosition & rPos )
SwNodeIndex aIdx( rPos.nNode, 1 );
SwTxtNode* pNew = _MakeNewTxtNode( aIdx, sal_True );
- // --> OD 2008-05-14 #refactorlists#
// reset list attributes at appended text node
pNew->ResetAttr( RES_PARATR_LIST_ISRESTART );
pNew->ResetAttr( RES_PARATR_LIST_RESTARTVALUE );
@@ -2722,14 +2704,11 @@ SwCntntNode* SwTxtNode::AppendNode( const SwPosition & rPos )
pNew->ResetAttr( RES_PARATR_LIST_ID );
pNew->ResetAttr( RES_PARATR_LIST_LEVEL );
}
- // <--
- // --> OD 2008-03-13 #refactorlists#
-// SyncNumberAndNumRule();
+
if ( !IsInList() && GetNumRule() && GetListId().Len() > 0 )
{
AddToList();
}
- // <--
if( GetDepends() )
MakeFrms( *pNew );
@@ -2740,7 +2719,8 @@ SwCntntNode* SwTxtNode::AppendNode( const SwPosition & rPos )
* SwTxtNode::GetTxtAttr
*************************************************************************/
-SwTxtAttr * SwTxtNode::GetTxtAttrForCharAt( const xub_StrLen nIndex,
+SwTxtAttr * SwTxtNode::GetTxtAttrForCharAt(
+ const xub_StrLen nIndex,
const RES_TXTATR nWhich ) const
{
if ( HasHints() )
@@ -2756,7 +2736,7 @@ SwTxtAttr * SwTxtNode::GetTxtAttrForCharAt( const xub_StrLen nIndex,
if ( (nIndex == nStartPos) && pHint->HasDummyChar() )
{
return ( RES_TXTATR_END == nWhich || nWhich == pHint->Which() )
- ? pHint : 0;
+ ? pHint : 0;
}
}
}
@@ -3092,6 +3072,11 @@ XubString SwTxtNode::GetExpandTxt( const xub_StrLen nIdx,
XubString aTxt( GetTxt().Copy( nIdx, nLen ) );
xub_StrLen nTxtStt = nIdx;
Replace0xFF( aTxt, nTxtStt, aTxt.Len(), sal_True );
+
+ // remove dummy characters of Input Fields
+ aTxt.EraseAllChars( CH_TXT_ATR_INPUTFIELDSTART );
+ aTxt.EraseAllChars( CH_TXT_ATR_INPUTFIELDEND );
+
if( bWithNum )
{
XubString aListLabelStr = GetNumString();
@@ -3145,6 +3130,11 @@ sal_Bool SwTxtNode::GetExpandTxt( SwTxtNode& rDestNd, const SwIndex* pDestIdx,
SwScriptInfo::MaskHiddenRanges( *this, sTmpText, 0, sTmpText.Len(), cChar );
sTmpText = sTmpText.Copy( nIdx, nLen );
+ // remove dummy characters of Input Fields
+ {
+ sTmpText.EraseAllChars( CH_TXT_ATR_INPUTFIELDSTART );
+ sTmpText.EraseAllChars( CH_TXT_ATR_INPUTFIELDEND );
+ }
rDestNd.InsertText( sTmpText, aDestIdx );
nLen = aDestIdx.GetIndex() - nDestStt;
@@ -3160,7 +3150,7 @@ sal_Bool SwTxtNode::GetExpandTxt( SwTxtNode& rDestNd, const SwIndex* pDestIdx,
if (nIdx + nLen <= nAttrStartIdx)
break; // ueber das Textende
- const xub_StrLen *pEndIdx = pHt->GetEnd();
+ const xub_StrLen *pEndIdx = pHt->End();
if( pEndIdx && *pEndIdx > nIdx &&
( RES_CHRATR_FONT == nWhich ||
RES_TXTATR_CHARFMT == nWhich ||
@@ -3470,19 +3460,12 @@ namespace {
bParagraphStyleChanged = true;
if( rTxtNode.GetNodes().IsDocNodes() )
{
- // --> OD 2008-12-17 #i70748#
- // The former list style set at the paragraph can not be
- // retrieved from the change set.
-// sOldNumRule =
-// dynamic_cast<const SwFmtChg*>(pOldValue)->pChangedFmt->GetNumRule().GetValue();
const SwNumRule* pFormerNumRuleAtTxtNode =
rTxtNode.GetNum() ? rTxtNode.GetNum()->GetNumRule() : 0;
if ( pFormerNumRuleAtTxtNode )
{
sOldNumRule = pFormerNumRuleAtTxtNode->GetName();
}
- // <--
- // --> OD 2008-11-19 #i70748#
if ( rTxtNode.IsEmptyListStyleDueToSetOutlineLevelAttr() )
{
const SwNumRuleItem& rNumRuleItem = rTxtNode.GetTxtColl()->GetNumRule();
@@ -3491,7 +3474,6 @@ namespace {
rTxtNode.ResetEmptyListStyleDueToResetOutlineLevelAttr();
}
}
- // <--
const SwNumRule* pNumRuleAtTxtNode = rTxtNode.GetNumRule();
if ( pNumRuleAtTxtNode )
{
@@ -3504,80 +3486,45 @@ namespace {
case RES_ATTRSET_CHG:
{
const SfxPoolItem* pItem = 0;
- // --> OD 2008-12-19 #i70748#
- // The former list style set at the paragraph can not be
- // retrieved from the change set.
-// if ( dynamic_cast<const SwAttrSetChg*>(pOldValue)->GetChgSet()->GetItemState( RES_PARATR_NUMRULE, sal_False, &pItem ) ==
-// SFX_ITEM_SET )
-// {
-// sOldNumRule = dynamic_cast<const SwNumRuleItem*>(pItem)->GetValue();
-// }
const SwNumRule* pFormerNumRuleAtTxtNode =
rTxtNode.GetNum() ? rTxtNode.GetNum()->GetNumRule() : 0;
if ( pFormerNumRuleAtTxtNode )
{
sOldNumRule = pFormerNumRuleAtTxtNode->GetName();
}
- // <--
if ( dynamic_cast<const SwAttrSetChg*>(pNewValue)->GetChgSet()->GetItemState( RES_PARATR_NUMRULE, sal_False, &pItem ) ==
SFX_ITEM_SET )
{
- // --> OD 2008-11-19 #i70748#
rTxtNode.ResetEmptyListStyleDueToResetOutlineLevelAttr();
- // <--
bNumRuleSet = true;
- // The new list style set at the paragraph can not be
- // retrieved from the change set.
-// sNumRule = dynamic_cast<const SwNumRuleItem*>(pItem)->GetValue();
- // <--
}
- // --> OD 2008-12-17 #i70748#
- // The new list style set at the paragraph.
const SwNumRule* pNumRuleAtTxtNode = rTxtNode.GetNumRule();
if ( pNumRuleAtTxtNode )
{
sNumRule = pNumRuleAtTxtNode->GetName();
}
- // <--
break;
}
case RES_PARATR_NUMRULE:
{
if ( rTxtNode.GetNodes().IsDocNodes() )
{
- // The former list style set at the paragraph can not be
- // retrieved from the change set.
-// if ( pOldValue )
-// {
-// sOldNumRule = dynamic_cast<const SwNumRuleItem*>(pOldValue)->GetValue();
-// }
const SwNumRule* pFormerNumRuleAtTxtNode =
rTxtNode.GetNum() ? rTxtNode.GetNum()->GetNumRule() : 0;
if ( pFormerNumRuleAtTxtNode )
{
sOldNumRule = pFormerNumRuleAtTxtNode->GetName();
}
- // <--
if ( pNewValue )
{
- // --> OD 2008-11-19 #i70748#
rTxtNode.ResetEmptyListStyleDueToResetOutlineLevelAttr();
- // <--
bNumRuleSet = true;
- // --> OD 2008-12-17 #i70748#
- // The new list style set at the paragraph can not be
- // retrieved from the change set.
-// sNumRule = dynamic_cast<const SwNumRuleItem*>(pNewValue)->GetValue();
- // <--
}
- // --> OD 2008-12-17 #i70748#
- // The new list style set at the paragraph.
const SwNumRule* pNumRuleAtTxtNode = rTxtNode.GetNumRule();
if ( pNumRuleAtTxtNode )
{
sNumRule = pNumRuleAtTxtNode->GetName();
}
- // <--
}
break;
}
@@ -3598,12 +3545,10 @@ namespace {
aResetAttrsArray.Insert( RES_PARATR_LIST_RESTARTVALUE );
aResetAttrsArray.Insert( RES_PARATR_LIST_ISCOUNTED );
SwPaM aPam( rTxtNode );
- // --> OD 2008-11-28 #i96644#
// suppress side effect "send data changed events"
rTxtNode.GetDoc()->ResetAttrs( aPam, sal_False,
&aResetAttrsArray,
false );
- // <--
}
}
else
@@ -3614,12 +3559,9 @@ namespace {
if ( sNumRule ==
String::CreateFromAscii( SwNumRule::GetOutlineRuleName() ) )
{
- // --> OD 2008-09-10 #i70748#
ASSERT( rTxtNode.GetTxtColl()->IsAssignedToListLevelOfOutlineStyle(),
"<HandleModifyAtTxtNode()> - text node with outline style, but its paragraph style is not assigned to outline style." );
- int nNewListLevel =
- rTxtNode.GetTxtColl()->GetAssignedOutlineStyleLevel();
- // <--
+ const int nNewListLevel = rTxtNode.GetTxtColl()->GetAssignedOutlineStyleLevel();
if ( 0 <= nNewListLevel && nNewListLevel < MAXLEVEL )
{
rTxtNode.SetAttrListLevel( nNewListLevel );
@@ -3640,18 +3582,13 @@ namespace {
aResetAttrsArray.Insert( RES_PARATR_LIST_RESTARTVALUE );
aResetAttrsArray.Insert( RES_PARATR_LIST_ISCOUNTED );
SwPaM aPam( rTxtNode );
- // --> OD 2008-11-28 #i96644#
- // suppress side effect "send data changed events"
rTxtNode.GetDoc()->ResetAttrs( aPam, sal_False,
&aResetAttrsArray,
false );
- // <--
- // --> OD 2008-11-19 #i70748#
if ( dynamic_cast<const SfxUInt16Item &>(rTxtNode.GetAttr( RES_PARATR_OUTLINELEVEL, sal_False )).GetValue() > 0 )
{
rTxtNode.SetEmptyListStyleDueToSetOutlineLevelAttr();
}
- // <--
}
}
}
@@ -3659,7 +3596,6 @@ namespace {
{
rTxtNode.AddToList();
}
- // <--
}
// End of method <HandleModifyAtTxtNode>
}
@@ -5068,16 +5004,19 @@ SwTxtNode::MakeUnoObject()
SwXParagraph::CreateXParagraph(*GetDoc(), *this), uno::UNO_QUERY);
return xMeta;
}
+
//Bug 120881:Modify here for Directly Page Numbering
bool SwTxtNode::HasPageNumberField()
{
- xub_StrLen nEnd = Len();
- for(xub_StrLen nStart=0;nStart<nEnd;nStart++)
+ const xub_StrLen nEnd = Len();
+ for( xub_StrLen nStart = 0; nStart < nEnd; ++nStart )
{
- const SwTxtFld* pFld = GetTxtFld(nStart);
- const SwField* pSwField = pFld
- ? pFld->GetFmtFld().GetField()
- : NULL;
+ const SwTxtAttr* pTxtAttr = GetTxtAttrAt( nStart, RES_TXTATR_FIELD );
+ if ( pTxtAttr == NULL )
+ {
+ continue;
+ }
+ const SwField* pSwField = pTxtAttr->GetFmtFld().GetField();
const SwFieldType* pType = pSwField
? pSwField->GetTyp()
: NULL;
diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx
index 97ac87a1c5c1..03bf0b1f067f 100644
--- a/sw/source/core/txtnode/swfont.cxx
+++ b/sw/source/core/txtnode/swfont.cxx
@@ -441,6 +441,7 @@ SwFont::SwFont( const SwFont &rFont )
nToxCnt = 0;
nRefCnt = 0;
m_nMetaCount = 0;
+ m_nInputFieldCount = 0;
bFntChg = rFont.bFntChg;
bOrgChg = rFont.bOrgChg;
bPaintBlank = rFont.bPaintBlank;
@@ -459,6 +460,7 @@ SwFont::SwFont( const SwAttrSet* pAttrSet,
nToxCnt = 0;
nRefCnt = 0;
m_nMetaCount = 0;
+ m_nInputFieldCount = 0;
bPaintBlank = sal_False;
bPaintWrong = sal_False;
bURL = sal_False;
@@ -590,6 +592,7 @@ SwFont& SwFont::operator=( const SwFont &rFont )
nToxCnt = 0;
nRefCnt = 0;
m_nMetaCount = 0;
+ m_nInputFieldCount = 0;
bFntChg = rFont.bFntChg;
bOrgChg = rFont.bOrgChg;
bPaintBlank = rFont.bPaintBlank;
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index 451f57ff4348..35ce95c25ef4 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -123,7 +123,7 @@ struct TxtAttrContains
TxtAttrContains( const xub_StrLen nPos ) : m_nPos( nPos ) { }
bool operator() (SwTxtAttrEnd * const pAttr)
{
- return (*pAttr->GetStart() < m_nPos) && (m_nPos < *pAttr->GetEnd());
+ return (*pAttr->GetStart() < m_nPos) && (m_nPos < *pAttr->End());
}
};
@@ -167,7 +167,8 @@ static
bool isSelfNestable(const sal_uInt16 nWhich)
{
if ((RES_TXTATR_INETFMT == nWhich) ||
- (RES_TXTATR_CJK_RUBY == nWhich))
+ (RES_TXTATR_CJK_RUBY == nWhich) ||
+ (RES_TXTATR_INPUTFIELD == nWhich))
return false;
ASSERT((RES_TXTATR_META == nWhich) ||
(RES_TXTATR_METAFIELD == nWhich), "???");
@@ -181,7 +182,8 @@ bool isSplittable(const sal_uInt16 nWhich)
(RES_TXTATR_CJK_RUBY == nWhich))
return true;
ASSERT((RES_TXTATR_META == nWhich) ||
- (RES_TXTATR_METAFIELD == nWhich), "???");
+ (RES_TXTATR_METAFIELD == nWhich) ||
+ (RES_TXTATR_INPUTFIELD == nWhich), "???");
return false;
}
@@ -202,8 +204,10 @@ splitPolicy(const sal_uInt16 nWhichNew, const sal_uInt16 nWhichOther)
}
else
{
- if ((RES_TXTATR_INETFMT == nWhichNew) &&
- (RES_TXTATR_CJK_RUBY == nWhichOther))
+ if ( RES_TXTATR_INPUTFIELD == nWhichNew )
+ return FAIL;
+ else if ( (RES_TXTATR_INETFMT == nWhichNew) &&
+ (RES_TXTATR_CJK_RUBY == nWhichOther) )
return SPLIT_NEW;
else
return SPLIT_OTHER;
@@ -362,14 +366,14 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint )
const sal_uInt16 nNewWhich( rNewHint.Which() );
const xub_StrLen nNewStart( *rNewHint.GetStart() );
const xub_StrLen nNewEnd ( *rNewHint.GetEnd() );
-//??? const bool bNoLengthAttribute( nNewStart == nNewEnd );
const bool bNewSelfNestable( isSelfNestable(nNewWhich) );
ASSERT( (RES_TXTATR_INETFMT == nNewWhich) ||
(RES_TXTATR_CJK_RUBY == nNewWhich) ||
(RES_TXTATR_META == nNewWhich) ||
- (RES_TXTATR_METAFIELD == nNewWhich),
- "TryInsertNesting: Expecting INETFMT or RUBY or META or METAFIELD" );
+ (RES_TXTATR_METAFIELD == nNewWhich) ||
+ (RES_TXTATR_INPUTFIELD == nNewWhich),
+ "TryInsertNesting: Expecting INETFMT or RUBY or META or METAFIELD or INPUTFIELD" );
NestList_t OverlappingExisting; // existing hints to be split
NestList_t OverwrittenExisting; // existing hints to be replaced
@@ -681,7 +685,7 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint,
continue;
const xub_StrLen nOtherStart = *pOther->GetStart();
- const xub_StrLen nOtherEnd = *pOther->GetEnd();
+ const xub_StrLen nOtherEnd = *pOther->End();
aBounds.insert( nOtherStart );
aBounds.insert( nOtherEnd );
@@ -989,9 +993,13 @@ SwTxtAttr* MakeRedlineTxtAttr( SwDoc & rDoc, SfxPoolItem & rAttr )
}
// create new text attribute
-SwTxtAttr* MakeTxtAttr( SwDoc & rDoc, SfxPoolItem& rAttr,
- xub_StrLen const nStt, xub_StrLen const nEnd,
- CopyOrNew_t const bIsCopy, SwTxtNode *const pTxtNode)
+SwTxtAttr* MakeTxtAttr(
+ SwDoc & rDoc,
+ SfxPoolItem& rAttr,
+ xub_StrLen const nStt,
+ xub_StrLen const nEnd,
+ CopyOrNew_t const bIsCopy,
+ SwTxtNode *const pTxtNode )
{
if ( isCHRATR(rAttr.Which()) )
{
@@ -1041,6 +1049,9 @@ SwTxtAttr* MakeTxtAttr( SwDoc & rDoc, SfxPoolItem& rAttr,
case RES_TXTATR_FIELD:
pNew = new SwTxtFld( static_cast<SwFmtFld &>(rNew), nStt );
break;
+ case RES_TXTATR_INPUTFIELD:
+ pNew = new SwTxtInputFld( static_cast<SwFmtFld &>(rNew), nStt, nEnd );
+ break;
case RES_TXTATR_FLYCNT:
{
// erst hier wird das Frame-Format kopiert (mit Inhalt) !!
@@ -1126,6 +1137,7 @@ void SwTxtNode::DestroyAttr( SwTxtAttr* pAttr )
break;
case RES_TXTATR_FIELD:
+ case RES_TXTATR_INPUTFIELD:
if( !pDoc->IsInDtor() )
{
// Wenn wir ein HiddenParaField sind, dann muessen wir
@@ -1228,7 +1240,7 @@ SwTxtNode::InsertItem( SfxPoolItem& rAttr,
// take ownership of pAttr; if insertion fails, delete pAttr
bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode )
{
- sal_Bool bHiddenPara = sal_False;
+ bool bHiddenPara = false;
ASSERT( pAttr && *pAttr->GetStart() <= Len(), "StartIdx out of bounds!" );
ASSERT( !pAttr->GetEnd() || (*pAttr->GetEnd() <= Len()),
@@ -1250,7 +1262,7 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode )
sal_uInt16 nInsMode = nMode;
switch( pAttr->Which() )
{
- case RES_TXTATR_FLYCNT:
+ case RES_TXTATR_FLYCNT:
{
SwTxtFlyCnt *pFly = (SwTxtFlyCnt *)pAttr;
SwFrmFmt* pFmt = pAttr->GetFlyCnt().GetFrmFmt();
@@ -1264,7 +1276,7 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode )
// erfolgen (Fehleranfaellig !)
const SwFmtAnchor* pAnchor = 0;
pFmt->GetItemState( RES_ANCHOR, sal_False,
- (const SfxPoolItem**)&pAnchor );
+ (const SfxPoolItem**)&pAnchor );
SwIndex aIdx( this, *pAttr->GetStart() );
const sal_Unicode c = GetCharOfTxtAttr(*pAttr);
@@ -1325,7 +1337,7 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode )
break;
}
- case RES_TXTATR_FTN :
+ case RES_TXTATR_FTN :
{
// Fussnoten, man kommt an alles irgendwie heran.
// CntntNode erzeugen und in die Inserts-Section stellen
@@ -1343,10 +1355,10 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode )
{
// loesche das Zeichen aus dem String !
ASSERT( ( CH_TXTATR_BREAKWORD ==
- m_Text.GetChar(*pAttr->GetStart() ) ||
- CH_TXTATR_INWORD ==
- m_Text.GetChar(*pAttr->GetStart())),
- "where is my attribute character?" );
+ m_Text.GetChar(*pAttr->GetStart() ) ||
+ CH_TXTATR_INWORD ==
+ m_Text.GetChar(*pAttr->GetStart())),
+ "where is my attribute character?" );
m_Text.Erase( *pAttr->GetStart(), 1 );
// Indizies Updaten
SwIndex aTmpIdx( this, *pAttr->GetStart() );
@@ -1403,8 +1415,8 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode )
pDoc->GetFtnIdxs().Remove( n );
break;
}
- // wenn ueber Undo der StartNode gesetzt wurde, kann
- // der Index noch gar nicht in der Verwaltung stehen !!
+ // wenn ueber Undo der StartNode gesetzt wurde, kann
+ // der Index noch gar nicht in der Verwaltung stehen !!
}
if( !pTxtFtn )
pTxtFtn = (SwTxtFtn*)pAttr;
@@ -1434,9 +1446,10 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode )
{
// fuer HiddenParaFields Benachrichtigungsmechanismus
// anwerfen
- if( RES_HIDDENPARAFLD ==
- pAttr->GetFmtFld().GetField()->GetTyp()->Which() )
- bHiddenPara = sal_True;
+ if( RES_HIDDENPARAFLD == pAttr->GetFmtFld().GetField()->GetTyp()->Which() )
+ {
+ bHiddenPara = true;
+ }
}
break;
@@ -1459,25 +1472,144 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode )
}
}
+ // handle attributes which provide content
+ xub_StrLen nEnd = nStart;
+ bool bInputFieldStartCharInserted = false;
+ bool bInputFieldEndCharInserted = false;
+ const bool bHasContent( pAttr->HasContent() );
+ if ( bHasContent )
+ {
+ switch( pAttr->Which() )
+ {
+ case RES_TXTATR_INPUTFIELD:
+ {
+ SwTxtInputFld* pTxtInputFld = dynamic_cast<SwTxtInputFld*>(pAttr);
+ if ( pTxtInputFld )
+ {
+ if( !(nsSetAttrMode::SETATTR_NOTXTATRCHR & nMode) )
+ {
+ SwIndex aIdx( this, *pAttr->GetStart() );
+ InsertText( CH_TXT_ATR_INPUTFIELDSTART, aIdx, nInsertFlags );
+ const String aContent = pTxtInputFld->GetFieldContent();
+ InsertText( aContent, aIdx, nInsertFlags );
+ InsertText( CH_TXT_ATR_INPUTFIELDEND, aIdx, nInsertFlags );
+
+ xub_StrLen * const pEnd(pAttr->GetEnd());
+ ASSERT( pEnd != NULL, "<SwTxtNode::InsertHint(..)> - missing end of RES_TXTATR_INPUTFIELD!" );
+ if ( pEnd != NULL )
+ {
+ *pEnd = *pEnd + 2 + aContent.Len();
+ nEnd = *pEnd;
+ }
+ }
+ else
+ {
+ // assure that CH_TXT_ATR_INPUTFIELDSTART and CH_TXT_ATR_INPUTFIELDEND are inserted.
+ if ( m_Text.GetChar( *(pAttr->GetStart()) ) != CH_TXT_ATR_INPUTFIELDSTART )
+ {
+ SwIndex aIdx( this, *pAttr->GetStart() );
+ InsertText( CH_TXT_ATR_INPUTFIELDSTART, aIdx, nInsertFlags );
+ bInputFieldStartCharInserted = true;
+ xub_StrLen * const pEnd(pAttr->GetEnd());
+ ASSERT( pEnd != NULL, "<SwTxtNode::InsertHint(..)> - missing end of RES_TXTATR_INPUTFIELD!" );
+ if ( pEnd != NULL )
+ {
+ *pEnd = *pEnd + 1;
+ nEnd = *pEnd;
+ }
+ }
+
+ xub_StrLen * const pEnd(pAttr->GetEnd());
+ ASSERT( pEnd != NULL, "<SwTxtNode::InsertHint(..)> - missing end of RES_TXTATR_INPUTFIELD!" );
+ if ( pEnd != NULL
+ && m_Text.GetChar( *(pEnd) - 1 ) != CH_TXT_ATR_INPUTFIELDEND )
+ {
+ SwIndex aIdx( this, *(pEnd) );
+ InsertText( CH_TXT_ATR_INPUTFIELDEND, aIdx, nInsertFlags );
+ bInputFieldEndCharInserted = true;
+ *pEnd = *pEnd + 1;
+ nEnd = *pEnd;
+ }
+ }
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
GetOrCreateSwpHints();
+ // handle overlap with an existing InputField
+ bool bInsertHint = true;
+ {
+ const SwTxtInputFld* pTxtInputFld = GetOverlappingInputFld( *pAttr );
+ if ( pTxtInputFld != NULL )
+ {
+ if ( pAttr->End() == NULL )
+ {
+ bInsertHint = false;
+ }
+ else
+ {
+ if ( *(pAttr->GetStart()) > *(pTxtInputFld->GetStart()) )
+ {
+ *(pAttr->GetStart()) = *(pTxtInputFld->GetStart());
+ }
+ if ( *(pAttr->End()) < *(pTxtInputFld->End()) )
+ {
+ *(pAttr->GetEnd()) = *(pTxtInputFld->End());
+ }
+ }
+ }
+ }
+
// 4263: AttrInsert durch TextInsert => kein Adjust
- const bool bRet = m_pSwpHints->TryInsertHint( pAttr, *this, nMode );
+ const bool bRet = bInsertHint
+ ? m_pSwpHints->TryInsertHint( pAttr, *this, nMode )
+ : false;
- if (!bRet && bDummyChar)
+ if ( !bRet )
{
- // undo insertion of dummy character
- // N.B. cannot insert the dummy character after inserting the hint,
- // because if the hint has no extent it will be moved in InsertText,
- // resulting in infinite recursion
- if ( !(nsSetAttrMode::SETATTR_NOTXTATRCHR & nMode) )
+ if ( bDummyChar
+ && !(nsSetAttrMode::SETATTR_NOTXTATRCHR & nMode) )
{
+ // undo insertion of dummy character
+ // N.B. cannot insert the dummy character after inserting the hint,
+ // because if the hint has no extent it will be moved in InsertText,
+ // resulting in infinite recursion
ASSERT( ( CH_TXTATR_BREAKWORD == m_Text.GetChar(nStart) ||
- CH_TXTATR_INWORD == m_Text.GetChar(nStart) ),
- "where is my attribute character?" );
+ CH_TXTATR_INWORD == m_Text.GetChar(nStart) ),
+ "where is my attribute character?" );
SwIndex aIdx( this, nStart );
EraseText( aIdx, 1 );
}
+
+ if ( bHasContent )
+ {
+ if ( !(nsSetAttrMode::SETATTR_NOTXTATRCHR & nMode)
+ && (nEnd - nStart) > 0 )
+ {
+ SwIndex aIdx( this, nStart );
+ EraseText( aIdx, (nEnd - nStart) );
+ }
+ else
+ {
+ if ( bInputFieldEndCharInserted
+ && (nEnd - nStart) > 0 )
+ {
+ SwIndex aIdx( this, nEnd - 1 );
+ EraseText( aIdx, 1 );
+ }
+
+ if ( bInputFieldStartCharInserted )
+ {
+ SwIndex aIdx( this, nStart );
+ EraseText( aIdx, 1 );
+ }
+ }
+ }
}
if ( bHiddenPara )
@@ -1508,6 +1640,12 @@ void SwTxtNode::DeleteAttribute( SwTxtAttr * const pAttr )
// erase the CH_TXTATR, which will also delete pAttr
EraseText( aIdx, 1 );
}
+ else if ( pAttr->HasContent() )
+ {
+ const SwIndex aIdx( this, *pAttr->GetStart() );
+ ASSERT( pAttr->End() != NULL, "<SwTxtNode::DeleteAttribute(..)> - missing End() at <SwTxtAttr> instance which has content" );
+ EraseText( aIdx, *pAttr->End() - *pAttr->GetStart() );
+ }
else
{
// create MsgHint before start/end become invalid
@@ -1526,8 +1664,10 @@ void SwTxtNode::DeleteAttribute( SwTxtAttr * const pAttr )
*************************************************************************/
//FIXME: this does NOT respect SORT NUMBER (for CHARFMT)!
-void SwTxtNode::DeleteAttributes( const sal_uInt16 nWhich,
- const xub_StrLen nStart, const xub_StrLen nEnd )
+void SwTxtNode::DeleteAttributes(
+ const sal_uInt16 nWhich,
+ const xub_StrLen nStart,
+ const xub_StrLen nEnd )
{
if ( !HasHints() )
return;
@@ -1555,7 +1695,7 @@ void SwTxtNode::DeleteAttributes( const sal_uInt16 nWhich,
if ( SFX_ITEM_SET == pFmt->GetItemState( RES_CHRATR_HIDDEN, sal_True, &pItem ) )
SetCalcHiddenCharFlags();
}
- // --> FME 2007-03-16 #i75430# Recalc hidden flags if necessary
+ // Recalc hidden flags if necessary
else if ( nWhich == RES_TXTATR_AUTOFMT )
{
// Check if auto style contains hidden attribute:
@@ -1563,7 +1703,6 @@ void SwTxtNode::DeleteAttributes( const sal_uInt16 nWhich,
if ( pHiddenItem )
SetCalcHiddenCharFlags();
}
- // <--
xub_StrLen const * const pEndIdx = pTxtHt->GetEnd();
@@ -1574,6 +1713,12 @@ void SwTxtNode::DeleteAttributes( const sal_uInt16 nWhich,
// erase the CH_TXTATR, which will also delete pTxtHt
EraseText( aIdx, 1 );
}
+ else if ( pTxtHt->HasContent() )
+ {
+ const SwIndex aIdx( this, nStart );
+ ASSERT( pTxtHt->End() != NULL, "<SwTxtNode::DeleteAttributes(..)> - missing End() at <SwTxtAttr> instance which has content" );
+ EraseText( aIdx, *pTxtHt->End() - nStart );
+ }
else if( *pEndIdx == nEnd )
{
// den MsgHint jetzt fuettern, weil gleich sind
@@ -1681,8 +1826,11 @@ bool SwTxtNode::TryCharSetExpandToNum(const SfxItemSet& aCharSet)
// setze diese Attribute am TextNode. Wird der gesamte Bereich umspannt,
// dann setze sie nur im AutoAttrSet (SwCntntNode:: SetAttr)
-sal_Bool SwTxtNode::SetAttr( const SfxItemSet& rSet, xub_StrLen nStt,
- xub_StrLen nEnd, const SetAttrMode nMode )
+sal_Bool SwTxtNode::SetAttr(
+ const SfxItemSet& rSet,
+ const xub_StrLen nStt,
+ const xub_StrLen nEnd,
+ const SetAttrMode nMode )
{
if( !rSet.Count() )
return sal_False;
@@ -1760,7 +1908,7 @@ sal_Bool SwTxtNode::SetAttr( const SfxItemSet& rSet, xub_StrLen nStt,
static_cast<const SwFmtCharFmt*>(pItem)->GetCharFmt()))
{
SwIndex aIndex( this, nStt );
- RstAttr( aIndex, nEnd - nStt, RES_TXTATR_CHARFMT, 0 );
+ RstTxtAttr( aIndex, nEnd - nStt, RES_TXTATR_CHARFMT, 0 );
DontExpandFmt( aIndex );
}
else
@@ -1947,7 +2095,7 @@ sal_Bool SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd,
if( nAttrStart > nEnd ) // ueber den Bereich hinaus
break;
- const xub_StrLen* pAttrEnd = pHt->GetEnd();
+ const xub_StrLen* pAttrEnd = pHt->End();
if ( ! pAttrEnd ) // no attributes without end
continue;
@@ -1975,7 +2123,7 @@ sal_Bool SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd,
if( nAttrStart > nEnd ) // ueber den Bereich hinaus
break;
- const xub_StrLen* pAttrEnd = pHt->GetEnd();
+ const xub_StrLen* pAttrEnd = pHt->End();
if ( ! pAttrEnd ) // no attributes without end
continue;
@@ -2208,7 +2356,7 @@ lcl_CollectHintSpans(const SwpHints& i_rHints, const sal_uInt16 nLength,
const sal_uInt16 nWhich(pHint->Which());
if (nWhich == RES_TXTATR_CHARFMT || nWhich == RES_TXTATR_AUTOFMT)
{
- const AttrSpan_t aSpan(*pHint->GetStart(), *pHint->GetEnd());
+ const AttrSpan_t aSpan(*pHint->GetStart(), *pHint->End());
o_rSpanMap.insert(AttrSpanMap_t::value_type(aSpan, pHint));
// < not != because there may be multiple CHARFMT at same range
@@ -2555,7 +2703,7 @@ bool SwpHints::MergePortions( SwTxtNode& rNode )
{
const SwTxtAttr* p1 = (*aIter1).second;
const SwTxtAttr* p2 = (*aIter2).second;
- if ( *p1->GetEnd() < *p2->GetStart() || p1->Which() != p2->Which() || !(*p1 == *p2) )
+ if ( *p1->End() < *p2->GetStart() || p1->Which() != p2->Which() || !(*p1 == *p2) )
{
bMerge = false;
break;
@@ -2632,7 +2780,7 @@ void lcl_CheckSortNumber( const SwpHints& rHints, SwTxtCharFmt& rNewCharFmt )
if ( RES_TXTATR_CHARFMT == pOtherHt->Which() )
{
- const xub_StrLen nOtherEnd = *pOtherHt->GetEnd();
+ const xub_StrLen nOtherEnd = *pOtherHt->End();
if ( nOtherStart == nHtStart && nOtherEnd == nHtEnd )
{
@@ -2702,6 +2850,7 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode,
static_cast<SwTxtINetFmt*>(pHint)->InitINetFmt(rNode);
break;
case RES_TXTATR_FIELD:
+ case RES_TXTATR_INPUTFIELD:
{
sal_Bool bDelFirst = 0 != ((SwTxtFld*)pHint)->GetpTxtNode();
((SwTxtFld*)pHint)->ChgTxtNode( &rNode );
@@ -3023,6 +3172,7 @@ void SwTxtNode::ClearSwpHintsArr( bool bDelFields )
break;
case RES_TXTATR_FIELD:
+ case RES_TXTATR_INPUTFIELD:
if( bDelFields )
bDel = true;
break;
@@ -3071,7 +3221,7 @@ sal_uInt16 SwTxtNode::GetLang( const xub_StrLen nBegin, const xub_StrLen nLen,
if( nWhichId == nWhich ||
( ( pHt->IsCharFmtAttr() || RES_TXTATR_AUTOFMT == nWhich ) && CharFmt::IsItemIncluded( nWhichId, pHt ) ) )
{
- const xub_StrLen *pEndIdx = pHt->GetEnd();
+ const xub_StrLen *pEndIdx = pHt->End();
// Ueberlappt das Attribut den Bereich?
if( pEndIdx &&
diff --git a/sw/source/core/txtnode/txatbase.cxx b/sw/source/core/txtnode/txatbase.cxx
index 2a1f746f9097..75ddc60fc301 100644
--- a/sw/source/core/txtnode/txatbase.cxx
+++ b/sw/source/core/txtnode/txatbase.cxx
@@ -42,6 +42,7 @@ SwTxtAttr::SwTxtAttr( SfxPoolItem& rAttr, xub_StrLen nStart )
, m_bDontExpandStart( false )
, m_bNesting( false )
, m_bHasDummyChar( false )
+ , m_bHasContent( false )
{
}
diff --git a/sw/source/core/txtnode/txatritr.cxx b/sw/source/core/txtnode/txatritr.cxx
index 4c3e3074d080..e1c91ca2ee03 100644
--- a/sw/source/core/txtnode/txatritr.cxx
+++ b/sw/source/core/txtnode/txatritr.cxx
@@ -123,7 +123,7 @@ sal_Bool SwTxtAttrIterator::Next()
{
do {
const SwTxtAttr* pHt = (SwTxtAttr*)aStack[ 0 ];
- sal_uInt16 nEndPos = *pHt->GetEnd();
+ const sal_uInt16 nEndPos = *pHt->End();
if( nChgPos >= nEndPos )
aStack.Remove( 0 );
else
@@ -138,7 +138,7 @@ sal_Bool SwTxtAttrIterator::Next()
if( aStack.Count() )
{
const SwTxtAttr* pHt = (SwTxtAttr*)aStack[ 0 ];
- sal_uInt16 nEndPos = *pHt->GetEnd();
+ const sal_uInt16 nEndPos = *pHt->End();
if( nChgPos >= nEndPos )
{
nChgPos = nEndPos;
@@ -167,7 +167,7 @@ sal_Bool SwTxtAttrIterator::Next()
void SwTxtAttrIterator::AddToStack( const SwTxtAttr& rAttr )
{
void* pAdd = (void*)&rAttr;
- sal_uInt16 nIns = 0, nEndPos = *rAttr.GetEnd();
+ sal_uInt16 nIns = 0, nEndPos = *rAttr.End();
for( ; nIns < aStack.Count(); ++nIns )
if( *((SwTxtAttr*)aStack[ nIns ] )->GetEnd() > nEndPos )
break;
@@ -213,7 +213,7 @@ void SwTxtAttrIterator::SearchNextChg()
for( ; nAttrPos < pHts->Count(); ++nAttrPos )
{
const SwTxtAttr* pHt = (*pHts)[ nAttrPos ];
- const sal_uInt16* pEnd = pHt->GetEnd();
+ const sal_uInt16* pEnd = pHt->End();
const sal_uInt16 nHtStt = *pHt->GetStart();
if( nHtStt < nStt && ( !pEnd || *pEnd <= nStt ))
continue;
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index 77469bd83a80..c256b6222a7c 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -394,7 +394,7 @@ inline sal_Bool InRange(xub_StrLen nIdx, xub_StrLen nStart, xub_StrLen nEnd) {
* -> nothing to do
*/
-void SwTxtNode::RstAttr(
+void SwTxtNode::RstTxtAttr(
const SwIndex &rIdx,
const xub_StrLen nLen,
const sal_uInt16 nWhich,
@@ -404,8 +404,27 @@ void SwTxtNode::RstAttr(
if ( !GetpSwpHints() )
return;
- const xub_StrLen nStt = rIdx.GetIndex();
- const xub_StrLen nEnd = nStt + nLen;
+ xub_StrLen nStt = rIdx.GetIndex();
+ xub_StrLen nEnd = nStt + nLen;
+ {
+ // enlarge range for the reset of text attributes in case of an overlapping input field
+ const SwTxtInputFld* pTxtInputFld = dynamic_cast<const SwTxtInputFld*>(GetTxtAttrAt( nStt, RES_TXTATR_INPUTFIELD, PARENT ));
+ if ( pTxtInputFld == NULL )
+ {
+ pTxtInputFld = dynamic_cast<const SwTxtInputFld*>(GetTxtAttrAt(nEnd, RES_TXTATR_INPUTFIELD, PARENT ));
+ }
+ if ( pTxtInputFld != NULL )
+ {
+ if ( nStt > *(pTxtInputFld->GetStart()) )
+ {
+ nStt = *(pTxtInputFld->GetStart());
+ }
+ if ( nEnd < *(pTxtInputFld->End()) )
+ {
+ nEnd = *(pTxtInputFld->End());
+ }
+ }
+ }
bool bChanged = false;
@@ -419,13 +438,13 @@ void SwTxtNode::RstAttr(
// They may not be forgotten inside the "Forget" function
//std::vector< const SwTxtAttr* > aNewAttributes;
- // iterate over attribute array until start of attribute is behind
- // deletion range
+ // iterate over attribute array until start of attribute is behind deletion range
sal_uInt16 i = 0;
xub_StrLen nAttrStart;
SwTxtAttr *pHt = NULL;
- while ((i < m_pSwpHints->Count()) &&
- ((( nAttrStart = *(*m_pSwpHints)[i]->GetStart()) < nEnd ) || nLen==0) )
+ while ( (i < m_pSwpHints->Count())
+ && ( ( ( nAttrStart = *(*m_pSwpHints)[i]->GetStart()) < nEnd )
+ || nLen==0 ) )
{
pHt = m_pSwpHints->GetTextHint(i);
@@ -445,6 +464,12 @@ void SwTxtNode::RstAttr(
i++;
continue;
}
+ // attributes with content stay in
+ if ( pHt->HasContent() )
+ {
+ ++i;
+ continue;
+ }
// Default behavior is to process all attributes:
bool bSkipAttr = false;;
diff --git a/sw/source/core/undo/SwUndoField.cxx b/sw/source/core/undo/SwUndoField.cxx
index 2f04cad7266b..f39d8a724fcc 100644
--- a/sw/source/core/undo/SwUndoField.cxx
+++ b/sw/source/core/undo/SwUndoField.cxx
@@ -81,7 +81,7 @@ SwUndoFieldFromDoc::~SwUndoFieldFromDoc()
void SwUndoFieldFromDoc::UndoImpl(::sw::UndoRedoContext &)
{
- SwTxtFld * pTxtFld = SwDoc::GetTxtFld(GetPosition());
+ SwTxtFld * pTxtFld = SwDoc::GetTxtFldAtPos(GetPosition());
const SwField * pField = pTxtFld->GetFmtFld().GetField();
if (pField)
@@ -92,7 +92,7 @@ void SwUndoFieldFromDoc::UndoImpl(::sw::UndoRedoContext &)
void SwUndoFieldFromDoc::DoImpl()
{
- SwTxtFld * pTxtFld = SwDoc::GetTxtFld(GetPosition());
+ SwTxtFld * pTxtFld = SwDoc::GetTxtFldAtPos(GetPosition());
const SwField * pField = pTxtFld->GetFmtFld().GetField();
if (pField)
@@ -129,7 +129,7 @@ SwUndoFieldFromAPI::~SwUndoFieldFromAPI()
void SwUndoFieldFromAPI::UndoImpl(::sw::UndoRedoContext &)
{
- SwField * pField = SwDoc::GetField(GetPosition());
+ SwField * pField = SwDoc::GetFieldAtPos(GetPosition());
if (pField)
pField->PutValue(aOldVal, nWhich);
@@ -137,7 +137,7 @@ void SwUndoFieldFromAPI::UndoImpl(::sw::UndoRedoContext &)
void SwUndoFieldFromAPI::DoImpl()
{
- SwField * pField = SwDoc::GetField(GetPosition());
+ SwField * pField = SwDoc::GetFieldAtPos(GetPosition());
if (pField)
pField->PutValue(aNewVal, nWhich);
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index ae10840fba5d..9ce89a1aa869 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -1036,10 +1036,8 @@ SwHistory::~SwHistory()
|*
*************************************************************************/
-// --> OD 2008-02-27 #refactorlists# - removed <rDoc>
void SwHistory::Add( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue,
sal_uLong nNodeIdx )
-// <--
{
ASSERT( !m_nEndDiff, "History was not deleted after REDO" );
@@ -1289,8 +1287,12 @@ void SwHistory::CopyFmtAttr( const SfxItemSet& rSet, sal_uLong nNodeIdx )
}
}
-void SwHistory::CopyAttr( SwpHints* pHts, sal_uLong nNodeIdx,
- xub_StrLen nStart, xub_StrLen nEnd, bool bFields )
+void SwHistory::CopyAttr(
+ SwpHints* pHts,
+ const sal_uLong nNodeIdx,
+ const xub_StrLen nStart,
+ const xub_StrLen nEnd,
+ const bool bCopyFields )
{
if( !pHts )
return;
@@ -1301,11 +1303,8 @@ void SwHistory::CopyAttr( SwpHints* pHts, sal_uLong nNodeIdx,
const xub_StrLen * pEndIdx;
for( sal_uInt16 n = 0; n < pHts->Count(); n++ )
{
- // BP: nAttrStt muss auch bei !pEndIdx gesetzt werden
pHt = pHts->GetTextHint(n);
nAttrStt = *pHt->GetStart();
-// JP: ???? wieso nAttrStt >= nEnd
-// if( 0 != ( pEndIdx = pHt->GetEnd() ) && nAttrStt >= nEnd )
if( 0 != ( pEndIdx = pHt->GetEnd() ) && nAttrStt > nEnd )
break;
@@ -1314,8 +1313,8 @@ void SwHistory::CopyAttr( SwpHints* pHts, sal_uLong nNodeIdx,
switch( pHt->Which() )
{
case RES_TXTATR_FIELD:
- // keine Felder, .. kopieren ??
- if( !bFields )
+ case RES_TXTATR_INPUTFIELD:
+ if( !bCopyFields )
bNextAttr = sal_True;
break;
case RES_TXTATR_FLYCNT:
@@ -1325,15 +1324,12 @@ void SwHistory::CopyAttr( SwpHints* pHts, sal_uLong nNodeIdx,
}
if( bNextAttr )
- continue;
+ continue;
// save all attributes that are somehow in this area
if ( nStart <= nAttrStt )
{
- if ( nEnd > nAttrStt
-// JP: ???? wieso nAttrStt >= nEnd
-// || (nEnd == nAttrStt && (!pEndIdx || nEnd == pEndIdx->GetIndex()))
- )
+ if ( nEnd > nAttrStt )
{
Add( pHt, nNodeIdx, false );
}
diff --git a/sw/source/core/undo/unsect.cxx b/sw/source/core/undo/unsect.cxx
index f26886621b17..c488485816c6 100644
--- a/sw/source/core/undo/unsect.cxx
+++ b/sw/source/core/undo/unsect.cxx
@@ -239,15 +239,16 @@ void SwUndoInsSection::Join( SwDoc& rDoc, sal_uLong nNode )
ASSERT( pTxtNd, "wo ist mein TextNode?" );
{
- RemoveIdxRel( nNode + 1, SwPosition( aIdx,
- SwIndex( pTxtNd, pTxtNd->GetTxt().Len() )));
+ RemoveIdxRel(
+ nNode + 1,
+ SwPosition( aIdx, SwIndex( pTxtNd, pTxtNd->GetTxt().Len() ) ) );
}
pTxtNd->JoinNext();
if (m_pHistory.get())
{
SwIndex aCntIdx( pTxtNd, 0 );
- pTxtNd->RstAttr( aCntIdx, pTxtNd->Len(), 0, 0, true );
+ pTxtNd->RstTxtAttr( aCntIdx, pTxtNd->Len(), 0, 0, true );
}
}
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index 4d186961ab59..44772872db5f 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -2111,16 +2111,13 @@ CHECKTABLE(pTblNd->GetTable())
// evt. noch ueberflussige Attribute loeschen
SwIndex aTmpIdx( pTxtNd, nDelPos );
if( pTxtNd->GetpSwpHints() && pTxtNd->GetpSwpHints()->Count() )
- pTxtNd->RstAttr( aTmpIdx, pTxtNd->GetTxt().Len() -
- nDelPos + 1 );
+ pTxtNd->RstTxtAttr( aTmpIdx, pTxtNd->GetTxt().Len() - nDelPos + 1 );
// das Trennzeichen loeschen
pTxtNd->EraseText( aTmpIdx, 1 );
}
-// delete pUndo;
DUMPDOC( &rDoc, String( "d:\\tmp\\tab_") + String( aNewSttNds.Count() - i ) +
String(".db") )
}
-// pMoves->Remove( 0, pMoves->Count() );
nIdx = pBox->GetSttIdx();
}
else
diff --git a/sw/source/core/undo/untblk.cxx b/sw/source/core/undo/untblk.cxx
index 57a7d7313c13..b77e878740a6 100644
--- a/sw/source/core/undo/untblk.cxx
+++ b/sw/source/core/undo/untblk.cxx
@@ -248,7 +248,7 @@ void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & rContext)
pTxtNode->JoinNext();
}
// reset all text attributes in the paragraph!
- pTxtNode->RstAttr( SwIndex(pTxtNode, 0), pTxtNode->Len(), 0, 0, true );
+ pTxtNode->RstTxtAttr( SwIndex(pTxtNode, 0), pTxtNode->Len(), 0, 0, true );
// setze alle Attribute im Node zurueck
pTxtNode->ResetAllAttr();
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx
index c53a8e6264e9..981e22c431aa 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -49,6 +49,7 @@
#include <ndtxt.hxx>
#include <txtrfmrk.hxx>
#include <fmtfld.hxx>
+#include <txtfld.hxx>
#include <docsh.hxx>
#include <section.hxx>
#include <shellio.hxx>
@@ -135,19 +136,19 @@ GetNestedTextContent(SwTxtNode & rTextNode, xub_StrLen const nIndex,
/* -----------------16.09.98 12:27-------------------
* Lesen spezieller Properties am Cursor
* --------------------------------------------------*/
-sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
- , SwPaM& rPam
- , Any *pAny
- , PropertyState& eState
- , const SwTxtNode* pNode )
+sal_Bool getCrsrPropertyValue(
+ const SfxItemPropertySimpleEntry& rEntry,
+ SwPaM& rPam,
+ Any *pAny,
+ PropertyState& eState,
+ const SwTxtNode* pNode )
{
PropertyState eNewState = PropertyState_DIRECT_VALUE;
-// PropertyState_DEFAULT_VALUE
-// PropertyState_AMBIGUOUS_VALUE
+ // PropertyState_DEFAULT_VALUE
+ // PropertyState_AMBIGUOUS_VALUE
sal_Bool bDone = sal_True;
switch(rEntry.nWID)
{
- // --> OD 2008-11-26 #158694#
case FN_UNO_PARA_CONT_PREV_SUBTREE:
if (pAny)
{
@@ -168,6 +169,7 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
*pAny <<= bRet;
}
break;
+
case FN_UNO_PARA_NUM_STRING:
if (pAny)
{
@@ -185,23 +187,7 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
*pAny <<= OUString(sRet);
}
break;
- // <--
- // --> OD 2008-05-20 #outlinelevel# - no longer needed
-// case FN_UNO_PARA_CHAPTER_NUMBERING_LEVEL:
-// if (pAny)
-// {
-// const SwTxtNode * pTmpNode = pNode;
-
-// if (!pTmpNode)
-// pTmpNode = rPam.GetNode()->GetTxtNode();
-
-// sal_Int8 nRet = -1;
-// if (pTmpNode && pTmpNode->GetOutlineLevel() != NO_NUMBERING)
-// nRet = sal::static_int_cast< sal_Int8 >(pTmpNode->GetOutlineLevel());
-// *pAny <<= nRet;
-// }
-// break;
- // <--
+
case RES_PARATR_OUTLINELEVEL: //#outlinelevel added by zhaojianwei
if (pAny)
{
@@ -217,9 +203,10 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
*pAny <<= nRet;
}
break; //<-end,zhaojianwei
+
case FN_UNO_PARA_CONDITIONAL_STYLE_NAME:
case FN_UNO_PARA_STYLE :
- {
+ {
SwFmtColl* pFmt = 0;
if(pNode)
pFmt = FN_UNO_PARA_CONDITIONAL_STYLE_NAME == rEntry.nWID
@@ -259,66 +246,62 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
*pAny <<= nValue;
}
break;
+
case FN_UNO_NUM_LEVEL :
case FN_UNO_IS_NUMBER :
- // --> OD 2008-07-14 #i91601#
case FN_UNO_LIST_ID:
- // <--
case FN_NUMBER_NEWSTART:
- {
- // a multi selection is not considered
- const SwTxtNode* pTxtNd = rPam.GetNode()->GetTxtNode();
- // --> OD 2010-01-13 #b6912256#
- if ( pTxtNd && pTxtNd->IsInList() )
- // <--
{
- if( pAny )
+ // a multi selection is not considered
+ const SwTxtNode* pTxtNd = rPam.GetNode()->GetTxtNode();
+ if ( pTxtNd && pTxtNd->IsInList() )
{
- if(rEntry.nWID == FN_UNO_NUM_LEVEL)
- *pAny <<= (sal_Int16)(pTxtNd->GetActualListLevel());
- else if(rEntry.nWID == FN_UNO_IS_NUMBER)
- {
- sal_Bool bIsNumber = pTxtNd->IsCountedInList();
- pAny->setValue(&bIsNumber, ::getBooleanCppuType());
- }
- // --> OD 2008-07-14 #i91601#
- else if ( rEntry.nWID == FN_UNO_LIST_ID )
- {
- const String sListId = pTxtNd->GetListId();
- *pAny <<= OUString(sListId);
- }
- // <--
- else /*if(rEntry.nWID == UNO_NAME_PARA_IS_NUMBERING_RESTART)*/
+ if( pAny )
{
- sal_Bool bIsRestart = pTxtNd->IsListRestart();
- pAny->setValue(&bIsRestart, ::getBooleanCppuType());
+ if(rEntry.nWID == FN_UNO_NUM_LEVEL)
+ *pAny <<= (sal_Int16)(pTxtNd->GetActualListLevel());
+ else if(rEntry.nWID == FN_UNO_IS_NUMBER)
+ {
+ sal_Bool bIsNumber = pTxtNd->IsCountedInList();
+ pAny->setValue(&bIsNumber, ::getBooleanCppuType());
+ }
+ else if ( rEntry.nWID == FN_UNO_LIST_ID )
+ {
+ const String sListId = pTxtNd->GetListId();
+ *pAny <<= OUString(sListId);
+ }
+ else /*if(rEntry.nWID == UNO_NAME_PARA_IS_NUMBERING_RESTART)*/
+ {
+ sal_Bool bIsRestart = pTxtNd->IsListRestart();
+ pAny->setValue(&bIsRestart, ::getBooleanCppuType());
+ }
}
}
- }
- else
- {
- eNewState = PropertyState_DEFAULT_VALUE;
-
- if( pAny )
+ else
{
- // #i30838# set default values for default properties
- if(rEntry.nWID == FN_UNO_NUM_LEVEL)
- *pAny <<= static_cast<sal_Int16>( 0 );
- else if(rEntry.nWID == FN_UNO_IS_NUMBER)
- *pAny <<= false;
- // --> OD 2008-07-14 #i91601#
- else if ( rEntry.nWID == FN_UNO_LIST_ID )
+ eNewState = PropertyState_DEFAULT_VALUE;
+
+ if( pAny )
{
- *pAny <<= OUString();
+ // #i30838# set default values for default properties
+ if(rEntry.nWID == FN_UNO_NUM_LEVEL)
+ *pAny <<= static_cast<sal_Int16>( 0 );
+ else if(rEntry.nWID == FN_UNO_IS_NUMBER)
+ *pAny <<= false;
+ // --> OD 2008-07-14 #i91601#
+ else if ( rEntry.nWID == FN_UNO_LIST_ID )
+ {
+ *pAny <<= OUString();
+ }
+ // <--
+ else /*if(rEntry.nWID == UNO_NAME_PARA_IS_NUMBERING_RESTART)*/
+ *pAny <<= false;
}
- // <--
- else /*if(rEntry.nWID == UNO_NAME_PARA_IS_NUMBERING_RESTART)*/
- *pAny <<= false;
}
+ //PROPERTY_MAYBEVOID!
}
- //PROPERTY_MAYBEVOID!
- }
- break;
+ break;
+
case FN_UNO_NUM_RULES :
if( pAny )
getNumberingProperty(rPam, eNewState, pAny);
@@ -328,184 +311,182 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
eNewState = PropertyState_DEFAULT_VALUE;
}
break;
+
case FN_UNO_DOCUMENT_INDEX_MARK:
- {
- ::std::vector<SwTxtAttr *> const marks(
- rPam.GetNode()->GetTxtNode()->GetTxtAttrsAt(
- rPam.GetPoint()->nContent.GetIndex(), RES_TXTATR_TOXMARK));
- if (marks.size())
{
- if( pAny )
- { // hmm... can only return 1 here
- SwTOXMark & rMark =
- static_cast<SwTOXMark &>((*marks.begin())->GetAttr());
- const uno::Reference< text::XDocumentIndexMark > xRef =
- SwXDocumentIndexMark::CreateXDocumentIndexMark(
+ ::std::vector<SwTxtAttr *> const marks(
+ rPam.GetNode()->GetTxtNode()->GetTxtAttrsAt(
+ rPam.GetPoint()->nContent.GetIndex(), RES_TXTATR_TOXMARK));
+ if (marks.size())
+ {
+ if( pAny )
+ { // hmm... can only return 1 here
+ SwTOXMark & rMark =
+ static_cast<SwTOXMark &>((*marks.begin())->GetAttr());
+ const uno::Reference< text::XDocumentIndexMark > xRef =
+ SwXDocumentIndexMark::CreateXDocumentIndexMark(
*rPam.GetDoc(),
*const_cast<SwTOXType*>(rMark.GetTOXType()), rMark);
- (*pAny) <<= xRef;
+ (*pAny) <<= xRef;
+ }
}
+ else
+ //auch hier - nicht zu unterscheiden
+ eNewState = PropertyState_DEFAULT_VALUE;
}
- else
- //auch hier - nicht zu unterscheiden
- eNewState = PropertyState_DEFAULT_VALUE;
- }
- break;
+ break;
+
case FN_UNO_DOCUMENT_INDEX:
- {
- const SwTOXBase* pBase = rPam.GetDoc()->GetCurTOX(
- *rPam.Start() );
- if( pBase )
{
- if( pAny )
+ const SwTOXBase* pBase = rPam.GetDoc()->GetCurTOX(
+ *rPam.Start() );
+ if( pBase )
{
- const uno::Reference< text::XDocumentIndex > xRef =
- SwXDocumentIndex::CreateXDocumentIndex(*rPam.GetDoc(),
+ if( pAny )
+ {
+ const uno::Reference< text::XDocumentIndex > xRef =
+ SwXDocumentIndex::CreateXDocumentIndex(*rPam.GetDoc(),
*static_cast<SwTOXBaseSection const*>(pBase));
- (*pAny) <<= xRef;
+ (*pAny) <<= xRef;
+ }
}
+ else
+ eNewState = PropertyState_DEFAULT_VALUE;
}
- else
- eNewState = PropertyState_DEFAULT_VALUE;
- }
- break;
+ break;
+
case FN_UNO_TEXT_FIELD:
- {
- const SwPosition *pPos = rPam.Start();
- const SwTxtNode *pTxtNd =
- rPam.GetDoc()->GetNodes()[pPos->nNode.GetIndex()]->GetTxtNode();
- SwTxtAttr *const pTxtAttr = (pTxtNd)
- ? pTxtNd->GetTxtAttrForCharAt(
- pPos->nContent.GetIndex(), RES_TXTATR_FIELD)
- : 0;
- if(pTxtAttr)
{
- if( pAny )
+ const SwPosition *pPos = rPam.Start();
+ const SwTxtNode *pTxtNd =
+ rPam.GetDoc()->GetNodes()[pPos->nNode.GetIndex()]->GetTxtNode();
+ const SwTxtAttr* pTxtAttr = (pTxtNd)
+ ? pTxtNd->GetFldTxtAttrAt( pPos->nContent.GetIndex(), true )
+ : 0;
+ if ( pTxtAttr != NULL )
{
- SwXTextField* pField =
- SwXTextField::CreateSwXTextField( *rPam.GetDoc(),pTxtAttr->GetFmtFld() );
- *pAny <<= uno::Reference< XTextField >( pField );
+ if( pAny )
+ {
+ SwXTextField* pField =
+ SwXTextField::CreateSwXTextField( *rPam.GetDoc(),pTxtAttr->GetFmtFld() );
+ *pAny <<= uno::Reference< XTextField >( pField );
+ }
}
+ else
+ eNewState = PropertyState_DEFAULT_VALUE;
}
- else
- eNewState = PropertyState_DEFAULT_VALUE;
- }
- break;
-/* laesst sich nicht feststellen
-* case FN_UNO_BOOKMARK:
- {
- if()
- {
- uno::Reference< XBookmark > xBkm = SwXBookmarks::GetObject(rBkm);
- rAny.set(&xBkm, ::getCppuType((const XBookmark*)0)());
- }
- }
- break;*/
+ break;
+
case FN_UNO_TEXT_TABLE:
case FN_UNO_CELL:
- {
- SwStartNode* pSttNode = rPam.GetNode()->StartOfSectionNode();
- SwStartNodeType eType = pSttNode->GetStartNodeType();
- if(SwTableBoxStartNode == eType)
{
- if( pAny )
+ SwStartNode* pSttNode = rPam.GetNode()->StartOfSectionNode();
+ SwStartNodeType eType = pSttNode->GetStartNodeType();
+ if(SwTableBoxStartNode == eType)
{
- const SwTableNode* pTblNode = pSttNode->FindTableNode();
- SwFrmFmt* pTableFmt = (SwFrmFmt*)pTblNode->GetTable().GetFrmFmt();
- //SwTable& rTable = ((SwTableNode*)pSttNode)->GetTable();
- if(FN_UNO_TEXT_TABLE == rEntry.nWID)
- {
- uno::Reference< XTextTable > xTable = SwXTextTables::GetObject(*pTableFmt);
- pAny->setValue(&xTable, ::getCppuType((uno::Reference<XTextTable>*)0));
- }
- else
+ if( pAny )
{
- SwTableBox* pBox = pSttNode->GetTblBox();
- uno::Reference< XCell > xCell = SwXCell::CreateXCell(pTableFmt, pBox);
- pAny->setValue(&xCell, ::getCppuType((uno::Reference<XCell>*)0));
+ const SwTableNode* pTblNode = pSttNode->FindTableNode();
+ SwFrmFmt* pTableFmt = (SwFrmFmt*)pTblNode->GetTable().GetFrmFmt();
+ //SwTable& rTable = ((SwTableNode*)pSttNode)->GetTable();
+ if(FN_UNO_TEXT_TABLE == rEntry.nWID)
+ {
+ uno::Reference< XTextTable > xTable = SwXTextTables::GetObject(*pTableFmt);
+ pAny->setValue(&xTable, ::getCppuType((uno::Reference<XTextTable>*)0));
+ }
+ else
+ {
+ SwTableBox* pBox = pSttNode->GetTblBox();
+ uno::Reference< XCell > xCell = SwXCell::CreateXCell(pTableFmt, pBox);
+ pAny->setValue(&xCell, ::getCppuType((uno::Reference<XCell>*)0));
+ }
}
}
+ else
+ eNewState = PropertyState_DEFAULT_VALUE;
}
- else
- eNewState = PropertyState_DEFAULT_VALUE;
- }
- break;
- case FN_UNO_TEXT_FRAME:
- {
- SwStartNode* pSttNode = rPam.GetNode()->StartOfSectionNode();
- SwStartNodeType eType = pSttNode->GetStartNodeType();
+ break;
- SwFrmFmt* pFmt;
- if(eType == SwFlyStartNode && 0 != (pFmt = pSttNode->GetFlyFmt()))
+ case FN_UNO_TEXT_FRAME:
{
- if( pAny )
+ SwStartNode* pSttNode = rPam.GetNode()->StartOfSectionNode();
+ SwStartNodeType eType = pSttNode->GetStartNodeType();
+
+ SwFrmFmt* pFmt;
+ if(eType == SwFlyStartNode && 0 != (pFmt = pSttNode->GetFlyFmt()))
{
- uno::Reference< XTextFrame > xFrm = (SwXTextFrame*) SwXFrames::GetObject(*pFmt, FLYCNTTYPE_FRM);
- pAny->setValue(&xFrm, ::getCppuType((uno::Reference<XTextFrame>*)0));
+ if( pAny )
+ {
+ uno::Reference< XTextFrame > xFrm = (SwXTextFrame*) SwXFrames::GetObject(*pFmt, FLYCNTTYPE_FRM);
+ pAny->setValue(&xFrm, ::getCppuType((uno::Reference<XTextFrame>*)0));
+ }
}
+ else
+ eNewState = PropertyState_DEFAULT_VALUE;
}
- else
- eNewState = PropertyState_DEFAULT_VALUE;
- }
- break;
+ break;
+
case FN_UNO_TEXT_SECTION:
- {
- SwSection* pSect = rPam.GetDoc()->GetCurrSection(*rPam.GetPoint());
- if(pSect)
{
- if( pAny )
+ SwSection* pSect = rPam.GetDoc()->GetCurrSection(*rPam.GetPoint());
+ if(pSect)
{
- uno::Reference< XTextSection > xSect = SwXTextSections::GetObject( *pSect->GetFmt() );
- pAny->setValue(&xSect, ::getCppuType((uno::Reference<XTextSection>*)0) );
+ if( pAny )
+ {
+ uno::Reference< XTextSection > xSect = SwXTextSections::GetObject( *pSect->GetFmt() );
+ pAny->setValue(&xSect, ::getCppuType((uno::Reference<XTextSection>*)0) );
+ }
}
+ else
+ eNewState = PropertyState_DEFAULT_VALUE;
}
- else
- eNewState = PropertyState_DEFAULT_VALUE;
- }
- break;
+ break;
+
case FN_UNO_ENDNOTE:
case FN_UNO_FOOTNOTE:
- {
- SwTxtAttr *const pTxtAttr =
- rPam.GetNode()->GetTxtNode()->GetTxtAttrForCharAt(
- rPam.GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN);
- if(pTxtAttr)
{
- const SwFmtFtn& rFtn = pTxtAttr->GetFtn();
- if(rFtn.IsEndNote() == (FN_UNO_ENDNOTE == rEntry.nWID))
+ SwTxtAttr *const pTxtAttr =
+ rPam.GetNode()->GetTxtNode()->GetTxtAttrForCharAt(
+ rPam.GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN);
+ if(pTxtAttr)
{
- if( pAny )
+ const SwFmtFtn& rFtn = pTxtAttr->GetFtn();
+ if(rFtn.IsEndNote() == (FN_UNO_ENDNOTE == rEntry.nWID))
{
- const uno::Reference< text::XFootnote > xFootnote =
- SwXFootnote::CreateXFootnote(*rPam.GetDoc(), rFtn);
- *pAny <<= xFootnote;
+ if( pAny )
+ {
+ const uno::Reference< text::XFootnote > xFootnote =
+ SwXFootnote::CreateXFootnote(*rPam.GetDoc(), rFtn);
+ *pAny <<= xFootnote;
+ }
}
+ else
+ eNewState = PropertyState_DEFAULT_VALUE;
}
else
eNewState = PropertyState_DEFAULT_VALUE;
}
- else
- eNewState = PropertyState_DEFAULT_VALUE;
- }
- break;
+ break;
+
case FN_UNO_REFERENCE_MARK:
- {
- ::std::vector<SwTxtAttr *> const marks(
- rPam.GetNode()->GetTxtNode()->GetTxtAttrsAt(
- rPam.GetPoint()->nContent.GetIndex(), RES_TXTATR_REFMARK));
- if (marks.size())
{
- if( pAny )
- { // hmm... can only return 1 here
- const SwFmtRefMark& rRef = (*marks.begin())->GetRefMark();
- uno::Reference< XTextContent > xRef = SwXReferenceMarks::GetObject( rPam.GetDoc(), &rRef );
- pAny->setValue(&xRef, ::getCppuType((uno::Reference<XTextContent>*)0));
+ ::std::vector<SwTxtAttr *> const marks(
+ rPam.GetNode()->GetTxtNode()->GetTxtAttrsAt(
+ rPam.GetPoint()->nContent.GetIndex(), RES_TXTATR_REFMARK));
+ if (marks.size())
+ {
+ if( pAny )
+ { // hmm... can only return 1 here
+ const SwFmtRefMark& rRef = (*marks.begin())->GetRefMark();
+ uno::Reference< XTextContent > xRef = SwXReferenceMarks::GetObject( rPam.GetDoc(), &rRef );
+ pAny->setValue(&xRef, ::getCppuType((uno::Reference<XTextContent>*)0));
+ }
}
+ else
+ eNewState = PropertyState_DEFAULT_VALUE;
}
- else
- eNewState = PropertyState_DEFAULT_VALUE;
- }
- break;
+ break;
+
case FN_UNO_NESTED_TEXT_CONTENT:
{
uno::Reference<XTextContent> const xRet(
@@ -524,6 +505,7 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
}
}
break;
+
case FN_UNO_CHARFMT_SEQUENCE:
{
@@ -586,8 +568,9 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
eNewState = PropertyState_DEFAULT_VALUE;
}
break;
+
case RES_TXTATR_CHARFMT:
- // kein break hier!
+ // kein break hier!
default: bDone = sal_False;
}
if( bDone )
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index b394acefbba4..ed7363d7fdc7 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -1254,8 +1254,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
.SetFlyFmt();
//The connection is removed now the attribute can be deleted.
- pTxtNode->DeleteAttributes(
- RES_TXTATR_FLYCNT, nIdx );
+ pTxtNode->DeleteAttributes( RES_TXTATR_FLYCNT, nIdx );
//create a new one
SwTxtNode *pNd = pInternalPam->GetNode()->GetTxtNode();
DBG_ASSERT( pNd, "Cursor not at TxtNode." );
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index db1b868bf283..fb4953b4feee 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -1619,9 +1619,10 @@ void SwXTextField::attachToRange(
throw uno::RuntimeException();
sal_uInt16 nInpSubType = sal::static_int_cast< sal_uInt16 >(SW_SERVICE_FIELDTYPE_INPUT_USER == m_nServiceId ? INP_USR : INP_TXT);
SwInputField * pTxtField =
- new SwInputField((SwInputFieldType*)pFldType,
- m_pProps->sPar1, m_pProps->sPar2,
- nInpSubType);
+ new SwInputField( static_cast<SwInputFieldType*>(pFldType),
+ m_pProps->sPar1,
+ m_pProps->sPar2,
+ nInpSubType );
pTxtField->SetHelp(m_pProps->sPar3);
pTxtField->SetToolTip(m_pProps->sPar4);
@@ -1729,19 +1730,19 @@ void SwXTextField::attachToRange(
if(aPam.HasMark())
pDoc->DeleteAndJoin(aPam);
- SwXTextCursor const*const pTextCursor(
- dynamic_cast<SwXTextCursor*>(pCursor));
- const bool bForceExpandHints( (pTextCursor)
- ? pTextCursor->IsAtEndOfMeta() : false );
- const SetAttrMode nInsertFlags = (bForceExpandHints)
+ SwXTextCursor const*const pTextCursor( dynamic_cast<SwXTextCursor*>(pCursor) );
+ const bool bForceExpandHints(
+ (pTextCursor)
+ ? pTextCursor->IsAtEndOfMeta()
+ : false );
+ const SetAttrMode nInsertFlags =
+ (bForceExpandHints)
? nsSetAttrMode::SETATTR_FORCEHINTEXPAND
: nsSetAttrMode::SETATTR_DEFAULT;
pDoc->InsertPoolItem(aPam, aFmt, nInsertFlags);
- pTxtAttr = aPam.GetNode()->GetTxtNode()->GetTxtAttrForCharAt(
- aPam.GetPoint()->nContent.GetIndex()-1, RES_TXTATR_FIELD);
-
+ pTxtAttr = aPam.GetNode()->GetTxtNode()->GetFldTxtAttrAt( aPam.GetPoint()->nContent.GetIndex()-1, true );
// was passiert mit dem Update der Felder ? (siehe fldmgr.cxx)
if(pTxtAttr)
{
@@ -1907,7 +1908,7 @@ void SwXTextField::setPropertyValue(const OUString& rPropertyName, const uno::An
//#to the SwTxtFld
if(RES_DBFLD == nWhich && pFmtFld->GetTxtFld())
{
- pFmtFld->GetTxtFld()->Expand();
+ pFmtFld->GetTxtFld()->ExpandTxtFld();
}
//#i100374# changing a document field should set the modify flag
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index 59263cf095ca..3720e26eaa9f 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -121,7 +121,7 @@
#include <switerator.hxx>
// from fefly1.cxx
-extern sal_Bool lcl_ChkAndSetNewAnchor( const SwFlyFrm& rFly, SfxItemSet& rSet );
+extern sal_Bool lcl_ChkAndSetNewAnchor( SwEditShell& rEditShell, const SwFlyFrm& rFly, SfxItemSet& rSet );
using namespace ::com::sun::star;
using ::rtl::OUString;
@@ -1043,21 +1043,6 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
}
}
}
- // --> OD 2009-07-13 #i73249#
- // Attribute AlternativeText was never published.
- // Now it has been replaced by Attribute Title - valid for all <SwXFrame> instances
-// else if( FN_UNO_ALTERNATIVE_TEXT == pEntry->nWID && eType != FLYCNTTYPE_FRM )
-// {
-// const :: SwNodeIndex* pIdx = pFmt->GetCntnt().GetCntntIdx();
-// if(pIdx)
-// {
-// SwNodeIndex aIdx(*pIdx, 1);
-// SwNoTxtNode* pNoTxt = aIdx.GetNode().GetNoTxtNode();
-// OUString uTemp;
-// aValue >>= uTemp;
-// pNoTxt->SetAlternateText(uTemp);
-// }
-// }
// New attribute Title
else if( FN_UNO_TITLE == pEntry->nWID )
{
@@ -1112,7 +1097,8 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
{
pSet = new SfxItemSet( pDoc->GetAttrPool(), aFrmFmtSetRange );
pSet->Put( *pItem );
- if ( !::lcl_ChkAndSetNewAnchor( *pFly, *pSet ) )
+ if ( pFmt->GetDoc()->GetEditShell() != NULL
+ && !::lcl_ChkAndSetNewAnchor( *(pFmt->GetDoc()->GetEditShell()), *pFly, *pSet ) )
delete pSet, pSet = 0;
}
}
@@ -1388,7 +1374,10 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
if( SFX_ITEM_SET == aSet.GetItemState( RES_ANCHOR, sal_False, &pItem ))
{
aSet.Put( *pItem );
- ::lcl_ChkAndSetNewAnchor( *pFly, aSet );
+ if ( pFmt->GetDoc()->GetEditShell() != NULL )
+ {
+ ::lcl_ChkAndSetNewAnchor( *(pFmt->GetDoc()->GetEditShell()), *pFly, aSet );
+ }
}
}
}
diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx
index 33e09fd8c65f..eb4c251a63ec 100644
--- a/sw/source/core/unocore/unoidx.cxx
+++ b/sw/source/core/unocore/unoidx.cxx
@@ -1858,9 +1858,9 @@ throw (uno::RuntimeException)
m_pImpl->m_pTOXMark->GetTxtTOXMark();
SwPaM aPam(pTxtMark->GetTxtNode(), *pTxtMark->GetStart());
aPam.SetMark();
- if(pTxtMark->GetEnd())
+ if(pTxtMark->End())
{
- aPam.GetPoint()->nContent = *pTxtMark->GetEnd();
+ aPam.GetPoint()->nContent = *pTxtMark->End();
}
else
aPam.GetPoint()->nContent++;
@@ -2109,9 +2109,9 @@ SwXDocumentIndexMark::getAnchor() throw (uno::RuntimeException)
const SwTxtTOXMark* pTxtMark = m_pImpl->m_pTOXMark->GetTxtTOXMark();
SwPaM aPam(pTxtMark->GetTxtNode(), *pTxtMark->GetStart());
aPam.SetMark();
- if(pTxtMark->GetEnd())
+ if(pTxtMark->End())
{
- aPam.GetPoint()->nContent = *pTxtMark->GetEnd();
+ aPam.GetPoint()->nContent = *pTxtMark->End();
}
else
{
@@ -2270,9 +2270,9 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
m_pImpl->m_pTOXMark->GetTxtTOXMark();
SwPaM aPam(pTxtMark->GetTxtNode(), *pTxtMark->GetStart());
aPam.SetMark();
- if(pTxtMark->GetEnd())
+ if(pTxtMark->End())
{
- aPam.GetPoint()->nContent = *pTxtMark->GetEnd();
+ aPam.GetPoint()->nContent = *pTxtMark->End();
}
else
{
diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx
index 27e546c248a7..da1f6f68f516 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -482,6 +482,32 @@ SwUnoPropertyMapProvider::~SwUnoPropertyMapProvider()
{ SW_PROP_NMID(UNO_NAME_IS_FIELD_USED), FIELD_PROP_IS_FIELD_USED, CPPU_E2T(CPPUTYPE_FLOAT), PropertyAttribute::READONLY, 0},\
{ SW_PROP_NMID(UNO_NAME_IS_FIELD_DISPLAYED), FIELD_PROP_IS_FIELD_DISPLAYED, CPPU_E2T(CPPUTYPE_INT16), PropertyAttribute::READONLY, 0},\
+//IAccessibility2 Implementation 2009-----
+#define COMMON_ACCESSIBILITY_TEXT_ATTRIBUTE \
+ { SW_PROP_NMID(UNO_NAME_CHAR_BACK_COLOR), RES_CHRATR_BACKGROUND, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE ,MID_BACK_COLOR }, \
+ { SW_PROP_NMID(UNO_NAME_CHAR_COLOR), RES_CHRATR_COLOR, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE, 0}, \
+ { SW_PROP_NMID(UNO_NAME_CHAR_CONTOURED), RES_CHRATR_CONTOUR, CPPU_E2T(CPPUTYPE_BOOLEAN) , PROPERTY_NONE, 0}, \
+ { SW_PROP_NMID(UNO_NAME_CHAR_EMPHASIS), RES_CHRATR_EMPHASIS_MARK, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, MID_EMPHASIS}, \
+ { SW_PROP_NMID(UNO_NAME_CHAR_ESCAPEMENT), RES_CHRATR_ESCAPEMENT, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, MID_ESC }, \
+ { SW_PROP_NMID(UNO_NAME_CHAR_FONT_NAME), RES_CHRATR_FONT, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::MAYBEVOID, MID_FONT_FAMILY_NAME }, \
+ { SW_PROP_NMID(UNO_NAME_CHAR_HEIGHT), RES_CHRATR_FONTSIZE , CPPU_E2T(CPPUTYPE_FLOAT), PropertyAttribute::MAYBEVOID, MID_FONTHEIGHT|CONVERT_TWIPS}, \
+ { SW_PROP_NMID(UNO_NAME_CHAR_POSTURE), RES_CHRATR_POSTURE , CPPU_E2T(CPPUTYPE_FONTSLANT), PropertyAttribute::MAYBEVOID, MID_POSTURE}, \
+ { SW_PROP_NMID(UNO_NAME_CHAR_SHADOWED), RES_CHRATR_SHADOWED , CPPU_E2T(CPPUTYPE_BOOLEAN) , PROPERTY_NONE, 0}, \
+ { SW_PROP_NMID(UNO_NAME_CHAR_STRIKEOUT), RES_CHRATR_CROSSEDOUT, CPPU_E2T(CPPUTYPE_INT16), PropertyAttribute::MAYBEVOID, MID_CROSS_OUT}, \
+ { SW_PROP_NMID(UNO_NAME_CHAR_UNDERLINE_COLOR), RES_CHRATR_UNDERLINE , CPPU_E2T(CPPUTYPE_INT32), PropertyAttribute::MAYBEVOID, MID_TL_COLOR}, \
+ { SW_PROP_NMID(UNO_NAME_CHAR_WEIGHT), RES_CHRATR_WEIGHT , CPPU_E2T(CPPUTYPE_FLOAT), PropertyAttribute::MAYBEVOID, MID_WEIGHT}, \
+ { SW_PROP_NMID(UNO_NAME_NUMBERING_LEVEL), RES_PARATR_LIST_LEVEL,CPPU_E2T(CPPUTYPE_INT16), PropertyAttribute::MAYBEVOID, 0}, \
+ { SW_PROP_NMID(UNO_NAME_CHAR_UNDERLINE), RES_CHRATR_UNDERLINE , CPPU_E2T(CPPUTYPE_INT16), PropertyAttribute::MAYBEVOID, MID_TL_STYLE}, \
+ { SW_PROP_NMID(UNO_NAME_NUMBERING_RULES), RES_PARATR_NUMRULE,CPPU_E2T(CPPUTYPE_INT16), PropertyAttribute::MAYBEVOID, CONVERT_TWIPS}, \
+ { SW_PROP_NMID(UNO_NAME_PARA_ADJUST), RES_PARATR_ADJUST, CPPU_E2T(CPPUTYPE_INT16), PropertyAttribute::MAYBEVOID, MID_PARA_ADJUST}, \
+ { SW_PROP_NMID(UNO_NAME_PARA_BOTTOM_MARGIN), RES_UL_SPACE, CPPU_E2T(CPPUTYPE_INT32), PropertyAttribute::MAYBEVOID, MID_LO_MARGIN|CONVERT_TWIPS}, \
+ { SW_PROP_NMID(UNO_NAME_PARA_FIRST_LINE_INDENT), RES_LR_SPACE, CPPU_E2T(CPPUTYPE_INT32), PropertyAttribute::MAYBEVOID, MID_FIRST_LINE_INDENT|CONVERT_TWIPS}, \
+ { SW_PROP_NMID(UNO_NAME_PARA_LEFT_MARGIN), RES_LR_SPACE, CPPU_E2T(CPPUTYPE_INT32), PropertyAttribute::MAYBEVOID, MID_TXT_LMARGIN|CONVERT_TWIPS}, \
+ { SW_PROP_NMID(UNO_NAME_PARA_LINE_SPACING), RES_PARATR_LINESPACING, CPPU_E2T(CPPUTYPE_LINESPACE), PropertyAttribute::MAYBEVOID, CONVERT_TWIPS}, \
+ { SW_PROP_NMID(UNO_NAME_PARA_RIGHT_MARGIN), RES_LR_SPACE, CPPU_E2T(CPPUTYPE_INT32), PropertyAttribute::MAYBEVOID, MID_R_MARGIN|CONVERT_TWIPS}, \
+ { SW_PROP_NMID(UNO_NAME_TABSTOPS), RES_PARATR_TABSTOP, CPPU_E2T(CPPUTYPE_SEQTABSTOP), PropertyAttribute::MAYBEVOID, CONVERT_TWIPS}, \
+
+//-----IAccessibility2 Implementation 2009
const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(sal_uInt16 nPropertyId)
{
@@ -500,6 +526,18 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
aMapEntriesArr[nPropertyId] = aCharAndParaMap_Impl;
}
break;
+ //IAccessibility2 Implementation 2009-----
+ case PROPERTY_MAP_ACCESSIBILITY_TEXT_ATTRIBUTE:
+ {
+ static SfxItemPropertyMapEntry aAccessibilityTextAttrMap_Impl[] =
+ {
+ COMMON_ACCESSIBILITY_TEXT_ATTRIBUTE
+ {0,0,0,0,0,0}
+ };
+ aMapEntriesArr[nPropertyId] = aAccessibilityTextAttrMap_Impl;
+ }
+ break;
+ //-----IAccessibility2 Implementation 2009
case PROPERTY_MAP_PARAGRAPH:
{
static SfxItemPropertyMapEntry aParagraphMap_Impl[] =
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx
index edd295269c2b..1cd9b56ee784 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -46,6 +46,8 @@
#include <unoredline.hxx>
#include <unofield.hxx>
#include <unometa.hxx>
+#include <fmtfld.hxx>
+#include <fldbas.hxx>
#include <fmtmeta.hxx>
#include <fmtanchr.hxx>
#include <fmtrfmrk.hxx>
@@ -438,7 +440,7 @@ lcl_CreateRefMarkPortion(
{
pPortion = new SwXTextPortion(pUnoCrsr, xParent, PORTION_REFMARK_START);
pPortion->SetRefMark(xContent);
- pPortion->SetCollapsed(rAttr.GetEnd() ? false : true);
+ pPortion->SetCollapsed(rAttr.End() ? false : true);
}
else
{
@@ -459,7 +461,7 @@ lcl_InsertRubyPortion(
SwXTextPortion* pPortion = new SwXTextPortion(pUnoCrsr,
static_cast<const SwTxtRuby&>(rAttr), xParent, bEnd);
rPortions.push_back(pPortion);
- pPortion->SetCollapsed(rAttr.GetEnd() ? false : true);
+ pPortion->SetCollapsed(rAttr.End() ? false : true);
}
//-----------------------------------------------------------------------------
@@ -760,34 +762,56 @@ lcl_ExportHints(
SwXTextField::CreateSwXTextField(*pDoc, pAttr->GetFmtFld());
pPortion->SetTextField(xField);
}
- break;
- case RES_TXTATR_FLYCNT :
+ break;
+
+ case RES_TXTATR_INPUTFIELD:
if(!bRightMoveForbidden)
{
- pUnoCrsr->Right(1,CRSR_SKIP_CHARS,sal_False,sal_False);
+
+ pUnoCrsr->Right(
+ pAttr->GetFmtFld().GetField()->GetPar1().Len() + 2,
+ CRSR_SKIP_CHARS,
+ sal_False,
+ sal_False );
if( *pUnoCrsr->GetMark() == *pUnoCrsr->GetPoint() )
- break; // Robust #i81708 content in covered cells
- pUnoCrsr->Exchange();
- xRef = new SwXTextPortion(
- pUnoCrsr, xParent, PORTION_FRAME);
+ break;
+ SwXTextPortion* pPortion =
+ new SwXTextPortion( pUnoCrsr, xParent, PORTION_FIELD);
+ xRef = pPortion;
+ Reference<XTextField> xField =
+ SwXTextField::CreateSwXTextField(*pDoc, pAttr->GetFmtFld());
+ pPortion->SetTextField(xField);
}
- break;
- case RES_TXTATR_FTN :
- {
+ break;
+
+ case RES_TXTATR_FLYCNT:
if(!bRightMoveForbidden)
{
pUnoCrsr->Right(1,CRSR_SKIP_CHARS,sal_False,sal_False);
if( *pUnoCrsr->GetMark() == *pUnoCrsr->GetPoint() )
- break;
- SwXTextPortion* pPortion;
- xRef = pPortion = new SwXTextPortion(
+ break; // Robust #i81708 content in covered cells
+ pUnoCrsr->Exchange();
+ xRef = new SwXTextPortion( pUnoCrsr, xParent, PORTION_FRAME);
+ }
+ break;
+
+ case RES_TXTATR_FTN:
+ {
+ if(!bRightMoveForbidden)
+ {
+ pUnoCrsr->Right(1,CRSR_SKIP_CHARS,sal_False,sal_False);
+ if( *pUnoCrsr->GetMark() == *pUnoCrsr->GetPoint() )
+ break;
+ SwXTextPortion* pPortion;
+ xRef = pPortion = new SwXTextPortion(
pUnoCrsr, xParent, PORTION_FOOTNOTE);
- Reference<XFootnote> xContent =
- SwXFootnotes::GetObject(*pDoc, pAttr->GetFtn());
- pPortion->SetFootnote(xContent);
+ Reference<XFootnote> xContent =
+ SwXFootnotes::GetObject(*pDoc, pAttr->GetFtn());
+ pPortion->SetFootnote(xContent);
+ }
}
- }
- break;
+ break;
+
case RES_TXTATR_TOXMARK:
case RES_TXTATR_REFMARK:
{
diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx
index 13e66476bda0..369076f42b4c 100644
--- a/sw/source/core/unocore/unorefmk.cxx
+++ b/sw/source/core/unocore/unorefmk.cxx
@@ -356,8 +356,8 @@ SwXReferenceMark::getAnchor() throw (uno::RuntimeException)
&m_pImpl->m_pDoc->GetNodes()))
{
SwTxtNode const& rTxtNode = pTxtMark->GetTxtNode();
- const ::std::auto_ptr<SwPaM> pPam( (pTxtMark->GetEnd())
- ? new SwPaM( rTxtNode, *pTxtMark->GetEnd(),
+ const ::std::auto_ptr<SwPaM> pPam( (pTxtMark->End())
+ ? new SwPaM( rTxtNode, *pTxtMark->End(),
rTxtNode, *pTxtMark->GetStart())
: new SwPaM( rTxtNode, *pTxtMark->GetStart()) );
@@ -387,9 +387,10 @@ void SAL_CALL SwXReferenceMark::dispose() throw (uno::RuntimeException)
&m_pImpl->m_pDoc->GetNodes()))
{
SwTxtNode const& rTxtNode = pTxtMark->GetTxtNode();
- xub_StrLen nStt = *pTxtMark->GetStart(),
- nEnd = pTxtMark->GetEnd() ? *pTxtMark->GetEnd()
- : nStt + 1;
+ const xub_StrLen nStt = *pTxtMark->GetStart();
+ const xub_StrLen nEnd = pTxtMark->End()
+ ? *pTxtMark->End()
+ : nStt + 1;
SwPaM aPam( rTxtNode, nStt, rTxtNode, nEnd );
m_pImpl->m_pDoc->DeleteAndJoin( aPam );
@@ -477,9 +478,10 @@ throw (uno::RuntimeException)
&m_pImpl->m_pDoc->GetNodes()))
{
SwTxtNode const& rTxtNode = pTxtMark->GetTxtNode();
- xub_StrLen nStt = *pTxtMark->GetStart(),
- nEnd = pTxtMark->GetEnd() ? *pTxtMark->GetEnd()
- : nStt + 1;
+ const xub_StrLen nStt = *pTxtMark->GetStart();
+ const xub_StrLen nEnd = pTxtMark->End()
+ ? *pTxtMark->End()
+ : nStt + 1;
SwPaM aPam( rTxtNode, nStt, rTxtNode, nEnd );
// deletes the m_pImpl->m_pDoc member in the SwXReferenceMark!
@@ -873,7 +875,7 @@ bool SwXMeta::SetContentRange(
{
// rStart points at the first position _within_ the meta!
rStart = *pTxtAttr->GetStart() + 1;
- rEnd = *pTxtAttr->GetEnd();
+ rEnd = *pTxtAttr->End();
return true;
}
}
diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx
index 323b0a75fbe8..519cbb04e3b9 100644
--- a/sw/source/core/view/viewimp.cxx
+++ b/sw/source/core/view/viewimp.cxx
@@ -446,6 +446,24 @@ void SwViewImp::MoveAccessible( const SwFrm *pFrm, const SdrObject *pObj,
} while ( pTmp != pVSh );
}
+//IAccessibility2 Implementation 2009-----
+void SwViewImp::FirePageChangeEvent(sal_uInt16 nOldPage, sal_uInt16 nNewPage)
+{
+ if( IsAccessible() )
+ GetAccessibleMap().FirePageChangeEvent( nOldPage, nNewPage);
+}
+
+void SwViewImp::FireSectionChangeEvent(sal_uInt16 nOldSection, sal_uInt16 nNewSection)
+{
+ if( IsAccessible() )
+ GetAccessibleMap().FireSectionChangeEvent(nOldSection, nNewSection);
+}
+void SwViewImp::FireColumnChangeEvent(sal_uInt16 nOldColumn, sal_uInt16 nNewColumn)
+{
+ if( IsAccessible() )
+ GetAccessibleMap().FireColumnChangeEvent(nOldColumn, nNewColumn);
+}
+//-----IAccessibility2 Implementation 2009
void SwViewImp::InvalidateAccessibleFrmContent( const SwFrm *pFrm )
{
ASSERT( pFrm->IsAccessibleFrm(), "frame is not accessible" );
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
index 14ee0f4a9133..1447555d2a62 100644
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -662,6 +662,7 @@ sal_Bool ViewShell::IsAnyFieldInDoc() const
const SfxPoolItem* pItem;
sal_uInt32 nMaxItems = pDoc->GetAttrPool().GetItemCount2( RES_TXTATR_FIELD );
for( sal_uInt32 n = 0; n < nMaxItems; ++n )
+ {
if( 0 != (pItem = pDoc->GetAttrPool().GetItem2( RES_TXTATR_FIELD, n )))
{
const SwFmtFld* pFmtFld = (SwFmtFld*)pItem;
@@ -674,6 +675,22 @@ sal_Bool ViewShell::IsAnyFieldInDoc() const
return sal_True;
}
}
+ }
+
+ nMaxItems = pDoc->GetAttrPool().GetItemCount2( RES_TXTATR_INPUTFIELD );
+ for( sal_uInt32 n = 0; n < nMaxItems; ++n )
+ {
+ if( 0 != (pItem = pDoc->GetAttrPool().GetItem2( RES_TXTATR_INPUTFIELD, n )))
+ {
+ const SwFmtFld* pFmtFld = (SwFmtFld*)pItem;
+ const SwTxtFld* pTxtFld = pFmtFld->GetTxtFld();
+ if( pTxtFld && pTxtFld->GetTxtNode().GetNodes().IsDocNodes() )
+ {
+ return sal_True;
+ }
+ }
+ }
+
return sal_False;
}
diff --git a/sw/source/filter/ascii/ascatr.cxx b/sw/source/filter/ascii/ascatr.cxx
index bbba284dbf11..a86d0fd01b44 100644
--- a/sw/source/filter/ascii/ascatr.cxx
+++ b/sw/source/filter/ascii/ascatr.cxx
@@ -60,16 +60,27 @@ class SwASC_AttrIter
public:
SwASC_AttrIter( SwASCWriter& rWrt, const SwTxtNode& rNd, xub_StrLen nStt );
- void NextPos() { nAktSwPos = SearchNext( nAktSwPos + 1 ); }
+ void NextPos()
+ {
+ nAktSwPos = SearchNext( nAktSwPos + 1 );
+ }
+
+ xub_StrLen WhereNext() const
+ {
+ return nAktSwPos;
+ }
- xub_StrLen WhereNext() const { return nAktSwPos; }
sal_Bool OutAttr( xub_StrLen nSwPos );
};
-SwASC_AttrIter::SwASC_AttrIter( SwASCWriter& rWr, const SwTxtNode& rTxtNd,
- xub_StrLen nStt )
- : rWrt( rWr ), rNd( rTxtNd ), nAktSwPos( 0 )
+SwASC_AttrIter::SwASC_AttrIter(
+ SwASCWriter& rWr,
+ const SwTxtNode& rTxtNd,
+ xub_StrLen nStt )
+ : rWrt( rWr )
+ , rNd( rTxtNd )
+ , nAktSwPos( 0 )
{
nAktSwPos = SearchNext( nStt + 1 );
}
@@ -81,13 +92,10 @@ xub_StrLen SwASC_AttrIter::SearchNext( xub_StrLen nStartPos )
const SwpHints* pTxtAttrs = rNd.GetpSwpHints();
if( pTxtAttrs )
{
-// kann noch optimiert werden, wenn ausgenutzt wird, dass die TxtAttrs
-// nach der Anfangsposition geordnet sind. Dann muessten
-// allerdings noch 2 Indices gemerkt werden
for ( sal_uInt16 i = 0; i < pTxtAttrs->Count(); i++ )
{
const SwTxtAttr* pHt = (*pTxtAttrs)[i];
- if (pHt->HasDummyChar())
+ if ( pHt->HasDummyChar() )
{
xub_StrLen nPos = *pHt->GetStart();
@@ -97,6 +105,20 @@ xub_StrLen SwASC_AttrIter::SearchNext( xub_StrLen nStartPos )
if( ( ++nPos ) >= nStartPos && nPos < nMinPos )
nMinPos = nPos;
}
+ else if ( pHt->HasContent() )
+ {
+ const xub_StrLen nHintStart = *pHt->GetStart();
+ if ( nHintStart >= nStartPos && nHintStart <= nMinPos )
+ {
+ nMinPos = nHintStart;
+ }
+
+ const xub_StrLen nHintEnd = pHt->End() ? *pHt->End() : STRING_MAXLEN;
+ if ( nHintEnd >= nStartPos && nHintEnd < nMinPos )
+ {
+ nMinPos = nHintEnd;
+ }
+ }
}
}
return nMinPos;
@@ -113,15 +135,17 @@ sal_Bool SwASC_AttrIter::OutAttr( xub_StrLen nSwPos )
for( i = 0; i < pTxtAttrs->Count(); i++ )
{
const SwTxtAttr* pHt = (*pTxtAttrs)[i];
- if ( pHt->HasDummyChar() && nSwPos == *pHt->GetStart() )
+ if ( ( pHt->HasDummyChar()
+ || pHt->HasContent() )
+ && nSwPos == *pHt->GetStart() )
{
bRet = sal_True;
String sOut;
switch( pHt->Which() )
{
case RES_TXTATR_FIELD:
- sOut =
- static_cast<SwTxtFld const*>(pHt)->GetFmtFld().GetField()->ExpandField(true);
+ case RES_TXTATR_INPUTFIELD:
+ sOut = static_cast<SwTxtFld const*>(pHt)->GetFmtFld().GetField()->ExpandField(true);
break;
case RES_TXTATR_FTN:
@@ -131,10 +155,10 @@ sal_Bool SwASC_AttrIter::OutAttr( xub_StrLen nSwPos )
sOut = rFtn.GetNumStr();
else if( rFtn.IsEndNote() )
sOut = rWrt.pDoc->GetEndNoteInfo().aFmt.
- GetNumStr( rFtn.GetNumber() );
+ GetNumStr( rFtn.GetNumber() );
else
sOut = rWrt.pDoc->GetFtnInfo().aFmt.
- GetNumStr( rFtn.GetNumber() );
+ GetNumStr( rFtn.GetNumber() );
}
break;
}
diff --git a/sw/source/filter/ascii/parasc.cxx b/sw/source/filter/ascii/parasc.cxx
index bb20eb6253f9..b5f7fc283b8d 100644
--- a/sw/source/filter/ascii/parasc.cxx
+++ b/sw/source/filter/ascii/parasc.cxx
@@ -452,8 +452,8 @@ sal_uLong SwASCIIParser::ReadChars()
InsertText( String( pLastStt ));
}
pDoc->SplitNode( *pPam->GetPoint(), false );
- pDoc->InsertPoolItem( *pPam, SvxFmtBreakItem(
- SVX_BREAK_PAGE_BEFORE, RES_BREAK ), 0);
+ pDoc->InsertPoolItem(
+ *pPam, SvxFmtBreakItem( SVX_BREAK_PAGE_BEFORE, RES_BREAK ), 0);
pLastStt = pStt;
nLineLen = 0;
bIns = false;
diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx
index ab005119c1e6..6b72e561e4ec 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -3758,7 +3758,7 @@ SwAttrFnTab aCSS1AttrFnTab = {
/* RES_TXTATR_CHARFMT */ 0,
/* RES_TXTATR_CJK_RUBY */ 0,
/* RES_TXTATR_UNKNOWN_CONTAINER */ 0,
-/* RES_TXTATR_DUMMY5 */ 0,
+/* RES_TXTATR_INPUTFIELD */ 0,
/* RES_TXTATR_FIELD */ 0,
/* RES_TXTATR_FLYCNT */ 0,
diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx
index 910b661aad55..c9dd2bf6239c 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -2485,9 +2485,9 @@ Writer& OutHTML_SwTxtNode( Writer& rWrt, const SwCntntNode& rNode )
if( RES_TXTATR_FIELD == pHt->Which() ) // Felder nicht
continue; // ausgeben
- if ( pHt->GetEnd() && !pHt->HasDummyChar() )
+ if ( pHt->End() && !pHt->HasDummyChar() )
{
- xub_StrLen nHtEnd = *pHt->GetEnd(),
+ const xub_StrLen nHtEnd = *pHt->End(),
nHtStt = *pHt->GetStart();
if( !rHTMLWrt.bWriteAll && nHtEnd <= nStrPos )
continue;
@@ -2545,11 +2545,11 @@ Writer& OutHTML_SwTxtNode( Writer& rWrt, const SwCntntNode& rNode )
&& nStrPos != nEnde )
{
do {
- if ( pHt->GetEnd() && !pHt->HasDummyChar() )
+ if ( pHt->End() && !pHt->HasDummyChar() )
{
if( RES_CHRATR_KERNING == pHt->Which() &&
rHTMLWrt.IsHTMLMode(HTMLMODE_FIRSTLINE) &&
- *pHt->GetEnd() - nStrPos == 1 &&
+ *pHt->End() - nStrPos == 1 &&
' ' == rStr.GetChar(nStrPos) &&
((const SvxKerningItem&)pHt->GetAttr()).GetValue() > 0 )
{
@@ -2564,13 +2564,13 @@ Writer& OutHTML_SwTxtNode( Writer& rWrt, const SwCntntNode& rNode )
// Der Hint braucht nun doch nicht weiter
// beruecksichtigt werden.
}
- else if( *pHt->GetEnd() != nStrPos )
+ else if( *pHt->End() != nStrPos )
{
// Hints mit Ende einsortieren, wenn sie keinen
// leeren Bereich aufspannen (Hints, die keinen
// Bereich aufspannen werden ignoriert
aEndPosLst.Insert( pHt->GetAttr(), nStrPos + nOffset,
- *pHt->GetEnd() + nOffset,
+ *pHt->End() + nOffset,
rHTMLWrt.aChrFmtInfos );
}
}
@@ -3413,7 +3413,7 @@ SwAttrFnTab aHTMLAttrFnTab = {
/* RES_TXTATR_CHARFMT */ OutHTML_SwTxtCharFmt,
/* RES_TXTATR_CJK_RUBY */ 0,
/* RES_TXTATR_UNKNOWN_CONTAINER */ 0,
-/* RES_TXTATR_DUMMY5 */ 0,
+/* RES_TXTATR_INPUTFIELD */ OutHTML_SwFmtFld,
/* RES_TXTATR_FIELD */ OutHTML_SwFmtFld,
/* RES_TXTATR_FLYCNT */ OutHTML_SwFlyCnt,
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index 51a6442d6708..e1caf2afb86b 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -2265,11 +2265,7 @@ sal_Bool SwHTMLParser::AppendTxtNode( SwHTMLAppendMode eMode, sal_Bool bUpdateNu
if( GetNumInfo().GetDepth() )
{
sal_uInt8 nLvl = GetNumInfo().GetLevel();
- // --> OD 2008-04-02 #refactorlists#
-// SetNoNum (&nLvl, sal_True);
-// SetNodeNum( nLvl);
SetNodeNum( nLvl, false );
- // <--
}
else
pPam->GetNode()->GetTxtNode()->ResetAttr( RES_PARATR_NUMRULE );
@@ -2777,6 +2773,7 @@ void SwHTMLParser::_SetAttr( sal_Bool bChkEnd, sal_Bool bBeforeTable,
}
break;
case RES_TXTATR_FIELD:
+ case RES_TXTATR_INPUTFIELD:
{
sal_uInt16 nFldWhich =
pPostIts
diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx
index 14bd9bd9b0c3..4a1d66149d95 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -891,7 +891,7 @@ sal_uInt16 SwHTMLWriter::OutHeaderAttrs()
for( sal_uInt16 i=0; i<nCntAttr; i++ )
{
const SwTxtAttr *pHt = pTxtNd->GetSwpHints()[i];
- if( !pHt->GetEnd() )
+ if( !pHt->End() )
{
xub_StrLen nPos = *pHt->GetStart();
if( nPos-nOldPos > 1 || RES_TXTATR_FIELD != pHt->Which() )
diff --git a/sw/source/filter/rtf/rtffly.cxx b/sw/source/filter/rtf/rtffly.cxx
index 57cfd289da86..07530fc2f3ba 100644
--- a/sw/source/filter/rtf/rtffly.cxx
+++ b/sw/source/filter/rtf/rtffly.cxx
@@ -272,7 +272,7 @@ void SwRTFParser::SetFlysInDoc()
aDropCap.GetChars() = 1;
SwIndex aIdx( pEndNd );
- pNd->RstAttr( aIdx, 1, RES_CHRATR_FONTSIZE );
+ pNd->RstTxtAttr( aIdx, 1, RES_CHRATR_FONTSIZE );
pNd->SetAttr( aDropCap );
}
delete pFlySave;
diff --git a/sw/source/filter/ww1/fltshell.cxx b/sw/source/filter/ww1/fltshell.cxx
index dd0b66b2cdcb..9a3b7ab3fa87 100644
--- a/sw/source/filter/ww1/fltshell.cxx
+++ b/sw/source/filter/ww1/fltshell.cxx
@@ -142,12 +142,17 @@ void SwFltStackEntry::SetEndPos(const SwPosition& rEndPos)
//because it is beyond the length of para...need special consideration here.
bool SwFltStackEntry::IsAbleMakeRegion()
{
- SwCntntNode *const pCntntNode(
- SwNodeIndex(nMkNode, +1).GetNode().GetCntntNode());
- if ((nMkNode.GetIndex() == nPtNode.GetIndex()) && (nMkCntnt == nPtCntnt)
- && ((0 != nPtCntnt) || (pCntntNode && (0 != pCntntNode->Len())))
- && ((RES_TXTATR_FIELD != pAttr->Which())
- && !(bIsParaEnd && pCntntNode && pCntntNode->IsTxtNode() && 0 != pCntntNode->Len() )))
+ SwCntntNode *const pCntntNode( SwNodeIndex(nMkNode, +1).GetNode().GetCntntNode() );
+ if ( (nMkNode.GetIndex() == nPtNode.GetIndex())
+ && (nMkCntnt == nPtCntnt)
+ && ( (0 != nPtCntnt)
+ || ( pCntntNode
+ && ( 0 != pCntntNode->Len() ) ) )
+ && ( RES_TXTATR_FIELD != pAttr->Which() && RES_TXTATR_INPUTFIELD != pAttr->Which() )
+ && !( bIsParaEnd
+ && pCntntNode
+ && pCntntNode->IsTxtNode()
+ && 0 != pCntntNode->Len() ) )
{
return false;
}
@@ -505,9 +510,11 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos, SwFltStackEntry*
case RES_FLTR_STYLESHEET:
break;
case RES_TXTATR_FIELD:
+ case RES_TXTATR_INPUTFIELD:
break;
case RES_TXTATR_TOXMARK:
break;
+
case RES_FLTR_NUMRULE: // Numrule 'reinsetzen
{
const String& rNumNm = ((SfxStringItem*)pEntry->pAttr)->GetValue();
diff --git a/sw/source/filter/ww1/w1filter.cxx b/sw/source/filter/ww1/w1filter.cxx
index 7e67ed035b74..5929b97c01ec 100644
--- a/sw/source/filter/ww1/w1filter.cxx
+++ b/sw/source/filter/ww1/w1filter.cxx
@@ -885,9 +885,9 @@ oncemore:
}
case 39: // fillin command
pField = new SwInputField(
- (SwInputFieldType*)rOut.GetSysFldType( RES_INPUTFLD ),
+ static_cast<SwInputFieldType*>(rOut.GetSysFldType( RES_INPUTFLD )),
aEmptyStr, sFormel,
- INP_TXT, 0 ); // sichtbar ( geht z.Zt. nicht anders )
+ INP_TXT, 0, false );
break;
case 51: // macro button
{
diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx b/sw/source/filter/ww8/attributeoutputbase.hxx
index a644371385ce..b3a0f03cfad1 100644
--- a/sw/source/filter/ww8/attributeoutputbase.hxx
+++ b/sw/source/filter/ww8/attributeoutputbase.hxx
@@ -437,7 +437,7 @@ protected:
/// Sfx item RES_TXTATR_CHARFMT
virtual void TextCharFormat( const SwFmtCharFmt& ) = 0;
- /// Sfx item RES_TXTATR_FIELD
+ /// Sfx item RES_TXTATR_FIELD and RES_TXTATR_INPUTFIELD
void TextField( const SwFmtFld& );
/// Sfx item RES_TXTATR_FLYCNT
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index 4355fcdc7148..47c21884c4da 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -563,11 +563,10 @@ void WW8Export::DoFormText(const SwInputField * pFld)
OutputField(0, ww::eFORMTEXT, aEmptyStr, WRITEFIELD_CMD_END);
- String const fieldStr( pFld->ExpandField(true) );
+ const String fieldStr( pFld->ExpandField(true) );
SwWW8Writer::WriteString16(Strm(), fieldStr, false);
static sal_uInt8 aArr2[] = {
- 0x03, 0x6a, 0x00, 0x00, 0x00, 0x00, // sprmCPicLocation
0x55, 0x08, 0x01, // sprmCFSpec
0x75, 0x08, 0x01 // ???
};
@@ -2105,7 +2104,7 @@ sal_Int32 SwBasicEscherEx::WriteFlyFrameAttr(const SwFrmFmt& rFmt,
{
const SvxShadowItem* pSI = (const SvxShadowItem*)pShadItem;
- const sal_uInt16 nCstScale = 635; // unit scale between SODC and MS Word
+ const sal_uInt16 nCstScale = 635; // unit scale between AOO and MS Word
const sal_uInt32 nShadowType = 131074; // shadow type of ms word. need to set the default value.
sal_uInt32 nColor = (sal_uInt32)(pSI->GetColor().GetColor()) ;
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index cf2032f164ba..813b9e821496 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -396,9 +396,9 @@ xub_StrLen WW8SwAttrIter::SearchNext( xub_StrLen nStartPos )
if( nPos >= nStartPos && nPos <= nMinPos )
nMinPos = nPos;
- if( pHt->GetEnd() ) // Attr mit Ende
+ if( pHt->End() ) // Attr mit Ende
{
- nPos = *pHt->GetEnd(); // gibt letztes Attr-Zeichen + 1
+ nPos = *pHt->End(); // gibt letztes Attr-Zeichen + 1
if( nPos >= nStartPos && nPos <= nMinPos )
nMinPos = nPos;
}
@@ -491,7 +491,7 @@ void WW8SwAttrIter::OutAttr( xub_StrLen nSwPos )
for (xub_StrLen i = 0; i < pTxtAttrs->Count(); ++i)
{
const SwTxtAttr* pHt = (*pTxtAttrs)[i];
- const xub_StrLen* pEnd = pHt->GetEnd();
+ const xub_StrLen* pEnd = pHt->End();
if (pEnd ? ( nSwPos >= *pHt->GetStart() && nSwPos < *pEnd)
: nSwPos == *pHt->GetStart() )
@@ -601,14 +601,17 @@ void WW8SwAttrIter::OutFlys(xub_StrLen nSwPos)
bool WW8SwAttrIter::IsTxtAttr( xub_StrLen nSwPos )
{
- // search for attrs with CH_TXTATR
+ // search for attrs with dummy character or content
if (const SwpHints* pTxtAttrs = rNd.GetpSwpHints())
{
for (sal_uInt16 i = 0; i < pTxtAttrs->Count(); ++i)
{
const SwTxtAttr* pHt = (*pTxtAttrs)[i];
- if ( pHt->HasDummyChar() && (*pHt->GetStart() == nSwPos) )
+ if ( ( pHt->HasDummyChar() || pHt->HasContent() )
+ && (*pHt->GetStart() == nSwPos) )
+ {
return true;
+ }
}
}
@@ -666,7 +669,7 @@ const SfxPoolItem* WW8SwAttrIter::HasTextItem( sal_uInt16 nWhich ) const
const SwTxtAttr* pHt = (*pTxtAttrs)[i];
const SfxPoolItem* pItem = &pHt->GetAttr();
const xub_StrLen* pAtrEnd = 0;
- if( 0 != ( pAtrEnd = pHt->GetEnd() ) && // nur Attr mit Ende
+ if( 0 != ( pAtrEnd = pHt->End() ) && // nur Attr mit Ende
nWhich == pItem->Which() && //
nTmpSwPos >= *pHt->GetStart() && nTmpSwPos < *pAtrEnd )
{
@@ -1115,7 +1118,7 @@ void AttributeOutputBase::TOXMark( const SwTxtNode& rNode, const SwTOXMark& rAtt
ww::eField eType = ww::eNONE;
const SwTxtTOXMark& rTxtTOXMark = *rAttr.GetTxtTOXMark();
- const xub_StrLen* pTxtEnd = rTxtTOXMark.GetEnd();
+ const xub_StrLen* pTxtEnd = rTxtTOXMark.End();
if ( pTxtEnd ) // has range?
{
sTxt = rNode.GetExpandTxt( *rTxtTOXMark.GetStart(),
@@ -1188,7 +1191,7 @@ int WW8SwAttrIter::OutAttrWithRange(xub_StrLen nPos)
if ( m_rExport.AttrOutput().StartURL( rINet->GetValue(), rINet->GetTargetFrame() ) )
++nRet;
}
- if ( 0 != ( pEnd = pHt->GetEnd() ) && nPos == *pEnd )
+ if ( 0 != ( pEnd = pHt->End() ) && nPos == *pEnd )
{
if ( m_rExport.AttrOutput().EndURL() )
--nRet;
@@ -1200,7 +1203,7 @@ int WW8SwAttrIter::OutAttrWithRange(xub_StrLen nPos)
OutSwFmtRefMark( *static_cast< const SwFmtRefMark* >( pItem ), true );
++nRet;
}
- if ( 0 != ( pEnd = pHt->GetEnd() ) && nPos == *pEnd )
+ if ( 0 != ( pEnd = pHt->End() ) && nPos == *pEnd )
{
OutSwFmtRefMark( *static_cast< const SwFmtRefMark* >( pItem ), false );
--nRet;
@@ -1216,7 +1219,7 @@ int WW8SwAttrIter::OutAttrWithRange(xub_StrLen nPos)
m_rExport.AttrOutput().StartRuby( rNd, *static_cast< const SwFmtRuby* >( pItem ) );
++nRet;
}
- if ( 0 != ( pEnd = pHt->GetEnd() ) && nPos == *pEnd )
+ if ( 0 != ( pEnd = pHt->End() ) && nPos == *pEnd )
{
m_rExport.AttrOutput().EndRuby();
--nRet;
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 7616c90c4ca8..e5e137f4596a 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -1843,9 +1843,7 @@ void WW8Export::OutputField( const SwField* pFld, ww::eField eFldType,
bool bUnicode = IsUnicode();
WW8_WrPlcFld* pFldP = CurrentFieldPlc();
- // --> OD 2008-08-14 #158418#
const bool bIncludeEmptyPicLocation = ( eFldType == ww::ePAGE );
- // <--
if (WRITEFIELD_START & nMode)
{
sal_uInt8 aFld13[2] = { 0x13, 0x00 }; // will change
@@ -1854,9 +1852,7 @@ void WW8Export::OutputField( const SwField* pFld, ww::eField eFldType,
aFld13[0] |= 0x80;
aFld13[1] = static_cast< sal_uInt8 >(eFldType); // Typ nachtragen
pFldP->Append( Fc2Cp( Strm().Tell() ), aFld13 );
- // --> OD 2008-08-14 #158418#
InsertSpecialChar( *this, 0x13, 0, bIncludeEmptyPicLocation );
- // <--
}
if (WRITEFIELD_CMD_START & nMode)
{
@@ -1867,8 +1863,8 @@ void WW8Export::OutputField( const SwField* pFld, ww::eField eFldType,
SwWW8Writer::WriteString8(Strm(), rFldCmd, false,
RTL_TEXTENCODING_MS_1252);
}
- // --> OD 2005-06-08 #i43956# - write hyperlink character including
- // attributes and corresponding binary data for certain reference fields.
+ // write hyperlink character including attributes and
+ // corresponding binary data for certain reference fields.
bool bHandleBookmark = false;
if (pFld)
@@ -1877,12 +1873,6 @@ void WW8Export::OutputField( const SwField* pFld, ww::eField eFldType,
( eFldType == ww::ePAGEREF || eFldType == ww::eREF ||
eFldType == ww::eNOTEREF || eFldType == ww::eFOOTREF ))
bHandleBookmark = true;
-
-#if 0
- if (pFld->GetTyp()->Which() == RES_INPUTFLD &&
- eFldType == ww::eFORMTEXT)
- bHandleBookmark = true;
-#endif
}
if ( bHandleBookmark )
@@ -1908,16 +1898,13 @@ void WW8Export::OutputField( const SwField* pFld, ww::eField eFldType,
// insert hyperlink character including attributes and data.
InsertSpecialChar( *this, 0x01, &aLinkStr );
}
- // <--
}
if (WRITEFIELD_CMD_END & nMode)
{
static const sal_uInt8 aFld14[2] = { 0x14, 0xff };
pFldP->Append( Fc2Cp( Strm().Tell() ), aFld14 );
pFldP->ResultAdded();
- // --> OD 2008-08-14 #158418#
InsertSpecialChar( *this, 0x14, 0, bIncludeEmptyPicLocation );
- // <--
}
if (WRITEFIELD_END & nMode)
{
@@ -1985,9 +1972,7 @@ void WW8Export::OutputField( const SwField* pFld, ww::eField eFldType,
}
pFldP->Append( Fc2Cp( Strm().Tell() ), aFld15 );
- // --> OD 2008-08-14 #158418#
InsertSpecialChar( *this, 0x15, 0, bIncludeEmptyPicLocation );
- // <--
}
}
@@ -2619,7 +2604,7 @@ void AttributeOutputBase::TextField( const SwFmtFld& rField )
const SwField* pFld = rField.GetField();
String sStr; // fuer optionale Parameter
bool bWriteExpand = false;
- sal_uInt16 nSubType = pFld->GetSubType();
+ const sal_uInt16 nSubType = pFld->GetSubType();
switch (pFld->GetTyp()->Which())
{
@@ -2866,8 +2851,7 @@ void AttributeOutputBase::TextField( const SwFmtFld& rField )
break;
case RES_INPUTFLD:
{
- const SwInputField * pInputField =
- dynamic_cast<const SwInputField *>(pFld);
+ const SwInputField * pInputField = dynamic_cast<const SwInputField *>(pFld);
if (pInputField->isFormField())
GetExport().DoFormText(pInputField);
@@ -5182,6 +5166,7 @@ void AttributeOutputBase::OutputItem( const SfxPoolItem& rHt )
TextCharFormat( static_cast< const SwFmtCharFmt& >( rHt ) );
break;
case RES_TXTATR_FIELD:
+ case RES_TXTATR_INPUTFIELD:
TextField( static_cast< const SwFmtFld& >( rHt ) );
break;
case RES_TXTATR_FLYCNT:
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 2e75bd06defc..9d6c6c9c7888 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1091,6 +1091,8 @@ void SwWW8FltControlStack::NewAttr(const SwPosition& rPos,
{
ASSERT(RES_TXTATR_FIELD != rAttr.Which(), "probably don't want to put"
"fields into the control stack");
+ ASSERT(RES_TXTATR_INPUTFIELD != rAttr.Which(), "probably don't want to put"
+ "input fields into the control stack");
ASSERT(RES_FLTR_REDLINE != rAttr.Which(), "probably don't want to put"
"redlines into the control stack");
SwFltControlStack::NewAttr(rPos, rAttr);
@@ -1332,6 +1334,12 @@ void SwWW8FltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
ASSERT(!this, "What is a field doing in the control stack,"
"probably should have been in the endstack");
break;
+
+ case RES_TXTATR_INPUTFIELD:
+ ASSERT(!this, "What is a input field doing in the control stack,"
+ "probably should have been in the endstack");
+ break;
+
case RES_TXTATR_INETFMT:
{
SwPaM aRegion(rTmpPos);
@@ -1451,6 +1459,7 @@ void SwWW8FltRefStack::SetAttrInDoc(const SwPosition& rTmpPos,
do normal (?) strange stuff
*/
case RES_TXTATR_FIELD:
+ case RES_TXTATR_INPUTFIELD:
{
SwNodeIndex aIdx(pEntry->nMkNode, 1);
SwPaM aPaM(aIdx, pEntry->nMkCntnt);
@@ -1788,10 +1797,13 @@ void SwWW8ImplReader::ImportDop()
mpDocShell->SetModifyPasswordHash(pWDop->lKeyProtDoc);
- const SvtFilterOptions* pOpt = SvtFilterOptions::Get();
- sal_Bool bUseEnhFields=(pOpt && pOpt->IsUseEnhancedFields());
- if (bUseEnhFields) {
- rDoc.set(IDocumentSettingAccess::PROTECT_FORM, pWDop->fProtEnabled );
+ {
+ const SvtFilterOptions* pOpt = SvtFilterOptions::Get();
+ const sal_Bool bUseEnhFields=(pOpt && pOpt->IsUseEnhancedFields());
+ if (bUseEnhFields)
+ {
+ rDoc.set(IDocumentSettingAccess::PROTECT_FORM, pWDop->fProtEnabled );
+ }
}
maTracer.LeaveEnvironment(sw::log::eDocumentProperties);
@@ -3886,26 +3898,6 @@ void wwSectionManager::SetUseOn(wwSection &rSection)
rSection.mpTitlePage->WriteUseOn(
(UseOnPage) (eUseBase | nsUseOnPage::PD_HEADERSHARE | nsUseOnPage::PD_FOOTERSHARE));
}
-
- if( nsUseOnPage::PD_MIRROR != (UseOnPage)(eUse & nsUseOnPage::PD_MIRROR) )
- {
- if( rSection.maSep.bkc == 3 )
- {
- if( rSection.mpPage )
- rSection.mpPage->SetUseOn( nsUseOnPage::PD_LEFT );
- if( rSection.mpTitlePage )
- rSection.mpTitlePage->SetUseOn( nsUseOnPage::PD_LEFT );
- }
- else if( rSection.maSep.bkc == 4 )
- {
- if( rSection.mpPage )
- rSection.mpPage->SetUseOn( nsUseOnPage::PD_RIGHT );
- if( rSection.mpTitlePage )
- rSection.mpTitlePage->SetUseOn( nsUseOnPage::PD_RIGHT );
- }
-
- }
-
}
//Set the page descriptor on this node, handle the different cases for a text
@@ -4044,7 +4036,8 @@ void wwSectionManager::InsertSegments()
bool bInsertSection = (aIter != aStart) ? (aIter->IsContinous() && bThisAndPreviousAreCompatible): false;
bool bInsertPageDesc = !bInsertSection;
bool bProtected = SectionIsProtected(*aIter); // do we really need this ?? I guess I have a different logic in editshell which disales this...
- if (bUseEnhFields && mrReader.pWDop->fProtEnabled && aIter->IsNotProtected()) {
+ if (bUseEnhFields && mrReader.pWDop->fProtEnabled && aIter->IsNotProtected())
+ {
// here we have the special case that the whole document is protected, with the execption of this section.
// I want to address this when I do the section rework, so for the moment we disable the overall protection then...
mrReader.rDoc.set(IDocumentSettingAccess::PROTECT_FORM, false );
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index 4a00e026367c..b607f5920dda 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -133,55 +133,62 @@ eF_ResT SwWW8ImplReader::Read_F_FormTextBox( WW8FieldDesc* pF, String& rStr )
*/
const SvtFilterOptions* pOpt = SvtFilterOptions::Get();
- sal_Bool bUseEnhFields=(pOpt && pOpt->IsUseEnhancedFields());
+ const sal_Bool bUseEnhFields=(pOpt && pOpt->IsUseEnhancedFields());
- if (!bUseEnhFields) {
- aFormula.sDefault = GetFieldResult(pF);
+ if (!bUseEnhFields)
+ {
+ aFormula.sDefault = GetFieldResult(pF);
#if 0 // why not? (flr)
- //substituting Unicode spacing 0x2002 with double space for layout
- aFormula.sDefault.SearchAndReplaceAll(
- String(static_cast< sal_Unicode >(0x2002)),
- CREATE_CONST_ASC(" "));
+ //substituting Unicode spacing 0x2002 with double space for layout
+ aFormula.sDefault.SearchAndReplaceAll(
+ String(static_cast< sal_Unicode >(0x2002)),
+ CREATE_CONST_ASC(" "));
#endif
- SwInputField aFld((SwInputFieldType*)rDoc.GetSysFldType( RES_INPUTFLD ),
- aFormula.sDefault , aFormula.sTitle , INP_TXT, 0 );
- aFld.SetHelp(aFormula.sHelp);
- aFld.SetToolTip(aFormula.sToolTip);
-
- rDoc.InsertPoolItem(*pPaM, SwFmtFld(aFld), 0);
- return FLD_OK;
- } else {
- WW8PLCFx_Book* pB = pPlcxMan->GetBook();
- String aBookmarkName;
- if (pB!=NULL) {
- WW8_CP currentCP=pF->nSCode;
- WW8_CP currentLen=pF->nLen;
-
- sal_uInt16 bkmFindIdx;
- String aBookmarkFind=pB->GetBookmark(currentCP-1, currentCP+currentLen-1, bkmFindIdx);
-
- if (aBookmarkFind.Len()>0) {
- pB->SetStatus(bkmFindIdx, BOOK_FIELD); // mark bookmark as consumed, such that tl'll not get inserted as a "normal" bookmark again
+ SwInputField aFld(
+ static_cast<SwInputFieldType*>(rDoc.GetSysFldType( RES_INPUTFLD )),
+ aFormula.sDefault,
+ aFormula.sTitle,
+ INP_TXT,
+ 0 );
+ aFld.SetHelp(aFormula.sHelp);
+ aFld.SetToolTip(aFormula.sToolTip);
+
+ rDoc.InsertPoolItem( *pPaM, SwFmtFld(aFld), 0 );
+ return FLD_OK;
+ }
+ else
+ {
+ WW8PLCFx_Book* pB = pPlcxMan->GetBook();
+ String aBookmarkName;
+ if (pB!=NULL) {
+ WW8_CP currentCP=pF->nSCode;
+ WW8_CP currentLen=pF->nLen;
+
+ sal_uInt16 bkmFindIdx;
+ String aBookmarkFind=pB->GetBookmark(currentCP-1, currentCP+currentLen-1, bkmFindIdx);
+
if (aBookmarkFind.Len()>0) {
- aBookmarkName=aBookmarkFind;
+ pB->SetStatus(bkmFindIdx, BOOK_FIELD); // mark bookmark as consumed, such that tl'll not get inserted as a "normal" bookmark again
+ if (aBookmarkFind.Len()>0) {
+ aBookmarkName=aBookmarkFind;
+ }
}
}
- }
- if (pB!=NULL && aBookmarkName.Len()==0) {
- aBookmarkName=pB->GetUniqueBookmarkName(aFormula.sTitle);
- }
+ if (pB!=NULL && aBookmarkName.Len()==0) {
+ aBookmarkName=pB->GetUniqueBookmarkName(aFormula.sTitle);
+ }
- if (aBookmarkName.Len()>0) {
- maFieldStack.back().SetBookmarkName(aBookmarkName);
- maFieldStack.back().SetBookmarkType(::rtl::OUString::createFromAscii(ODF_FORMTEXT));
- maFieldStack.back().getParameters()[::rtl::OUString::createFromAscii("Description")] = uno::makeAny(::rtl::OUString(aFormula.sToolTip));
- maFieldStack.back().getParameters()[::rtl::OUString::createFromAscii("Name")] = uno::makeAny(::rtl::OUString(aFormula.sTitle));
- }
- return FLD_TEXT;
+ if (aBookmarkName.Len()>0) {
+ maFieldStack.back().SetBookmarkName(aBookmarkName);
+ maFieldStack.back().SetBookmarkType(::rtl::OUString::createFromAscii(ODF_FORMTEXT));
+ maFieldStack.back().getParameters()[::rtl::OUString::createFromAscii("Description")] = uno::makeAny(::rtl::OUString(aFormula.sToolTip));
+ maFieldStack.back().getParameters()[::rtl::OUString::createFromAscii("Name")] = uno::makeAny(::rtl::OUString(aFormula.sTitle));
+ }
+ return FLD_TEXT;
}
}
@@ -197,49 +204,52 @@ eF_ResT SwWW8ImplReader::Read_F_FormCheckBox( WW8FieldDesc* pF, String& rStr )
const SvtFilterOptions* pOpt = SvtFilterOptions::Get();
sal_Bool bUseEnhFields=(pOpt && pOpt->IsUseEnhancedFields());
- if (!bUseEnhFields) {
- pFormImpl->InsertFormula(aFormula);
- return FLD_OK;
- } else {
- String aBookmarkName;
- WW8PLCFx_Book* pB = pPlcxMan->GetBook();
- if (pB!=NULL) {
- WW8_CP currentCP=pF->nSCode;
- WW8_CP currentLen=pF->nLen;
-
- sal_uInt16 bkmFindIdx;
- String aBookmarkFind=pB->GetBookmark(currentCP-1, currentCP+currentLen-1, bkmFindIdx);
-
- if (aBookmarkFind.Len()>0) {
- pB->SetStatus(bkmFindIdx, BOOK_FIELD); // mark as consumed by field
+ if (!bUseEnhFields)
+ {
+ pFormImpl->InsertFormula(aFormula);
+ return FLD_OK;
+ }
+ else
+ {
+ String aBookmarkName;
+ WW8PLCFx_Book* pB = pPlcxMan->GetBook();
+ if (pB!=NULL) {
+ WW8_CP currentCP=pF->nSCode;
+ WW8_CP currentLen=pF->nLen;
+
+ sal_uInt16 bkmFindIdx;
+ String aBookmarkFind=pB->GetBookmark(currentCP-1, currentCP+currentLen-1, bkmFindIdx);
+
if (aBookmarkFind.Len()>0) {
- aBookmarkName=aBookmarkFind;
+ pB->SetStatus(bkmFindIdx, BOOK_FIELD); // mark as consumed by field
+ if (aBookmarkFind.Len()>0) {
+ aBookmarkName=aBookmarkFind;
+ }
}
}
- }
- if (pB!=NULL && aBookmarkName.Len()==0) {
- aBookmarkName=pB->GetUniqueBookmarkName(aFormula.sTitle);
- }
+ if (pB!=NULL && aBookmarkName.Len()==0) {
+ aBookmarkName=pB->GetUniqueBookmarkName(aFormula.sTitle);
+ }
- if (aBookmarkName.Len()>0)
- {
- IDocumentMarkAccess* pMarksAccess = rDoc.getIDocumentMarkAccess( );
- IFieldmark* pFieldmark = dynamic_cast<IFieldmark*>( pMarksAccess->makeNoTextFieldBookmark(
+ if (aBookmarkName.Len()>0)
+ {
+ IDocumentMarkAccess* pMarksAccess = rDoc.getIDocumentMarkAccess( );
+ IFieldmark* pFieldmark = dynamic_cast<IFieldmark*>( pMarksAccess->makeNoTextFieldBookmark(
*pPaM, aBookmarkName,
rtl::OUString::createFromAscii( ODF_FORMCHECKBOX ) ) );
- ASSERT(pFieldmark!=NULL, "hmmm; why was the bookmark not created?");
- if (pFieldmark!=NULL) {
- IFieldmark::parameter_map_t* const pParameters = pFieldmark->GetParameters();
- ICheckboxFieldmark* pCheckboxFm = dynamic_cast<ICheckboxFieldmark*>(pFieldmark);
- (*pParameters)[::rtl::OUString::createFromAscii(ODF_FORMCHECKBOX_NAME)] = uno::makeAny(::rtl::OUString(aFormula.sTitle));
- (*pParameters)[::rtl::OUString::createFromAscii(ODF_FORMCHECKBOX_HELPTEXT)] = uno::makeAny(::rtl::OUString(aFormula.sToolTip));
- if(pCheckboxFm)
- pCheckboxFm->SetChecked(aFormula.nChecked);
- // set field data here...
+ ASSERT(pFieldmark!=NULL, "hmmm; why was the bookmark not created?");
+ if (pFieldmark!=NULL) {
+ IFieldmark::parameter_map_t* const pParameters = pFieldmark->GetParameters();
+ ICheckboxFieldmark* pCheckboxFm = dynamic_cast<ICheckboxFieldmark*>(pFieldmark);
+ (*pParameters)[::rtl::OUString::createFromAscii(ODF_FORMCHECKBOX_NAME)] = uno::makeAny(::rtl::OUString(aFormula.sTitle));
+ (*pParameters)[::rtl::OUString::createFromAscii(ODF_FORMCHECKBOX_HELPTEXT)] = uno::makeAny(::rtl::OUString(aFormula.sToolTip));
+ if(pCheckboxFm)
+ pCheckboxFm->SetChecked(aFormula.nChecked);
+ // set field data here...
+ }
}
- }
- return FLD_OK;
+ return FLD_OK;
}
}
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index d6c1278a25df..115d982cbdb5 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -1227,8 +1227,8 @@ eF_ResT SwWW8ImplReader::Read_F_Input( WW8FieldDesc* pF, String& rStr )
if( !aDef.Len() )
aDef = GetFieldResult( pF );
- SwInputField aFld( (SwInputFieldType*)rDoc.GetSysFldType( RES_INPUTFLD ),
- aDef, aQ, INP_TXT, 0 ); // sichtbar ( geht z.Zt. nicht anders )
+ SwInputField aFld( static_cast<SwInputFieldType*>(rDoc.GetSysFldType( RES_INPUTFLD )),
+ aDef, aQ, INP_TXT, 0, false );
rDoc.InsertPoolItem( *pPaM, SwFmtFld( aFld ), 0 );
return FLD_OK;
@@ -2668,8 +2668,8 @@ void SwWW8ImplReader::Read_SubF_Combined( _ReadFieldParams& rReadParam)
sCombinedCharacters = sPart.Copy( nBegin+1, nEnd-nBegin-1 );
if ( sCombinedCharacters.Len() )
{
- SwInputField aFld( (SwInputFieldType*)rDoc.GetSysFldType( RES_INPUTFLD ),
- sCombinedCharacters, sCombinedCharacters, INP_TXT, 0 );
+ SwInputField aFld( static_cast<SwInputFieldType*>(rDoc.GetSysFldType( RES_INPUTFLD )),
+ sCombinedCharacters, sCombinedCharacters, INP_TXT, 0, false );
rDoc.InsertPoolItem( *pPaM, SwFmtFld( aFld ), 0 ); // insert input field
}
}
diff --git a/sw/source/ui/app/applab.cxx b/sw/source/ui/app/applab.cxx
index 388e298bcc04..2d3886a9e48b 100644
--- a/sw/source/ui/app/applab.cxx
+++ b/sw/source/ui/app/applab.cxx
@@ -310,7 +310,7 @@ static sal_uInt16 nBCTitleNo = 0;
if ( nMin > 0 )
{
SvxLRSpaceItem aLR( RES_LR_SPACE );
- pSh->SetAttr( aLR );
+ pSh->SetAttrItem( aLR );
SwFmt *pStandard = pSh->GetTxtCollFromPool( RES_POOLCOLL_STANDARD );
aLR.SetLeft ( sal_uInt16(nMin) );
aLR.SetRight( sal_uInt16(nMin) );
diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx
index dbb2327a3172..606434e106f8 100644
--- a/sw/source/ui/app/docsh.cxx
+++ b/sw/source/ui/app/docsh.cxx
@@ -103,6 +103,9 @@
#include <unotools/fltrcfg.hxx>
#include <svtools/htmlcfg.hxx>
#include <sfx2/fcontnr.hxx>
+//IAccessibility2 Implementation 2009-----
+#include <sfx2/viewfrm.hxx>
+//-----IAccessibility2 Implementation 2009
#include <sfx2/objface.hxx>
#include <comphelper/storagehelper.hxx>
@@ -399,6 +402,22 @@ sal_Bool SwDocShell::SaveAs( SfxMedium& rMedium )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDocShell::SaveAs" );
+ //IAccessibility2 Implementation 2009-----
+ pDoc->setDocAccTitle(String());
+ SfxViewFrame* pFrame1 = SfxViewFrame::GetFirst( this );
+ if (pFrame1)
+ {
+ Window* pWindow = &pFrame1->GetWindow();
+ if ( pWindow )
+ {
+ Window* pSysWin = pWindow->GetSystemWindow();
+ if ( pSysWin )
+ {
+ pSysWin->SetAccessibleName(String());
+ }
+ }
+ }
+ //-----IAccessibility2 Implementation 2009
SwWait aWait( *this, sal_True );
//#i3370# remove quick help to prevent saving of autocorrection suggestions
if(pView)
@@ -1264,6 +1283,43 @@ uno::Reference< frame::XController >
/* -----------------------------12.02.01 12:08--------------------------------
---------------------------------------------------------------------------*/
+//IAccessibility2 Implementation 2009-----
+void SwDocShell::setDocAccTitle( const String& rTitle )
+{
+ if (pDoc )
+ {
+ pDoc->setDocAccTitle( rTitle );
+ }
+}
+const String SwDocShell::getDocAccTitle() const
+{
+ String sRet;
+ if (pDoc)
+ {
+ sRet = pDoc->getDocAccTitle();
+ }
+
+ return sRet;
+}
+
+void SwDocShell::setDocReadOnly( sal_Bool bReadOnly)
+{
+ if (pDoc )
+ {
+ pDoc->setDocReadOnly( bReadOnly );
+ }
+}
+sal_Bool SwDocShell::getDocReadOnly() const
+{
+ if (pDoc)
+ {
+ return pDoc->getDocReadOnly();
+ }
+
+ return sal_False;
+}
+//-----IAccessibility2 Implementation 2009
+
static const char* s_EventNames[] =
{
"OnPageCountChange",
diff --git a/sw/source/ui/app/docst.cxx b/sw/source/ui/app/docst.cxx
index b28ff49de918..ffaefbe8ae31 100644
--- a/sw/source/ui/app/docst.cxx
+++ b/sw/source/ui/app/docst.cxx
@@ -878,7 +878,7 @@ sal_uInt16 SwDocShell::ApplyStyles(const String &rName, sal_uInt16 nFamily,
case SFX_STYLE_FAMILY_CHAR:
{
SwFmtCharFmt aFmt(pStyle->GetCharFmt());
- pSh->SetAttr( aFmt, (nMode & KEY_SHIFT) ?
+ pSh->SetAttrItem( aFmt, (nMode & KEY_SHIFT) ?
nsSetAttrMode::SETATTR_DONTREPLACE : nsSetAttrMode::SETATTR_DEFAULT );
break;
}
@@ -1184,7 +1184,7 @@ sal_uInt16 SwDocShell::MakeByExample( const String &rName, sal_uInt16 nFamily,
pCurrWrtShell->FillByEx( pChar );
pChar->SetDerivedFrom( pCurrWrtShell->GetCurCharFmt() );
SwFmtCharFmt aFmt( pChar );
- pCurrWrtShell->SetAttr( aFmt );
+ pCurrWrtShell->SetAttrItem( aFmt );
pCurrWrtShell->EndAllAction();
}
}
diff --git a/sw/source/ui/cctrl/actctrl.cxx b/sw/source/ui/cctrl/actctrl.cxx
index d8b6d52e13e5..bb9b291e9474 100644
--- a/sw/source/ui/cctrl/actctrl.cxx
+++ b/sw/source/ui/cctrl/actctrl.cxx
@@ -105,8 +105,13 @@ void NoSpaceEdit::Modify()
SetText(sTemp);
SetSelection(aSel);
}
+//IAccessibility2 Impplementaton 2009-----
+ Edit::Modify();
+ /*
if(GetModifyHdl().IsSet())
GetModifyHdl().Call(this);
+ */
+//-----IAccessibility2 Impplementaton 2009
}
/* -----------------25.06.2003 15:57-----------------
diff --git a/sw/source/ui/cctrl/swlbox.cxx b/sw/source/ui/cctrl/swlbox.cxx
index 39e0b8dc4c63..15e0a1f855ad 100644
--- a/sw/source/ui/cctrl/swlbox.cxx
+++ b/sw/source/ui/cctrl/swlbox.cxx
@@ -223,5 +223,11 @@ String SwComboBox::GetText() const
return aTxt;
}
-
-
+//IAccessibility2 Impplementaton 2009-----
+void SwComboBox::SetText( const XubString& rStr )
+{
+ ComboBox::SetText(rStr);
+ // MT: CallEventListeners stay protected for now. Probably not needed at all, as the implementation of VCLXAccessibelEdit/ComboBox should do it on text changed nowadays anyway. Verify.
+ // CallEventListeners( VCLEVENT_EDIT_MODIFY );
+}
+//-----IAccessibility2 Impplementaton 2009
diff --git a/sw/source/ui/chrdlg/swuiccoll.cxx b/sw/source/ui/chrdlg/swuiccoll.cxx
index 32db26d9b4b5..bd0e3bb71641 100644
--- a/sw/source/ui/chrdlg/swuiccoll.cxx
+++ b/sw/source/ui/chrdlg/swuiccoll.cxx
@@ -127,12 +127,17 @@ SwCondCollPage::SwCondCollPage(Window *pParent, const SfxItemSet &rSet)
break;
}
- const SfxStyleFilter& rFilterList = pFamilyItem->GetFilterList();
- for( i = 0; i < rFilterList.Count(); ++i)
+//IAccessibility2 Impplementaton 2009-----
+ if( pFamilyItem )
{
- aFilterLB.InsertEntry(rFilterList.GetObject(i)->aName);
- sal_uInt16* pFilter = new sal_uInt16(rFilterList.GetObject(i)->nFlags);
- aFilterLB.SetEntryData(i, pFilter);
+ const SfxStyleFilter& rFilterList = pFamilyItem->GetFilterList();
+ for( i = 0; i < rFilterList.Count(); ++i)
+ {
+ aFilterLB.InsertEntry(rFilterList.GetObject(i)->aName);
+ sal_uInt16* pFilter = new sal_uInt16(rFilterList.GetObject(i)->nFlags);
+ aFilterLB.SetEntryData(i, pFilter);
+ }
+//-----IAccessibility2 Impplementaton 2009
}
aFilterLB.SelectEntryPos(1);
diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx
index beb0c3398ad1..6bed9b350b48 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -457,6 +457,9 @@ SwEditRegionDlg::SwEditRegionDlg( Window* pParent, SwWrtShell& rWrtSh )
aPasswdPB.SetAccessibleRelationMemberOf(&aProtectFL);
aPasswdPB.SetAccessibleRelationLabeledBy(&aPasswdCB);
aSubRegionED.SetAccessibleName(aSubRegionFT.GetText());
+//IAccessibility2 Impplementaton 2009-----
+ aTree.SetAllEntriesAccessibleRoleType(TREEBOX_ALLITEM_ACCROLE_TYPE_TREE);
+//-----IAccessibility2 Impplementaton 2009
}
/* -----------------------------26.04.01 14:56--------------------------------
diff --git a/sw/source/ui/docvw/SidebarTxtControl.hxx b/sw/source/ui/docvw/SidebarTxtControl.hxx
index 99d016ea08cc..444242f5fe69 100644
--- a/sw/source/ui/docvw/SidebarTxtControl.hxx
+++ b/sw/source/ui/docvw/SidebarTxtControl.hxx
@@ -29,7 +29,7 @@
class OutlinerView;
class SwView;
class SwPostItMgr;
-class SpellCallbackInfo;
+struct SpellCallbackInfo;
namespace sw { namespace sidebarwindows {
diff --git a/sw/source/ui/docvw/edtdd.cxx b/sw/source/ui/docvw/edtdd.cxx
index ed2c44cc87e2..90e71bb8c7ce 100644
--- a/sw/source/ui/docvw/edtdd.cxx
+++ b/sw/source/ui/docvw/edtdd.cxx
@@ -266,7 +266,9 @@ sal_uInt16 SwEditWin::GetDropDestination( const Point& rPixPnt, SdrObject ** ppO
{
SwWrtShell &rSh = rView.GetWrtShell();
const Point aDocPt( PixelToLogic( rPixPnt ) );
- if( rSh.ChgCurrPam( aDocPt ) || rSh.IsOverReadOnlyPos( aDocPt ) )
+ if( rSh.ChgCurrPam( aDocPt )
+ || rSh.IsOverReadOnlyPos( aDocPt )
+ || rSh.DocPtInsideInputFld( aDocPt ) )
return 0;
SdrObject *pObj = NULL;
diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index bc62f772b709..4542681c7a3f 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -82,6 +82,7 @@
#include <dselect.hxx>
#include <textsh.hxx>
#include <shdwcrsr.hxx>
+#include <txatbase.hxx>
#include <fmtanchr.hxx>
#include <fmtornt.hxx>
#include <fmtfsize.hxx>
@@ -924,7 +925,7 @@ void SwEditWin::FlushInBuffer()
if(bLang)
{
SvxLanguageItem aLangItem( eBufferLanguage, nWhich );
- rSh.SetAttr( aLangItem );
+ rSh.SetAttrItem( aLangItem );
}
}
}
@@ -1372,8 +1373,8 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
// pressing this inside a note will switch to next/previous note
if ((rKeyCode.IsMod1() && rKeyCode.IsMod2()) && ((rKeyCode.GetCode() == KEY_PAGEUP) || (rKeyCode.GetCode() == KEY_PAGEDOWN)))
{
- bool bNext = rKeyCode.GetCode()==KEY_PAGEDOWN ? true : false;
- SwFieldType* pFldType = rSh.GetFldType(0, RES_POSTITFLD);
+ const bool bNext = rKeyCode.GetCode()==KEY_PAGEDOWN ? true : false;
+ const SwFieldType* pFldType = rSh.GetFldType( 0, RES_POSTITFLD );
rSh.MoveFldType( pFldType, bNext );
return;
}
@@ -1491,9 +1492,8 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
- SW_KeyState eKeyState = bIsDocReadOnly ? KS_CheckDocReadOnlyKeys
- : KS_CheckKey,
- eNextKeyState = KS_Ende;
+ SW_KeyState eKeyState = bIsDocReadOnly ? KS_CheckDocReadOnlyKeys : KS_CheckKey;
+ SW_KeyState eNextKeyState = KS_Ende;
sal_uInt8 nDir = 0;
if (nKS_NUMDOWN_Count > 0)
@@ -1778,7 +1778,8 @@ KEYINPUT_CHECKTABLE_INSDEL:
break;
case KEY_RETURN: // Return
- if( !rSh.HasReadonlySel() )
+ if ( !rSh.HasReadonlySel()
+ && !rSh.CrsrInsideInputFld() )
{
const int nSelectionType = rSh.GetSelectionType();
if(nSelectionType & nsSelectionType::SEL_OLE)
@@ -1814,8 +1815,13 @@ KEYINPUT_CHECKTABLE_INSDEL:
break;
case KEY_RETURN | KEY_MOD2: // ALT-Return
- if( !rSh.HasReadonlySel() && !rSh.IsSttPara() && rSh.GetCurNumRule() )
+ if ( !rSh.HasReadonlySel()
+ && !rSh.IsSttPara()
+ && rSh.GetCurNumRule()
+ && !rSh.CrsrInsideInputFld() )
+ {
eKeyState = KS_NoNum;
+ }
else if( rSh.CanSpecialInsert() )
eKeyState = KS_SpecialInsert;
break;
@@ -1926,6 +1932,11 @@ KEYINPUT_CHECKTABLE_INSDEL:
{
eKeyState=KS_GotoNextFieldMark;
}
+ else if ( !rSh.IsMultiSelection() && rSh.CrsrInsideInputFld() )
+ {
+ GetView().GetViewFrame()->GetDispatcher()->Execute( FN_GOTO_NEXT_INPUTFLD );
+ eKeyState = KS_Ende;
+ }
else
if( rSh.GetCurNumRule() && rSh.IsSttOfPara() &&
!rSh.HasReadonlySel() )
@@ -1976,9 +1987,15 @@ KEYINPUT_CHECKTABLE_INSDEL:
sal_Bool bOld = rSh.ChgCrsrTimerFlag( sal_False );
sal_Bool bOld = rSh.ChgCrsrTimerFlag( sal_False );
#endif
- if (rSh.IsFormProtected() || rSh.GetCurrentFieldmark()|| rSh.GetChar(sal_False)==CH_TXT_ATR_FORMELEMENT) {
+ if (rSh.IsFormProtected() || rSh.GetCurrentFieldmark()|| rSh.GetChar(sal_False)==CH_TXT_ATR_FORMELEMENT)
+ {
eKeyState=KS_GotoPrevFieldMark;
}
+ else if ( !rSh.IsMultiSelection() && rSh.CrsrInsideInputFld() )
+ {
+ GetView().GetViewFrame()->GetDispatcher()->Execute( FN_GOTO_PREV_INPUTFLD );
+ eKeyState = KS_Ende;
+ }
else if( rSh.GetCurNumRule() && rSh.IsSttOfPara() &&
!rSh.HasReadonlySel() )
{
@@ -2094,9 +2111,15 @@ KEYINPUT_CHECKTABLE_INSDEL:
eKeyState = rKeyCode.GetModifier() & KEY_SHIFT ?
KS_PrevObject : KS_NextObject;
}
+ else if ( !rSh.IsMultiSelection() && rSh.CrsrInsideInputFld() )
+ {
+ GetView().GetViewFrame()->GetDispatcher()->Execute(
+ KEY_SHIFT != rKeyCode.GetModifier() ? FN_GOTO_NEXT_INPUTFLD : FN_GOTO_PREV_INPUTFLD );
+ }
else
- rSh.SelectNextPrevHyperlink(
- KEY_SHIFT != rKeyCode.GetModifier() );
+ {
+ rSh.SelectNextPrevHyperlink( KEY_SHIFT != rKeyCode.GetModifier() );
+ }
break;
case KEY_RETURN:
{
@@ -2739,12 +2762,6 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
}
}
- //Man kann sich in einem Selektionszustand befinden, wenn zuletzt
- //mit dem Keyboard selektiert wurde, aber noch kein CURSOR_KEY
- //anschliessend bewegt worden ist. In diesem Fall muss die vorher-
- //gehende Selektion zuerst beendet werden.
- //MA 07. Oct. 95: Und zwar nicht nur bei Linker Maustaste sondern immer.
- //siehe auch Bug: 19263
if ( rSh.IsInSelect() )
rSh.EndSelect();
@@ -4165,7 +4182,19 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
if( SwContentAtPos::SW_FIELD == aCntntAtPos.eCntntAtPos )
{
- rSh.ClickToField( *aCntntAtPos.aFnd.pFld );
+ if ( aCntntAtPos.pFndTxtAttr != NULL
+ && aCntntAtPos.pFndTxtAttr->Which() == RES_TXTATR_INPUTFIELD )
+ {
+ // select content of Input Field, but exclude CH_TXT_ATR_INPUTFIELDSTART
+ // and CH_TXT_ATR_INPUTFIELDEND
+ rSh.SttSelect();
+ rSh.SelectTxt( *(aCntntAtPos.pFndTxtAttr->GetStart()) + 1,
+ *(aCntntAtPos.pFndTxtAttr->End()) - 1 );
+ }
+ else
+ {
+ rSh.ClickToField( *aCntntAtPos.aFnd.pFld );
+ }
}
else if ( SwContentAtPos::SW_SMARTTAG == aCntntAtPos.eCntntAtPos )
{
@@ -4320,10 +4349,10 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
Color aColor( COL_TRANSPARENT );
if( !SwEditWin::bTransparentBackColor )
aColor = SwEditWin::aTextBackColor;
- rSh.SetAttr( SvxBrushItem( aColor, nId ) );
+ rSh.SetAttrItem( SvxBrushItem( aColor, nId ) );
}
else
- rSh.SetAttr( SvxColorItem(SwEditWin::aTextColor, nId) );
+ rSh.SetAttrItem( SvxColorItem(SwEditWin::aTextColor, nId) );
rSh.UnSetVisCrsr();
rSh.EnterStdMode();
rSh.SetVisCrsr(aDocPt);
@@ -4359,7 +4388,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
if( (( nsSelectionType::SEL_TXT | nsSelectionType::SEL_TBL )
& eSelection ) && !rSh.HasReadonlySel() )
{
- rSh.SetAttr( SwFmtCharFmt(pApplyTempl->aColl.pCharFmt) );
+ rSh.SetAttrItem( SwFmtCharFmt(pApplyTempl->aColl.pCharFmt) );
rSh.UnSetVisCrsr();
rSh.EnterStdMode();
rSh.SetVisCrsr(aDocPt);
@@ -5709,3 +5738,17 @@ Selection SwEditWin::GetSurroundingTextSelection() const
return Selection( nPos - nStartPos, nPos - nStartPos );
}
}
+//IAccessibility2 Implementation 2009-----
+// MT: Removed Windows::SwitchView() introduced with IA2 CWS.
+// There are other notifications for this when the active view has chnaged, so please update the code to use that event mechanism
+void SwEditWin::SwitchView()
+{
+#ifdef ACCESSIBLE_LAYOUT
+ if (!Application::IsAccessibilityEnabled())
+ {
+ return ;
+ }
+ rView.GetWrtShell().InvalidateAccessibleFocus();
+#endif
+}
+//-----IAccessibility2 Implementation 2009
diff --git a/sw/source/ui/docvw/edtwin2.cxx b/sw/source/ui/docvw/edtwin2.cxx
index f5cd0a3ae993..d56aa0859bfa 100644
--- a/sw/source/ui/docvw/edtwin2.cxx
+++ b/sw/source/ui/docvw/edtwin2.cxx
@@ -136,13 +136,13 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
SwContentAtPos::SW_SMARTTAG |
#ifdef DBG_UTIL
SwContentAtPos::SW_TABLEBOXVALUE |
- ( bBalloon ? SwContentAtPos::SW_CURR_ATTRS : 0) |
+ ( bBalloon ? SwContentAtPos::SW_CURR_ATTRS : 0) |
#endif
SwContentAtPos::SW_TABLEBOXFML );
if( rSh.GetContentAtPos( aPos, aCntntAtPos, sal_False, &aFldRect ) )
{
- switch( aCntntAtPos.eCntntAtPos )
+ switch( aCntntAtPos.eCntntAtPos )
{
case SwContentAtPos::SW_TABLEBOXFML:
sTxt.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "= " ));
@@ -150,98 +150,92 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
break;
#ifdef DBG_UTIL
case SwContentAtPos::SW_TABLEBOXVALUE:
- {
- sTxt = UniString(
- ByteString::CreateFromDouble(
- ((SwTblBoxValue*)aCntntAtPos.aFnd.pAttr)->GetValue() )
- , gsl_getSystemTextEncoding());
- }
- break;
+ {
+ sTxt = UniString(
+ ByteString::CreateFromDouble(
+ ((SwTblBoxValue*)aCntntAtPos.aFnd.pAttr)->GetValue() )
+ , gsl_getSystemTextEncoding());
+ }
+ break;
case SwContentAtPos::SW_CURR_ATTRS:
sTxt = aCntntAtPos.sStr;
break;
#endif
case SwContentAtPos::SW_INETATTR:
- {
- sTxt = ((SfxStringItem*)aCntntAtPos.aFnd.pAttr)->GetValue();
- sTxt = URIHelper::removePassword( sTxt,
- INetURLObject::WAS_ENCODED,
- INetURLObject::DECODE_UNAMBIGUOUS);
- //#i63832# remove the link target type
- xub_StrLen nFound = sTxt.Search(cMarkSeperator);
- if( nFound != STRING_NOTFOUND && (++nFound) < sTxt.Len() )
{
- String sSuffix( sTxt.Copy(nFound) );
- if( sSuffix.EqualsAscii( pMarkToTable ) ||
- sSuffix.EqualsAscii( pMarkToFrame ) ||
- sSuffix.EqualsAscii( pMarkToRegion ) ||
- sSuffix.EqualsAscii( pMarkToOutline ) ||
- sSuffix.EqualsAscii( pMarkToText ) ||
- sSuffix.EqualsAscii( pMarkToGraphic ) ||
- sSuffix.EqualsAscii( pMarkToOLE ))
- sTxt = sTxt.Copy( 0, nFound - 1);
- }
- // --> OD 2009-08-18 #i104300#
- // special handling if target is a cross-reference bookmark
- {
- String sTmpSearchStr = sTxt.Copy( 1, sTxt.Len() );
- IDocumentMarkAccess* const pMarkAccess =
- rSh.getIDocumentMarkAccess();
- IDocumentMarkAccess::const_iterator_t ppBkmk =
- pMarkAccess->findBookmark( sTmpSearchStr );
- if ( ppBkmk != pMarkAccess->getBookmarksEnd() &&
- IDocumentMarkAccess::GetType( *(ppBkmk->get()) )
- == IDocumentMarkAccess::CROSSREF_HEADING_BOOKMARK )
+ sTxt = ((SfxStringItem*)aCntntAtPos.aFnd.pAttr)->GetValue();
+ sTxt = URIHelper::removePassword( sTxt,
+ INetURLObject::WAS_ENCODED,
+ INetURLObject::DECODE_UNAMBIGUOUS);
+ //#i63832# remove the link target type
+ xub_StrLen nFound = sTxt.Search(cMarkSeperator);
+ if( nFound != STRING_NOTFOUND && (++nFound) < sTxt.Len() )
+ {
+ String sSuffix( sTxt.Copy(nFound) );
+ if( sSuffix.EqualsAscii( pMarkToTable ) ||
+ sSuffix.EqualsAscii( pMarkToFrame ) ||
+ sSuffix.EqualsAscii( pMarkToRegion ) ||
+ sSuffix.EqualsAscii( pMarkToOutline ) ||
+ sSuffix.EqualsAscii( pMarkToText ) ||
+ sSuffix.EqualsAscii( pMarkToGraphic ) ||
+ sSuffix.EqualsAscii( pMarkToOLE ))
+ sTxt = sTxt.Copy( 0, nFound - 1);
+ }
+ // special handling if target is a cross-reference bookmark
{
- SwTxtNode* pTxtNode = ppBkmk->get()->GetMarkStart().nNode.GetNode().GetTxtNode();
- if ( pTxtNode )
+ String sTmpSearchStr = sTxt.Copy( 1, sTxt.Len() );
+ IDocumentMarkAccess* const pMarkAccess = rSh.getIDocumentMarkAccess();
+ IDocumentMarkAccess::const_iterator_t ppBkmk = pMarkAccess->findBookmark( sTmpSearchStr );
+ if ( ppBkmk != pMarkAccess->getBookmarksEnd()
+ && IDocumentMarkAccess::GetType( *(ppBkmk->get()) ) == IDocumentMarkAccess::CROSSREF_HEADING_BOOKMARK )
{
- sTxt = pTxtNode->GetExpandTxt( 0, pTxtNode->Len(), true, true );
-
- if( sTxt.Len() )
+ SwTxtNode* pTxtNode = ppBkmk->get()->GetMarkStart().nNode.GetNode().GetTxtNode();
+ if ( pTxtNode )
{
- sTxt.EraseAllChars( 0xad );
- for( sal_Unicode* p = sTxt.GetBufferAccess(); *p; ++p )
+ sTxt = pTxtNode->GetExpandTxt( 0, pTxtNode->Len(), true, true );
+
+ if( sTxt.Len() )
{
- if( *p < 0x20 )
- *p = 0x20;
- else if(*p == 0x2011)
- *p = '-';
+ sTxt.EraseAllChars( 0xad );
+ for( sal_Unicode* p = sTxt.GetBufferAccess(); *p; ++p )
+ {
+ if( *p < 0x20 )
+ *p = 0x20;
+ else if(*p == 0x2011)
+ *p = '-';
+ }
}
}
}
}
- }
- // <--
- // --> OD 2007-07-26 #i80029#
- sal_Bool bExecHyperlinks = rView.GetDocShell()->IsReadOnly();
- if ( !bExecHyperlinks )
- {
- SvtSecurityOptions aSecOpts;
- bExecHyperlinks = !aSecOpts.IsOptionSet( SvtSecurityOptions::E_CTRLCLICK_HYPERLINK );
+ sal_Bool bExecHyperlinks = rView.GetDocShell()->IsReadOnly();
if ( !bExecHyperlinks )
{
- sTxt.InsertAscii( ": ", 0 );
- sTxt.Insert( ViewShell::GetShellRes()->aHyperlinkClick, 0 );
+ SvtSecurityOptions aSecOpts;
+ bExecHyperlinks = !aSecOpts.IsOptionSet( SvtSecurityOptions::E_CTRLCLICK_HYPERLINK );
+
+ if ( !bExecHyperlinks )
+ {
+ sTxt.InsertAscii( ": ", 0 );
+ sTxt.Insert( ViewShell::GetShellRes()->aHyperlinkClick, 0 );
+ }
}
+ break;
}
- // <--
- break;
- }
case SwContentAtPos::SW_SMARTTAG:
- {
- sTxt = SW_RESSTR(STR_SMARTTAG_CLICK);
-
- KeyCode aCode( KEY_SPACE );
- KeyCode aModifiedCode( KEY_SPACE, KEY_MOD1 );
- String aModStr( aModifiedCode.GetName() );
- aModStr.SearchAndReplace( aCode.GetName(), String() );
- aModStr.SearchAndReplaceAllAscii( "+", String() );
- sTxt.SearchAndReplaceAllAscii( "%s", aModStr );
- }
- break;
+ {
+ sTxt = SW_RESSTR(STR_SMARTTAG_CLICK);
+
+ KeyCode aCode( KEY_SPACE );
+ KeyCode aModifiedCode( KEY_SPACE, KEY_MOD1 );
+ String aModStr( aModifiedCode.GetName() );
+ aModStr.SearchAndReplace( aCode.GetName(), String() );
+ aModStr.SearchAndReplaceAllAscii( "+", String() );
+ sTxt.SearchAndReplaceAllAscii( "%s", aModStr );
+ }
+ break;
case SwContentAtPos::SW_FTN:
if( aCntntAtPos.pFndTxtAttr && aCntntAtPos.aFnd.pAttr )
@@ -249,7 +243,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
const SwFmtFtn* pFtn = (SwFmtFtn*)aCntntAtPos.aFnd.pAttr;
pFtn->GetFtnText( sTxt );
sTxt.Insert( SW_RESSTR( pFtn->IsEndNote()
- ? STR_ENDNOTE : STR_FTNNOTE ), 0 );
+ ? STR_ENDNOTE : STR_FTNNOTE ), 0 );
if( aCntntAtPos.IsInRTLText() )
nStyle |= QUICKHELP_BIDI_RTL;
}
@@ -264,7 +258,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
if( sTxt.Len() && aCntntAtPos.pFndTxtAttr )
{
const SwTOXType* pTType = aCntntAtPos.pFndTxtAttr->
- GetTOXMark().GetTOXType();
+ GetTOXMark().GetTOXType();
if( pTType && pTType->GetTypeName().Len() )
{
sTxt.InsertAscii( ": ", 0 );
@@ -272,6 +266,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
}
}
break;
+
case SwContentAtPos::SW_REFMARK:
if(aCntntAtPos.aFnd.pAttr)
{
@@ -279,7 +274,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
sTxt.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": "));
sTxt += ((const SwFmtRefMark*)aCntntAtPos.aFnd.pAttr)->GetRefName();
}
- break;
+ break;
default:
{
@@ -292,34 +287,16 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
case RES_SETEXPFLD:
case RES_TABLEFLD:
case RES_GETEXPFLD:
- {
- sal_uInt16 nOldSubType = pFld->GetSubType();
- ((SwField*)pFld)->SetSubType(nsSwExtendedSubType::SUB_CMD);
- sTxt = pFld->ExpandField(true);
- ((SwField*)pFld)->SetSubType(nOldSubType);
- }
- break;
+ {
+ sal_uInt16 nOldSubType = pFld->GetSubType();
+ ((SwField*)pFld)->SetSubType(nsSwExtendedSubType::SUB_CMD);
+ sTxt = pFld->ExpandField(true);
+ ((SwField*)pFld)->SetSubType(nOldSubType);
+ }
+ break;
case RES_POSTITFLD:
{
- /*
- SwPostItMgr* pMgr = rView.GetPostItMgr();
- if (pMgr->ShowNotes())
- {
- SwFmtFld* pSwFmtFld = 0;
- if (pMgr->ShowPreview(pFld,pSwFmtFld))
- {
- SwPostIt* pPostIt = new SwPostIt(static_cast<Window*>(this),0,pSwFmtFld,pMgr,PB_Preview);
- pPostIt->InitControls();
- pPostIt->SetReadonly(true);
- pMgr->SetColors(pPostIt,static_cast<SwPostItField*>(pSwFmtFld->GetFld()));
- pPostIt->SetVirtualPosSize(rEvt.GetMousePosPixel(),Size(180,70));
- pPostIt->ShowNote();
- SetPointerPosPixel(pPostIt->GetPosPixel() + Point(20,20));
- }
- return;
- }
- */
break;
}
case RES_INPUTFLD: // BubbleHelp, da der Hinweis ggf ziemlich lang sein kann
@@ -346,33 +323,31 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
break;
case RES_GETREFFLD:
- {
- // --> OD 2008-01-09 #i85090#
- const SwGetRefField* pRefFld( dynamic_cast<const SwGetRefField*>(pFld) );
- ASSERT( pRefFld,
- "<SwEditWin::RequestHelp(..)> - unexpected type of <pFld>" );
- if ( pRefFld )
{
- if ( pRefFld->IsRefToHeadingCrossRefBookmark() ||
- pRefFld->IsRefToNumItemCrossRefBookmark() )
+ const SwGetRefField* pRefFld( dynamic_cast<const SwGetRefField*>(pFld) );
+ ASSERT( pRefFld,
+ "<SwEditWin::RequestHelp(..)> - unexpected type of <pFld>" );
+ if ( pRefFld )
{
- sTxt = pRefFld->GetExpandedTxtOfReferencedTxtNode();
- if ( sTxt.Len() > 80 )
+ if ( pRefFld->IsRefToHeadingCrossRefBookmark() ||
+ pRefFld->IsRefToNumItemCrossRefBookmark() )
{
- sTxt.Erase( 80 );
- sTxt += '.';
- sTxt += '.';
- sTxt += '.';
+ sTxt = pRefFld->GetExpandedTxtOfReferencedTxtNode();
+ if ( sTxt.Len() > 80 )
+ {
+ sTxt.Erase( 80 );
+ sTxt += '.';
+ sTxt += '.';
+ sTxt += '.';
+ }
+ }
+ else
+ {
+ sTxt = ((SwGetRefField*)pFld)->GetSetRefName();
}
- }
- else
- {
- sTxt = ((SwGetRefField*)pFld)->GetSetRefName();
}
}
- // <--
- }
- break;
+ break;
}
}
@@ -380,8 +355,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
{
aCntntAtPos.eCntntAtPos = SwContentAtPos::SW_REDLINE;
if( rSh.GetContentAtPos( aPos, aCntntAtPos, sal_False, &aFldRect ) )
- lcl_GetRedlineHelp( *aCntntAtPos.aFnd.pRedl,
- sTxt, bBalloon );
+ lcl_GetRedlineHelp( *aCntntAtPos.aFnd.pRedl, sTxt, bBalloon );
}
}
}
@@ -419,7 +393,6 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
case SW_TABROW_VERT:
nTabRes = STR_TABLE_ROW_ADJUST;
break;
- // --> FME 2004-07-30 #i32329# Enhanced table selection
case SW_TABSEL_HORI:
case SW_TABSEL_HORI_RTL:
case SW_TABSEL_VERT:
@@ -434,7 +407,6 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
case SW_TABCOLSEL_VERT:
nTabRes = STR_TABLE_SELECT_COL;
break;
- // <--
}
if(nTabRes)
{
diff --git a/sw/source/ui/docvw/edtwin3.cxx b/sw/source/ui/docvw/edtwin3.cxx
index 2f8b144badc9..525761819529 100644
--- a/sw/source/ui/docvw/edtwin3.cxx
+++ b/sw/source/ui/docvw/edtwin3.cxx
@@ -142,6 +142,34 @@ sal_Bool SwEditWin::RulerMarginDrag( const MouseEvent& rMEvt,
return !rRuler.StartDocDrag( rMEvt, RULER_TYPE_INDENT);
}
// <--
+//IAccessibility2 Impplementaton 2009-----
+void AccessibilityScrollMDI(ViewShell* pVwSh, const SwRect& rRect , sal_uInt16 nRangeX, sal_uInt16 nRangeY, sal_Bool isLeftTop)
+{
+ SfxViewShell *pSfxVwSh = pVwSh->GetSfxViewShell();
+ SwView* pView = dynamic_cast< SwView* >(pSfxVwSh);
+
+ if(pView)
+ {
+ Size aSz( rRect.Left(), rRect.Top());
+ aSz = pView->GetEditWin().PixelToLogic( aSz );
+
+ Point aTopLeft( aSz.Width(), aSz.Height() );
+ Point aPoint;
+ Rectangle aRect(aTopLeft,aPoint);
+
+ sal_Bool bIsCrsrAtTop = pView->IsCrsrAtTop();
+ sal_Bool bIsCrsrAtCenter = pView->IsCrsrAtCenter();
+ if(isLeftTop)
+ pView->SetCrsrAtTop(sal_True);
+
+ pView->Scroll( aRect, nRangeX, nRangeY );
+
+ if(isLeftTop)
+ pView->SetCrsrAtTop(bIsCrsrAtTop, bIsCrsrAtCenter);
+ }
+
+}
+//-----IAccessibility2 Impplementaton 2009
LAYOUT_NS Dialog* GetSearchDialog()
{
diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx
index f8ac5a382c80..b6fd646319c7 100644
--- a/sw/source/ui/envelp/envfmt.cxx
+++ b/sw/source/ui/envelp/envfmt.cxx
@@ -300,7 +300,6 @@ IMPL_LINK( SwEnvFmtPage, EditHdl, MenuButton *, pButton )
pCollSet->Put( aTmpBrush );
}
aOutputSet.ClearItem( RES_BACKGROUND );
- //pColl->SetAttr( aTmpSet );
pCollSet->Put(aOutputSet);
}
delete pDlg;
@@ -354,7 +353,6 @@ IMPL_LINK( SwEnvFmtPage, EditHdl, MenuButton *, pButton )
}
if( pOutputSet->Count() )
{
- //pColl->SetAttr( *pOutputSet );
pCollSet->Put(*pOutputSet);
}
}
diff --git a/sw/source/ui/fldui/fldedt.cxx b/sw/source/ui/fldui/fldedt.cxx
index 8199757e3335..5b09fcd846fc 100644
--- a/sw/source/ui/fldui/fldedt.cxx
+++ b/sw/source/ui/fldui/fldedt.cxx
@@ -33,45 +33,24 @@
#include <sfx2/app.hxx>
#include <svx/optgenrl.hxx>
#include <docufld.hxx>
-#ifndef _VIEW_HXX
+#include <expfld.hxx>
#include <view.hxx>
-#endif
#include <dbfld.hxx>
#include <wrtsh.hxx>
-#ifndef _FLDDB_HXX
#include <flddb.hxx>
-#endif
-#ifndef _FLDDINF_HXX
#include <flddinf.hxx>
-#endif
-#ifndef _FLDVAR_HXX
#include <fldvar.hxx>
-#endif
-#ifndef _FLDDOK_HXX
#include <flddok.hxx>
-#endif
-#ifndef _FLDFUNC_HXX
#include <fldfunc.hxx>
-#endif
-#ifndef _FLDREF_HXX
#include <fldref.hxx>
-#endif
#include <fldedt.hxx>
#include <crsskip.hxx>
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
-#ifndef _HELPID_H
#include <helpid.h>
-#endif
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
-#ifndef _FLDUI_HRC
#include <fldui.hrc>
-#endif
#include "swabstdlg.hxx"
#include "dialog.hrc"
@@ -103,10 +82,21 @@ SwFldEditDlg::SwFldEditDlg(SwView& rVw) :
pSh->SetCareWin(this);
- /* #108536# Only create selection if there is none
- already. Normalize PaM instead of swapping. */
+ if ( pSh->CrsrInsideInputFld() )
+ {
+ // move cursor to start of Input Field
+ SwInputField* pInputFld = dynamic_cast<SwInputField*>(pCurFld);
+ if ( pInputFld != NULL
+ && pInputFld->GetFmtFld() != NULL )
+ {
+ pSh->GotoField( *(pInputFld->GetFmtFld()) );
+ }
+ }
+
if ( ! pSh->HasSelection() )
+ {
pSh->Right(CRSR_SKIP_CHARS, sal_True, 1, sal_False );
+ }
pSh->NormalizePam();
diff --git a/sw/source/ui/fldui/fldmgr.cxx b/sw/source/ui/fldui/fldmgr.cxx
index 4cfdc0078497..78b43ea2ce89 100644
--- a/sw/source/ui/fldui/fldmgr.cxx
+++ b/sw/source/ui/fldui/fldmgr.cxx
@@ -343,7 +343,7 @@ SwField* SwFldMgr::GetCurFld()
{
SwWrtShell *pSh = pWrtShell ? pWrtShell : ::lcl_GetShell();
if ( pSh )
- pCurFld = pSh->GetCurFld();
+ pCurFld = pSh->GetCurFld( true );
else
pCurFld = NULL;
@@ -818,10 +818,12 @@ sal_Bool SwFldMgr::GoNextPrev( sal_Bool bNext, SwFieldType* pTyp )
if (pTyp && pTyp->Which() == RES_DBFLD)
{
// Fuer Feldbefehl-bearbeiten (alle DB-Felder anspringen)
- return pSh->MoveFldType( 0, bNext, USHRT_MAX, RES_DBFLD );
+ return pSh->MoveFldType( 0, (bNext ? true : false), RES_DBFLD );
}
- return pTyp && pSh ? pSh->MoveFldType( pTyp, bNext ) : sal_False;
+ return (pTyp && pSh)
+ ? pSh->MoveFldType( pTyp, (bNext ? true : false) )
+ : sal_False;
}
/*--------------------------------------------------------------------
@@ -1008,7 +1010,7 @@ sal_Bool SwFldMgr::InsertFld( const SwInsertFld_Data& rData )
{
if( rData.sPar1.Len() > 0 && CanInsertRefMark( rData.sPar1 ) )
{
- pCurShell->SetAttr( SwFmtRefMark( rData.sPar1 ) );
+ pCurShell->SetAttrItem( SwFmtRefMark( rData.sPar1 ) );
return sal_True;
}
return sal_False;
@@ -1240,7 +1242,7 @@ sal_Bool SwFldMgr::InsertFld( const SwInsertFld_Data& rData )
(SwInputFieldType*)pCurShell->GetFldType(0, RES_INPUTFLD);
SwInputField* pInpFld =
- new SwInputField(pTyp, rData.sPar1, rData.sPar2, nSubType|nsSwExtendedSubType::SUB_INVISIBLE, nFormatId);
+ new SwInputField( pTyp, rData.sPar1, rData.sPar2, nSubType|nsSwExtendedSubType::SUB_INVISIBLE, nFormatId);
pFld = pInpFld;
}
diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx
index b0ab9b34e99a..002e16fd93d2 100644
--- a/sw/source/ui/frmdlg/column.cxx
+++ b/sw/source/ui/frmdlg/column.cxx
@@ -517,8 +517,35 @@ SwColumnPage::SwColumnPage(Window *pParent, const SfxItemSet &rSet)
| WB_ITEMBORDER
| WB_DOUBLEBORDER );
+//IAccessibility2 Impplementaton 2009-----
for( i = 0; i < 5; i++)
- aDefaultVS.InsertItem( i + 1, i );
+ //Solution:Set accessible name one be one
+ //aDefaultVS.InsertItem( i + 1, i );
+ {
+ String aItemText;
+ switch( i )
+ {
+ case 0:
+ aItemText = SW_RESSTR( STR_COLUMN_VALUESET_ITEM0 ) ;
+ break;
+ case 1:
+ aItemText = SW_RESSTR( STR_COLUMN_VALUESET_ITEM1 ) ;
+ break;
+ case 2:
+ aItemText = SW_RESSTR( STR_COLUMN_VALUESET_ITEM2 ) ;
+ break;
+ case 3:
+ aItemText = SW_RESSTR( STR_COLUMN_VALUESET_ITEM3 );
+ break;
+ case 4:
+ aItemText = SW_RESSTR( STR_COLUMN_VALUESET_ITEM4 );
+ break;
+ default:
+ break;
+ }
+ aDefaultVS.InsertItem( i + 1, aItemText, i );
+ }
+//-----IAccessibility2 Impplementaton 2009
aDefaultVS.SetSelectHdl(LINK(this, SwColumnPage, SetDefaultsHdl));
@@ -968,7 +995,14 @@ IMPL_LINK( SwColumnPage, ColModify, NumericField *, pNF )
// #i17816# changing the displayed types within the ValueSet
//from two columns to two columns with different settings doesn't invalidate the
// example windows in ::ColModify()
- if(!pNF ||(pColMgr->GetCount() != nCols))
+//IAccessibility2 Impplementaton 2009-----
+// the pColMgr->GetCount()'s return is some how bugged,
+// it will return 0 when actual count is 1, so fix it.
+ //if(!pNF ||(pColMgr->GetCount() != nCols))
+ int nTemp = pColMgr->GetCount();
+ if(nTemp == 0) nTemp = 1;
+ if( nTemp != nCols )
+//-----IAccessibility2 Impplementaton 2009
{
if(pNF)
aDefaultVS.SetNoSelection();
diff --git a/sw/source/ui/frmdlg/column.hrc b/sw/source/ui/frmdlg/column.hrc
index 2e6e23a25fa7..eb506201915d 100644
--- a/sw/source/ui/frmdlg/column.hrc
+++ b/sw/source/ui/frmdlg/column.hrc
@@ -75,8 +75,15 @@
#define FT_TEXTDIRECTION 60
#define LB_TEXTDIRECTION 61
#define FL_VERT 62
+//IAccessibility2 Impplementaton 2009-----
+#define STR_PAGESETUP_SPACING 32765
+//-----IAccessibility2 Impplementaton 2009
#define LISTBOX_SELECTION 0
#define LISTBOX_SECTION 1
#define LISTBOX_SECTIONS 2
#define LISTBOX_PAGE 3
#define LISTBOX_FRAME 4
+
+//IAccessibility2 Impplementaton 2009-----
+#define STR_COLUMN_WIDTH 63
+//-----IAccessibility2 Impplementaton 2009
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index 86d861ce0976..e399fd2fdecd 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -639,11 +639,15 @@ sal_uLong lcl_GetLBRelationsForStrID( const FrmMap* _pMap,
namespace
{
- void HandleAutoCB( sal_Bool _bChecked, FixedText& _rFT_man, FixedText& _rFT_auto )
+ //IAccessibility2 Implementation 2009-----
+ void HandleAutoCB( sal_Bool _bChecked, FixedText& _rFT_man, FixedText& _rFT_auto, PercentField& _rPF_Edit)
{
_rFT_man.Show( !_bChecked );
_rFT_auto.Show( _bChecked );
+ String accName = _bChecked ? _rFT_auto.GetText() : _rFT_man.GetText();
+ _rPF_Edit.SetAccessibleName(accName);
}
+ //-----IAccessibility2 Implementation 2009
}
@@ -2091,14 +2095,18 @@ IMPL_LINK_INLINE_END( SwFrmPage, RealSizeHdl, Button *, EMPTYARG )
IMPL_LINK( SwFrmPage, AutoWidthClickHdl, void*, EMPTYARG )
{
if( !IsInGraficMode() )
- HandleAutoCB( aAutoWidthCB.IsChecked(), aWidthFT, aWidthAutoFT );
+ //IAccessibility2 Implementation 2009-----
+ HandleAutoCB( aAutoWidthCB.IsChecked(), aWidthFT, aWidthAutoFT, aWidthED );
+ //-----IAccessibility2 Implementation 2009
return 0;
}
IMPL_LINK( SwFrmPage, AutoHeightClickHdl, void*, EMPTYARG )
{
if( !IsInGraficMode() )
- HandleAutoCB( aAutoHeightCB.IsChecked(), aHeightFT, aHeightAutoFT );
+ //IAccessibility2 Implementation 2009-----
+ HandleAutoCB( aAutoHeightCB.IsChecked(), aHeightFT, aHeightAutoFT, aWidthED );
+ //-----IAccessibility2 Implementation 2009
return 0;
}
@@ -2247,14 +2255,18 @@ void SwFrmPage::Init(const SfxItemSet& rSet, sal_Bool bReset)
SwFrmSize eSize = rSize.GetHeightSizeType();
sal_Bool bCheck = eSize != ATT_FIX_SIZE;
aAutoHeightCB.Check( bCheck );
- HandleAutoCB( bCheck, aHeightFT, aHeightAutoFT );
+ //IAccessibility2 Implementation 2009-----
+ HandleAutoCB( bCheck, aHeightFT, aHeightAutoFT, aWidthED );
+ //-----IAccessibility2 Implementation 2009
if( eSize == ATT_VAR_SIZE )
aHeightED.SetValue( aHeightED.GetMin(), FUNIT_NONE );
eSize = rSize.GetWidthSizeType();
bCheck = eSize != ATT_FIX_SIZE;
aAutoWidthCB.Check( bCheck );
- HandleAutoCB( bCheck, aWidthFT, aWidthAutoFT );
+ //IAccessibility2 Implementation 2009-----
+ HandleAutoCB( bCheck, aWidthFT, aWidthAutoFT, aWidthED );
+ //-----IAccessibility2 Implementation 2009
if( eSize == ATT_VAR_SIZE )
aWidthED.SetValue( aWidthED.GetMin(), FUNIT_NONE );
diff --git a/sw/source/ui/inc/conttree.hxx b/sw/source/ui/inc/conttree.hxx
index 25ff5fd97060..23e344f0c5cd 100644
--- a/sw/source/ui/inc/conttree.hxx
+++ b/sw/source/ui/inc/conttree.hxx
@@ -36,6 +36,10 @@ class SwGlblDocContents;
class SwGlblDocContent;
class SfxObjectShell;
+//IAccessibility2 Implementation 2009-----
+//Solution: Include SdrObject class
+class SdrObject;
+//-----IAccessibility2 Implementation 2009
#define EDIT_MODE_EDIT 0
#define EDIT_MODE_UPD_IDX 1
@@ -89,7 +93,10 @@ class SwContentTree : public SvTreeListBox
sal_Bool bIsImageListInitialized : 1;
static sal_Bool bIsInDrag;
-
+ //IAccessibility2 Implementation 2009-----
+ sal_Bool bIsKeySpace;
+ Rectangle oldRectangle;
+ //-----IAccessibility2 Implementation 2009
void FindActiveTypeAndRemoveUserData();
using SvLBox::ExecuteDrop;
@@ -144,6 +151,11 @@ protected:
public:
SwContentTree(Window* pParent, const ResId& rResId);
~SwContentTree();
+ //IAccessibility2 Implementation 2009-----
+ String GetEntryAltText( SvLBoxEntry* pEntry ) const;
+ String GetEntryLongDescription( SvLBoxEntry* pEntry ) const;
+ SdrObject* GetDrawingObjectsByContent(const SwContent *pCnt);
+ //-----IAccessibility2 Implementation 2009
sal_Bool ToggleToRoot();
sal_Bool IsRoot() const {return bIsRoot;}
@@ -196,6 +208,9 @@ public:
virtual void KeyInput(const KeyEvent& rKEvt);
virtual sal_Bool Select( SvLBoxEntry* pEntry, sal_Bool bSelect=sal_True );
+ //IAccessibility2 Implementation 2009-----
+ virtual sal_Int32 GetEntryRealChildsNum( SvLBoxEntry* pEntry ) const;
+ //-----IAccessibility2 Implementation 2009
};
diff --git a/sw/source/ui/inc/edtwin.hxx b/sw/source/ui/inc/edtwin.hxx
index 6facd20b49bb..4c348da304c1 100644
--- a/sw/source/ui/inc/edtwin.hxx
+++ b/sw/source/ui/inc/edtwin.hxx
@@ -297,6 +297,9 @@ public:
SwEditWin(Window *pParent, SwView &);
virtual ~SwEditWin();
+ //IAccessibility2 Implementation 2009-----
+ virtual void SwitchView();
+ //-----IAccessibility2 Implementation 2009
};
#endif
diff --git a/sw/source/ui/inc/pview.hxx b/sw/source/ui/inc/pview.hxx
index a06e08285da5..42f32dc4b040 100644
--- a/sw/source/ui/inc/pview.hxx
+++ b/sw/source/ui/inc/pview.hxx
@@ -164,6 +164,9 @@ public:
virtual ::com::sun::star::uno::Reference<
::com::sun::star::accessibility::XAccessible>
CreateAccessible();
+ //IAccessibility2 Implementation 2009-----
+ virtual void SwitchView();
+ //-----IAccessibility2 Implementation 2009
};
@@ -175,7 +178,7 @@ class SW_DLLPUBLIC SwPagePreView: public SfxViewShell
{
// ViewWindow und Henkel zur Core
// aktuelle Dispatcher-Shell
- SwPagePreViewWin aViewWin;
+ SwPagePreViewWin* pViewWin;//IAccessibility2 Implementation 2009
//viewdata of the previous SwView and the new crsrposition
String sSwViewData,
//and the new cursor position if the user double click in the PagePreView
@@ -250,11 +253,11 @@ public:
SFX_DECL_INTERFACE(SW_PAGEPREVIEW)
inline Window* GetFrameWindow() const { return &(GetViewFrame())->GetWindow(); }
- inline ViewShell* GetViewShell() const { return aViewWin.GetViewShell(); }
+ inline ViewShell* GetViewShell() const { return pViewWin->GetViewShell(); }
inline const Rectangle& GetVisArea() const { return aVisArea; }
- inline void GrabFocusViewWin() { aViewWin.GrabFocus(); }
+ inline void GrabFocusViewWin() { pViewWin->GrabFocus(); }
inline void RepaintCoreRect( const SwRect& rRect )
- { aViewWin.RepaintCoreRect( rRect ); }
+ { pViewWin->RepaintCoreRect( rRect ); }
void DocSzChgd(const Size& rNewSize);
const Size& GetDocSz() const { return aDocSz; }
diff --git a/sw/source/ui/inc/swlbox.hxx b/sw/source/ui/inc/swlbox.hxx
index e5d531d74be1..bec28ca748c9 100644
--- a/sw/source/ui/inc/swlbox.hxx
+++ b/sw/source/ui/inc/swlbox.hxx
@@ -115,6 +115,9 @@ public:
void SetStyle(const sal_uInt16 nSt) { nStyle = nSt; }
String GetText() const;
+//IAccessibility2 Impplementaton 2009-----
+ void SetText( const XubString& rStr );
+ void SetText( const XubString& rStr, const Selection& rNewSelection ) { ComboBox::SetText( rStr, rNewSelection ); };
};
#endif /* _SWLBOX_HXX */
diff --git a/sw/source/ui/inc/swuicnttab.hxx b/sw/source/ui/inc/swuicnttab.hxx
index 175ad0b2d1ae..253e05be78c8 100644
--- a/sw/source/ui/inc/swuicnttab.hxx
+++ b/sw/source/ui/inc/swuicnttab.hxx
@@ -286,6 +286,12 @@ class SwTokenWindow : public Window
Link aButtonSelectedHdl;
Control* pActiveCtrl;
Link aModifyHdl;
+//IAccessibility2 Impplementaton 2009-----
+ String accessibleName;
+ String sAdditionalAccnameString1;
+ String sAdditionalAccnameString2;
+ String sAdditionalAccnameString3;
+//-----IAccessibility2 Impplementaton 2009
SwTOXEntryTabPage* m_pParent;
@@ -337,6 +343,11 @@ public:
virtual void Resize();
virtual void GetFocus();
+//IAccessibility2 Impplementaton 2009-----
+ void SetFocus2theAllBtn();
+private:
+ sal_uInt32 GetControlIndex(FormTokenType eType, const Control* pCurControl) const;
+//-----IAccessibility2 Impplementaton 2009
};
/* -----------------------------23.12.99 14:16--------------------------------
@@ -482,6 +493,10 @@ public:
String GetLevelHelp(sal_uInt16 nLevel) const;
void PreTokenButtonRemoved(const SwFormToken& rToken);
+//IAccessibility2 Impplementaton 2009-----
+ void SetFocus2theAllBtn();
+ virtual long Notify( NotifyEvent& rNEvt );
+//-----IAccessibility2 Impplementaton 2009
};
/* -----------------05.07.99 13:00-------------------
diff --git a/sw/source/ui/inc/view.hxx b/sw/source/ui/inc/view.hxx
index f35cc0fe7d9d..68d9b7d3e7d9 100644
--- a/sw/source/ui/inc/view.hxx
+++ b/sw/source/ui/inc/view.hxx
@@ -200,7 +200,10 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
sNewCrsrPos;
// to support keyboard the number of the page to go to can be set too
sal_uInt16 nNewPage;
-
+ //IAccessibility2 Implementation 2009-----
+ sal_uInt16 nOldPageNum;
+ String nOldSectionName;
+ //-----IAccessibility2 Implementation 2009
Point aTabColFromDocPos; //Verschieben von Tabellenspalten aus
//aus dem Dokument heraus.
SwTxtNode * pNumRuleNodeFromDoc; // Moving indent of numrule #i23726#
diff --git a/sw/source/ui/inc/wrtsh.hxx b/sw/source/ui/inc/wrtsh.hxx
index a20e92ab853a..9de7c352939f 100644
--- a/sw/source/ui/inc/wrtsh.hxx
+++ b/sw/source/ui/inc/wrtsh.hxx
@@ -256,7 +256,7 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)();
sal_Bool PageCrsr(SwTwips lOffset, sal_Bool bSelect);
// Felder Update
- void UpdateInputFlds( SwInputFieldList* pLst = 0, sal_Bool bOnlyInSel = sal_False );
+ void UpdateInputFlds( SwInputFieldList* pLst = 0 );
void NoEdit(sal_Bool bHideCrsr = sal_True);
void Edit();
@@ -446,9 +446,6 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)();
void NavigatorPaste( const NaviContentBookmark& rBkmk,
const sal_uInt16 nAction );
- // die Core erzeugt eine Selektion, das SttSelect muss gerufen werden
- virtual void NewCoreSelection();
-
virtual void ApplyViewOptions( const SwViewOption &rOpt );
// autom. Update von Vorlagen
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 2ff5d5563edd..c6a7fca54649 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -1860,7 +1860,15 @@ void SwTOXEdit::KeyInput( const KeyEvent& rKEvt )
bNextControl = sal_False;
bCall = sal_True;
}
-
+//IAccessibility2 Impplementaton 2009-----
+ else if ( (aCode.GetCode() == KEY_F3) && aCode.IsShift() && !aCode.IsMod1() && !aCode.IsMod2() )
+ {
+ if ( m_pParent )
+ {
+ m_pParent->SetFocus2theAllBtn();
+ }
+ }
+//-----IAccessibility2 Impplementaton 2009
if(bCall && aPrevNextControlLink.IsSet())
aPrevNextControlLink.Call(this);
@@ -1996,6 +2004,15 @@ void SwTOXButton::KeyInput( const KeyEvent& rKEvt )
//this is invalid here
return;
}
+//IAccessibility2 Impplementaton 2009-----
+ else if ( (aCode.GetCode() == KEY_F3) && aCode.IsShift() && !aCode.IsMod1() && !aCode.IsMod2() )
+ {
+ if ( m_pParent )
+ {
+ m_pParent->SetFocus2theAllBtn();
+ }
+ }
+//-----IAccessibility2 Impplementaton 2009
if(bCall && aPrevNextControlLink.IsSet())
aPrevNextControlLink.Call(this);
else
@@ -2644,6 +2661,30 @@ void SwTOXEntryTabPage::PreTokenButtonRemoved(const SwFormToken& rToken)
sal_uInt16 nPos = aAuthFieldsLB.InsertEntry(sTemp);
aAuthFieldsLB.SetEntryData(nPos, (void*)(nData));
}
+//IAccessibility2 Impplementaton 2009-----
+void SwTOXEntryTabPage::SetFocus2theAllBtn()
+{
+ aAllLevelsPB.GrabFocus();
+}
+long SwTOXEntryTabPage::Notify( NotifyEvent& rNEvt )
+{
+ if ( rNEvt.GetType() == EVENT_KEYINPUT )
+ {
+ const KeyEvent& rKEvt = *rNEvt.GetKeyEvent();
+ KeyCode aCode = rKEvt.GetKeyCode();
+ if ( (aCode.GetCode() == KEY_F4) && aCode.IsShift() && !aCode.IsMod1() && !aCode.IsMod2() )
+ {
+ if ( aTokenWIN.GetActiveControl() )
+ {
+ aTokenWIN.GetActiveControl()->GrabFocus();
+ }
+ }
+
+ }
+
+ return SfxTabPage::Notify( rNEvt );
+}
+//-----IAccessibility2 Impplementaton 2009
/*-- 16.06.99 10:47:35---------------------------------------------------
This function inizializes the default value in the Token
@@ -3137,7 +3178,12 @@ SwTokenWindow::SwTokenWindow(SwTOXEntryTabPage* pParent, const ResId& rResId) :
nHelpId = STR_TOKEN_HELP_ENTRY;
aButtonHelpTexts[i] = String(ResId(nHelpId, *rResId.GetResMgr()));
}
-
+//IAccessibility2 Impplementaton 2009-----
+ accessibleName = String(SW_RES(STR_STRUCTURE));
+ sAdditionalAccnameString1 = String(SW_RES(STR_ADDITIONAL_ACCNAME_STRING1));
+ sAdditionalAccnameString2 = String(SW_RES(STR_ADDITIONAL_ACCNAME_STRING2));
+ sAdditionalAccnameString3 = String(SW_RES(STR_ADDITIONAL_ACCNAME_STRING3));
+//-----IAccessibility2 Impplementaton 2009
FreeResource();
Link aLink(LINK(this, SwTokenWindow, ScrollHdl));
@@ -3295,6 +3341,32 @@ Control* SwTokenWindow::InsertItem(const String& rText, const SwFormToken& rT
pEdit->SetPosPixel(aControlPos);
aControlList.Insert(pEdit, aControlList.Count());
pEdit->SetText(rText);
+//IAccessibility2 Impplementaton 2009-----
+ sal_uInt32 nIndex = GetControlIndex( TOKEN_TEXT, pEdit );
+ String s1 = String::CreateFromAscii(" (");
+ String s2 = String::CreateFromAscii(")");
+ String s3 = String::CreateFromAscii(", ");
+ String strName(accessibleName);
+ strName += String::CreateFromInt32(nIndex);
+ if ( nIndex == 1 )
+ {
+ /*Press left or right arrow to choose the structure controls*/
+ strName += s1;
+ strName += sAdditionalAccnameString2;
+ strName += s3;
+ /*Press Ctrl+Alt+A to move focus for more operations*/
+ strName += sAdditionalAccnameString1;
+ strName += s3;
+ /*Press Ctrl+Alt+B to move focus back to the current structure control*/
+ strName += sAdditionalAccnameString3;
+ strName += s2;
+ pEdit->SetAccessibleName(strName);
+ }
+ else
+ {
+ pEdit->SetAccessibleName(strName);
+ }
+//-----IAccessibility2 Impplementaton 2009
Size aEditSize(aControlSize);
aEditSize.Width() = pEdit->GetTextWidth(rText) + EDIT_MINWIDTH;
pEdit->SetSizePixel(aEditSize);
@@ -3325,6 +3397,17 @@ Control* SwTokenWindow::InsertItem(const String& rText, const SwFormToken& rT
(ToxAuthorityField)rToken.nAuthorityField));
pButton->SetText(sTmp.Copy(0, 2));
}
+//IAccessibility2 Impplementaton 2009-----
+ String sSpace = String::CreateFromAscii(" ");
+ sal_uInt32 nIndex = GetControlIndex( rToken.eTokenType, pButton );
+ String sAccName = aButtonHelpTexts[rToken.eTokenType];
+ if ( nIndex )
+ {
+ sAccName += sSpace;
+ sAccName += String::CreateFromInt32(nIndex);
+ }
+ pButton->SetAccessibleName( sAccName );
+//-----IAccessibility2 Impplementaton 2009
pButton->Show();
pRet = pButton;
}
@@ -3466,6 +3549,32 @@ void SwTokenWindow::InsertAtSelection(
SwTOXEdit* pEdit = new SwTOXEdit(&aCtrlParentWin, this, aTmpToken);
aControlList.Insert(pEdit, nActivePos + 1);
pEdit->SetText(sRight);
+//IAccessibility2 Impplementaton 2009-----
+ sal_uInt32 nIndex = GetControlIndex( TOKEN_TEXT, pEdit );
+ String s1 = String::CreateFromAscii(" (");
+ String s2 = String::CreateFromAscii(")");
+ String s3 = String::CreateFromAscii(", ");
+ String strName(accessibleName);
+ strName += String::CreateFromInt32(nIndex);
+ if ( nIndex == 1)
+ {
+ /*Press left or right arrow to choose the structure controls*/
+ strName += s1;
+ strName += sAdditionalAccnameString2;
+ strName += s3;
+ /*Press Ctrl+Alt+A to move focus for more operations*/
+ strName += sAdditionalAccnameString1;
+ strName += s3;
+ /*Press Ctrl+Alt+B to move focus back to the current structure control*/
+ strName += sAdditionalAccnameString3;
+ strName += s2;
+ pEdit->SetAccessibleName(strName);
+ }
+ else
+ {
+ pEdit->SetAccessibleName(strName);
+ }
+//-----IAccessibility2 Impplementaton 2009
pEdit->SetSizePixel(aControlSize);
pEdit->AdjustSize();
pEdit->SetModifyHdl(LINK(this, SwTokenWindow, EditResize ));
@@ -3495,6 +3604,17 @@ void SwTokenWindow::InsertAtSelection(
pButton->SetText(sTmp.Copy(0, 2));
}
+//IAccessibility2 Impplementaton 2009-----
+ String sSpace = String::CreateFromAscii(" ");
+ sal_uInt32 nIndex = GetControlIndex( rToken.eTokenType, pButton );
+ String sAccName = aButtonHelpTexts[rToken.eTokenType];
+ if ( nIndex )
+ {
+ sAccName += sSpace;
+ sAccName += String::CreateFromInt32(nIndex);
+ }
+ pButton->SetAccessibleName( sAccName );
+//-----IAccessibility2 Impplementaton 2009
Size aEditSize(GetOutputSizePixel());
aEditSize.Width() = pButton->GetTextWidth(rText) + 5;
pButton->SetSizePixel(aEditSize);
@@ -3922,6 +4042,41 @@ void SwTokenWindow::GetFocus()
}
}
}
+//IAccessibility2 Impplementaton 2009-----
+void SwTokenWindow::SetFocus2theAllBtn()
+{
+ if (m_pParent)
+ {
+ m_pParent->SetFocus2theAllBtn();
+ }
+}
+sal_uInt32 SwTokenWindow::GetControlIndex(FormTokenType eType, const Control* pCurControl) const
+{
+ //there are only one entry-text button and only one page-number button,
+ //so we need not add index for these two buttons.
+ if ( eType == TOKEN_ENTRY_TEXT || eType == TOKEN_PAGE_NUMS )
+ {
+ return 0;
+ }
+
+ sal_uInt32 nIndex = 0;
+ const Control* pControl = ((SwTokenWindow*)this)->aControlList.First();
+ while(pControl)
+ {
+ const SwFormToken& rNewToken = WINDOW_EDIT == pControl->GetType()
+ ? ((SwTOXEdit*)pControl)->GetFormToken()
+ : ((SwTOXButton*)pControl)->GetFormToken();
+
+ if(eType == rNewToken.eTokenType)
+ {
+ nIndex++;
+ }
+ pControl = ((SwTokenWindow*)this)->aControlList.Next();
+ }
+
+ return nIndex;
+}
+//-----IAccessibility2 Impplementaton 2009
/* -----------------25.03.99 15:17-------------------
*
* --------------------------------------------------*/
diff --git a/sw/source/ui/index/cnttab.hrc b/sw/source/ui/index/cnttab.hrc
index f436cb1bff1e..a6ffb2e72e43 100644
--- a/sw/source/ui/index/cnttab.hrc
+++ b/sw/source/ui/index/cnttab.hrc
@@ -169,7 +169,12 @@
#define STR_TOKEN_HELP_AUTHORITY (STR_BUTTON_HELP_TEXT_START + 9)
#define STR_CHARSTYLE (STR_TOKEN_HELP_AUTHORITY + 1)
-
+//IAccessibility2 Impplementaton 2009-----
+#define STR_STRUCTURE (STR_TOKEN_HELP_AUTHORITY + 2)
+#define STR_ADDITIONAL_ACCNAME_STRING1 (STR_TOKEN_HELP_AUTHORITY + 3)
+#define STR_ADDITIONAL_ACCNAME_STRING2 (STR_TOKEN_HELP_AUTHORITY + 4)
+#define STR_ADDITIONAL_ACCNAME_STRING3 (STR_TOKEN_HELP_AUTHORITY + 5)
+//-----IAccessibility2 Impplementaton 2009
#define TLB_STYLES 100
#define FL_STYLES 101
#define PB_OK 102
diff --git a/sw/source/ui/index/cnttab.src b/sw/source/ui/index/cnttab.src
index f373bb7299ec..a51713b233e9 100644
--- a/sw/source/ui/index/cnttab.src
+++ b/sw/source/ui/index/cnttab.src
@@ -674,6 +674,24 @@ TabPage TP_TOX_ENTRY
{
Text [ en-US ] = "Character Style: ";
};
+//IAccessibility2 Impplementaton 2009-----
+ String STR_STRUCTURE
+ {
+ Text [ en-US ] = "Structure text";
+ };
+ String STR_ADDITIONAL_ACCNAME_STRING1
+ {
+ Text [ en-US ] = "Press Ctrl+Alt+A to move focus for more operations";
+ };
+ String STR_ADDITIONAL_ACCNAME_STRING2
+ {
+ Text [ en-US ] = "Press left or right arrow to choose the structure controls";
+ };
+ String STR_ADDITIONAL_ACCNAME_STRING3
+ {
+ Text [ en-US ] = "Press Ctrl+Alt+B to move focus back to the current structure control";
+ };
+//-----IAccessibility2 Impplementaton 2009
};
PushButton PB_ALL_LEVELS
{
diff --git a/sw/source/ui/lingu/hhcwrp.cxx b/sw/source/ui/lingu/hhcwrp.cxx
index be8b649e5494..be4b349005b4 100644
--- a/sw/source/ui/lingu/hhcwrp.cxx
+++ b/sw/source/ui/lingu/hhcwrp.cxx
@@ -400,7 +400,7 @@ void SwHHCWrapper::ChangeText_impl( const String &rNewText, sal_Bool bKeepAttrib
// was deleted)
rWrtShell.ResetAttr();
// apply previously saved attributes to new text
- rWrtShell.SetAttr( aItemSet );
+ rWrtShell.SetAttrSet( aItemSet );
}
else
{
@@ -512,7 +512,7 @@ void SwHHCWrapper::ReplaceUnit(
SwPaM *pPaM = rWrtShell.GetCrsr();
(void)pPaM;
#endif
- rWrtShell.SetAttr(*pRuby);
+ rWrtShell.SetAttrItem(*pRuby);
delete pRuby;
rWrtShell.EndUndo( UNDO_SETRUBYATTR );
}
@@ -564,7 +564,7 @@ void SwHHCWrapper::ReplaceUnit(
aSet.Put( aFontItem );
}
- rWrtShell.SetAttr( aSet );
+ rWrtShell.SetAttrSet( aSet );
rWrtShell.ClearMark();
}
diff --git a/sw/source/ui/misc/glossary.hrc b/sw/source/ui/misc/glossary.hrc
index 44708bf92343..22bfa334c5dd 100644
--- a/sw/source/ui/misc/glossary.hrc
+++ b/sw/source/ui/misc/glossary.hrc
@@ -84,4 +84,6 @@
#define FL_NN 9
#define BT_CANCEL 10
#define BT_OKNEW 11
-
+//IAccessibility2 Implementation 2009-----
+#define STR_SW_CATEGORY 12
+//-----IAccessibility2 Implementation 2009
diff --git a/sw/source/ui/misc/insfnote.cxx b/sw/source/ui/misc/insfnote.cxx
index 8fa8adc5ece4..ea6bec7be94f 100644
--- a/sw/source/ui/misc/insfnote.cxx
+++ b/sw/source/ui/misc/insfnote.cxx
@@ -79,7 +79,7 @@ void __EXPORT SwInsFootNoteDlg::Apply()
rFont.GetStyleName(), rFont.GetPitch(),
eCharSet, RES_CHRATR_FONT );
aSet.Put( aFont );
- rSh.SetAttr( aSet, nsSetAttrMode::SETATTR_DONTEXPAND );
+ rSh.SetAttrSet( aSet, nsSetAttrMode::SETATTR_DONTEXPAND );
rSh.ResetSelect(0, sal_False);
rSh.Left(CRSR_SKIP_CHARS, sal_False, 1, sal_False );
}
diff --git a/sw/source/ui/ribbar/inputwin.cxx b/sw/source/ui/ribbar/inputwin.cxx
index cad727e68413..e17f41834e51 100644
--- a/sw/source/ui/ribbar/inputwin.cxx
+++ b/sw/source/ui/ribbar/inputwin.cxx
@@ -47,6 +47,7 @@
#include "cellatr.hxx"
#include "edtwin.hxx"
#include "helpid.h"
+#include "access.hrc"
// nur fuers UpdateRange - Box in dem der gestackte Cursor sthet loeschen
#include "pam.hxx"
@@ -90,9 +91,16 @@ SwInputWindow::SwInputWindow( Window* pParent, SfxBindings* pBind )
pWrtShell = pView ? pView->GetWrtShellPtr() : 0;
InsertWindow( ED_POS, &aPos, 0, 0);
+ //IAccessibility2 Implementation 2009-----
+ SetItemText(ED_POS, String(SW_RES(STR_ACCESS_FORMULA_TYPE)));
+ aPos.SetAccessibleName(String(SW_RES(STR_ACCESS_FORMULA_TYPE)));
+ SetAccessibleName(String(SW_RES(STR_ACCESS_FORMULA_TOOLBAR)));
InsertSeparator ( 1 );
InsertSeparator ();
InsertWindow( ED_FORMULA, &aEdit);
+ SetItemText(ED_FORMULA, String(SW_RES(STR_ACCESS_FORMULA_TEXT)));
+ aEdit.SetAccessibleName(String(SW_RES(STR_ACCESS_FORMULA_TEXT)));
+ //-----IAccessibility2 Implementation 2009
SetHelpId(ED_FORMULA, HID_EDIT_FORMULA);
sal_Bool bHC = GetSettings().GetStyleSettings().GetHighContrastMode();
diff --git a/sw/source/ui/ribbar/inputwin.hrc b/sw/source/ui/ribbar/inputwin.hrc
index 8c87ffc091ba..59ebcf906060 100644
--- a/sw/source/ui/ribbar/inputwin.hrc
+++ b/sw/source/ui/ribbar/inputwin.hrc
@@ -60,6 +60,11 @@
#define ED_POS 2
#define ED_FORMULA 3
+//IAccessibility2 Impplementaton 2009-----
+#define STR_ED_POS 1
+#define STR_ED_FORMULA 2
+#define STR_TOOLBAR_FORMULA 35
+//-----IAccessibility2 Impplementaton 2009
#endif
diff --git a/sw/source/ui/ribbar/inputwin.src b/sw/source/ui/ribbar/inputwin.src
index 21c3ccc0e7e8..431c07ae1dec 100644
--- a/sw/source/ui/ribbar/inputwin.src
+++ b/sw/source/ui/ribbar/inputwin.src
@@ -28,6 +28,8 @@
#include "globals.hrc"
#include "ribbar.hrc"
#include "inputwin.hrc"
+#include "access.hrc"
+
ToolBox RID_TBX_FORMULA
{
Pos = MAP_APPFONT ( 0 , 0 ) ;
@@ -279,6 +281,20 @@ String STR_TBL_FORMULA
{
Text [ en-US ] = "Text formula" ;
};
+//IAccessibility2 Impplementaton 2009-----
+String STR_ACCESS_FORMULA_TOOLBAR
+{
+ Text [ en-US ] = "Formula Tool Bar" ;
+};
+String STR_ACCESS_FORMULA_TYPE
+{
+ Text [ en-US ] = "Formula Type" ;
+};
+String STR_ACCESS_FORMULA_TEXT
+{
+ Text [ en-US ] = "Formula Text" ;
+};
+//-----IAccessibility2 Impplementaton 2009
#define TB_INPUT \
ToolBoxItem\
{\
diff --git a/sw/source/ui/ribbar/workctrl.cxx b/sw/source/ui/ribbar/workctrl.cxx
index 6f626ec31f19..7229b9f249ee 100644
--- a/sw/source/ui/ribbar/workctrl.cxx
+++ b/sw/source/ui/ribbar/workctrl.cxx
@@ -503,6 +503,15 @@ SwScrollNaviPopup::SwScrollNaviPopup( sal_uInt16 nId, const Reference< XFrame >&
sText = String(SW_RES(nResStr));
nTbxBits = TIB_CHECKABLE;
}
+ //IAccessibility2 Impplementaton 2009-----
+ else
+ {
+ if (nNaviId == NID_PREV)
+ sText = String(SW_RES(STR_IMGBTN_PGE_UP));
+ else if (nNaviId == NID_NEXT)
+ sText = String(SW_RES(STR_IMGBTN_PGE_DOWN));
+ }
+ //-----IAccessibility2 Impplementaton 2009
aToolBox.InsertItem(nNaviId, sText, nTbxBits);
aToolBox.SetHelpId( nNaviId, aNavigationHelpIds[i] );
}
diff --git a/sw/source/ui/shells/annotsh.cxx b/sw/source/ui/shells/annotsh.cxx
index e4a9ed62ad84..51d2f0086c4c 100644
--- a/sw/source/ui/shells/annotsh.cxx
+++ b/sw/source/ui/shells/annotsh.cxx
@@ -1100,13 +1100,14 @@ void SwAnnotationShell::NoteExec(SfxRequest &rReq)
sal_uInt16 nSlot = rReq.GetSlot();
switch (nSlot)
{
- case FN_REPLY:
- case FN_POSTIT:
- case FN_DELETE_COMMENT:
- if ( pPostItMgr->HasActiveSidebarWin() )
- pPostItMgr->GetActiveSidebarWin()->ExecuteCommand(nSlot);
- break;
- case FN_DELETE_ALL_NOTES:
+ case FN_REPLY:
+ case FN_POSTIT:
+ case FN_DELETE_COMMENT:
+ if ( pPostItMgr->HasActiveSidebarWin() )
+ pPostItMgr->GetActiveSidebarWin()->ExecuteCommand(nSlot);
+ break;
+
+ case FN_DELETE_ALL_NOTES:
pPostItMgr->Delete();
break;
case FN_DELETE_NOTE_AUTHOR:
@@ -1149,22 +1150,23 @@ void SwAnnotationShell::GetNoteState(SfxItemSet &rSet)
sal_uInt16 nSlotId = GetPool().GetSlotId( nWhich );
switch( nSlotId )
{
- case FN_POSTIT:
- case FN_DELETE_NOTE_AUTHOR:
- case FN_DELETE_ALL_NOTES:
- case FN_HIDE_NOTE:
- case FN_HIDE_NOTE_AUTHOR:
- case FN_HIDE_ALL_NOTES:
- case FN_DELETE_COMMENT:
+ case FN_POSTIT:
+ case FN_DELETE_NOTE_AUTHOR:
+ case FN_DELETE_ALL_NOTES:
+ case FN_HIDE_NOTE:
+ case FN_HIDE_NOTE_AUTHOR:
+ case FN_HIDE_ALL_NOTES:
+ case FN_DELETE_COMMENT:
{
- if ( !pPostItMgr ||
- !pPostItMgr->HasActiveAnnotationWin() )
+ if( !pPostItMgr
+ || !pPostItMgr->HasActiveAnnotationWin() )
{
rSet.DisableItem(nWhich);
}
break;
}
- case FN_REPLY:
+
+ case FN_REPLY:
{
if ( !pPostItMgr ||
!pPostItMgr->HasActiveAnnotationWin() )
diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx
index eacd9d225196..e23d67df936e 100644
--- a/sw/source/ui/shells/basesh.cxx
+++ b/sw/source/ui/shells/basesh.cxx
@@ -296,11 +296,10 @@ void SwBaseShell::ExecClpbrd(SfxRequest &rReq)
case SID_PASTE:
{
TransferableDataHelper aDataHelper(
- TransferableDataHelper::CreateFromSystemClipboard(
- &rSh.GetView().GetEditWin() ) );
-
- if( aDataHelper.GetXTransferable().is() &&
- SwTransferable::IsPaste( rSh, aDataHelper ))
+ TransferableDataHelper::CreateFromSystemClipboard( &rSh.GetView().GetEditWin() ) );
+ if( aDataHelper.GetXTransferable().is()
+ && SwTransferable::IsPaste( rSh, aDataHelper )
+ && !rSh.CrsrInsideInputFld() )
{
// temp. Variablen, da die Shell nach dem Paste schon
// zerstoert sein kann
@@ -348,10 +347,9 @@ void SwBaseShell::ExecClpbrd(SfxRequest &rReq)
case SID_PASTE_UNFORMATTED:
{
TransferableDataHelper aDataHelper(
- TransferableDataHelper::CreateFromSystemClipboard(
- &rSh.GetView().GetEditWin()) );
- if( aDataHelper.GetXTransferable().is() &&
- SwTransferable::IsPaste( rSh, aDataHelper ))
+ TransferableDataHelper::CreateFromSystemClipboard( &rSh.GetView().GetEditWin()) );
+ if( aDataHelper.GetXTransferable().is()
+ && SwTransferable::IsPaste( rSh, aDataHelper ) )
{
// temp. Variablen, da die Shell nach dem Paste schon
// zerstoert sein kann
@@ -383,10 +381,10 @@ void SwBaseShell::ExecClpbrd(SfxRequest &rReq)
case SID_PASTE_SPECIAL:
{
TransferableDataHelper aDataHelper(
- TransferableDataHelper::CreateFromSystemClipboard(
- &rSh.GetView().GetEditWin()) );
- if( aDataHelper.GetXTransferable().is() &&
- SwTransferable::IsPaste( rSh, aDataHelper ))
+ TransferableDataHelper::CreateFromSystemClipboard( &rSh.GetView().GetEditWin()) );
+ if( aDataHelper.GetXTransferable().is()
+ && SwTransferable::IsPaste( rSh, aDataHelper )
+ && !rSh.CrsrInsideInputFld() )
{
// temp. Variablen, da die Shell nach dem Paste schon
// zerstoert sein kann
@@ -399,7 +397,7 @@ void SwBaseShell::ExecClpbrd(SfxRequest &rReq)
{
SfxViewFrame* pViewFrame = pView->GetViewFrame();
uno::Reference< frame::XDispatchRecorder > xRecorder =
- pViewFrame->GetBindings().GetRecorder();
+ pViewFrame->GetBindings().GetRecorder();
if(xRecorder.is()) {
SfxRequest aReq( pViewFrame, SID_CLIPBOARD_FORMAT_ITEMS );
aReq.AppendItem( SfxUInt32Item( SID_CLIPBOARD_FORMAT_ITEMS, nFormatId ) );
@@ -415,6 +413,7 @@ void SwBaseShell::ExecClpbrd(SfxRequest &rReq)
return;
}
break;
+
default:
DBG_ERROR("falscher Dispatcher");
return;
@@ -452,15 +451,25 @@ void SwBaseShell::StateClpbrd(SfxItemSet &rSet)
break;
case SID_PASTE:
- if( !GetView().IsPasteAllowed() )
- rSet.DisableItem( SID_PASTE );
+ if( !GetView().IsPasteAllowed()
+ || rSh.CrsrInsideInputFld() )
+ {
+ rSet.DisableItem( nWhich );
+ }
break;
case SID_PASTE_SPECIAL:
+ if( !GetView().IsPasteSpecialAllowed()
+ || rSh.CrsrInsideInputFld() )
+ {
+ rSet.DisableItem( nWhich );
+ }
+ break;
+
+ case SID_PASTE_UNFORMATTED:
if( !GetView().IsPasteSpecialAllowed() )
{
- rSet.DisableItem( SID_PASTE_SPECIAL );
- rSet.DisableItem( SID_PASTE_UNFORMATTED );
+ rSet.DisableItem( nWhich );
}
break;
@@ -660,8 +669,9 @@ void SwBaseShell::Execute(SfxRequest &rReq)
break;
case FN_UPDATE_INPUTFIELDS:
- rSh.UpdateInputFlds(NULL, sal_False);
+ rSh.UpdateInputFlds();
break;
+
case FN_PREV_BOOKMARK:
rReq.SetReturnValue(SfxBoolItem( nSlot, rSh.GoPrevBookmark()));
break;
@@ -691,7 +701,7 @@ void SwBaseShell::Execute(SfxRequest &rReq)
rSh.ClearMark();
rSh.EndSelect();
}
- sal_Bool bRet = rSh.MoveFldType(pFldType, nSlot == FN_GOTO_NEXT_MARK);
+ sal_Bool bRet = rSh.MoveFldType( pFldType, nSlot == FN_GOTO_NEXT_MARK );
SwField* pCurField = bRet ? rSh.GetCurFld() : 0;
if (pCurField)
rSh.ClickToField(*pCurField);
@@ -1228,7 +1238,7 @@ void SwBaseShell::Execute(SfxRequest &rReq)
}
else
{
- rSh.SetAttr( *pArgs );
+ rSh.SetAttrSet( *pArgs );
}
rSh.EndAllAction();
}
@@ -1261,7 +1271,7 @@ void SwBaseShell::Execute(SfxRequest &rReq)
else
{
// Umrandungsattribute ganz normal ueber Shell setzen
- rSh.SetAttr( *pItem );
+ rSh.SetAttrItem( *pItem );
}
}
break;
@@ -1395,10 +1405,14 @@ void SwBaseShell::GetState( SfxItemSet &rSet )
break;
case FN_INSERT_REGION:
- if( rSh.IsSelFrmMode() ||
- !rSh.IsInsRegionAvailable() )
+ if( rSh.CrsrInsideInputFld()
+ || rSh.IsSelFrmMode()
+ || !rSh.IsInsRegionAvailable() )
+ {
rSet.DisableItem( nWhich );
+ }
break;
+
case FN_CONVERT_TABLE_TO_TEXT:
{
sal_uInt16 eFrmType = rSh.GetFrmType(0,sal_True);
@@ -2127,7 +2141,7 @@ void SwBaseShell::ExecTxtCtrl( SfxRequest& rReq )
if (!bAuto)
{
- rSh.SetAttr( *pArgs );
+ rSh.SetAttrSet( *pArgs );
}
}
delete pSSetItem;
@@ -2392,7 +2406,7 @@ void SwBaseShell::ExecBckCol(SfxRequest& rReq)
rSh.AutoUpdatePara( pColl, aSet);
}
else
- rSh.SetAttr( aBrushItem );
+ rSh.SetAttrItem( aBrushItem );
}
rReq.Done();
@@ -2530,7 +2544,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
DBG_ASSERT(pDlg, "Dialogdiet fail!");
if ( pDlg->Execute() == RET_OK )
{
- rSh.SetAttr( *pDlg->GetOutputItemSet() );
+ rSh.SetAttrSet( *pDlg->GetOutputItemSet() );
pOutSet = pDlg->GetOutputItemSet();
}
}
@@ -2598,7 +2612,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
DBG_ASSERT(pDlg, "Dialogdiet fail!");
if ( pDlg->Execute() == RET_OK )
{
- rSh.SetAttr( *pDlg->GetOutputItemSet() );
+ rSh.SetAttrSet( *pDlg->GetOutputItemSet() );
pOutSet = pDlg->GetOutputItemSet();
}
}
@@ -2881,7 +2895,7 @@ void SwBaseShell::ExecuteGallery(SfxRequest &rReq)
SvxBrushItem aBrush( *pBrush );
aBrush.SetWhich( RES_BACKGROUND );
if ( nPos == nParagraphPos )
- rSh.SetAttr( aBrush );
+ rSh.SetAttrItem( aBrush );
else if ( nPos == nTablePos )
rSh.SetTabBackground( aBrush );
else if ( nPos == nTableRowPos )
diff --git a/sw/source/ui/shells/drwtxtex.cxx b/sw/source/ui/shells/drwtxtex.cxx
index 780ed04c8041..12944dd52b9c 100644
--- a/sw/source/ui/shells/drwtxtex.cxx
+++ b/sw/source/ui/shells/drwtxtex.cxx
@@ -992,7 +992,7 @@ void SwDrawTextShell::StateClpbrd(SfxItemSet &rSet)
OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView();
ESelection aSel(pOLV->GetSelection());
const sal_Bool bCopy = (aSel.nStartPara != aSel.nEndPara) ||
- (aSel.nStartPos != aSel.nEndPos);
+ (aSel.nStartPos != aSel.nEndPos);
SfxWhichIter aIter(rSet);
@@ -1002,33 +1002,31 @@ void SwDrawTextShell::StateClpbrd(SfxItemSet &rSet)
{
switch(nWhich)
{
- case SID_CUT:
- case SID_COPY:
- if( !bCopy )
- rSet.DisableItem( nWhich );
- break;
+ case SID_CUT:
+ case SID_COPY:
+ if( !bCopy )
+ rSet.DisableItem( nWhich );
+ break;
- case SID_PASTE:
- {
- TransferableDataHelper aDataHelper(
- TransferableDataHelper::CreateFromSystemClipboard(
- &GetView().GetEditWin() ) );
+ case SID_PASTE:
+ {
+ TransferableDataHelper aDataHelper(
+ TransferableDataHelper::CreateFromSystemClipboard( &GetView().GetEditWin() ) );
- if( !aDataHelper.GetXTransferable().is() ||
- !SwTransferable::IsPaste( GetShell(), aDataHelper ))
- rSet.DisableItem( SID_PASTE );
+ if( !aDataHelper.GetXTransferable().is()
+ || !SwTransferable::IsPaste( GetShell(), aDataHelper ) )
+ {
+ rSet.DisableItem( nWhich );
}
- break;
+ }
+ break;
- case SID_PASTE_SPECIAL:
- rSet.DisableItem( SID_PASTE_SPECIAL );
- break;
- // --> OD 2008-06-20 #151110#
- case SID_CLIPBOARD_FORMAT_ITEMS:
- rSet.DisableItem( SID_CLIPBOARD_FORMAT_ITEMS );
- break;
- // <--
+ case SID_PASTE_SPECIAL:
+ case SID_CLIPBOARD_FORMAT_ITEMS:
+ rSet.DisableItem( nWhich );
+ break;
}
+
nWhich = aIter.NextWhich();
}
}
diff --git a/sw/source/ui/shells/frmsh.cxx b/sw/source/ui/shells/frmsh.cxx
index 732c0312bead..4fe1e5815880 100644
--- a/sw/source/ui/shells/frmsh.cxx
+++ b/sw/source/ui/shells/frmsh.cxx
@@ -1219,7 +1219,13 @@ void SwFrameShell::GetLineStyleState(SfxItemSet &rSet)
void SwFrameShell::StateInsert(SfxItemSet &rSet)
{
const int nSel = GetShell().GetSelectionType();
-
- if ((nSel & nsSelectionType::SEL_GRF) || (nSel & nsSelectionType::SEL_OLE))
+ if ( (nSel & nsSelectionType::SEL_GRF)
+ || (nSel & nsSelectionType::SEL_OLE) )
+ {
+ rSet.DisableItem(FN_INSERT_FRAME);
+ }
+ else if ( GetShell().CrsrInsideInputFld() )
+ {
rSet.DisableItem(FN_INSERT_FRAME);
+ }
}
diff --git a/sw/source/ui/shells/grfsh.cxx b/sw/source/ui/shells/grfsh.cxx
index 847d0bd80d0a..4dda12e079ce 100644
--- a/sw/source/ui/shells/grfsh.cxx
+++ b/sw/source/ui/shells/grfsh.cxx
@@ -339,7 +339,7 @@ void SwGrfShell::Execute(SfxRequest &rReq)
RES_GRFATR_END-1 );
aGrfSet.Put( *pSet );
if( aGrfSet.Count() )
- rSh.SetAttr( aGrfSet );
+ rSh.SetAttrSet( aGrfSet );
rSh.EndUndo(UNDO_END);
rSh.EndAllAction();
@@ -354,7 +354,7 @@ void SwGrfShell::Execute(SfxRequest &rReq)
rSh.GetCurAttr( aSet );
SwMirrorGrf aGrf((const SwMirrorGrf &)aSet.Get(RES_GRFATR_MIRRORGRF));
aGrf.SetGrfToggle(!aGrf.IsGrfToggle());
- rSh.SetAttr(aGrf);
+ rSh.SetAttrItem(aGrf);
}
break;
@@ -505,7 +505,7 @@ void SwGrfShell::ExecAttr( SfxRequest &rReq )
ASSERT(!this, falscher Dispatcher);
}
if( aGrfSet.Count() )
- GetShell().SetAttr( aGrfSet );
+ GetShell().SetAttrSet( aGrfSet );
}
GetView().GetViewFrame()->GetBindings().Invalidate(rReq.GetSlot());
}
@@ -532,11 +532,18 @@ void SwGrfShell::GetAttrState(SfxItemSet &rSet)
case SID_TWAIN_TRANSFER:
if( bParentCntProt || !bIsGrfCntnt )
bDisable = sal_True;
+ else if ( nWhich == SID_INSERT_GRAPHIC
+ && rSh.CrsrInsideInputFld() )
+ {
+ bDisable = sal_True;
+ }
break;
+
case FN_SAVE_GRAPHIC:
if( rSh.GetGraphicType() == GRAPHIC_NONE )
bDisable = sal_True;
- break;
+ break;
+
case SID_COLOR_SETTINGS:
{
if ( bParentCntProt || !bIsGrfCntnt )
@@ -646,16 +653,6 @@ void SwGrfShell::GetAttrState(SfxItemSet &rSet)
{
if( bParentCntProt || !bIsGrfCntnt )
bDisable = sal_True;
- // --> OD 2006-11-03 #i59688#
- // load graphic only if type is unknown
-// else if( bSwappedOut )
-// {
-// rSet.DisableItem( nWhich );
-// if( AddGrfUpdateSlot( nWhich ))
-// rSh.GetGraphic(sal_False); // start the loading
-// }
-// else
-// bDisable = !bBitmapType;
else
{
const sal_uInt16 eGraphicType( rSh.GetGraphicType() );
diff --git a/sw/source/ui/shells/langhelper.cxx b/sw/source/ui/shells/langhelper.cxx
index b178666e004b..070af91a7182 100644
--- a/sw/source/ui/shells/langhelper.cxx
+++ b/sw/source/ui/shells/langhelper.cxx
@@ -282,7 +282,7 @@ namespace SwLangHelper
{
rWrtSh.GetCurAttr( rCoreSet );
rCoreSet.Put( SvxLanguageItem( nLang, nLangWhichId ));
- rWrtSh.SetAttr( rCoreSet );
+ rWrtSh.SetAttrSet( rCoreSet );
}
}
else // change language for all text
@@ -298,7 +298,7 @@ namespace SwLangHelper
// #i102191: hard set respective language attribute in text document
// (for all text in the document - which should be selected by now...)
- rWrtSh.SetAttr( SvxLanguageItem( nLang, nLangWhichId ) );
+ rWrtSh.SetAttrItem( SvxLanguageItem( nLang, nLangWhichId ) );
}
}
}
@@ -346,7 +346,7 @@ namespace SwLangHelper
rWrtSh.GetCurAttr( rCoreSet );
for (sal_uInt16 i = 0; i < 3; ++i)
rCoreSet.Put( SvxLanguageItem( LANGUAGE_NONE, aLangWhichId_Writer[i] ));
- rWrtSh.SetAttr( rCoreSet );
+ rWrtSh.SetAttrSet( rCoreSet );
}
}
else // change language for all text
diff --git a/sw/source/ui/shells/listsh.cxx b/sw/source/ui/shells/listsh.cxx
index 58068080dd2d..c0a2bc7f8626 100644
--- a/sw/source/ui/shells/listsh.cxx
+++ b/sw/source/ui/shells/listsh.cxx
@@ -273,6 +273,13 @@ void SwListShell::GetState(SfxItemSet &rSet)
if(nCurrentNumLevel == (MAXLEVEL - 1))
rSet.DisableItem(nWhich);
break;
+
+ case FN_NUM_BULLET_NONUM:
+ if ( rSh.CrsrInsideInputFld() )
+ {
+ rSet.DisableItem(nWhich);
+ }
+ break;
}
nWhich = aIter.NextWhich();
}
diff --git a/sw/source/ui/shells/tabsh.cxx b/sw/source/ui/shells/tabsh.cxx
index 73ef1a358e9b..fb9e85e05b52 100644
--- a/sw/source/ui/shells/tabsh.cxx
+++ b/sw/source/ui/shells/tabsh.cxx
@@ -1290,9 +1290,10 @@ void SwTableShell::GetState(SfxItemSet &rSet)
break;
case FN_INSERT_TABLE:
- // Irgendeinen Wert "putten", damit Controller enabled bleibt.
- // Statt "Insert:Table" erscheint dann "Format:Table".
-// rSet.Put(SfxUInt16Item(nSlot, 1));
+ if ( rSh.CrsrInsideInputFld() )
+ {
+ rSet.DisableItem( nSlot );
+ }
break;
case FN_TABLE_OPTIMAL_HEIGHT:
diff --git a/sw/source/ui/shells/textfld.cxx b/sw/source/ui/shells/textfld.cxx
index 980add9723d4..4031f5415899 100644
--- a/sw/source/ui/shells/textfld.cxx
+++ b/sw/source/ui/shells/textfld.cxx
@@ -45,6 +45,7 @@
#include <fldwrap.hxx>
#include <redline.hxx>
#include <view.hxx>
+#include <viewopt.hxx>
#include <wrtsh.hxx>
#include <basesh.hxx>
#include <wrtsh.hxx>
@@ -172,11 +173,26 @@ void SwTextShell::ExecField(SfxRequest &rReq)
{
sal_Bool bRet = sal_False;
SwFieldType* pFld = rSh.GetFldType( 0, RES_INPUTFLD );
- if( pFld && rSh.MoveFldType( pFld,
- FN_GOTO_NEXT_INPUTFLD == nSlot ))
+ const bool bAddSetExpressionFlds = !( rSh.GetViewOptions()->IsReadonly() );
+ if ( pFld != NULL
+ && rSh.MoveFldType(
+ pFld,
+ FN_GOTO_NEXT_INPUTFLD == nSlot,
+ USHRT_MAX,
+ bAddSetExpressionFlds ) )
{
rSh.ClearMark();
- rSh.StartInputFldDlg( rSh.GetCurFld(), sal_False );
+ if ( dynamic_cast<SwInputField*>(rSh.GetCurFld( true )) != NULL )
+ {
+ rSh.SttSelect();
+ rSh.SelectTxt(
+ rSh.StartOfInputFldAtPos( *(rSh.GetCrsr()->Start()) ) + 1,
+ rSh.EndOfInputFldAtPos( *(rSh.GetCrsr()->Start()) ) - 1 );
+ }
+ else
+ {
+ rSh.StartInputFldDlg( rSh.GetCurFld( true ), sal_False );
+ }
bRet = sal_True;
}
@@ -340,7 +356,7 @@ void SwTextShell::ExecField(SfxRequest &rReq)
break;
case FN_POSTIT:
{
- SwPostItField* pPostIt = (SwPostItField*)aFldMgr.GetCurFld();
+ SwPostItField* pPostIt = dynamic_cast<SwPostItField*>(aFldMgr.GetCurFld());
sal_Bool bNew = !(pPostIt && pPostIt->GetTyp()->Which() == RES_POSTITFLD);
if (bNew || GetView().GetPostItMgr()->IsAnswer())
{
@@ -615,32 +631,26 @@ void SwTextShell::StateField( SfxItemSet &rSet )
{
switch (nWhich)
{
- case FN_DELETE_COMMENT:
- case FN_DELETE_NOTE_AUTHOR:
- case FN_DELETE_ALL_NOTES:
- case FN_HIDE_NOTE:
- case FN_HIDE_NOTE_AUTHOR:
- case FN_HIDE_ALL_NOTES:
+ case FN_DELETE_COMMENT:
+ case FN_DELETE_NOTE_AUTHOR:
+ case FN_DELETE_ALL_NOTES:
+ case FN_HIDE_NOTE:
+ case FN_HIDE_NOTE_AUTHOR:
+ case FN_HIDE_ALL_NOTES:
+ {
+ SwPostItMgr* pPostItMgr = GetView().GetPostItMgr();
+ if ( !pPostItMgr )
+ rSet.InvalidateItem( nWhich );
+ else if ( !pPostItMgr->HasActiveSidebarWin() )
{
- SwPostItMgr* pPostItMgr = GetView().GetPostItMgr();
- if ( !pPostItMgr )
- rSet.InvalidateItem( nWhich );
- else if ( !pPostItMgr->HasActiveSidebarWin() )
- {
- rSet.InvalidateItem( FN_DELETE_COMMENT );
- rSet.InvalidateItem( FN_HIDE_NOTE );
- }
+ rSet.InvalidateItem( FN_DELETE_COMMENT );
+ rSet.InvalidateItem( FN_HIDE_NOTE );
}
+ }
break;
- case FN_EDIT_FIELD:
- {
- /* #108536# Fields can be selected, too now. Removed
-
- if( rSh.HasSelection() )
- rSet.DisableItem(nWhich);
- else ...
- */
+ case FN_EDIT_FIELD:
+ {
if( !bGetField )
{
pField = rSh.GetCurFld();
@@ -654,14 +664,15 @@ void SwTextShell::StateField( SfxItemSet &rSet )
RES_AUTHORITY == nTempWhich )
rSet.DisableItem( nWhich );
else if( RES_DDEFLD == nTempWhich &&
- !((SwDDEFieldType*)pField->GetTyp())->GetBaseLink().IsVisible())
+ !((SwDDEFieldType*)pField->GetTyp())->GetBaseLink().IsVisible())
{
// nested links cannot be edited
rSet.DisableItem( nWhich );
}
}
break;
- case FN_EXECUTE_MACROFIELD:
+
+ case FN_EXECUTE_MACROFIELD:
{
if(!bGetField)
{
@@ -673,33 +684,55 @@ void SwTextShell::StateField( SfxItemSet &rSet )
}
break;
- case FN_INSERT_FIELD:
+ case FN_INSERT_FIELD:
{
- SfxViewFrame* pVFrame = GetView().GetViewFrame();
- //#i5788# prevent closing of the field dialog while a modal dialog ( Input field dialog ) is active
- if(!pVFrame->IsInModalMode() &&
- pVFrame->KnowsChildWindow(FN_INSERT_FIELD) && !pVFrame->HasChildWindow(FN_INSERT_FIELD_DATA_ONLY) )
- rSet.Put(SfxBoolItem( FN_INSERT_FIELD, pVFrame->HasChildWindow(nWhich)));
+ if ( rSh.CrsrInsideInputFld() )
+ {
+ rSet.DisableItem(nWhich);
+ }
else
- rSet.DisableItem(FN_INSERT_FIELD);
+ {
+ SfxViewFrame* pVFrame = GetView().GetViewFrame();
+ //#i5788# prevent closing of the field dialog while a modal dialog ( Input field dialog ) is active
+ if(!pVFrame->IsInModalMode() &&
+ pVFrame->KnowsChildWindow(FN_INSERT_FIELD) && !pVFrame->HasChildWindow(FN_INSERT_FIELD_DATA_ONLY) )
+ rSet.Put(SfxBoolItem( FN_INSERT_FIELD, pVFrame->HasChildWindow(nWhich)));
+ else
+ rSet.DisableItem(FN_INSERT_FIELD);
+ }
}
break;
- case FN_INSERT_REF_FIELD:
+
+ case FN_INSERT_REF_FIELD:
{
SfxViewFrame* pVFrame = GetView().GetViewFrame();
- if (!pVFrame->KnowsChildWindow(FN_INSERT_FIELD))
+ if ( !pVFrame->KnowsChildWindow(FN_INSERT_FIELD)
+ || rSh.CrsrInsideInputFld() )
+ {
rSet.DisableItem(FN_INSERT_REF_FIELD);
+ }
}
break;
- case FN_INSERT_FIELD_CTRL:
- rSet.Put(SfxBoolItem( nWhich, GetView().GetViewFrame()->HasChildWindow(FN_INSERT_FIELD)));
- break;
- case FN_REDLINE_COMMENT:
- if (!rSh.GetCurrRedline())
+
+ case FN_INSERT_FIELD_CTRL:
+ if ( rSh.CrsrInsideInputFld() )
+ {
rSet.DisableItem(nWhich);
- break;
- case FN_POSTIT :
- case FN_JAVAEDIT :
+ }
+ else
+ {
+ rSet.Put(SfxBoolItem( nWhich, GetView().GetViewFrame()->HasChildWindow(FN_INSERT_FIELD)));
+ }
+ break;
+
+ case FN_REDLINE_COMMENT:
+ if (!rSh.GetCurrRedline())
+ rSet.DisableItem(nWhich);
+ break;
+
+ case FN_POSTIT :
+ case FN_JAVAEDIT :
+ {
sal_Bool bCurField = sal_False;
pField = rSh.GetCurFld();
if(nWhich == FN_POSTIT)
@@ -707,9 +740,32 @@ void SwTextShell::StateField( SfxItemSet &rSet )
else
bCurField = pField && pField->GetTyp()->Which() == RES_SCRIPTFLD;
- if(!bCurField && rSh.IsReadOnlyAvailable() && rSh.HasReadonlySel() )
+ if( !bCurField && rSh.IsReadOnlyAvailable() && rSh.HasReadonlySel() )
+ {
rSet.DisableItem(nWhich);
+ }
+ else if ( rSh.CrsrInsideInputFld() )
+ {
+ rSet.DisableItem(nWhich);
+ }
+ }
+
break;
+
+ case FN_INSERT_FLD_AUTHOR:
+ case FN_INSERT_FLD_DATE:
+ case FN_INSERT_FLD_PGCOUNT:
+ case FN_INSERT_FLD_PGNUMBER:
+ case FN_INSERT_FLD_TIME:
+ case FN_INSERT_FLD_TITLE:
+ case FN_INSERT_FLD_TOPIC:
+ case FN_INSERT_DBFIELD:
+ if ( rSh.CrsrInsideInputFld() )
+ {
+ rSet.DisableItem(nWhich);
+ }
+ break;
+
}
nWhich = aIter.NextWhich();
}
diff --git a/sw/source/ui/shells/textidx.cxx b/sw/source/ui/shells/textidx.cxx
index 27bd4827557f..d6ed9a4cdeec 100644
--- a/sw/source/ui/shells/textidx.cxx
+++ b/sw/source/ui/shells/textidx.cxx
@@ -211,7 +211,16 @@ void SwTextShell::GetIdxState(SfxItemSet &rSet)
rSet.Put(SfxBoolItem(FN_INSERT_AUTH_ENTRY_DLG, sal_True));
}
- else //if( SFX_ITEM_UNKNOWN != rSet.GetItemState( FN_EDIT_IDX_ENTRY_DLG ))
+ else if ( rSh.CrsrInsideInputFld() )
+ {
+ rSet.DisableItem( FN_INSERT_IDX_ENTRY_DLG );
+ rSet.DisableItem( FN_INSERT_AUTH_ENTRY_DLG );
+ rSet.DisableItem( FN_EDIT_AUTH_ENTRY_DLG );
+ rSet.DisableItem( FN_EDIT_IDX_ENTRY_DLG );
+ rSet.DisableItem( FN_INSERT_MULTI_TOX );
+ rSet.DisableItem( FN_REMOVE_CUR_TOX );
+ }
+ else
{
sal_Bool bEnableEdit = sal_True;
diff --git a/sw/source/ui/shells/textsh.cxx b/sw/source/ui/shells/textsh.cxx
index 907a6d981b86..b65e65142875 100644
--- a/sw/source/ui/shells/textsh.cxx
+++ b/sw/source/ui/shells/textsh.cxx
@@ -159,7 +159,8 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
case FN_INSERT_STRING:
if( pItem )
rSh.InsertByWord(((const SfxStringItem *)pItem)->GetValue());
- break;
+ break;
+
case FN_INSERT_SOFT_HYPHEN:
if( CHAR_SOFTHYPHEN != rSh.SwCrsrShell::GetChar( sal_True, 0 ) &&
CHAR_SOFTHYPHEN != rSh.SwCrsrShell::GetChar( sal_True, -1 ))
@@ -169,20 +170,23 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
case FN_INSERT_HARDHYPHEN:
case FN_INSERT_HARD_SPACE:
{
- sal_Unicode cIns = FN_INSERT_HARD_SPACE == nSlot ? CHAR_HARDBLANK
- : CHAR_HARDHYPHEN;
+ const sal_Unicode cIns = FN_INSERT_HARD_SPACE == nSlot ? CHAR_HARDBLANK : CHAR_HARDHYPHEN;
SvxAutoCorrCfg* pACfg = SvxAutoCorrCfg::Get();
SvxAutoCorrect* pACorr = pACfg->GetAutoCorrect();
- if( pACorr && pACfg->IsAutoFmtByInput() &&
- pACorr->IsAutoCorrFlag( CptlSttSntnc | CptlSttWrd |
- AddNonBrkSpace | ChgOrdinalNumber |
- ChgToEnEmDash | SetINetAttr | Autocorrect ))
+ if( pACorr && pACfg->IsAutoFmtByInput()
+ && pACorr->IsAutoCorrFlag(
+ CptlSttSntnc | CptlSttWrd | AddNonBrkSpace | ChgOrdinalNumber | ChgToEnEmDash | SetINetAttr | Autocorrect ) )
+ {
rSh.AutoCorrect( *pACorr, cIns );
+ }
else
+ {
rSh.Insert( String( cIns ) );
+ }
}
break;
+
case SID_INSERT_RLM :
case SID_INSERT_LRM :
case SID_INSERT_ZWNBSP :
@@ -199,30 +203,46 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
rSh.Insert( String( cIns ) );
}
break;
+
case FN_INSERT_BREAK:
- rSh.SplitNode();
+ {
+ if( !rSh.CrsrInsideInputFld() )
+ {
+ rSh.SplitNode();
+ }
+ else
+ {
+ rSh.InsertLineBreak();
+ }
+ }
rReq.Done();
- break;
+ break;
+
case FN_INSERT_PAGEBREAK:
rSh.InsertPageBreak();
rReq.Done();
- break;
+ break;
+
case FN_INSERT_LINEBREAK:
rSh.InsertLineBreak();
rReq.Done();
- break;
+ break;
+
case FN_INSERT_COLUMN_BREAK:
rSh.InsertColumnBreak();
rReq.Done();
- break;
+ break;
+
case SID_HYPERLINK_SETLINK:
if (pItem)
InsertHyperlink(*((const SvxHyperlinkItem *)pItem));
rReq.Done();
break;
+
case SID_INSERT_AVMEDIA:
rReq.SetReturnValue(SfxBoolItem(nSlot, InsertMediaDlg( rReq )));
break;
+
case SID_INSERT_SOUND:
case SID_INSERT_VIDEO:
{
@@ -262,6 +282,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
}
}
break;
+
case SID_INSERT_OBJECT:
case SID_INSERT_PLUGIN:
{
@@ -709,7 +730,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
rSh.SplitNode( sal_False, sal_False );
rSh.SplitNode( sal_False, sal_False );
rSh.Left(CRSR_SKIP_CHARS, sal_False, 1, sal_False );
- rSh.SetAttr(SvxAdjustItem(SVX_ADJUST_CENTER,RES_PARATR_ADJUST ));
+ rSh.SetAttrItem(SvxAdjustItem(SVX_ADJUST_CENTER,RES_PARATR_ADJUST ));
if(GRFILTER_OK == GetView().InsertGraphic(sPath, aEmptyStr, sal_True, 0, 0 ))
bRet = sal_True;
rSh.EnterStdMode();
@@ -759,38 +780,39 @@ void SwTextShell::StateInsert( SfxItemSet &rSet )
rSh.Push();
const sal_Bool bCrsrInHidden = rSh.SelectHiddenRange();
- // --> OD 2009-08-05 #i103839#, #b6855246#
- // Do not call method <SwCrsrShell::Pop(..)> with 1st parameter = <sal_False>
- // in order to avoid that the view jumps to the visible cursor.
rSh.Pop();
- // <--
while ( nWhich )
{
switch ( nWhich )
{
- case SID_INSERT_SOUND:
- case SID_INSERT_VIDEO:
- /*!SvxPluginFileDlg::IsAvailable( nWhich ) ||
-
- discussed with mba: for performance reasons we skip the IsAvailable call here
- */
- if ( GetShell().IsSelFrmMode() ||
- SFX_CREATE_MODE_EMBEDDED == eCreateMode || bCrsrInHidden )
- {
- rSet.DisableItem( nWhich );
- }
- break;
+ case SID_INSERT_AVMEDIA:
+ case SID_INSERT_SOUND:
+ case SID_INSERT_VIDEO:
+ if ( GetShell().IsSelFrmMode()
+ || GetShell().CrsrInsideInputFld()
+ || SFX_CREATE_MODE_EMBEDDED == eCreateMode
+ || bCrsrInHidden )
+ {
+ rSet.DisableItem( nWhich );
+ }
+ break;
- case SID_INSERT_DIAGRAM:
- if( !aMOpt.IsChart() || eCreateMode == SFX_CREATE_MODE_EMBEDDED || bCrsrInHidden )
- {
- rSet.DisableItem( nWhich );
- }
- break;
+ case SID_INSERT_DIAGRAM:
+ if( !aMOpt.IsChart()
+ || GetShell().CrsrInsideInputFld()
+ || eCreateMode == SFX_CREATE_MODE_EMBEDDED
+ || bCrsrInHidden )
+ {
+ rSet.DisableItem( nWhich );
+ }
+ break;
case FN_INSERT_SMA:
- if( !aMOpt.IsMath() || eCreateMode == SFX_CREATE_MODE_EMBEDDED || bCrsrInHidden )
+ if( !aMOpt.IsMath()
+ || eCreateMode == SFX_CREATE_MODE_EMBEDDED
+ || bCrsrInHidden
+ || rSh.CrsrInsideInputFld() )
{
rSet.DisableItem( nWhich );
}
@@ -799,30 +821,38 @@ void SwTextShell::StateInsert( SfxItemSet &rSet )
case SID_INSERT_FLOATINGFRAME:
case SID_INSERT_OBJECT:
case SID_INSERT_PLUGIN:
- {
- if( eCreateMode == SFX_CREATE_MODE_EMBEDDED || bCrsrInHidden )
{
- rSet.DisableItem( nWhich );
+ if( eCreateMode == SFX_CREATE_MODE_EMBEDDED || bCrsrInHidden )
+ {
+ rSet.DisableItem( nWhich );
+ }
+ else if( GetShell().IsSelFrmMode()
+ || GetShell().CrsrInsideInputFld() )
+ {
+ rSet.DisableItem( nWhich );
+ }
+ else if(SID_INSERT_FLOATINGFRAME == nWhich && nHtmlMode&HTMLMODE_ON)
+ {
+ SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
+ sal_uInt16 nExport = pHtmlOpt->GetExportMode();
+ if(HTML_CFG_MSIE_40 != nExport && HTML_CFG_WRITER != nExport )
+ rSet.DisableItem(nWhich);
+ }
}
- else if( GetShell().IsSelFrmMode())
- rSet.DisableItem( nWhich );
- else if(SID_INSERT_FLOATINGFRAME == nWhich && nHtmlMode&HTMLMODE_ON)
+ break;
+
+ case FN_INSERT_FRAME_INTERACT_NOCOL :
+ case FN_INSERT_FRAME_INTERACT:
{
- SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
- sal_uInt16 nExport = pHtmlOpt->GetExportMode();
- if(HTML_CFG_MSIE_40 != nExport && HTML_CFG_WRITER != nExport )
+ if( GetShell().IsSelFrmMode()
+ || GetShell().CrsrInsideInputFld()
+ || ( 0 != (nHtmlMode & HTMLMODE_ON)
+ && 0 == (nHtmlMode & HTMLMODE_SOME_ABS_POS) )
+ || bCrsrInHidden )
rSet.DisableItem(nWhich);
}
- }
- break;
- case FN_INSERT_FRAME_INTERACT_NOCOL :
- case FN_INSERT_FRAME_INTERACT:
- {
- if ( GetShell().IsSelFrmMode() ||
- (0 != (nHtmlMode & HTMLMODE_ON) && 0 == (nHtmlMode & HTMLMODE_SOME_ABS_POS)) || bCrsrInHidden )
- rSet.DisableItem(nWhich);
- }
- break;
+ break;
+
case SID_HYPERLINK_GETLINK:
{
SfxItemSet aSet(GetPool(), RES_TXTATR_INETFMT, RES_TXTATR_INETFMT);
@@ -869,24 +899,34 @@ void SwTextShell::StateInsert( SfxItemSet &rSet )
aHLinkItem.SetInsertMode((SvxLinkInsertMode)(aHLinkItem.GetInsertMode() |
((nHtmlMode & HTMLMODE_ON) != 0 ? HLINK_HTMLMODE : 0)));
aHLinkItem.SetMacroEvents ( HYPERDLG_EVENT_MOUSEOVER_OBJECT|
- HYPERDLG_EVENT_MOUSECLICK_OBJECT | HYPERDLG_EVENT_MOUSEOUT_OBJECT );
+ HYPERDLG_EVENT_MOUSECLICK_OBJECT | HYPERDLG_EVENT_MOUSEOUT_OBJECT );
rSet.Put(aHLinkItem);
}
break;
case FN_INSERT_FRAME:
- if(rSh.IsSelFrmMode())
+ if (rSh.IsSelFrmMode() )
{
const int nSel = rSh.GetSelectionType();
if( ((nsSelectionType::SEL_GRF | nsSelectionType::SEL_OLE ) & nSel ) || bCrsrInHidden )
rSet.DisableItem(nWhich);
}
- break;
+ else if ( rSh.CrsrInsideInputFld() )
+ {
+ rSet.DisableItem(nWhich);
+ }
+ break;
+
case FN_INSERT_HRULER :
- if((rSh.IsReadOnlyAvailable() && rSh.HasReadonlySel()) || bCrsrInHidden )
+ if( (rSh.IsReadOnlyAvailable() && rSh.HasReadonlySel())
+ || bCrsrInHidden
+ || rSh.CrsrInsideInputFld() )
+ {
rSet.DisableItem(nWhich);
- break;
+ }
+ break;
+
case FN_FORMAT_COLUMN :
{
//#i80458# column dialog cannot work if the selection contains different page styles and different sections
@@ -1181,7 +1221,7 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq )
rSh.SetMark();
rSh.ExtendSelection( sal_False, aChars.Len() );
- rSh.SetAttr( aSet, nsSetAttrMode::SETATTR_DONTEXPAND | nsSetAttrMode::SETATTR_NOFORMATATTR );
+ rSh.SetAttrSet( aSet, nsSetAttrMode::SETATTR_DONTEXPAND | nsSetAttrMode::SETATTR_NOFORMATATTR );
if( !rSh.IsCrsrPtAtEnd() )
rSh.SwapPam();
@@ -1191,7 +1231,7 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq )
// SETATTR_DONTEXPAND does not work if there are already hard attributes.
// Therefore we have to restore the font attributes.
rSh.SetMark();
- rSh.SetAttr( aRestoreSet );
+ rSh.SetAttrSet( aRestoreSet );
rSh.ClearMark();
// <--
diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx
index 965c92e812eb..82b4536186ef 100644
--- a/sw/source/ui/shells/textsh1.cxx
+++ b/sw/source/ui/shells/textsh1.cxx
@@ -255,7 +255,7 @@ void lcl_CharDialog( SwWrtShell &rWrtSh, sal_Bool bUseDialog, sal_uInt16 nSlot,c
rWrtSh.AutoUpdatePara(pColl, aTmpSet);
}
else
- rWrtSh.SetAttr( aTmpSet );
+ rWrtSh.SetAttrSet( aTmpSet );
if (pReq)
pReq->Done(aTmpSet);
if(bInsert)
@@ -462,7 +462,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
SvxFontItem aFont( rFont.GetFamily(), pFont->GetValue(),
rFont.GetStyleName(), rFont.GetPitch(), RTL_TEXTENCODING_DONTKNOW, RES_CHRATR_FONT );
//pCharset ? (CharSet) pCharset->GetValue() : RTL_TEXTENCODING_DONTKNOW );
- rWrtSh.SetAttr( aSet, nsSetAttrMode::SETATTR_DONTEXPAND );
+ rWrtSh.SetAttrSet( aSet, nsSetAttrMode::SETATTR_DONTEXPAND );
rWrtSh.ResetSelect(0, sal_False);
rWrtSh.EndSelect();
rWrtSh.GotoFtnTxt();
@@ -1039,7 +1039,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
if ( ((SfxStringItem*)pItem)->GetValue().Len() )
rWrtSh.ReplaceDropTxt(((SfxStringItem*)pItem)->GetValue());
}
- rWrtSh.SetAttr( *pSet );
+ rWrtSh.SetAttrSet( *pSet );
// rWrtSh.EndUndo( UNDO_END );
rWrtSh.EndAction();
SwTxtFmtColl* pColl = rWrtSh.GetCurTxtFmtColl();
@@ -1119,8 +1119,35 @@ void SwTextShell::Execute(SfxRequest &rReq)
case SID_DEC_INDENT:
case SID_INC_INDENT:
+//IAccessibility2 Implementation 2009-----
+ //According to the requirement, modified the behavior when user
+ //using the indent button on the toolbar. Now if we increase/decrease indent for a
+ //paragraph which has bullet style it will increase/decrease the bullet level.
+ {
+ //If the current paragraph has bullet call the function to
+ //increase or decrease the bullet level.
+ //Why could I know wheter a paragraph has bullet or not by checking the below conditions?
+ //Please refer to the "case KEY_TAB:" section in SwEditWin::KeyInput(..) :
+ // if( rSh.GetCurNumRule() && rSh.IsSttOfPara() &&
+ // !rSh.HasReadonlySel() )
+ // eKeyState = KS_NumDown;
+ //Above code demonstrates that when the cursor is at the start of a paragraph which has bullet,
+ //press TAB will increase the bullet level.
+ //So I copied from that ^^
+ if ( rWrtSh.GetCurNumRule() && !rWrtSh.HasReadonlySel() )
+ {
+ rWrtSh.NumUpDown( SID_INC_INDENT == nSlot );
+ }
+ else//execute the original processing functions
+ {
+ //below is copied of the old codes
rWrtSh.MoveLeftMargin( SID_INC_INDENT == nSlot,
rReq.GetModifier() != KEY_MOD1 );
+ }
+ }
+ //rWrtSh.MoveLeftMargin( SID_INC_INDENT == nSlot,
+ // rReq.GetModifier() != KEY_MOD1 );
+//-----IAccessibility2 Implementation 2009
rReq.Done();
break;
case FN_DEC_INDENT_OFFSET:
@@ -1143,7 +1170,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
// besteht eine Selektion, wird sie gleich gefaerbt
if(!pApply && rWrtSh.HasSelection())
{
- rWrtSh.SetAttr(SvxColorItem (aSet, RES_CHRATR_COLOR));
+ rWrtSh.SetAttrItem(SvxColorItem (aSet, RES_CHRATR_COLOR));
}
else if(!pApply || pApply->nColor != SID_ATTR_CHAR_COLOR_EXT)
{
@@ -1151,17 +1178,6 @@ void SwTextShell::Execute(SfxRequest &rReq)
}
rReq.Done();
-/* OS 22.02.97 18:40 Das alte Verhalten ist unerwuenscht
- SwEditWin& rEdtWin = GetView().GetEditWin();
-
- SwApplyTemplate* pApply = rEdtWin.GetApplyTemplate();
- SvxColorItem aItem(aSet, RES_CHRATR_COLOR);
-
- if(!pApply || pApply->nColor != SID_ATTR_CHAR_COLOR_EXT)
- {
- GetShell().SetAttr(aItem);
- }
-*/
}
}
break;
@@ -1183,7 +1199,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
aBrushItem.SetColor(aSet);
else
aBrushItem.SetColor(Color(COL_TRANSPARENT));
- rWrtSh.SetAttr( aBrushItem );
+ rWrtSh.SetAttrItem( aBrushItem );
}
else if(!pApply || pApply->nColor != SID_ATTR_CHAR_COLOR_BACKGROUND_EXT)
{
@@ -1192,15 +1208,6 @@ void SwTextShell::Execute(SfxRequest &rReq)
rReq.Done();
-/* OS 22.02.97 18:40 Das alte Verhalten ist unerwuenscht
- if(!pApply || pApply->nColor != SID_ATTR_CHAR_COLOR_BACKGROUND_EXT)
- {
- Brush aBrush(pItem ? BRUSH_SOLID : BRUSH_NULL);
- if(pItem)
- aBrush.SetColor( aSet );
- GetShell().SetAttr( SvxBrushItem(aBrush, RES_CHRATR_BACKGROUND) );
- }
-*/
}
break;
case SID_ATTR_CHAR_COLOR_BACKGROUND_EXT:
@@ -1215,12 +1222,12 @@ void SwTextShell::Execute(SfxRequest &rReq)
if(nSlot == SID_ATTR_CHAR_COLOR_BACKGROUND_EXT)
{
- rWrtSh.SetAttr( SvxBrushItem(
- rEdtWin.GetTextBackColor(), RES_CHRATR_BACKGROUND) );
+ rWrtSh.SetAttrItem(
+ SvxBrushItem( rEdtWin.GetTextBackColor(), RES_CHRATR_BACKGROUND) );
}
else
- rWrtSh.SetAttr( SvxColorItem( rEdtWin.GetTextColor(),
- RES_CHRATR_COLOR) );
+ rWrtSh.SetAttrItem(
+ SvxColorItem( rEdtWin.GetTextColor(), RES_CHRATR_COLOR) );
}
else
{
@@ -1464,6 +1471,7 @@ void SwTextShell::GetState( SfxItemSet &rSet )
rSet.Put(SfxBoolItem(FN_NUMBER_NEWSTART,
rSh.IsNumRuleStart()));
break;
+
case FN_EDIT_FORMULA:
case SID_CHARMAP:
{
@@ -1471,7 +1479,14 @@ void SwTextShell::GetState( SfxItemSet &rSet )
if (!(nType & nsSelectionType::SEL_TXT) &&
!(nType & nsSelectionType::SEL_TBL) &&
!(nType & nsSelectionType::SEL_NUM))
+ {
rSet.DisableItem(nWhich);
+ }
+ else if ( nWhich == FN_EDIT_FORMULA
+ && rSh.CrsrInsideInputFld() )
+ {
+ rSet.DisableItem( nWhich );
+ }
}
break;
@@ -1479,16 +1494,35 @@ void SwTextShell::GetState( SfxItemSet &rSet )
case FN_INSERT_FOOTNOTE:
case FN_INSERT_FOOTNOTE_DLG:
{
- const sal_uInt16 nNoType = FRMTYPE_FLY_ANY | FRMTYPE_HEADER |
- FRMTYPE_FOOTER | FRMTYPE_FOOTNOTE;
+ const sal_uInt16 nNoType =
+ FRMTYPE_FLY_ANY | FRMTYPE_HEADER | FRMTYPE_FOOTER | FRMTYPE_FOOTNOTE;
if ( (rSh.GetFrmType(0,sal_True) & nNoType) )
rSet.DisableItem(nWhich);
+
+ if ( rSh.CrsrInsideInputFld() )
+ {
+ rSet.DisableItem( nWhich );
+ }
+ }
+ break;
+
+ case FN_INSERT_HYPERLINK:
+ case SID_INSERTDOC:
+ case FN_INSERT_GLOSSARY:
+ case FN_EXPAND_GLOSSARY:
+ if ( rSh.CrsrInsideInputFld() )
+ {
+ rSet.DisableItem( nWhich );
}
break;
+
case FN_INSERT_TABLE:
- if ( rSh.GetTableFmt() ||
- (rSh.GetFrmType(0,sal_True) & FRMTYPE_FOOTNOTE) )
+ if ( rSh.CrsrInsideInputFld()
+ || rSh.GetTableFmt()
+ || (rSh.GetFrmType(0,sal_True) & FRMTYPE_FOOTNOTE) )
+ {
rSet.DisableItem( nWhich );
+ }
break;
case FN_CALCULATE:
@@ -1507,20 +1541,53 @@ void SwTextShell::GetState( SfxItemSet &rSet )
rSet.Put( SfxBoolItem( nWhich, SvxAutoCorrCfg::Get()->IsAutoFmtByInput() ));
}
break;
+
case FN_GLOSSARY_DLG:
{
- rSet.Put(SfxBoolItem(nWhich), sal_True);
+ if ( rSh.CrsrInsideInputFld() )
+ {
+ rSet.DisableItem( nWhich );
+ }
+ else
+ {
+ rSet.Put(SfxBoolItem(nWhich), sal_True);
+ }
}
break;
case SID_DEC_INDENT:
case SID_INC_INDENT:
{
+//IAccessibility2 Implementation 2009-----
+ //if the paragrah has bullet we'll do the following things:
+ //1: if the bullet level is the first level, disable the decrease-indent button
+ //2: if the bullet level is the last level, disable the increase-indent button
+ if ( rSh.GetCurNumRule() && !rSh.HasReadonlySel() )
+ {
+ sal_uInt8 nLevel = rSh.GetNumLevel();
+ if ( nLevel == (MAXLEVEL-1) && nWhich == SID_INC_INDENT ||
+ nLevel == 0 && nWhich == SID_DEC_INDENT )
+ {
+ rSet.DisableItem( nWhich );
+ }
+ }
+ else//if the paragraph has no bullet, execute the original functions
+ {
+ //below is copied of the old codes
sal_uInt16 nHtmlMode = ::GetHtmlMode(GetView().GetDocShell());
nHtmlMode &= HTMLMODE_ON|HTMLMODE_SOME_STYLES;
if( (nHtmlMode == HTMLMODE_ON) || !rSh.IsMoveLeftMargin(
SID_INC_INDENT == nWhich, sal_True ))
rSet.DisableItem( nWhich );
+ }
+ //old code begins
+ //sal_uInt16 nHtmlMode = ::GetHtmlMode(GetView().GetDocShell());
+ //nHtmlMode &= HTMLMODE_ON|HTMLMODE_SOME_STYLES;
+ //if( (nHtmlMode == HTMLMODE_ON) || !rSh.IsMoveLeftMargin(
+ // SID_INC_INDENT == nWhich, TRUE ))
+ // rSet.DisableItem( nWhich );
+ //old code ends
+//-----IAccessibility2 Implementation 2009
}
break;
@@ -1557,9 +1624,22 @@ void SwTextShell::GetState( SfxItemSet &rSet )
rSet.Put(SfxBoolItem(nWhich, pApply && pApply->nColor == nWhich));
}
break;
+
case FN_INSERT_BOOKMARK:
- if( rSh.IsTableMode() )
+ if( rSh.IsTableMode()
+ || rSh.CrsrInsideInputFld() )
+ {
+ rSet.DisableItem( nWhich );
+ }
+ break;
+
+ case FN_INSERT_BREAK_DLG:
+ case FN_INSERT_COLUMN_BREAK:
+ case FN_INSERT_PAGEBREAK:
+ if( rSh.CrsrInsideInputFld() )
+ {
rSet.DisableItem( nWhich );
+ }
break;
case FN_INSERT_PAGEHEADER:
@@ -1596,42 +1676,50 @@ void SwTextShell::GetState( SfxItemSet &rSet )
(FN_TABLE_SORT_DIALOG == nWhich && !rSh.GetTableFmt()))
rSet.DisableItem( nWhich );
break;
+
case SID_RUBY_DIALOG:
- {
- SvtCJKOptions aCJKOptions;
- if(!aCJKOptions.IsRubyEnabled())
{
- GetView().GetViewFrame()->GetBindings().SetVisibleState( nWhich, sal_False );
- rSet.DisableItem(nWhich);
+ SvtCJKOptions aCJKOptions;
+ if( !aCJKOptions.IsRubyEnabled()
+ || rSh.CrsrInsideInputFld() )
+ {
+ GetView().GetViewFrame()->GetBindings().SetVisibleState( nWhich, sal_False );
+ rSet.DisableItem(nWhich);
+ }
+ else
+ GetView().GetViewFrame()->GetBindings().SetVisibleState( nWhich, sal_True );
}
- else
- GetView().GetViewFrame()->GetBindings().SetVisibleState( nWhich, sal_True );
break;
- }
- //no break!
+
case SID_HYPERLINK_DIALOG:
- if( GetView().GetDocShell()->IsReadOnly() ||
- (!GetView().GetViewFrame()->HasChildWindow(nWhich) &&
- rSh.HasReadonlySel()) )
+ if( GetView().GetDocShell()->IsReadOnly()
+ || ( !GetView().GetViewFrame()->HasChildWindow(nWhich)
+ && rSh.HasReadonlySel() )
+ || rSh.CrsrInsideInputFld() )
+ {
rSet.DisableItem(nWhich);
+ }
else
- rSet.Put(SfxBoolItem( nWhich, 0 != GetView().
- GetViewFrame()->GetChildWindow( nWhich ) ));
+ {
+ rSet.Put(SfxBoolItem( nWhich, 0 != GetView().GetViewFrame()->GetChildWindow( nWhich ) ));
+ }
break;
+
case FN_EDIT_HYPERLINK:
case FN_REMOVE_HYPERLINK:
case FN_COPY_HYPERLINK_LOCATION:
- {
- SfxItemSet aSet(GetPool(),
- RES_TXTATR_INETFMT,
- RES_TXTATR_INETFMT);
- rSh.GetCurAttr(aSet);
- if(SFX_ITEM_SET > aSet.GetItemState( RES_TXTATR_INETFMT, sal_True ) || rSh.HasReadonlySel())
{
- rSet.DisableItem(nWhich);
+ SfxItemSet aSet(GetPool(),
+ RES_TXTATR_INETFMT,
+ RES_TXTATR_INETFMT);
+ rSh.GetCurAttr(aSet);
+ if(SFX_ITEM_SET > aSet.GetItemState( RES_TXTATR_INETFMT, sal_True ) || rSh.HasReadonlySel())
+ {
+ rSet.DisableItem(nWhich);
+ }
}
- }
- break;
+ break;
+
case SID_TRANSLITERATE_HALFWIDTH:
case SID_TRANSLITERATE_FULLWIDTH:
case SID_TRANSLITERATE_HIRAGANA:
@@ -1755,13 +1843,6 @@ void SwTextShell::GetState( SfxItemSet &rSet )
break;
case FN_NUM_CONTINUE:
{
- // --> OD 2009-08-26 #i86492#
- // Allow continuation of previous list, even if at current cursor
- // a list is active.
-// if ( rSh.GetCurNumRule() )
-// rSet.DisableItem(nWhich);
-// else
- // <--
{
// --> OD 2009-08-26 #i86492#
// Search also for bullet list
diff --git a/sw/source/ui/shells/txtattr.cxx b/sw/source/ui/shells/txtattr.cxx
index 181e0dafc2a9..f955b18ed8ae 100644
--- a/sw/source/ui/shells/txtattr.cxx
+++ b/sw/source/ui/shells/txtattr.cxx
@@ -149,7 +149,7 @@ void SwTextShell::ExecCharAttr(SfxRequest &rReq)
if(eEscape == FN_SET_SUPER_SCRIPT)
aEscape.GetEsc() *= -1;
}
- rSh.SetAttr( aEscape );
+ rSh.SetAttrItem( aEscape );
rReq.AppendItem( aEscape );
rReq.Done();
}
@@ -178,7 +178,7 @@ void SwTextShell::ExecCharAttr(SfxRequest &rReq)
break;
}
SvxUnderlineItem aUnderline(eUnderline, RES_CHRATR_UNDERLINE );
- rSh.SetAttr( aUnderline );
+ rSh.SetAttrItem( aUnderline );
rReq.AppendItem( aUnderline );
rReq.Done();
}
@@ -234,7 +234,7 @@ void SwTextShell::ExecCharAttrArgs(SfxRequest &rReq)
if ( pColl )
pColl->SetFmtAttr( aINetFmt );
- else rWrtSh.SetAttr( aINetFmt );
+ else rWrtSh.SetAttrItem( aINetFmt );
rReq.Done();
}
break;
@@ -281,7 +281,7 @@ void SwTextShell::ExecCharAttrArgs(SfxRequest &rReq)
if( pColl )
pColl->SetFmtAttr( aAttrSet );
else
- rWrtSh.SetAttr( aAttrSet );
+ rWrtSh.SetAttrSet( aAttrSet );
}
rReq.Done();
}
@@ -345,7 +345,7 @@ void SwTextShell::ExecParaAttr(SfxRequest &rReq)
}
else
{
- rWrtSh.SetAttr( aSet );
+ rWrtSh.SetAttrSet( aSet );
rReq.Done( aSet );
}
}
@@ -508,7 +508,7 @@ SET_LINESPACE:
rWrtSh.AutoUpdatePara(pColl, aSet);
}
else
- rWrtSh.SetAttr( aSet );
+ rWrtSh.SetAttrSet( aSet );
rReq.Done();
}
@@ -539,14 +539,14 @@ void SwTextShell::ExecParaAttrArgs(SfxRequest &rReq)
pFmt = rSh.FindCharFmtByName( sCharStyleName );
aDropItem.SetCharFmt( pFmt );
aSet.Put(aDropItem);
- rSh.SetAttr(aSet);
+ rSh.SetAttrSet(aSet);
}
break;
case FN_FORMAT_DROPCAPS:
{
if(pItem)
{
- rSh.SetAttr(*pItem);
+ rSh.SetAttrItem(*pItem);
rReq.Done();
}
else
@@ -569,7 +569,7 @@ void SwTextShell::ExecParaAttrArgs(SfxRequest &rReq)
if ( ((SfxStringItem*)pItem)->GetValue().Len() )
rSh.ReplaceDropTxt(((SfxStringItem*)pItem)->GetValue());
}
- rSh.SetAttr(*pDlg->GetOutputItemSet());
+ rSh.SetAttrSet(*pDlg->GetOutputItemSet());
rSh.StartUndo( UNDO_END );
rSh.EndAction();
rReq.Done(*pDlg->GetOutputItemSet());
@@ -581,7 +581,7 @@ void SwTextShell::ExecParaAttrArgs(SfxRequest &rReq)
case SID_ATTR_PARA_PAGEBREAK:
if(pItem)
{
- rSh.SetAttr( *pItem );
+ rSh.SetAttrItem( *pItem );
rReq.Done();
}
break;
@@ -594,7 +594,7 @@ void SwTextShell::ExecParaAttrArgs(SfxRequest &rReq)
SID_ATTR_PARA_MODEL, SID_ATTR_PARA_MODEL, 0);
aCoreSet.Put(*pItem);
SfxToSwPageDescAttr( rSh, aCoreSet);
- rSh.SetAttr(aCoreSet);
+ rSh.SetAttrSet(aCoreSet);
rReq.Done();
}
}
diff --git a/sw/source/ui/shells/txtnum.cxx b/sw/source/ui/shells/txtnum.cxx
index b5016bc4dbe4..3c1591aa8d7a 100644
--- a/sw/source/ui/shells/txtnum.cxx
+++ b/sw/source/ui/shells/txtnum.cxx
@@ -354,7 +354,7 @@ void SwTextShell::ExecSetNumber(SfxRequest &rReq)
numfunc::GetDefaultPositionAndSpaceMode() );
SvxNumRule aTempRule = aTmpRule.MakeSvxNumRule();
- //Sym3_2508, set unit attribute to NB Manager
+ // set unit attribute to NB Manager
SfxItemSet aSet(GetPool(),
SID_ATTR_NUMBERING_RULE, SID_PARAM_CUR_NUM_LEVEL,
0 );
@@ -407,7 +407,7 @@ void SwTextShell::ExecSetNumber(SfxRequest &rReq)
numfunc::GetDefaultPositionAndSpaceMode() );
SvxNumRule aTempRule = aTmpRule.MakeSvxNumRule();
- //Sym3_2508, set unit attribute to NB Manager
+ // set unit attribute to NB Manager
SfxItemSet aSet(GetPool(),
SID_ATTR_NUMBERING_RULE, SID_PARAM_CUR_NUM_LEVEL,
0 );
diff --git a/sw/source/ui/table/convert.hrc b/sw/source/ui/table/convert.hrc
index 7537d868689d..4156a5e7b4d4 100644
--- a/sw/source/ui/table/convert.hrc
+++ b/sw/source/ui/table/convert.hrc
@@ -35,6 +35,12 @@
#define FL_OPTIONS 17
#define FT_REPEAT_HEADER 18
#define NF_REPEAT_HEADER 19
+//Table Row Header for ACC Supporting 2010.02.22
+#define FT_EXPLAIN_REPEAT_HEADER 20
+#define CB_LABEL 21
+#define NF_REPEAT_LABEL 22
+#define FT_REPEAT_LABEL 23
+//End table_row_header
#define BT_OK 100
#define BT_CANCEL 101
diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx
index 088586236c2b..6af7e25d3d4f 100644
--- a/sw/source/ui/table/tabledlg.cxx
+++ b/sw/source/ui/table/tabledlg.cxx
@@ -991,11 +991,9 @@ IMPL_LINK( SwTableColumnPage, AutoClickHdl, CheckBox *, pBox )
sEntry += sIndex;
pTextArr[i]->SetText( sEntry );
//IAccessibility2 Impplementaton 2009-----
- //added by menghu for SODC_5143,12/12/2006
String sColumnWidth = SW_RESSTR( STR_ACCESS_COLUMN_WIDTH);
sColumnWidth.SearchAndReplace( DEFINE_CONST_UNICODE("%1"), sIndex );
pFieldArr[i]->SetAccessibleName( sColumnWidth );
- //end of SODC_5143
//-----IAccessibility2 Impplementaton 2009
}
diff --git a/sw/source/ui/table/tabledlg.hrc b/sw/source/ui/table/tabledlg.hrc
index c0fe76d8f9a0..2c063603ce76 100644
--- a/sw/source/ui/table/tabledlg.hrc
+++ b/sw/source/ui/table/tabledlg.hrc
@@ -102,6 +102,9 @@
#define FL_VERT_ORIENT 140
#define RB_FROM_LEFT 144
+//IAccessibility2 Impplementaton 2009-----
+#define STR_COLUMN_WIDTH 145
+//-----IAccessibility2 Impplementaton 2009
#define FT_VERTORIENT 150
#define LB_VERTORIENT 151
diff --git a/sw/source/ui/uiview/formatclipboard.cxx b/sw/source/ui/uiview/formatclipboard.cxx
index cef5e2dc9820..039e5ae3249c 100644
--- a/sw/source/ui/uiview/formatclipboard.cxx
+++ b/sw/source/ui/uiview/formatclipboard.cxx
@@ -509,7 +509,7 @@ void SwFormatClipboard::Paste( SwWrtShell& rWrtShell, SfxStyleSheetBasePool* pPo
// #144857# collect items from character style
lcl_AppendSetItems( aItemVector, aFmt.GetCharFmt()->GetAttrSet());
sal_uInt16 nFlags=0; //(nMode & KEY_SHIFT) ? SETATTR_DONTREPLACE : SETATTR_DEFAULT;
- rWrtShell.SetAttr( aFmt, nFlags );
+ rWrtShell.SetAttrItem( aFmt, nFlags );
}
}
if(m_aParaStyle.Len() && !bNoParagraphFormats )
@@ -550,7 +550,7 @@ void SwFormatClipboard::Paste( SwWrtShell& rWrtShell, SfxStyleSheetBasePool* pPo
rWrtShell.SetFlyFrmAttr(*pTemplateItemSet);
else
{
- rWrtShell.SetAttr(*pTemplateItemSet);
+ rWrtShell.SetAttrSet(*pTemplateItemSet);
// additional numbering properties for paragraph styles
if( nSelectionType & nsSelectionType::SEL_TXT && rWrtShell.GetCurNumRule() )
diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx
index b22d9c15ea3d..d4aceb94a396 100644
--- a/sw/source/ui/uiview/pview.cxx
+++ b/sw/source/ui/uiview/pview.cxx
@@ -238,8 +238,11 @@ SwPagePreViewWin::SwPagePreViewWin( Window *pParent, SwPagePreView& rPView )
SwPagePreViewWin::~SwPagePreViewWin()
{
- if( mpViewShell )
- delete mpViewShell;
+ //IAccessibility2 Implementation 2009-----
+ // Remove to the deconstruction of SwPagePreView.
+ //if( mpViewShell)
+ // delete mpViewShell;
+ //-----IAccessibility2 Implementation 2009
}
/*--------------------------------------------------------------------
@@ -714,46 +717,46 @@ void SwPagePreView::_ExecPgUpAndPgDown( const bool _bPgUp,
SwPagePreViewWin::MV_PAGE_UP :
SwPagePreViewWin::MV_PAGE_DOWN;
if ( ChgPage( eMvMode, sal_True ) )
- aViewWin.Invalidate();
+ pViewWin->Invalidate();
}
else
{
SwTwips nScrollAmount;
sal_uInt16 nNewSelectedPageNum = 0;
- const sal_uInt16 nVisPages = aViewWin.GetRow() * aViewWin.GetCol();
+ const sal_uInt16 nVisPages = pViewWin->GetRow() * pViewWin->GetCol();
if( _bPgUp )
{
if ( pPagePrevwLay->DoesPreviewLayoutRowsFitIntoWindow() )
{
nScrollAmount = pPagePrevwLay->GetWinPagesScrollAmount( -1 );
- if ( (aViewWin.SelectedPage() - nVisPages) > 0 )
- nNewSelectedPageNum = aViewWin.SelectedPage() - nVisPages;
+ if ( (pViewWin->SelectedPage() - nVisPages) > 0 )
+ nNewSelectedPageNum = pViewWin->SelectedPage() - nVisPages;
else
nNewSelectedPageNum = 1;
}
else
- nScrollAmount = - Min( aViewWin.GetOutputSize().Height(),
- aViewWin.GetPaintedPreviewDocRect().Top() );
+ nScrollAmount = - Min( pViewWin->GetOutputSize().Height(),
+ pViewWin->GetPaintedPreviewDocRect().Top() );
}
else
{
if ( pPagePrevwLay->DoesPreviewLayoutRowsFitIntoWindow() )
{
nScrollAmount = pPagePrevwLay->GetWinPagesScrollAmount( 1 );
- if ( (aViewWin.SelectedPage() + nVisPages) <= mnPageCount )
- nNewSelectedPageNum = aViewWin.SelectedPage() + nVisPages;
+ if ( (pViewWin->SelectedPage() + nVisPages) <= mnPageCount )
+ nNewSelectedPageNum = pViewWin->SelectedPage() + nVisPages;
else
nNewSelectedPageNum = mnPageCount;
}
else
- nScrollAmount = Min( aViewWin.GetOutputSize().Height(),
+ nScrollAmount = Min( pViewWin->GetOutputSize().Height(),
( pPagePrevwLay->GetPrevwDocSize().Height() -
- aViewWin.GetPaintedPreviewDocRect().Bottom() ) );
+ pViewWin->GetPaintedPreviewDocRect().Bottom() ) );
}
- aViewWin.Scroll( 0, nScrollAmount );
+ pViewWin->Scroll( 0, nScrollAmount );
if ( nNewSelectedPageNum != 0 )
{
- aViewWin.SetSelectedPage( nNewSelectedPageNum );
+ pViewWin->SetSelectedPage( nNewSelectedPageNum );
}
ScrollViewSzChg();
// OD 24.03.2003 #108282# - additional invalidate page status.
@@ -764,7 +767,7 @@ void SwPagePreView::_ExecPgUpAndPgDown( const bool _bPgUp,
};
SfxBindings& rBindings = GetViewFrame()->GetBindings();
rBindings.Invalidate( aInval );
- aViewWin.Invalidate();
+ pViewWin->Invalidate();
}
}
@@ -799,11 +802,11 @@ void SwPagePreView::Execute( SfxRequest &rReq )
SID_ATTR_TABLE_COLUMN)).GetValue();
sal_uInt8 nRows = (sal_uInt8)((SfxUInt16Item &)pArgs->Get(
SID_ATTR_TABLE_ROW)).GetValue();
- aViewWin.CalcWish( nRows, nCols );
+ pViewWin->CalcWish( nRows, nCols );
}
else
- SwPreViewZoomDlg( aViewWin ).Execute();
+ SwPreViewZoomDlg( *pViewWin ).Execute();
}
break;
@@ -818,7 +821,7 @@ void SwPagePreView::Execute( SfxRequest &rReq )
( ( SwViewOption* ) GetViewShell()->GetViewOptions() )->SetPagePrevBookview( bBookPreview );
// cast is not gentleman like, but it's common use in writer and in this case
}
- if ( aViewWin.SetBookPreviewMode( bBookPreview ) )
+ if ( pViewWin->SetBookPreviewMode( bBookPreview ) )
{
// book preview mode changed. Thus, adjust scrollbars and
// invalidate corresponding states.
@@ -830,13 +833,13 @@ void SwPagePreView::Execute( SfxRequest &rReq )
};
SfxBindings& rBindings = GetViewFrame()->GetBindings();
rBindings.Invalidate( aInval );
- aViewWin.Invalidate();
+ pViewWin->Invalidate();
}
}
break;
case FN_SHOW_TWO_PAGES:
- aViewWin.CalcWish( nRow, 2 );
+ pViewWin->CalcWish( nRow, 2 );
break;
case FN_PREVIEW_ZOOM:
@@ -930,7 +933,7 @@ void SwPagePreView::Execute( SfxRequest &rReq )
}
pPagePrevwLay->CalcStartValuesForSelectedPageMove( nHoriMove, nVertMove,
nNewSelectedPage, nNewStartPage, aNewStartPos );
- if ( aViewWin.SelectedPage() != nNewSelectedPage )
+ if ( pViewWin->SelectedPage() != nNewSelectedPage )
{
if ( pPagePrevwLay->IsPageVisible( nNewSelectedPage ) )
{
@@ -941,8 +944,8 @@ void SwPagePreView::Execute( SfxRequest &rReq )
}
else
{
- aViewWin.SetSelectedPage( nNewSelectedPage );
- aViewWin.SetSttPage( nNewStartPage );
+ pViewWin->SetSelectedPage( nNewSelectedPage );
+ pViewWin->SetSttPage( nNewStartPage );
int nRet = ChgPage( SwPagePreViewWin::MV_SELPAGE, sal_True );
bRefresh = 0 != nRet;
}
@@ -970,11 +973,11 @@ void SwPagePreView::Execute( SfxRequest &rReq )
}
case FN_START_OF_LINE:
case FN_START_OF_DOCUMENT:
- aViewWin.SetSelectedPage( 1 );
+ pViewWin->SetSelectedPage( 1 );
eMvMode = SwPagePreViewWin::MV_DOC_STT; bRetVal = sal_True; goto MOVEPAGE;
case FN_END_OF_LINE:
case FN_END_OF_DOCUMENT:
- aViewWin.SetSelectedPage( mnPageCount );
+ pViewWin->SetSelectedPage( mnPageCount );
eMvMode = SwPagePreViewWin::MV_DOC_END; bRetVal = sal_True; goto MOVEPAGE;
MOVEPAGE:
{
@@ -990,7 +993,7 @@ MOVEPAGE:
case FN_PRINT_PAGEPREVIEW:
{
- const SwPagePreViewPrtData* pPPVPD = aViewWin.GetViewShell()->GetDoc()->GetPreViewPrtData();
+ const SwPagePreViewPrtData* pPPVPD = pViewWin->GetViewShell()->GetDoc()->GetPreViewPrtData();
// die Sache mit der Orientation
if(pPPVPD)
{
@@ -999,7 +1002,7 @@ MOVEPAGE:
!= pPPVPD->GetLandscape())
pPrinter->SetOrientation(pPPVPD->GetLandscape() ? ORIENTATION_LANDSCAPE : ORIENTATION_PORTRAIT);
}
- ::SetAppPrintOptions( aViewWin.GetViewShell(), sal_False );
+ ::SetAppPrintOptions( pViewWin->GetViewShell(), sal_False );
bNormalPrint = sal_False;
sal_uInt16 nPrtSlot = SID_PRINTDOC;
rReq.SetSlot( nPrtSlot );
@@ -1009,7 +1012,7 @@ MOVEPAGE:
}
case SID_PRINTDOCDIRECT:
case SID_PRINTDOC:
- ::SetAppPrintOptions( aViewWin.GetViewShell(), sal_False );
+ ::SetAppPrintOptions( pViewWin->GetViewShell(), sal_False );
bNormalPrint = sal_True;
SfxViewShell::ExecuteSlot( rReq, SfxViewShell::GetInterface() );
return;
@@ -1022,7 +1025,7 @@ MOVEPAGE:
break;
case FN_INSERT_BREAK:
{
- sal_uInt16 nSelPage = aViewWin.SelectedPage();
+ sal_uInt16 nSelPage = pViewWin->SelectedPage();
//if a dummy page is selected (e.g. a non-existing right/left page)
//the direct neighbor is used
if(GetViewShell()->IsDummyPage( nSelPage ) && GetViewShell()->IsDummyPage( --nSelPage ))
@@ -1039,7 +1042,7 @@ MOVEPAGE:
}
if( bRefresh )
- aViewWin.Invalidate();
+ pViewWin->Invalidate();
}
/*--------------------------------------------------------------------
@@ -1094,7 +1097,7 @@ void SwPagePreView::GetState( SfxItemSet& rSet )
case FN_STAT_PAGE:
{
String aStr( sPageStr );
- aViewWin.GetStatusStr( aStr, mnPageCount );
+ pViewWin->GetStatusStr( aStr, mnPageCount );
rSet.Put( SfxStringItem( nWhich, aStr) );
}
break;
@@ -1166,7 +1169,7 @@ void SwPagePreView::GetState( SfxItemSet& rSet )
break;
case FN_SHOW_TWO_PAGES:
- if( 2 == aViewWin.GetCol() && nRow == aViewWin.GetRow() )
+ if( 2 == pViewWin->GetCol() && nRow == pViewWin->GetRow() )
rSet.DisableItem( nWhich );
break;
@@ -1292,7 +1295,7 @@ void SwPagePreView::Init(const SwViewOption * pPrefs)
SwPagePreView::SwPagePreView(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh):
SfxViewShell( pViewFrame, SWVIEWFLAGS ),
- aViewWin( &pViewFrame->GetWindow(), *this ),
+ pViewWin( new SwPagePreViewWin(&(GetViewFrame())->GetWindow(), *this ) ),//IAccessibility2 Implementation 2009
nNewPage(USHRT_MAX),
pHScrollbar(0),
pVScrollbar(0),
@@ -1306,7 +1309,7 @@ SwPagePreView::SwPagePreView(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh):
mbFormDesignModeToReset( false )
{
SetName(String::CreateFromAscii("PageView" ));
- SetWindow( &aViewWin );
+ SetWindow( pViewWin );
SetHelpId(SW_PAGEPREVIEW);
_CreateScrollbar( sal_True );
_CreateScrollbar( sal_False );
@@ -1341,9 +1344,9 @@ SwPagePreView::SwPagePreView(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh):
// setze die akt. Seite als die erste
sal_uInt16 nPhysPg, nVirtPg;
((SwCrsrShell*)pVS)->GetPageNum( nPhysPg, nVirtPg, /*sal_False*/sal_True, sal_False );
- if( 1 != aViewWin.GetCol() && 1 == nPhysPg )
+ if( 1 != pViewWin->GetCol() && 1 == nPhysPg )
--nPhysPg;
- aViewWin.SetSttPage( nPhysPg );
+ pViewWin->SetSttPage( nPhysPg );
}
}
@@ -1356,13 +1359,13 @@ SwPagePreView::SwPagePreView(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh):
}
if( pVS )
- pNew = new ViewShell( *pVS, &aViewWin, 0, VSHELLFLAG_ISPREVIEW );
+ pNew = new ViewShell( *pVS, pViewWin, 0, VSHELLFLAG_ISPREVIEW );
else
pNew = new ViewShell(
*((SwDocShell*)pViewFrame->GetObjectShell())->GetDoc(),
- &aViewWin, 0, 0, VSHELLFLAG_ISPREVIEW );
+ pViewWin, 0, 0, VSHELLFLAG_ISPREVIEW );
- aViewWin.SetViewShell( pNew );
+ pViewWin->SetViewShell( pNew );
pNew->SetSfxViewShell( this );
Init();
}
@@ -1376,6 +1379,15 @@ SwPagePreView::SwPagePreView(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh):
SwPagePreView::~SwPagePreView()
{
SetWindow( 0 );
+ //IAccessibility2 Implementation 2009-----
+ ViewShell* pVShell = pViewWin->GetViewShell();
+ pVShell->SetWin(0);
+ //pViewWin->Hide();
+ if( pVShell)
+ delete pVShell;
+ delete pViewWin;
+ //pViewWin->Hide();
+ //-----IAccessibility2 Implementation 2009
delete pScrollFill;
delete pHScrollbar;
@@ -1474,17 +1486,17 @@ IMPL_LINK_INLINE_END( SwPagePreView, BtnPage, Button *, pButton )
int SwPagePreView::ChgPage( int eMvMode, int bUpdateScrollbar )
{
- Rectangle aPixVisArea( aViewWin.LogicToPixel( aVisArea ) );
- int bChg = aViewWin.MovePage( eMvMode ) ||
+ Rectangle aPixVisArea( pViewWin->LogicToPixel( aVisArea ) );
+ int bChg = pViewWin->MovePage( eMvMode ) ||
eMvMode == SwPagePreViewWin::MV_CALC ||
eMvMode == SwPagePreViewWin::MV_NEWWINSIZE;
- aVisArea = aViewWin.PixelToLogic( aPixVisArea );
+ aVisArea = pViewWin->PixelToLogic( aPixVisArea );
if( bChg )
{
// Statusleiste updaten
String aStr( sPageStr );
- aViewWin.GetStatusStr( aStr, mnPageCount );
+ pViewWin->GetStatusStr( aStr, mnPageCount );
SfxBindings& rBindings = GetViewFrame()->GetBindings();
if( bUpdateScrollbar )
@@ -1516,7 +1528,7 @@ int SwPagePreView::ChgPage( int eMvMode, int bUpdateScrollbar )
void SwPagePreView::CalcAndSetBorderPixel( SvBorder &rToFill, sal_Bool /*bInner*/ )
{
// const long nAdd = bInner ? 0 : ScrollBar::GetWindowOverlapPixel();
- const StyleSettings &rSet = aViewWin.GetSettings().GetStyleSettings();
+ const StyleSettings &rSet = pViewWin->GetSettings().GetStyleSettings();
const long nTmp = rSet.GetScrollBarSize();// - nAdd;
if ( pVScrollbar->IsVisible( sal_False ))
rToFill.Right() = nTmp;
@@ -1536,8 +1548,8 @@ void SwPagePreView::InnerResizePixel( const Point &rOfst, const Size &rSize )
CalcAndSetBorderPixel( aBorder, sal_True );
Rectangle aRect( rOfst, rSize );
aRect += aBorder;
- ViewResizePixel( aViewWin, aRect.TopLeft(), aRect.GetSize(),
- aViewWin.GetOutputSizePixel(),
+ ViewResizePixel( *pViewWin, aRect.TopLeft(), aRect.GetSize(),
+ pViewWin->GetOutputSizePixel(),
sal_True,
*pVScrollbar, *pHScrollbar, pPageUpBtn, pPageDownBtn, 0,
*pScrollFill );
@@ -1555,14 +1567,14 @@ void SwPagePreView::OuterResizePixel( const Point &rOfst, const Size &rSize )
{
SvBorder aBorder;
CalcAndSetBorderPixel( aBorder, sal_False );
- ViewResizePixel( aViewWin, rOfst, rSize, aViewWin.GetOutputSizePixel(),
+ ViewResizePixel( *pViewWin, rOfst, rSize, pViewWin->GetOutputSizePixel(),
sal_False, *pVScrollbar,
*pHScrollbar, pPageUpBtn, pPageDownBtn, 0, *pScrollFill );
//EditWin niemals einstellen!
- Size aTmpSize( aViewWin.GetOutputSizePixel() );
- Point aBottomRight( aViewWin.PixelToLogic( Point( aTmpSize.Width(), aTmpSize.Height() ) ) );
+ Size aTmpSize( pViewWin->GetOutputSizePixel() );
+ Point aBottomRight( pViewWin->PixelToLogic( Point( aTmpSize.Width(), aTmpSize.Height() ) ) );
SetVisArea( Rectangle( Point(), aBottomRight ) );
//Aufruf der DocSzChgd-Methode der Scrollbars ist noetig, da vom maximalen
@@ -1617,15 +1629,15 @@ void SwPagePreView::SetVisArea( const Rectangle &rRect, sal_Bool bUpdateScrollba
//denn dann wir nicht wirklich gepaintet sondern die Rechtecke werden
//lediglich (in Dokumentkoordinaten) vorgemerkt.
if( GetViewShell()->ActionPend() )
- aViewWin.Update();
+ pViewWin->Update();
// setze am View-Win die aktuelle Size
aVisArea = aLR;
- aViewWin.SetWinSize( aLR.GetSize() );
+ pViewWin->SetWinSize( aLR.GetSize() );
// OD 18.12.2002 #103492# - use new mode
ChgPage( SwPagePreViewWin::MV_NEWWINSIZE, bUpdateScrollbar );
- aViewWin.Invalidate();
+ pViewWin->Invalidate();
}
/*--------------------------------------------------------------------
@@ -1645,7 +1657,7 @@ IMPL_LINK( SwPagePreView, ScrollHdl, SwScrollbar *, pScrollbar )
// wieviele Seiten scrollen ??
String sStateStr(sPageStr);
sal_uInt16 nThmbPos = (sal_uInt16)pScrollbar->GetThumbPos();
- if( 1 == aViewWin.GetCol() || !nThmbPos )
+ if( 1 == pViewWin->GetCol() || !nThmbPos )
++nThmbPos;
sStateStr += String::CreateFromInt32( nThmbPos );
Point aPos = pScrollbar->GetParent()->OutputToScreenPixel(
@@ -1689,7 +1701,7 @@ IMPL_LINK( SwPagePreView, EndScrollHdl, SwScrollbar *, pScrollbar )
// wieviele Seiten scrollen ??
sal_uInt16 nThmbPos = (sal_uInt16)pScrollbar->GetThumbPos();
// OD 05.12.2002 #103492# - adjust to new preview functionality
- if( nThmbPos != aViewWin.SelectedPage() )
+ if( nThmbPos != pViewWin->SelectedPage() )
{
// OD 17.01.2003 #103492# - consider case that page <nThmbPos>
// is already visible
@@ -1706,8 +1718,8 @@ IMPL_LINK( SwPagePreView, EndScrollHdl, SwScrollbar *, pScrollbar )
// fit or not.
if ( !pPagePrevwLay->DoesPreviewLayoutColsFitIntoWindow() )
{
- aViewWin.SetSttPage( nThmbPos );
- aViewWin.SetSelectedPage( nThmbPos );
+ pViewWin->SetSttPage( nThmbPos );
+ pViewWin->SetSelectedPage( nThmbPos );
ChgPage( SwPagePreViewWin::MV_SCROLL, sal_False );
// OD 20.01.2003 #103492# - update scrollbars
ScrollViewSzChg();
@@ -1715,16 +1727,16 @@ IMPL_LINK( SwPagePreView, EndScrollHdl, SwScrollbar *, pScrollbar )
else
{
// OD 04.03.2003 #107369# - correct scroll amount
- const sal_Int16 nPageDiff = nThmbPos - aViewWin.SelectedPage();
- const sal_uInt16 nVisPages = aViewWin.GetRow() * aViewWin.GetCol();
+ const sal_Int16 nPageDiff = nThmbPos - pViewWin->SelectedPage();
+ const sal_uInt16 nVisPages = pViewWin->GetRow() * pViewWin->GetCol();
sal_Int16 nWinPagesToScroll = nPageDiff / nVisPages;
if ( nPageDiff % nVisPages )
{
// decrease/increase number of preview pages to scroll
nPageDiff < 0 ? --nWinPagesToScroll : ++nWinPagesToScroll;
}
- aViewWin.SetSelectedPage( nThmbPos );
- aViewWin.Scroll( 0, pPagePrevwLay->GetWinPagesScrollAmount( nWinPagesToScroll ) );
+ pViewWin->SetSelectedPage( nThmbPos );
+ pViewWin->Scroll( 0, pPagePrevwLay->GetWinPagesScrollAmount( nWinPagesToScroll ) );
}
}
// OD 17.01.2003 #103492# - update accessibility
@@ -1739,13 +1751,13 @@ IMPL_LINK( SwPagePreView, EndScrollHdl, SwScrollbar *, pScrollbar )
else
{
long nThmbPos = pScrollbar->GetThumbPos();
- aViewWin.Scroll(0, nThmbPos - aViewWin.GetPaintedPreviewDocRect().Top());
+ pViewWin->Scroll(0, nThmbPos - pViewWin->GetPaintedPreviewDocRect().Top());
}
}
else
{
long nThmbPos = pScrollbar->GetThumbPos();
- aViewWin.Scroll(nThmbPos - aViewWin.GetPaintedPreviewDocRect().Left(), 0);
+ pViewWin->Scroll(nThmbPos - pViewWin->GetPaintedPreviewDocRect().Left(), 0);
}
// OD 24.03.2003 #108282# - additional invalidate page status.
static sal_uInt16 __READONLY_DATA aInval[] =
@@ -1758,7 +1770,7 @@ IMPL_LINK( SwPagePreView, EndScrollHdl, SwScrollbar *, pScrollbar )
// OD 04.03.2003 #107369# - control invalidation of window
if ( bInvalidateWin )
{
- aViewWin.Invalidate();
+ pViewWin->Invalidate();
}
return 0;
}
@@ -1769,7 +1781,7 @@ IMPL_LINK( SwPagePreView, EndScrollHdl, SwScrollbar *, pScrollbar )
Point SwPagePreView::AlignToPixel(const Point &rPt) const
{
- return aViewWin.PixelToLogic( aViewWin.LogicToPixel( rPt ) );
+ return pViewWin->PixelToLogic( pViewWin->LogicToPixel( rPt ) );
}
/*--------------------------------------------------------------------
@@ -1794,7 +1806,7 @@ void SwPagePreView::DocSzChgd( const Size &rSz )
ChgPage( SwPagePreViewWin::MV_CALC, sal_True );
ScrollDocSzChg();
- aViewWin.Invalidate();
+ pViewWin->Invalidate();
}
// <--
}
@@ -1814,20 +1826,20 @@ void SwPagePreView::ScrollViewSzChg()
{
//vertical scrolling by row
// OD 04.12.2002 #103492# - adjust to new preview functionality
- sal_uInt16 nVisPages = aViewWin.GetRow() * aViewWin.GetCol();
+ sal_uInt16 nVisPages = pViewWin->GetRow() * pViewWin->GetCol();
pVScrollbar->SetVisibleSize( nVisPages );
// OD 19.02.2003 #107369# - set selected page as scroll bar position,
// if it is visible.
SwPagePreviewLayout* pPagePrevwLay = GetViewShell()->PagePreviewLayout();
- if ( pPagePrevwLay->IsPageVisible( aViewWin.SelectedPage() ) )
+ if ( pPagePrevwLay->IsPageVisible( pViewWin->SelectedPage() ) )
{
- pVScrollbar->SetThumbPos( aViewWin.SelectedPage() );
+ pVScrollbar->SetThumbPos( pViewWin->SelectedPage() );
}
else
{
- pVScrollbar->SetThumbPos( aViewWin.GetSttPage() );
+ pVScrollbar->SetThumbPos( pViewWin->GetSttPage() );
}
- pVScrollbar->SetLineSize( aViewWin.GetCol() );
+ pVScrollbar->SetLineSize( pViewWin->GetCol() );
pVScrollbar->SetPageSize( nVisPages );
// calculate and set scrollbar range
Range aScrollbarRange( 1, mnPageCount );
@@ -1839,7 +1851,7 @@ void SwPagePreView::ScrollViewSzChg()
}
else //vertical scrolling by pixel
{
- const Rectangle& rDocRect = aViewWin.GetPaintedPreviewDocRect();
+ const Rectangle& rDocRect = pViewWin->GetPaintedPreviewDocRect();
const Size& rPreviewSize =
GetViewShell()->PagePreviewLayout()->GetPrevwDocSize();
pVScrollbar->SetRangeMax(rPreviewSize.Height()) ;
@@ -1852,7 +1864,7 @@ void SwPagePreView::ScrollViewSzChg()
}
if(pHScrollbar)
{
- const Rectangle& rDocRect = aViewWin.GetPaintedPreviewDocRect();
+ const Rectangle& rDocRect = pViewWin->GetPaintedPreviewDocRect();
const Size& rPreviewSize =
GetViewShell()->PagePreviewLayout()->GetPrevwDocSize();
long nVisWidth = 0;
@@ -1894,7 +1906,7 @@ void SwPagePreView::ScrollDocSzChg()
SfxPrinter* SwPagePreView::GetPrinter( sal_Bool bCreate )
{
- return aViewWin.GetViewShell()->getIDocumentDeviceAccess()->getPrinter( bCreate );
+ return pViewWin->GetViewShell()->getIDocumentDeviceAccess()->getPrinter( bCreate );
}
/*--------------------------------------------------------------------
@@ -1932,7 +1944,7 @@ sal_uInt16 SwPagePreView::SetPrinter( SfxPrinter *pNew, sal_uInt16 nDiffFlags,
rSh.ChgAllPageSize( aSz );
}
if( !bNormalPrint )
- aViewWin.CalcWish( aViewWin.GetRow(), aViewWin.GetCol() );
+ pViewWin->CalcWish( pViewWin->GetRow(), pViewWin->GetCol() );
rESh.SetModified();
rESh.EndAllAction();
@@ -2065,7 +2077,10 @@ sal_Bool SwPagePreView::HandleWheelCommands( const CommandEvent& rCEvt )
const CommandWheelData* pWData = rCEvt.GetWheelData();
if( pWData && COMMAND_WHEEL_ZOOM == pWData->GetMode() )
{
- if(!Application::GetSettings().GetMiscSettings().GetEnableATToolSupport())
+ //IAccessibility2 Implementation 2009-----, only the Preference shouldn't control the Zoom, it is better to detect AT tools running. So the bridge can be used here
+ //if(!Application::GetSettings().GetMiscSettings().GetEnableATToolSupport())
+ if ( !Application::IsAccessibilityEnabled() )
+ //-----IAccessibility2 Implementation 2009
{
sal_uInt16 nFactor = GetViewShell()->GetViewOptions()->GetZoom();
const sal_uInt16 nOffset = 10;
@@ -2086,7 +2101,7 @@ sal_Bool SwPagePreView::HandleWheelCommands( const CommandEvent& rCEvt )
bOk = sal_True;
}
else
- bOk = aViewWin.HandleScrollCommand( rCEvt, pHScrollbar, pVScrollbar );
+ bOk = pViewWin->HandleScrollCommand( rCEvt, pHScrollbar, pVScrollbar );
return bOk;
}
@@ -2098,8 +2113,37 @@ uno::Reference< ::com::sun::star::accessibility::XAccessible >
// happend already!!!
DBG_ASSERT( GetViewShell() != NULL, "We need a view shell" );
- return GetViewShell()->CreateAccessiblePreview();
+ //IAccessibility2 Implementation 2009-----
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xAcc = GetAccessible( sal_False );
+ if (xAcc.is())
+ {
+ return xAcc;
+ }
+ if (mpViewShell)
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xAccPreview = mpViewShell->CreateAccessiblePreview();
+ SetAccessible(xAccPreview);
+ }
+ return GetAccessible( sal_False );
+ //-----IAccessibility2 Implementation 2009
+}
+//IAccessibility2 Implementation 2009-----
+// MT: Removed Windows::SwitchView() introduced with IA2 CWS.
+// There are other notifications for this when the active view has chnaged, so please update the code to use that event mechanism
+void SwPagePreViewWin::SwitchView()
+{
+#ifdef ACCESSIBLE_LAYOUT
+ if (!Application::IsAccessibilityEnabled())
+ {
+ return ;
+ }
+ if (mpViewShell)
+ {
+ mpViewShell->InvalidateAccessibleFocus();
+ }
+#endif
}
+//-----IAccessibility2 Implementation 2009
/* -----------------------------06.05.2002 13:18------------------------------
@@ -2143,7 +2187,7 @@ void SwPagePreView::SetZoom(SvxZoomType eType, sal_uInt16 nFactor)
lcl_InvalidateZoomSlots(GetViewFrame()->GetBindings());
// OD 02.12.2002 #103492#
// OD 24.09.2003 #i19975# - also consider zoom type
- aViewWin.AdjustPreviewToNewZoom( nFactor, eType );
+ pViewWin->AdjustPreviewToNewZoom( nFactor, eType );
ScrollViewSzChg();
}
}
diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx
index 7d30dbd7a04d..279623663b09 100644
--- a/sw/source/ui/uiview/view.cxx
+++ b/sw/source/ui/uiview/view.cxx
@@ -540,23 +540,6 @@ IMPL_LINK( SwView, AttrChangedNotify, SwWrtShell *, EMPTYARG )
//#i6193#, change ui if cursor is at a SwPostItField
if (mpPostItMgr)
{
- // --> OD 2008-06-19 #i90516#
- // only perform the code that is needed to determine, if at the
- // actual cursor position is a post-it field
-// SwRect aFldRect;
-// SwContentAtPos aCntntAtPos( SwContentAtPos::SW_FIELD);
-// if( pWrtShell->GetContentAtPos( pWrtShell->GetCrsrDocPos(), aCntntAtPos, sal_False, &aFldRect ) )
-// {
-// const SwField* pFld = aCntntAtPos.aFnd.pFld;
-// if (pFld->Which()== RES_POSTITFLD)
-// {
-// mpPostItMgr->SetShadowState(reinterpret_cast<const SwPostItField*>(pFld));
-// }
-// else
-// mpPostItMgr->SetShadowState(0);
-// }
-// else
-// mpPostItMgr->SetShadowState(0);
mpPostItMgr->SetShadowState( pWrtShell->GetPostItFieldAtCursor() );
}
@@ -780,6 +763,9 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
nFormSfxId( USHRT_MAX ),
nLastPasteDestination( 0xFFFF ),
nLeftBorderDistance( 0 ),
+ //IAccessibility2 Implementation 2009-----
+ nOldPageNum(0),
+ //-----IAccessibility2 Implementation 2009
nRightBorderDistance( 0 ),
bInMailMerge(sal_False),
bInDtor(sal_False),
diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx
index 96caa859f11a..fa4163e68e17 100644
--- a/sw/source/ui/uiview/view2.cxx
+++ b/sw/source/ui/uiview/view2.cxx
@@ -766,7 +766,7 @@ void __EXPORT SwView::Execute(SfxRequest &rReq)
case SID_ATTR_BORDER_OUTER:
case SID_ATTR_BORDER_SHADOW:
if(pArgs)
- pWrtShell->SetAttr(*pArgs);
+ pWrtShell->SetAttrSet(*pArgs);
break;
case SID_ATTR_PAGE:
@@ -1179,6 +1179,32 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
SfxWhichIter aIter( rSet );
sal_uInt16 nWhich = aIter.FirstWhich();
ASSERT( nWhich, "leeres Set");
+ //IAccessibility2 Implementation 2009-----
+ if (Application::IsAccessibilityEnabled())
+ {
+ //get section chang event
+ const SwSection* CurrSect = rShell.GetCurrSection();
+ if( CurrSect )
+ {
+ String sCurrentSectionName = CurrSect->GetSectionName();
+ if(sCurrentSectionName != nOldSectionName)
+ {
+ rShell.FireSectionChangeEvent(2, 1);
+ }
+ nOldSectionName = sCurrentSectionName;
+ }
+ else if ( !(nOldSectionName.Equals(String())) )
+ {
+ rShell.FireSectionChangeEvent(2, 1);
+ nOldSectionName = String();
+ }
+ //get column change event
+ if(rShell.bColumnChange())
+ {
+ rShell.FireColumnChangeEvent(2, 1);
+ }
+ }
+ //-----IAccessibility2 Implementation 2009
while( nWhich )
{
@@ -1192,7 +1218,15 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
rShell.GetPageNumber( -1, rShell.IsCrsrVisible(), nPage, nLogPage, sDisplay );
rSet.Put( SfxStringItem( FN_STAT_PAGE,
GetPageStr( nPage, nLogPage, sDisplay) ));
-
+ //IAccessibility2 Implementation 2009-----
+ //if existing page number is not equal to old page number, send out this event.
+ if (nOldPageNum != nLogPage )
+ {
+ if (nOldPageNum != 0)
+ rShell.FirePageChangeEvent(nOldPageNum, nLogPage);
+ nOldPageNum = nLogPage;
+ }
+ //-----IAccessibility2 Implementation 2009
sal_uInt16 nCnt = GetWrtShell().GetPageCnt();
if (nPageCnt != nCnt) // Basic benachrichtigen
{
diff --git a/sw/source/ui/uiview/viewmdi.cxx b/sw/source/ui/uiview/viewmdi.cxx
index 375409273674..f5d2d7b53f30 100644
--- a/sw/source/ui/uiview/viewmdi.cxx
+++ b/sw/source/ui/uiview/viewmdi.cxx
@@ -379,7 +379,7 @@ IMPL_STATIC_LINK( SwView, MoveNavigationHdl, bool *, pbNext )
{
if ( !pbNext )
return 0;
- bool bNext = *pbNext;
+ const bool bNext = *pbNext;
SwWrtShell& rSh = pThis->GetWrtShell();
switch( nMoveType )
{
@@ -482,19 +482,21 @@ IMPL_STATIC_LINK( SwView, MoveNavigationHdl, bool *, pbNext )
}
}
break;
+
case NID_POSTIT:
- {
- sw::sidebarwindows::SwSidebarWin* pPostIt = pThis->GetPostItMgr()->GetActiveSidebarWin();
- if (pPostIt)
- pThis->GetPostItMgr()->SetActiveSidebarWin(0);
- SwFieldType* pFldType = rSh.GetFldType(0, RES_POSTITFLD);
- if (rSh.MoveFldType(pFldType, bNext))
- pThis->GetViewFrame()->GetDispatcher()->Execute(FN_POSTIT);
- else
- //first/last item
- pThis->GetPostItMgr()->SetActiveSidebarWin(pPostIt);
- }
- break;
+ {
+ sw::sidebarwindows::SwSidebarWin* pPostIt = pThis->GetPostItMgr()->GetActiveSidebarWin();
+ if (pPostIt)
+ pThis->GetPostItMgr()->SetActiveSidebarWin(0);
+ SwFieldType* pFldType = rSh.GetFldType(0, RES_POSTITFLD);
+ if ( rSh.MoveFldType( pFldType, bNext ) )
+ pThis->GetViewFrame()->GetDispatcher()->Execute(FN_POSTIT);
+ else
+ //first/last item
+ pThis->GetPostItMgr()->SetActiveSidebarWin(pPostIt);
+ }
+ break;
+
case NID_SRCH_REP:
if(pSrchItem)
{
diff --git a/sw/source/ui/uiview/viewsrch.cxx b/sw/source/ui/uiview/viewsrch.cxx
index c575f5464be3..8cf536b20c02 100644
--- a/sw/source/ui/uiview/viewsrch.cxx
+++ b/sw/source/ui/uiview/viewsrch.cxx
@@ -213,6 +213,19 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
if( bRet )
Scroll(pWrtShell->GetCharRect().SVRect());
rReq.SetReturnValue(SfxBoolItem(nSlot, bRet));
+ //IAccessibility2 Implementation 2009-----
+ if ( Application::IsAccessibilityEnabled() )
+ {
+ const sal_uInt16 nId = SvxSearchDialogWrapper::GetChildWindowId();
+ SvxSearchDialogWrapper *pWrp = (SvxSearchDialogWrapper*)GetViewFrame()->GetChildWindow(nId);
+ if ( pWrp )
+ {
+ pSrchDlg = (SvxSearchDialog*)(pWrp->GetWindow());
+ pSrchDlg->SetDocWin( (Window*)pEditWin );
+ pSrchDlg->SetSrchFlag();
+ }
+ }
+ //-----IAccessibility2 Implementation 2009
}
break;
case SVX_SEARCHCMD_FIND_ALL:
@@ -228,6 +241,20 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
bFound = sal_False;
}
rReq.SetReturnValue(SfxBoolItem(nSlot, bRet));
+ //IAccessibility2 Implementation 2009-----
+ if ( Application::IsAccessibilityEnabled() )
+ {
+ const sal_uInt16 nId = SvxSearchDialogWrapper::GetChildWindowId();
+ SvxSearchDialogWrapper *pWrp = (SvxSearchDialogWrapper*)GetViewFrame()->GetChildWindow(nId);
+
+ if ( pWrp )
+ {
+ pSrchDlg = (SvxSearchDialog*)(pWrp->GetWindow());
+ pSrchDlg->SetDocWin( (Window*)pEditWin );
+ pSrchDlg->SetSrchFlag();
+ }
+ }
+ //-----IAccessibility2 Implementation 2009
}
break;
case SVX_SEARCHCMD_REPLACE:
@@ -279,6 +306,19 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
pSrchItem->SetCommand( nOldCmd );
rReq.SetReturnValue(SfxBoolItem(nSlot, bRet));
}
+ //IAccessibility2 Implementation 2009-----
+ {
+ const sal_uInt16 nId = SvxSearchDialogWrapper::GetChildWindowId();
+ SvxSearchDialogWrapper *pWrp = (SvxSearchDialogWrapper*)GetViewFrame()->GetChildWindow(nId);
+
+ if ( pWrp )
+ {
+ pSrchDlg = (SvxSearchDialog*)(pWrp->GetWindow());
+ pSrchDlg->SetDocWin( (Window*)pEditWin );
+ pSrchDlg->SetSrchFlag();
+ }
+ }
+ //-----IAccessibility2 Implementation 2009
break;
case SVX_SEARCHCMD_REPLACE_ALL:
@@ -328,6 +368,17 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
InfoBox( pParentWindow, aText ).Execute();
}
}
+ //IAccessibility2 Implementation 2009-----
+ const sal_uInt16 nId = SvxSearchDialogWrapper::GetChildWindowId();
+ SvxSearchDialogWrapper *pWrp = (SvxSearchDialogWrapper*)GetViewFrame()->GetChildWindow(nId);
+
+ if ( pWrp )
+ {
+ pSrchDlg = (SvxSearchDialog*)(pWrp->GetWindow());
+ pSrchDlg->SetDocWin( (Window*)pEditWin );
+ pSrchDlg->SetSrchFlag();
+ }
+ //-----IAccessibility2 Implementation 2009
break;
}
@@ -597,7 +648,7 @@ void SwView::Replace()
if( pReplList->Get( aReplSet ).Count() )
{
::SfxToSwPageDescAttr( *pWrtShell, aReplSet );
- pWrtShell->SwEditShell::SetAttr( aReplSet );
+ pWrtShell->SwEditShell::SetAttrSet( aReplSet );
}
}
}
diff --git a/sw/source/ui/uiview/viewstat.cxx b/sw/source/ui/uiview/viewstat.cxx
index 0ece69ed26d5..aee1ca50f096 100644
--- a/sw/source/ui/uiview/viewstat.cxx
+++ b/sw/source/ui/uiview/viewstat.cxx
@@ -81,31 +81,39 @@ void SwView::GetState(SfxItemSet &rSet)
{
switch(nWhich)
{
- case FN_EDIT_LINK_DLG:
- if( !pWrtShell->GetLinkManager().GetLinks().Count() )
- rSet.DisableItem(nWhich);
- else if( pWrtShell->IsSelFrmMode() &&
- pWrtShell->IsSelObjProtected(FLYPROTECT_CONTENT))
- rSet.DisableItem(nWhich);
- break;
+ case FN_EDIT_LINK_DLG:
+ if( !pWrtShell->GetLinkManager().GetLinks().Count() )
+ rSet.DisableItem(nWhich);
+ else if( pWrtShell->IsSelFrmMode() &&
+ pWrtShell->IsSelObjProtected(FLYPROTECT_CONTENT))
+ rSet.DisableItem(nWhich);
+ break;
- case FN_INSERT_CAPTION:
+ case SID_INSERT_GRAPHIC:
+ if( pWrtShell->CrsrInsideInputFld() )
{
- // Captions gibt's fuer Grafiken, OLE-Objekte, Rahmen und Tabellen
- if( !bGetFrmType )
- eFrmType = pWrtShell->GetFrmType(0,sal_True), bGetFrmType = sal_True;
- if (! ( ((eFrmType & FRMTYPE_FLY_ANY) && nSelectionType != nsSelectionType::SEL_DRW_TXT)||
+ rSet.DisableItem(nWhich);
+ }
+ break;
+
+ case FN_INSERT_CAPTION:
+ {
+ // Captions gibt's fuer Grafiken, OLE-Objekte, Rahmen und Tabellen
+ if( !bGetFrmType )
+ eFrmType = pWrtShell->GetFrmType(0,sal_True), bGetFrmType = sal_True;
+ if (! ( ((eFrmType & FRMTYPE_FLY_ANY) && nSelectionType != nsSelectionType::SEL_DRW_TXT)||
nSelectionType & nsSelectionType::SEL_TBL ||
nSelectionType & nsSelectionType::SEL_DRW) )
- rSet.DisableItem(nWhich);
- else if((pWrtShell->IsObjSelected()||pWrtShell->IsFrmSelected()) &&
+ rSet.DisableItem(nWhich);
+ else if((pWrtShell->IsObjSelected()||pWrtShell->IsFrmSelected()) &&
(pWrtShell->IsSelObjProtected( FLYPROTECT_PARENT)||
- pWrtShell->IsSelObjProtected( FLYPROTECT_CONTENT )))
- rSet.DisableItem(nWhich);
- else if( pWrtShell->IsTableMode() )
- rSet.DisableItem(nWhich);
- }
- break;
+ pWrtShell->IsSelObjProtected( FLYPROTECT_CONTENT )))
+ rSet.DisableItem(nWhich);
+ else if( pWrtShell->IsTableMode()
+ || pWrtShell->CrsrInsideInputFld() )
+ rSet.DisableItem(nWhich);
+ }
+ break;
case FN_EDIT_FOOTNOTE:
{
@@ -184,24 +192,29 @@ void SwView::GetState(SfxItemSet &rSet)
rSet.Put(aImgItem);
}
break;
+
case FN_INSERT_OBJ_CTRL:
- if(bWeb)
- rSet.DisableItem(nWhich);
- else
- {
- SfxImageItem aImgItem(nWhich, SwView::nInsertObjectCtrlState);
- SfxSlotPool& rPool = SfxSlotPool::GetSlotPool( GetViewFrame() );
- const SfxSlot* pSlot = rPool.GetSlot( aImgItem.GetValue() );
- if(pSlot && pSlot->IsMode( SFX_SLOT_IMAGEROTATION ))
+ if( bWeb
+ || pWrtShell->CrsrInsideInputFld() )
{
- if(pWrtShell->IsInVerticalText())
- aImgItem.SetRotation(2700);
- if(pWrtShell->IsInRightToLeftText())
- aImgItem.SetMirrored(sal_True);
+ rSet.DisableItem(nWhich);
}
- rSet.Put(aImgItem);
- }
- break;
+ else
+ {
+ SfxImageItem aImgItem(nWhich, SwView::nInsertObjectCtrlState);
+ SfxSlotPool& rPool = SfxSlotPool::GetSlotPool( GetViewFrame() );
+ const SfxSlot* pSlot = rPool.GetSlot( aImgItem.GetValue() );
+ if(pSlot && pSlot->IsMode( SFX_SLOT_IMAGEROTATION ))
+ {
+ if(pWrtShell->IsInVerticalText())
+ aImgItem.SetRotation(2700);
+ if(pWrtShell->IsInRightToLeftText())
+ aImgItem.SetMirrored(sal_True);
+ }
+ rSet.Put(aImgItem);
+ }
+ break;
+
case FN_UPDATE_TOX:
if(!pWrtShell->GetTOXCount())
rSet.DisableItem(nWhich);
diff --git a/sw/source/ui/uiview/viewtab.cxx b/sw/source/ui/uiview/viewtab.cxx
index ec0be864e81d..db0f5d59b634 100644
--- a/sw/source/ui/uiview/viewtab.cxx
+++ b/sw/source/ui/uiview/viewtab.cxx
@@ -692,7 +692,7 @@ void SwView::ExecTabWin( SfxRequest& rReq )
rSh.AutoUpdatePara( pColl, aTmp );
}
else
- rSh.SetAttr( aTabStops );
+ rSh.SetAttrItem( aTabStops );
break;
}
@@ -750,7 +750,7 @@ void SwView::ExecTabWin( SfxRequest& rReq )
rSh.AutoUpdatePara( pColl, aSet);
}
else
- rSh.SetAttr( aParaMargin );
+ rSh.SetAttrItem( aParaMargin );
if ( aParaMargin.GetTxtFirstLineOfst() < 0 )
{
@@ -789,7 +789,7 @@ void SwView::ExecTabWin( SfxRequest& rReq )
rSh.AutoUpdatePara( pColl, aSetTmp );
}
else
- rSh.SetAttr( aTabStops );
+ rSh.SetAttrItem( aTabStops );
}
}
}
@@ -814,7 +814,7 @@ void SwView::ExecTabWin( SfxRequest& rReq )
rSh.AutoUpdatePara( pColl, aSet);
}
else
- rSh.SetAttr( aParaMargin );
+ rSh.SetAttrItem( aParaMargin );
}
break;
@@ -1076,7 +1076,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
RES_LR_SPACE, RES_UL_SPACE, 0 );
// get also the list level indent values merged as LR-SPACE item, if needed.
rSh.GetCurAttr( aCoreSet, true );
- SelectionType nSelType = rSh.GetSelectionType();
+ const SelectionType nSelType = rSh.GetSelectionType();
SfxWhichIter aIter( rSet );
sal_uInt16 nWhich = aIter.FirstWhich();
diff --git a/sw/source/ui/utlui/content.cxx b/sw/source/ui/utlui/content.cxx
index 06bb93d8ab29..619639ec5098 100644
--- a/sw/source/ui/utlui/content.cxx
+++ b/sw/source/ui/utlui/content.cxx
@@ -85,7 +85,15 @@
#include <numrule.hxx>
#include <swundo.hxx>
#include <ndtxt.hxx>
+//IAccessibility2 Implementation 2009-----
+//#include <ndgrf.hxx>
+#include <fmtcntnt.hxx>
#include <PostItMgr.hxx>
+//#include <../../core/inc/flyfrm.hxx>
+//#include <../../core/inc/cntfrm.hxx>
+//#include <ndnotxt.hxx>
+//-----IAccessibility2 Implementation 2009
+//#include <postit.hxx>
#include <postithelper.hxx>
#include <redline.hxx>
#include <docary.hxx>
@@ -891,7 +899,8 @@ SwContentTree::SwContentTree(Window* pParent, const ResId& rResId) :
bIsLastReadOnly(sal_False),
bIsOutlineMoveable(sal_True),
bViewHasChanged(sal_False),
- bIsImageListInitialized(sal_False)
+ bIsImageListInitialized(sal_False),
+ bIsKeySpace(sal_False) //IAccessibility2 Implementation 2009
{
sal_uInt16 i;
@@ -928,6 +937,149 @@ SwContentTree::~SwContentTree()
bIsInDrag = sal_False;
}
+//IAccessibility2 Implementation 2009-----
+String SwContentTree::GetEntryAltText( SvLBoxEntry* pEntry ) const
+{
+ if( pEntry == NULL)
+ return String();
+
+ SwContent* pCnt = (SwContent*)pEntry->GetUserData();
+ if( pCnt == NULL || pCnt->GetParent() == NULL)
+ return String();
+
+ sal_uInt16 nJumpType = pCnt->GetParent()->GetType();
+ SdrObject* pTemp;
+
+ switch(nJumpType)
+ {
+ case CONTENT_TYPE_DRAWOBJECT:
+ {
+ SdrView* pDrawView = pActiveShell->GetDrawView();
+ if (pDrawView)
+ {
+ SdrModel* pDrawModel = pActiveShell->GetDoc()->GetDrawModel();
+ SdrPage* pPage = pDrawModel->GetPage(0);
+ const sal_uInt32 nCount = pPage->GetObjCount();
+ for( sal_uInt32 i=0; i< nCount; i++ )
+ {
+ pTemp = pPage->GetObj(i);
+ sal_uInt16 nCmpId(OBJ_NONE);
+ switch( pTemp->GetObjIdentifier() )
+ {
+ case OBJ_GRUP:
+ case OBJ_TEXT:
+ case OBJ_RECT:
+ case OBJ_CUSTOMSHAPE:
+ case OBJ_CIRC:
+ case OBJ_POLY:
+ case OBJ_CAPTION:
+ nCmpId = OBJ_GRUP;
+ break;
+ default:
+ nCmpId = pTemp->GetObjIdentifier();
+ }
+ if(nCmpId == OBJ_GRUP && pTemp->GetName() == pCnt->GetName())
+ {
+ return pTemp->GetTitle();
+ }
+ //Commented End
+ }
+ }
+ }
+ break;
+ case CONTENT_TYPE_GRAPHIC :
+ {
+ if( pActiveShell && pActiveShell->GetDoc() )
+ {
+ const SwFlyFrmFmt* pFrmFmt = pActiveShell->GetDoc()->FindFlyByName( pCnt->GetName(), 0);
+ if( pFrmFmt )
+ {
+// SwNodeIndex aIdx( *(pFrmFmt->GetCntnt().GetCntntIdx()), 1 );
+// const SwGrfNode* pGrfNd = aIdx.GetNode().GetGrfNode();
+// if( pGrfNd )
+// return pGrfNd->GetAlternateText();
+ return pFrmFmt->GetObjTitle();
+ }
+ }
+ }
+ break;
+ case CONTENT_TYPE_OLE :
+ case CONTENT_TYPE_FRAME :
+ {
+ //Can't find the GetAlternateText function. Need to verify again.
+ const SwFlyFrmFmt* pFlyFmt = pActiveShell->GetDoc()->FindFlyByName( pCnt->GetName(), 0);
+ if( pFlyFmt )
+ return pFlyFmt->/*GetAlternateText*/GetName();
+ }
+ break;
+ }
+ return String();
+}
+
+String SwContentTree::GetEntryLongDescription( SvLBoxEntry* pEntry ) const
+{
+ if( pEntry == NULL)
+ return String();
+
+ SwContent* pCnt = (SwContent*)pEntry->GetUserData();
+ if( pCnt == NULL || pCnt->GetParent() == NULL)
+ return String();
+
+ sal_uInt16 nJumpType = pCnt->GetParent()->GetType();
+ SdrObject* pTemp;
+
+ switch(nJumpType)
+ {
+ case CONTENT_TYPE_DRAWOBJECT:
+ {
+ SdrView* pDrawView = pActiveShell->GetDrawView();
+ if (pDrawView)
+ {
+ SdrModel* pDrawModel = pActiveShell->GetDoc()->GetDrawModel();
+ SdrPage* pPage = pDrawModel->GetPage(0);
+ sal_uInt32 nCount = pPage->GetObjCount();
+ for( sal_uInt32 i=0; i< nCount; i++ )
+ {
+ pTemp = pPage->GetObj(i);
+ sal_uInt16 nCmpId(OBJ_NONE);
+ switch( pTemp->GetObjIdentifier() )
+ {
+ case OBJ_GRUP:
+ case OBJ_TEXT:
+ case OBJ_RECT:
+ case OBJ_CUSTOMSHAPE:
+ case OBJ_CIRC:
+ case OBJ_POLY:
+ case OBJ_CAPTION:
+ nCmpId = OBJ_GRUP;
+ break;
+ default:
+ nCmpId = pTemp->GetObjIdentifier();
+ }
+ if(nCmpId == OBJ_GRUP && pTemp->GetName() == pCnt->GetName())
+ {
+ return pTemp->GetDescription();
+ }
+ //Commented End
+ }
+ }
+ }
+ break;
+ case CONTENT_TYPE_GRAPHIC :
+ case CONTENT_TYPE_OLE :
+ case CONTENT_TYPE_FRAME :
+ {
+ //Can't find the function "GetLongDescription". Need to verify again.
+ const SwFlyFrmFmt* pFlyFmt = pActiveShell->GetDoc()->FindFlyByName( pCnt->GetName(), 0);
+ if( pFlyFmt )
+ return pFlyFmt->GetDescription();
+ }
+ break;
+ }
+ return String();
+}
+
+//-----IAccessibility2 Implementation 2009
/***************************************************************************
Drag&Drop methods
***************************************************************************/
@@ -1211,10 +1363,27 @@ void SwContentTree::RequestingChilds( SvLBoxEntry* pParent )
String sEntry = pCnt->GetName();
if(!sEntry.Len())
sEntry = sSpace;
- InsertEntry(sEntry, pParent,
+ SvLBoxEntry* pChild = InsertEntry(sEntry, pParent,
sal_False, LIST_APPEND, (void*)pCnt);
+ //IAccessibility2 Implementation 2009-----
+ //Solution: If object is marked , the corresponding entry is set true ,
+ //else the corresponding entry is set false .
+ //==================================================
+ SdrObject * pObj = GetDrawingObjectsByContent(pCnt);
+ if(pChild)
+ pChild->SetMarked(sal_False);
+ if(pObj)
+ {
+ SdrView* pDrawView = pActiveShell->GetDrawView();
+ const bool Marked(pDrawView->isSdrObjectSelected(*pObj));
+ if(Marked)
+ {
+ //sEntry += String::CreateFromAscii(" *");
+ pChild->SetMarked(true);
+ }
+ }
+ //-----IAccessibility2 Implementation 2009
}
-
}
}
}
@@ -1223,6 +1392,41 @@ void SwContentTree::RequestingChilds( SvLBoxEntry* pParent )
Beschreibung: Expand - Zustand fuer Inhaltstypen merken
***************************************************************************/
+//IAccessibility2 Implementation 2009-----
+//Solution: Get drawing Objects by content .
+SdrObject* SwContentTree::GetDrawingObjectsByContent(const SwContent *pCnt)
+{
+ SdrObject *pRetObj = NULL;
+ sal_uInt16 nJumpType = pCnt->GetParent()->GetType();
+ switch(nJumpType)
+ {
+ case CONTENT_TYPE_DRAWOBJECT:
+ {
+ SdrView* pDrawView = pActiveShell->GetDrawView();
+ if (pDrawView)
+ {
+ SdrModel* pDrawModel = pActiveShell->GetDoc()->GetDrawModel();
+ SdrPage* pPage = pDrawModel->GetPage(0);
+ sal_uInt32 nCount = pPage->GetObjCount();
+
+ for( sal_uInt32 i=0; i< nCount; i++ )
+ {
+ SdrObject* pTemp = pPage->GetObj(i);
+ if( pTemp->GetName() == pCnt->GetName())
+ {
+ pRetObj = pTemp;
+ break;
+ }
+ }
+ }
+ break;
+ }
+ default:
+ pRetObj = NULL;
+ }
+ return pRetObj;
+}
+//-----IAccessibility2 Implementation 2009
sal_Bool SwContentTree::Expand( SvLBoxEntry* pParent )
{
@@ -2222,6 +2426,15 @@ IMPL_LINK( SwContentTree, TimerUpdate, Timer*, EMPTYARG)
{
FindActiveTypeAndRemoveUserData();
Display(sal_True);
+ //IAccessibility2 Implementation 2009-----
+ //Solution: Set focus
+ if( bIsKeySpace )
+ {
+ HideFocus();
+ ShowFocus( oldRectangle);
+ bIsKeySpace = sal_False;
+ }
+ //-----IAccessibility2 Implementation 2009
}
}
else if(!pView && bIsActive && !bIsIdleClear)
@@ -2444,6 +2657,113 @@ void SwContentTree::KeyInput(const KeyEvent& rEvent)
GrabFocus();
}
}
+ //IAccessibility2 Implementation 2009-----
+ //Solution: Make KEY_SPACE has same function as DoubleClick ,
+ //and realize multi-selection .
+ else if(aCode.GetCode() == KEY_SPACE && 0 == aCode.GetModifier())
+ {
+
+ SvLBoxEntry* pEntry = GetCurEntry();
+ if( GetChildCount( pEntry ) == 0 )
+ bIsKeySpace = sal_True;
+ Point tempPoint = GetEntryPosition( pEntry );//Change from "GetEntryPos" to "GetEntryPosition" for acc migration
+ oldRectangle = GetFocusRect( pEntry,tempPoint.Y() );
+
+ if(pEntry)
+ {
+ if(bIsActive || bIsConstant)
+ {
+ if(bIsConstant)
+ {
+ pActiveShell->GetView().GetViewFrame()->GetWindow().ToTop();
+ }
+
+ SwContent* pCnt = (SwContent*)pEntry->GetUserData();
+
+ sal_Bool bSel = sal_False;
+ sal_uInt16 nJumpType = pCnt->GetParent()->GetType();
+ switch(nJumpType)
+ {
+ case CONTENT_TYPE_DRAWOBJECT:
+ {
+ SdrView* pDrawView = pActiveShell->GetDrawView();
+ if (pDrawView)
+ {
+ pDrawView->SdrEndTextEdit();//Change from "EndTextEdit" to "SdrEndTextEdit" for acc migration
+
+ SdrModel* pDrawModel = pActiveShell->GetDoc()->GetDrawModel();
+ SdrPage* pPage = pDrawModel->GetPage(0);
+ sal_uInt32 nCount = pPage->GetObjCount();
+ sal_Bool hasObjectMarked = sal_False;
+
+ SdrObject* pObject = NULL;
+ pObject = GetDrawingObjectsByContent( pCnt );
+ if( pObject )
+ {
+ const bool bUnMark(pDrawView->isSdrObjectSelected(*pObject));
+ pDrawView->MarkObj(*pObject, bUnMark);
+ }
+ for( sal_uInt32 i=0; i< nCount; i++ )
+ {
+ SdrObject* pTemp = pPage->GetObj(i);
+
+ if(!pTemp)
+ {
+ OSL_ENSURE(false, "Null pointer SdrObject in SdrPage's GetObj with valid index (!)");
+ continue;
+ }
+
+ sal_uInt16 nCmpId(OBJ_NONE);
+ const bool bMark(pDrawView->isSdrObjectSelected(*pTemp));
+ switch( pTemp->GetObjIdentifier() )
+ {
+ case OBJ_GRUP:
+ case OBJ_TEXT:
+ case OBJ_RECT:
+ case OBJ_CIRC:
+ case OBJ_POLY:
+ case OBJ_CAPTION:
+ case OBJ_CUSTOMSHAPE:
+ nCmpId = OBJ_GRUP;
+ if( bMark )
+ hasObjectMarked = sal_True;
+ break;
+ default:
+ nCmpId = pTemp->GetObjIdentifier();
+ //IAccessibility2 Implementation 2009-----
+ if ( bMark )
+ {
+ pDrawView->MarkObj(*pTemp, true);
+ }
+ //-----IAccessibility2 Implementation 2009
+ }
+ //mod end
+ }
+ if ( pActiveShell && !hasObjectMarked )
+ {
+ SwEditWin& pEditWindow =
+ pActiveShell->GetView().GetEditWin();
+ if( &pEditWindow )
+ {
+ KeyCode tempKeycode( KEY_ESCAPE );
+ KeyEvent rKEvt( 0 , tempKeycode );
+ ((Window*)&pEditWindow)->KeyInput( rKEvt );
+
+ }
+ //rView.GetEditWin().GrabFocus();
+ }
+ }
+ }
+ break;
+ }
+
+
+ bViewHasChanged = sal_True;
+ }
+ }
+
+ }
+ //-----IAccessibility2 Implementation 2009
else
SvTreeListBox::KeyInput(rEvent);
@@ -3202,6 +3522,26 @@ void SwContentLBoxString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFl
rDev.DrawText( rPos, GetText() );
rDev.SetFont( aOldFont );
}
+ //IAccessibility2 Implementation 2009-----
+ // IA2 CWS. MT: Removed for now (also in SvLBoxEntry) - only used in Sw/Sd/ScContentLBoxString, they should decide if they need this
+ /*
+ else if (pEntry->IsMarked())
+ {
+ rDev.DrawText( rPos, GetText() );
+ XubString str;
+ str = XubString::CreateFromAscii("*");
+ Point rPosStar(rPos.X()-6,rPos.Y());
+ Font aOldFont( rDev.GetFont());
+ Font aFont(aOldFont);
+ Color aCol( aOldFont.GetColor() );
+ aCol.DecreaseLuminance( 200 );
+ aFont.SetColor( aCol );
+ rDev.SetFont( aFont );
+ rDev.DrawText( rPosStar, str);
+ rDev.SetFont( aOldFont );
+ }
+ //-----IAccessibility2 Implementation 2009
+ */
else
SvLBoxString::Paint( rPos, rDev, nFlags, pEntry);
}
@@ -3222,3 +3562,18 @@ void SwContentTree::DataChanged( const DataChangedEvent& rDCEvt )
}
+//IAccessibility2 Implementation 2009-----
+sal_Int32 SwContentTree::GetEntryRealChildsNum( SvLBoxEntry* pParent ) const
+{
+ // ist es ein Inhaltstyp?
+ if(lcl_IsContentType(pParent))
+ {
+ if(!pParent->HasChilds())
+ {
+ SwContentType* pCntType = (SwContentType*)pParent->GetUserData();
+ return pCntType->GetMemberCount();
+ }
+ }
+ return 0;
+}
+//-----IAccessibility2 Implementation 2009
diff --git a/sw/source/ui/utlui/navipi.hrc b/sw/source/ui/utlui/navipi.hrc
index bae76b4afb6e..2209a5503ce1 100644
--- a/sw/source/ui/utlui/navipi.hrc
+++ b/sw/source/ui/utlui/navipi.hrc
@@ -84,3 +84,8 @@
#define ST_POSTIT_SHOW (ST_GLOBAL_CONTEXT_FIRST +35)
#define ST_POSTIT_HIDE (ST_GLOBAL_CONTEXT_FIRST +36)
#define ST_POSTIT_DELETE (ST_GLOBAL_CONTEXT_FIRST +37)
+
+//IAccessibility2 Implementation 2009-----
+#define ST_TL_GLOBAL ST_GLOBAL_CONTEXT_FIRST +38
+#define ST_TL_CONTENT ST_GLOBAL_CONTEXT_FIRST +39
+//-----IAccessibility2 Implementation 2009
diff --git a/sw/source/ui/wrtsh/delete.cxx b/sw/source/ui/wrtsh/delete.cxx
index b5608fb5edda..10e63e4eab49 100644
--- a/sw/source/ui/wrtsh/delete.cxx
+++ b/sw/source/ui/wrtsh/delete.cxx
@@ -89,7 +89,7 @@ sal_Bool SwWrtShell::TryRemoveIndent()
if (bResult)
{
aAttrSet.Put(aItem);
- SetAttr(aAttrSet);
+ SetAttrSet(aAttrSet);
}
return bResult;
diff --git a/sw/source/ui/wrtsh/select.cxx b/sw/source/ui/wrtsh/select.cxx
index 7b4216c091d0..fcb46a0e6d61 100644
--- a/sw/source/ui/wrtsh/select.cxx
+++ b/sw/source/ui/wrtsh/select.cxx
@@ -46,6 +46,11 @@
#include <swdtflvr.hxx>
#include <crsskip.hxx>
+//IAccessibility2 Implementation 2009-----
+#ifndef _DOC_HXX
+#include <doc.hxx>
+#endif
+//-----IAccessibility2 Implementation 2009
#if OSL_DEBUG_LEVEL > 1
#include <pam.hxx>
#endif
@@ -166,6 +171,14 @@ long SwWrtShell::SelAll()
}
SttSelect();
GoEnd(sal_True, &bMoveTable);
+
+ //IAccessibility2 Implementation 2009-----
+ SwDoc *pDoc = GetDoc();
+ if ( pDoc )
+ {
+ pDoc->SetPrepareSelAll();
+ }
+ //-----IAccessibility2 Implementation 2009
if( pStartPos )
{
pTmpCrsr = getShellCrsr( false );
diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx
index ed311635e7bf..be0ab6994f03 100644
--- a/sw/source/ui/wrtsh/wrtsh1.cxx
+++ b/sw/source/ui/wrtsh/wrtsh1.cxx
@@ -418,27 +418,7 @@ void SwWrtShell::InsertObject( const svt::EmbeddedObjectRef& xRef, SvGlobalName
// TODO/LATER: recording! Convert properties to items
case SID_INSERT_PLUGIN:
- /*
- if(pReq)
- {
- INetURLObject* pURL = aDlg.GetURL();
- if(pURL)
- pReq->AppendItem(SfxStringItem(FN_PARAM_2, pURL->GetMainURL(INetURLObject::NO_DECODE)));
- pReq->AppendItem(SfxStringItem(FN_PARAM_3 , aDlg.GetCommands()));
- } */
case SID_INSERT_FLOATINGFRAME:
- /*
- if(pReq && xFloatingFrame.Is())
- {
- const SfxFrameDescriptor* pDescriptor = xFloatingFrame->GetFrameDescriptor();
- pReq->AppendItem(SfxStringItem(FN_PARAM_1, pDescriptor->GetName()));
- pReq->AppendItem(
- SfxStringItem( FN_PARAM_2,
- pDescriptor->GetURL().GetMainURL(INetURLObject::NO_DECODE)));
- pReq->AppendItem(SvxSizeItem(FN_PARAM_3, pDescriptor->GetMargin()));
- pReq->AppendItem(SfxByteItem(FN_PARAM_4, pDescriptor->GetScrollingMode()));
- pReq->AppendItem(SfxBoolItem(FN_PARAM_5, pDescriptor->HasFrameBorder()));
- }*/
{
SfxSlotPool* pSlotPool = SW_MOD()->GetSlotPool();
const SfxSlot* pSlot = pSlotPool->GetSlot(nSlotId);
@@ -959,10 +939,10 @@ void SwWrtShell::InsertPageBreak(const String *pPageDesc, sal_uInt16 nPgNum )
{
SwFmtPageDesc aDesc( pDesc );
aDesc.SetNumOffset( nPgNum );
- SetAttr( aDesc );
+ SetAttrItem( aDesc );
}
else
- SetAttr( SvxFmtBreakItem(SVX_BREAK_PAGE_BEFORE, RES_BREAK) );
+ SetAttrItem( SvxFmtBreakItem(SVX_BREAK_PAGE_BEFORE, RES_BREAK) );
EndUndo(UNDO_UI_INSERT_PAGE_BREAK);
}
}
@@ -1008,7 +988,7 @@ void SwWrtShell::InsertColumnBreak()
DelRight();
SwFEShell::SplitNode( sal_False, sal_False );
}
- SetAttr(SvxFmtBreakItem(SVX_BREAK_COLUMN_BEFORE, RES_BREAK));
+ SetAttrItem(SvxFmtBreakItem(SVX_BREAK_COLUMN_BEFORE, RES_BREAK));
EndUndo(UNDO_UI_INSERT_COLUMN_BREAK);
}
@@ -1037,7 +1017,7 @@ void SwWrtShell::InsertFootnote(const String &rStr, sal_Bool bEndNote, sal_Bool
if(rStr.Len())
aFootNote.SetNumStr( rStr );
- SetAttr(aFootNote);
+ SetAttrItem(aFootNote);
if( bEdit )
{
@@ -1514,17 +1494,14 @@ SelectionType SwWrtShell::GetSelectionType() const
if ( BasicActionPend() )
return IsSelFrmMode() ? nsSelectionType::SEL_FRM : nsSelectionType::SEL_TXT;
-// if ( IsTableMode() )
-// return nsSelectionType::SEL_TBL | nsSelectionType::SEL_TBL_CELLS;
-
SwView &_rView = ((SwView&)GetView());
if (_rView.GetPostItMgr() && _rView.GetPostItMgr()->HasActiveSidebarWin() )
return nsSelectionType::SEL_POSTIT;
- int nCnt;
- // Rahmen einfuegen ist kein DrawMode
+ int nCnt;
+ // Insertion of a text frame is not a DrawMode
if ( !_rView.GetEditWin().IsFrmAction() &&
- (IsObjSelected() || (_rView.IsDrawMode() && !IsFrmSelected()) ))
+ (IsObjSelected() || (_rView.IsDrawMode() && !IsFrmSelected()) ))
{
if (GetDrawView()->IsTextEdit())
nCnt = nsSelectionType::SEL_DRW_TXT;
@@ -1541,14 +1518,14 @@ SelectionType SwWrtShell::GetSelectionType() const
nCnt |= nsSelectionType::SEL_MEDIA;
if (svx::checkForSelectedCustomShapes(
- const_cast<SdrView *>(GetDrawView()),
- true /* bOnlyExtruded */ ))
+ const_cast<SdrView *>(GetDrawView()),
+ true /* bOnlyExtruded */ ))
{
nCnt |= nsSelectionType::SEL_EXTRUDED_CUSTOMSHAPE;
}
sal_uInt32 nCheckStatus = 0;
if (svx::checkForSelectedFontWork(
- const_cast<SdrView *>(GetDrawView()), nCheckStatus ))
+ const_cast<SdrView *>(GetDrawView()), nCheckStatus ))
{
nCnt |= nsSelectionType::SEL_FONTWORK;
}
@@ -1573,25 +1550,20 @@ SelectionType SwWrtShell::GetSelectionType() const
if ( IsTableMode() )
nCnt |= (nsSelectionType::SEL_TBL | nsSelectionType::SEL_TBL_CELLS);
- // --> FME 2005-01-12 #i39855#
- // Do not pop up numbering toolbar, if the text node has a numbering
- // of type SVX_NUM_NUMBER_NONE.
+ // Do not pop up numbering toolbar, if the text node has a numbering of type SVX_NUM_NUMBER_NONE.
const SwNumRule* pNumRule = GetCurNumRule();
if ( pNumRule )
{
const SwTxtNode* pTxtNd =
GetCrsr()->GetPoint()->nNode.GetNode().GetTxtNode();
- // --> OD 2008-03-19 #refactorlists#
if ( pTxtNd && pTxtNd->IsInList() )
- // <--
{
const SwNumFmt& rFmt = pNumRule->Get(sal::static_int_cast< sal_uInt8, sal_Int32>(pTxtNd->GetActualListLevel()));
if ( SVX_NUM_NUMBER_NONE != rFmt.GetNumberingType() )
nCnt |= nsSelectionType::SEL_NUM;
}
}
- // <--
return nCnt;
}
@@ -1738,7 +1710,7 @@ void SwWrtShell::AutoUpdatePara(SwTxtFmtColl* pColl, const SfxItemSet& rStyleSet
if(bReset)
{
ResetAttr();
- SetAttr(aCoreSet);
+ SetAttrSet(aCoreSet);
}
pDoc->ChgFmt(*pColl, rStyleSet );
EndAction();
@@ -1853,11 +1825,6 @@ sal_Bool SwWrtShell::CanInsert()
return (!(IsSelFrmMode() | IsObjSelected() | (GetView().GetDrawFuncPtr() != NULL) | (GetView().GetPostItMgr()->GetActiveSidebarWin()!= NULL)));
}
-// die Core erzeugt eine Selektion, das SttSelect muss gerufen werden
-void SwWrtShell::NewCoreSelection()
-{
- SttSelect();
-}
// --------------
void SwWrtShell::ChgDBData(const SwDBData& aDBData)
diff --git a/sw/source/ui/wrtsh/wrtsh2.cxx b/sw/source/ui/wrtsh/wrtsh2.cxx
index f911bb7468f6..52bce47ce554 100644
--- a/sw/source/ui/wrtsh/wrtsh2.cxx
+++ b/sw/source/ui/wrtsh/wrtsh2.cxx
@@ -103,16 +103,13 @@ void SwWrtShell::Insert(SwField &rFld)
-void SwWrtShell::UpdateInputFlds( SwInputFieldList* pLst, sal_Bool bOnlyInSel )
+void SwWrtShell::UpdateInputFlds( SwInputFieldList* pLst )
{
// ueber die Liste der Eingabefelder gehen und Updaten
SwInputFieldList* pTmp = pLst;
if( !pTmp )
pTmp = new SwInputFieldList( this );
- if (bOnlyInSel)
- pTmp->RemoveUnselectedFlds();
-
const sal_uInt16 nCnt = pTmp->Count();
if(nCnt)
{
@@ -305,7 +302,13 @@ void SwWrtShell::ClickToField( const SwField& rFld )
break;
case RES_INPUTFLD:
- StartInputFldDlg( (SwField*)&rFld, sal_False );
+ {
+ const SwInputField* pInputField = dynamic_cast<const SwInputField*>(&rFld);
+ if ( pInputField == NULL )
+ {
+ StartInputFldDlg( (SwField*)&rFld, sal_False );
+ }
+ }
break;
case RES_SETEXPFLD:
@@ -321,7 +324,6 @@ void SwWrtShell::ClickToField( const SwField& rFld )
}
-
void SwWrtShell::ClickToINetAttr( const SwFmtINetFmt& rItem, sal_uInt16 nFilter )
{
if( !rItem.GetValue().Len() )