diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2009-08-26 13:37:34 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2009-08-26 13:37:34 +0000 |
commit | 11ee54427f1c4f514556d39d888ec1b333d4d566 (patch) | |
tree | 303ffaf27674da22343f5b2b3fd11095fa0e469b | |
parent | c1b45151c3c75e2cce692e78d815e33187ccd95f (diff) |
CWS-TOOLING: integrate CWS swa11y32_2nd
2009-08-13 13:04:09 +0200 mav r274936 : #i104204# remove support for Ctrl-Tab
2009-08-13 09:59:22 +0200 od r274924 : #i93269# method <atk_wrapper_focus_idle_handler(..)>
- emit also object:state-changed:focus, if cursor is inside <XAccessibleText> object
2009-08-11 12:15:11 +0200 tl r274851 : CWS-TOOLING: rebase CWS swa11y32_2nd to trunk@274622 (milestone: DEV300:m54)
2009-07-14 17:35:03 +0200 tl r273982 : 2009-07-10 10:46:39 +0200 tl r273879 : CWS-TOOLING: rebase CWS swa11y32 to trunk@273468 (milestone: DEV300:m51)
2009-07-01 14:00:25 +0200 mav r273577 : #i102879# the text of the button should not change
2009-07-01 13:16:19 +0200 od r273574 : #159496# method <GetHelpAnchor_Impl(..)>
- do not release the solar mutex
2009-06-29 15:29:10 +0200 od r273476 : #i95042# method <CreateXWindow(..)>
- return instance <VCLXComboBox> for <Window> instance of type <MetricBox>.
note: <MetricBox> is inherited from <ComboBox>
2009-06-23 15:49:32 +0200 mav r273283 : #i101967# fix tab-control implementation
2009-06-22 13:56:22 +0200 od r273229 : #i100938# method <text_wrapper_get_run_attributes(..)>
- always provide start_offset and end_offset
- do _not_ increment the end_offset provide by <accessibility::TextSegment> instance
2009-06-02 12:09:03 +0200 mav r272492 : #i101959# Let the additional dialog window add its childred to the parents tab-hierarchy
2009-06-02 09:55:39 +0200 mav r272484 : #i102015# allow to have indirect child windows in tab-hierarchy
2009-06-02 09:49:42 +0200 mav r272482 : #i102015# Let the windows containing the extension dialog controls add controls to the tab hierarchy
2009-05-27 15:45:33 +0200 od r272354 : #i101012# method <SvxIconChoiceCtrl_Impl::EntrySelected(..)>
- emit vcl event LISTBOX_SELECT only in case that the given entry is selected.
2009-05-27 09:54:36 +0200 od r272333 : #i92103# map UNO-API accessible events list box entry expanded/collapsed
to corresponding atk events.
2009-05-27 09:52:15 +0200 od r272331 : #i92103# process list box entry expanded/collapsed events
2009-05-27 09:49:19 +0200 od r272330 : #i92103# emit vcl event list box entry expanded/collapsed
2009-05-26 10:42:05 +0200 od r272283 : #i93269# correct fix: check success of <queryInterface> call
2009-05-04 15:52:04 +0200 od r271469 : #i92103# new vcl event ids VCLEVENT_LISTBOX_ENTRY_EXPANDED and VCLEVENT_LISTBOX_ENTRY_COLLAPSED
2009-05-04 15:10:20 +0200 od r271460 : #i92103# refine definition of new constants
2009-05-04 14:36:44 +0200 od r271454 : #i92103# new constants for indicating that a list box entry is
expanded respectively collapsed.
2009-04-30 16:09:40 +0200 od r271421 : #i93269# method <atk_wrapper_focus_idle_handler(..)>
- emit text_caret_moved event for <XAccessibleText> object,
if cursor is inside the <XAccessibleText> object.
2009-04-22 14:00:10 +0200 tl r271105 : warning-free code
2009-04-22 09:17:30 +0200 tl r271073 : CWS-TOOLING: rebase CWS swa11y32 to trunk@270723 (milestone: DEV300:m46)
2009-04-20 12:53:03 +0200 cd r270974 : #i83639# Check extendedhelp state to provide correct tool tip text
2009-04-03 13:07:13 +0200 tl r270471 : #i63983# changed accessible object names to empty strings
2009-04-01 15:52:09 +0200 tl r270336 : #i90991# accessible names and description for paragraphs should be empty
2009-04-01 15:12:42 +0200 tl r270333 : #i90991# accessible names and description for paragraphs should be empty
2009-04-01 15:10:34 +0200 tl r270331 : warning-free code
2009-04-01 12:54:44 +0200 tl r270319 : #i89176# Implementation of XAccessibleMultiLineText in EditEngine
2009-04-01 12:52:56 +0200 tl r270318 : #i89176# Implementation of XAccessibleMultiLineText in EditEngine
2009-03-27 18:31:01 +0100 tbe r270166 : #i92143# text getRangeExtents reports incorrect 'x' values for spreadsheet cells
2009-03-13 13:43:54 +0100 tl r269476 : #i94322# ImpEditView::ShowCursor and nPara == USHRT_MAX problem fixed
2009-03-12 10:27:30 +0100 tl r269366 : warning-free code; unresolved external dbg_out when compiling with debug=t
2009-03-11 12:40:31 +0100 tl r269312 : warning-free code Solaris x86
2009-03-10 15:49:01 +0100 tl r269279 : #i86443# handle GetColumnCount() == 0
2009-03-10 10:48:32 +0100 cl r269254 : #i91742# name cells for accessibility
2009-03-09 17:06:33 +0100 cl r269203 : #i91742# call init on accessible cells
-rw-r--r-- | sc/source/ui/Accessibility/AccessibleCell.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/Accessibility/AccessibleText.cxx | 140 | ||||
-rw-r--r-- | sc/source/ui/inc/AccessibleText.hxx | 4 |
3 files changed, 128 insertions, 18 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleCell.cxx b/sc/source/ui/Accessibility/AccessibleCell.cxx index 4e36c8df0196..4dbc47524276 100644 --- a/sc/source/ui/Accessibility/AccessibleCell.cxx +++ b/sc/source/ui/Accessibility/AccessibleCell.cxx @@ -371,7 +371,7 @@ ScDocument* ScAccessibleCell::GetDocument(ScTabViewShell* pViewShell) ::std::auto_ptr< SvxEditSource > ScAccessibleCell::CreateEditSource(ScTabViewShell* pViewShell, ScAddress aCell, ScSplitPos eSplitPos) { ::std::auto_ptr < ScAccessibleTextData > pAccessibleCellTextData - (new ScAccessibleCellTextData(pViewShell, aCell, eSplitPos)); + ( new ScAccessibleCellTextData( pViewShell, aCell, eSplitPos, this ) ); ::std::auto_ptr< SvxEditSource > pEditSource (new ScAccessibilityEditSource(pAccessibleCellTextData)); return pEditSource; diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx index 18470475cebf..feeae8c73023 100644 --- a/sc/source/ui/Accessibility/AccessibleText.cxx +++ b/sc/source/ui/Accessibility/AccessibleText.cxx @@ -37,6 +37,7 @@ #include <memory> #include "AccessibleText.hxx" +#include "AccessibleCell.hxx" #include "tabvwsh.hxx" #include "editutil.hxx" #include "document.hxx" @@ -54,6 +55,7 @@ #include <svx/editobj.hxx> #include <svx/adjitem.hxx> #include <svx/svdmodel.hxx> +#include <svx/algitem.hxx> // ============================================================================ @@ -753,13 +755,14 @@ void ScEditViewForwarder::SetInvalid() // ScAccessibleCellTextData: shared data between sub objects of a accessible cell text object ScAccessibleCellTextData::ScAccessibleCellTextData(ScTabViewShell* pViewShell, - const ScAddress& rP, ScSplitPos eSplitPos) + const ScAddress& rP, ScSplitPos eSplitPos, ScAccessibleCell* pAccCell) : ScAccessibleCellBaseTextData(GetDocShell(pViewShell), rP), mpViewForwarder(NULL), mpEditViewForwarder(NULL), mpViewShell(pViewShell), meSplitPos(eSplitPos), - mbViewEditEngine(sal_False) + mbViewEditEngine(sal_False), + mpAccessibleCell( pAccCell ) { } @@ -792,7 +795,7 @@ void ScAccessibleCellTextData::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ScAccessibleTextData* ScAccessibleCellTextData::Clone() const { - return new ScAccessibleCellTextData(mpViewShell, aCellPos, meSplitPos); + return new ScAccessibleCellTextData( mpViewShell, aCellPos, meSplitPos, mpAccessibleCell ); } void ScAccessibleCellTextData::GetCellText(const ScAddress& rCellPos, String& rText) @@ -866,7 +869,8 @@ SvxTextForwarder* ScAccessibleCellTextData::GetTextForwarder() if (!bHasForwarder)*/ ScCellTextData::GetTextForwarder(); // creates Forwarder and EditEngine - if (pEditEngine && mpViewShell) + ScDocument* pDoc = ( pDocShell ? pDocShell->GetDocument() : NULL ); + if ( pDoc && pEditEngine && mpViewShell ) { long nSizeX, nSizeY; mpViewShell->GetViewData()->GetMergeSizePixel( @@ -874,9 +878,39 @@ SvxTextForwarder* ScAccessibleCellTextData::GetTextForwarder() Size aSize(nSizeX, nSizeY); - Window* pWin = mpViewShell->GetWindowByPos(meSplitPos); - if (pWin) - aSize = pWin->PixelToLogic(aSize, pEditEngine->GetRefMapMode()); + // #i92143# text getRangeExtents reports incorrect 'x' values for spreadsheet cells + long nIndent = 0; + const SvxHorJustifyItem* pHorJustifyItem = static_cast< const SvxHorJustifyItem* >( + pDoc->GetAttr( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab(), ATTR_HOR_JUSTIFY ) ); + SvxCellHorJustify eHorJust = ( pHorJustifyItem ? static_cast< SvxCellHorJustify >( pHorJustifyItem->GetValue() ) : SVX_HOR_JUSTIFY_STANDARD ); + if ( eHorJust == SVX_HOR_JUSTIFY_LEFT ) + { + const SfxUInt16Item* pIndentItem = static_cast< const SfxUInt16Item* >( + pDoc->GetAttr( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab(), ATTR_INDENT ) ); + if ( pIndentItem ) + { + nIndent = static_cast< long >( pIndentItem->GetValue() ); + } + } + + const SvxMarginItem* pMarginItem = static_cast< const SvxMarginItem* >( + pDoc->GetAttr( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab(), ATTR_MARGIN ) ); + ScViewData* pViewData = mpViewShell->GetViewData(); + double nPPTX = ( pViewData ? pViewData->GetPPTX() : 0 ); + double nPPTY = ( pViewData ? pViewData->GetPPTY() : 0 ); + long nLeftM = ( pMarginItem ? static_cast< long >( ( pMarginItem->GetLeftMargin() + nIndent ) * nPPTX ) : 0 ); + long nTopM = ( pMarginItem ? static_cast< long >( pMarginItem->GetTopMargin() * nPPTY ) : 0 ); + long nRightM = ( pMarginItem ? static_cast< long >( pMarginItem->GetRightMargin() * nPPTX ) : 0 ); + long nBottomM = ( pMarginItem ? static_cast< long >( pMarginItem->GetBottomMargin() * nPPTY ) : 0 ); + long nWidth = aSize.getWidth() - nLeftM - nRightM; + aSize.setWidth( nWidth ); + aSize.setHeight( aSize.getHeight() - nTopM - nBottomM ); + + Window* pWin = mpViewShell->GetWindowByPos( meSplitPos ); + if ( pWin ) + { + aSize = pWin->PixelToLogic( aSize, pEditEngine->GetRefMapMode() ); + } /* #i19430# Gnopernicus reads text partly if it sticks out of the cell boundaries. This leads to wrong results in cases where the cell text @@ -888,20 +922,94 @@ SvxTextForwarder* ScAccessibleCellTextData::GetTextForwarder() return the size of the complete text then, which is used to expand the cell bounding box in ScAccessibleCell::GetBoundingBox() (see sc/source/ui/Accessibility/AccessibleCell.cxx). */ - if (pDocShell && pDocShell->GetDocument()) + const SfxInt32Item* pItem = static_cast< const SfxInt32Item* >( + pDoc->GetAttr( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab(), ATTR_ROTATE_VALUE ) ); + if( pItem && (pItem->GetValue() != 0) ) + { + pEditEngine->SetPaperSize( Size( LONG_MAX, aSize.getHeight() ) ); + long nTxtWidth = static_cast< long >( pEditEngine->CalcTextWidth() ); + aSize.setWidth( std::max( aSize.getWidth(), nTxtWidth + 2 ) ); + } + else { - const SfxInt32Item* pItem = static_cast< const SfxInt32Item* >( - pDocShell->GetDocument()->GetAttr( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab(), ATTR_ROTATE_VALUE ) ); - if( pItem && (pItem->GetValue() != 0) ) + // #i92143# text getRangeExtents reports incorrect 'x' values for spreadsheet cells + const SfxBoolItem* pLineBreakItem = static_cast< const SfxBoolItem* >( + pDoc->GetAttr( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab(), ATTR_LINEBREAK ) ); + bool bLineBreak = ( pLineBreakItem && pLineBreakItem->GetValue() ); + if ( !bLineBreak ) { - pEditEngine->SetPaperSize( Size( LONG_MAX, aSize.getHeight() ) ); - long nTextWidth = static_cast< long >( pEditEngine->CalcTextWidth() ); - aSize.setWidth( std::max( aSize.getWidth(), nTextWidth + 2 ) ); + long nTxtWidth = static_cast< long >( pEditEngine->CalcTextWidth() ); + aSize.setWidth( ::std::max( aSize.getWidth(), nTxtWidth ) ); } } - // #i70916# Text in spread sheet cells return the wrong extents - pEditEngine->SetPaperSize( Size( LONG_MAX, aSize.getHeight() ) ); + pEditEngine->SetPaperSize( aSize ); + + // #i92143# text getRangeExtents reports incorrect 'x' values for spreadsheet cells + if ( eHorJust == SVX_HOR_JUSTIFY_STANDARD && pDoc->HasValueData( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab() ) ) + { + pEditEngine->SetDefaultItem( SvxAdjustItem( SVX_ADJUST_RIGHT, EE_PARA_JUST ) ); + } + + Size aTextSize; + if ( pWin ) + { + aTextSize = pWin->LogicToPixel( Size( pEditEngine->CalcTextWidth(), pEditEngine->GetTextHeight() ), pEditEngine->GetRefMapMode() ); + } + long nTextWidth = aTextSize.Width(); + long nTextHeight = aTextSize.Height(); + + long nOffsetX = nLeftM; + long nDiffX = nTextWidth - nWidth; + if ( nDiffX > 0 ) + { + switch ( eHorJust ) + { + case SVX_HOR_JUSTIFY_RIGHT: + { + nOffsetX -= nDiffX; + } + break; + case SVX_HOR_JUSTIFY_CENTER: + { + nOffsetX -= nDiffX / 2; + } + break; + default: + { + } + break; + } + } + + long nOffsetY = 0; + const SvxVerJustifyItem* pVerJustifyItem = static_cast< const SvxVerJustifyItem* >( + pDoc->GetAttr( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab(), ATTR_VER_JUSTIFY ) ); + SvxCellVerJustify eVerJust = ( pVerJustifyItem ? static_cast< SvxCellVerJustify >( pVerJustifyItem->GetValue() ) : SVX_VER_JUSTIFY_STANDARD ); + switch ( eVerJust ) + { + case SVX_VER_JUSTIFY_STANDARD: + case SVX_VER_JUSTIFY_BOTTOM: + { + nOffsetY = nSizeY - nBottomM - nTextHeight; + } + break; + case SVX_VER_JUSTIFY_CENTER: + { + nOffsetY = ( nSizeY - nTopM - nBottomM - nTextHeight ) / 2 + nTopM; + } + break; + default: + { + nOffsetY = nTopM; + } + break; + } + + if ( mpAccessibleCell ) + { + mpAccessibleCell->SetOffset( Point( nOffsetX, nOffsetY ) ); + } pEditEngine->SetNotifyHdl( LINK(this, ScAccessibleCellTextData, NotifyHdl) ); } diff --git a/sc/source/ui/inc/AccessibleText.hxx b/sc/source/ui/inc/AccessibleText.hxx index 63e263a12f8a..a1138e869d3b 100644 --- a/sc/source/ui/inc/AccessibleText.hxx +++ b/sc/source/ui/inc/AccessibleText.hxx @@ -46,6 +46,7 @@ class ScEditViewForwarder; class ScPreviewShell; class EditTextObject; class ScCsvViewForwarder; +class ScAccessibleCell; // ============================================================================ @@ -103,7 +104,7 @@ class ScAccessibleCellTextData : public ScAccessibleCellBaseTextData { public: ScAccessibleCellTextData(ScTabViewShell* pViewShell, - const ScAddress& rP, ScSplitPos eSplitPos); + const ScAddress& rP, ScSplitPos eSplitPos, ScAccessibleCell* pAccCell); virtual ~ScAccessibleCellTextData(); virtual ScAccessibleTextData* Clone() const; @@ -123,6 +124,7 @@ private: ScTabViewShell* mpViewShell; ScSplitPos meSplitPos; sal_Bool mbViewEditEngine; + ScAccessibleCell* mpAccessibleCell; // prevent the using of this method of the base class ScSharedCellEditSource* GetOriginalSource() { return NULL; } |