summaryrefslogtreecommitdiff
path: root/sc/source/ui/Accessibility
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/Accessibility')
-rw-r--r--sc/source/ui/Accessibility/AccessibleContextBase.cxx12
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocument.cxx13
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx25
-rw-r--r--sc/source/ui/Accessibility/AccessiblePageHeader.cxx74
-rw-r--r--sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx20
-rw-r--r--sc/source/ui/Accessibility/AccessiblePreviewCell.cxx3
-rw-r--r--sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx26
-rw-r--r--sc/source/ui/Accessibility/AccessiblePreviewTable.cxx30
-rw-r--r--sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx127
-rw-r--r--sc/source/ui/Accessibility/AccessibleText.cxx21
10 files changed, 160 insertions, 191 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleContextBase.cxx b/sc/source/ui/Accessibility/AccessibleContextBase.cxx
index a044814ecae8..66ac3accfb18 100644
--- a/sc/source/ui/Accessibility/AccessibleContextBase.cxx
+++ b/sc/source/ui/Accessibility/AccessibleContextBase.cxx
@@ -26,7 +26,7 @@
#include <tools/gen.hxx>
#include <unotools/accessiblestatesethelper.hxx>
#include <toolkit/helper/convert.hxx>
-#include <svl/smplhint.hxx>
+#include <svl/hint.hxx>
#include <comphelper/sequence.hxx>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
@@ -126,14 +126,10 @@ void SAL_CALL ScAccessibleContextBase::release()
void ScAccessibleContextBase::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
- if (pSimpleHint)
+ if (rHint.GetId() == SFX_HINT_DYING)
{
- if (pSimpleHint->GetId() == SFX_HINT_DYING)
- {
- // it seems the Broadcaster is dying, since the view is dying
- dispose();
- }
+ // it seems the Broadcaster is dying, since the view is dying
+ dispose();
}
}
diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index 76a0997d3946..a21d4ffc9dd0 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -1552,11 +1552,10 @@ void ScAccessibleDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
}
}
- else if (dynamic_cast<const SfxSimpleHint*>(&rHint))
+ else
{
- const SfxSimpleHint* pSimpleHint = static_cast<const SfxSimpleHint*>(&rHint);
// only notify if child exist, otherwise it is not necessary
- if ((pSimpleHint->GetId() == SC_HINT_ACC_TABLECHANGED) &&
+ if ((rHint.GetId() == SC_HINT_ACC_TABLECHANGED) &&
mpAccessibleSpreadsheet.is())
{
FreeAccessibleSpreadsheet();
@@ -1580,12 +1579,12 @@ void ScAccessibleDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
if (mpAccessibleSpreadsheet.is())
mpAccessibleSpreadsheet->FireFirstCellFocus();
}
- else if (pSimpleHint->GetId() == SC_HINT_ACC_MAKEDRAWLAYER)
+ else if (rHint.GetId() == SC_HINT_ACC_MAKEDRAWLAYER)
{
if (mpChildrenShapes)
mpChildrenShapes->SetDrawBroadcaster();
}
- else if ((pSimpleHint->GetId() == SC_HINT_ACC_ENTEREDITMODE)) // this event comes only on creating edit field of a cell
+ else if ((rHint.GetId() == SC_HINT_ACC_ENTEREDITMODE)) // this event comes only on creating edit field of a cell
{
if (mpViewShell->GetViewData().HasEditView(meSplitPos))
{
@@ -1609,7 +1608,7 @@ void ScAccessibleDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
}
}
- else if (pSimpleHint->GetId() == SC_HINT_ACC_LEAVEEDITMODE)
+ else if (rHint.GetId() == SC_HINT_ACC_LEAVEEDITMODE)
{
if (mxTempAcc.is())
{
@@ -1624,7 +1623,7 @@ void ScAccessibleDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
CommitFocusGained();
}
}
- else if ((pSimpleHint->GetId() == SC_HINT_ACC_VISAREACHANGED) || (pSimpleHint->GetId() == SC_HINT_ACC_WINDOWRESIZED))
+ else if ((rHint.GetId() == SC_HINT_ACC_VISAREACHANGED) || (rHint.GetId() == SC_HINT_ACC_WINDOWRESIZED))
{
Rectangle aOldVisArea(maVisArea);
maVisArea = GetVisibleArea_Impl();
diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
index 6fdad87f41b0..05108da8ba07 100644
--- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
@@ -1230,11 +1230,18 @@ void SAL_CALL ScAccessibleDocumentPagePreview::disposing()
void ScAccessibleDocumentPagePreview::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
- if (pSimpleHint)
+ if ( dynamic_cast<const ScAccWinFocusLostHint*>(&rHint) )
+ {
+ CommitFocusLost();
+ }
+ else if ( dynamic_cast<const ScAccWinFocusGotHint*>(&rHint) )
+ {
+ CommitFocusGained();
+ }
+ else
{
// only notify if child exist, otherwise it is not necessary
- if (pSimpleHint->GetId() == SC_HINT_DATACHANGED)
+ if (rHint.GetId() == SC_HINT_DATACHANGED)
{
if (mpTable.is()) // if there is no table there is nothing to notify, because no one recongnizes the change
{
@@ -1282,11 +1289,11 @@ void ScAccessibleDocumentPagePreview::Notify( SfxBroadcaster& rBC, const SfxHint
}
}
}
- else if (pSimpleHint->GetId() == SC_HINT_ACC_MAKEDRAWLAYER)
+ else if (rHint.GetId() == SC_HINT_ACC_MAKEDRAWLAYER)
{
GetShapeChildren()->SetDrawBroadcaster();
}
- else if (pSimpleHint->GetId() == SC_HINT_ACC_VISAREACHANGED)
+ else if (rHint.GetId() == SC_HINT_ACC_VISAREACHANGED)
{
Size aOutputSize;
vcl::Window* pSizeWindow = mpViewShell->GetWindow();
@@ -1304,14 +1311,6 @@ void ScAccessibleDocumentPagePreview::Notify( SfxBroadcaster& rBC, const SfxHint
CommitChange(aEvent);
}
}
- else if ( dynamic_cast<const ScAccWinFocusLostHint*>(&rHint) )
- {
- CommitFocusLost();
- }
- else if ( dynamic_cast<const ScAccWinFocusGotHint*>(&rHint) )
- {
- CommitFocusGained();
- }
ScAccessibleDocumentBase::Notify(rBC, rHint);
}
diff --git a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx
index eda119923b45..956675a70fcb 100644
--- a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx
@@ -35,7 +35,7 @@
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <vcl/window.hxx>
-#include <svl/smplhint.hxx>
+#include <svl/hint.hxx>
#include <vcl/svapp.hxx>
#include <unotools/accessiblestatesethelper.hxx>
#include <svl/style.hxx>
@@ -122,51 +122,47 @@ void SAL_CALL ScAccessiblePageHeader::disposing()
void ScAccessiblePageHeader::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>( &rHint );
- if (pSimpleHint)
+ // only notify if child exist, otherwise it is not necessary
+ if (rHint.GetId() == SC_HINT_DATACHANGED)
{
- // only notify if child exist, otherwise it is not necessary
- if (pSimpleHint->GetId() == SC_HINT_DATACHANGED)
+ ScHFAreas aOldAreas(maAreas);
+ std::for_each(aOldAreas.begin(), aOldAreas.end(), Acquire());
+ mnChildCount = -1;
+ getAccessibleChildCount();
+ for (sal_uInt8 i = 0; i < MAX_AREAS; ++i)
{
- ScHFAreas aOldAreas(maAreas);
- std::for_each(aOldAreas.begin(), aOldAreas.end(), Acquire());
- mnChildCount = -1;
- getAccessibleChildCount();
- for (sal_uInt8 i = 0; i < MAX_AREAS; ++i)
- {
- if ((aOldAreas[i] && maAreas[i] && !ScGlobal::EETextObjEqual(aOldAreas[i]->GetEditTextObject(), maAreas[i]->GetEditTextObject())) ||
+ if ((aOldAreas[i] && maAreas[i] && !ScGlobal::EETextObjEqual(aOldAreas[i]->GetEditTextObject(), maAreas[i]->GetEditTextObject())) ||
(aOldAreas[i] && !maAreas[i]) || (!aOldAreas[i] && maAreas[i]))
+ {
+ if (aOldAreas[i] && aOldAreas[i]->GetEditTextObject())
{
- if (aOldAreas[i] && aOldAreas[i]->GetEditTextObject())
- {
- AccessibleEventObject aEvent;
- aEvent.EventId = AccessibleEventId::CHILD;
- aEvent.Source = uno::Reference< XAccessibleContext >(this);
- aEvent.OldValue = uno::makeAny(uno::Reference<XAccessible>(aOldAreas[i]));
-
- CommitChange(aEvent); // child gone - event
- aOldAreas[i]->dispose();
- }
- if (maAreas[i] && maAreas[i]->GetEditTextObject())
- {
- AccessibleEventObject aEvent;
- aEvent.EventId = AccessibleEventId::CHILD;
- aEvent.Source = uno::Reference< XAccessibleContext >(this);
- aEvent.NewValue = uno::makeAny(uno::Reference<XAccessible>(maAreas[i]));
-
- CommitChange(aEvent); // new child - event
- }
+ AccessibleEventObject aEvent;
+ aEvent.EventId = AccessibleEventId::CHILD;
+ aEvent.Source = uno::Reference< XAccessibleContext >(this);
+ aEvent.OldValue = uno::makeAny(uno::Reference<XAccessible>(aOldAreas[i]));
+
+ CommitChange(aEvent); // child gone - event
+ aOldAreas[i]->dispose();
+ }
+ if (maAreas[i] && maAreas[i]->GetEditTextObject())
+ {
+ AccessibleEventObject aEvent;
+ aEvent.EventId = AccessibleEventId::CHILD;
+ aEvent.Source = uno::Reference< XAccessibleContext >(this);
+ aEvent.NewValue = uno::makeAny(uno::Reference<XAccessible>(maAreas[i]));
+
+ CommitChange(aEvent); // new child - event
}
}
- std::for_each(aOldAreas.begin(), aOldAreas.end(), Release());
- }
- else if (pSimpleHint->GetId() == SC_HINT_ACC_VISAREACHANGED)
- {
- AccessibleEventObject aEvent;
- aEvent.EventId = AccessibleEventId::VISIBLE_DATA_CHANGED;
- aEvent.Source = uno::Reference< XAccessibleContext >(this);
- CommitChange(aEvent);
}
+ std::for_each(aOldAreas.begin(), aOldAreas.end(), Release());
+ }
+ else if (rHint.GetId() == SC_HINT_ACC_VISAREACHANGED)
+ {
+ AccessibleEventObject aEvent;
+ aEvent.EventId = AccessibleEventId::VISIBLE_DATA_CHANGED;
+ aEvent.Source = uno::Reference< XAccessibleContext >(this);
+ CommitChange(aEvent);
}
ScAccessibleContextBase::Notify(rBC, rHint);
diff --git a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx
index 4b6f9bcabbea..669c818bf038 100644
--- a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx
@@ -92,20 +92,16 @@ void SAL_CALL ScAccessiblePageHeaderArea::disposing()
void ScAccessiblePageHeaderArea::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
- if (pSimpleHint)
+ // only notify if child exist, otherwise it is not necessary
+ if (rHint.GetId() == SC_HINT_ACC_VISAREACHANGED)
{
- // only notify if child exist, otherwise it is not necessary
- if (pSimpleHint->GetId() == SC_HINT_ACC_VISAREACHANGED)
- {
- if (mpTextHelper)
- mpTextHelper->UpdateChildren();
+ if (mpTextHelper)
+ mpTextHelper->UpdateChildren();
- AccessibleEventObject aEvent;
- aEvent.EventId = AccessibleEventId::VISIBLE_DATA_CHANGED;
- aEvent.Source = uno::Reference< XAccessibleContext >(this);
- CommitChange(aEvent);
- }
+ AccessibleEventObject aEvent;
+ aEvent.EventId = AccessibleEventId::VISIBLE_DATA_CHANGED;
+ aEvent.Source = uno::Reference< XAccessibleContext >(this);
+ CommitChange(aEvent);
}
ScAccessibleContextBase::Notify(rBC, rHint);
}
diff --git a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx
index 5383e688bfcf..a1232985fc31 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx
@@ -83,8 +83,7 @@ void SAL_CALL ScAccessiblePreviewCell::disposing()
void ScAccessiblePreviewCell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
- if (pSimpleHint && pSimpleHint->GetId() == SC_HINT_ACC_VISAREACHANGED)
+ if (rHint.GetId() == SC_HINT_ACC_VISAREACHANGED)
{
if (mpTextHelper)
mpTextHelper->UpdateChildren();
diff --git a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
index 3aed647783de..31d9768ecbdb 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
@@ -55,7 +55,7 @@
#include <vcl/window.hxx>
#include <vcl/svapp.hxx>
-#include <svl/smplhint.hxx>
+#include <svl/hint.hxx>
#include <unotools/accessiblestatesethelper.hxx>
#include <comphelper/sequence.hxx>
#include <comphelper/servicehelper.hxx>
@@ -116,21 +116,17 @@ void SAL_CALL ScAccessiblePreviewHeaderCell::disposing()
void ScAccessiblePreviewHeaderCell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
- if (pSimpleHint)
+ const sal_uInt32 nId = rHint.GetId();
+ if (nId == SC_HINT_ACC_VISAREACHANGED)
{
- const sal_uInt32 nId {pSimpleHint->GetId()};
- if (nId == SC_HINT_ACC_VISAREACHANGED)
- {
- if (mpTextHelper)
- mpTextHelper->UpdateChildren();
- }
- else if ( nId == SFX_HINT_DATACHANGED )
- {
- // column / row layout may change with any document change,
- // so it must be invalidated
- DELETEZ( mpTableInfo );
- }
+ if (mpTextHelper)
+ mpTextHelper->UpdateChildren();
+ }
+ else if ( nId == SFX_HINT_DATACHANGED )
+ {
+ // column / row layout may change with any document change,
+ // so it must be invalidated
+ DELETEZ( mpTableInfo );
}
ScAccessibleContextBase::Notify(rBC, rHint);
diff --git a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
index 4e083a6b9106..abfa70176c90 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
@@ -36,7 +36,7 @@
#include <vcl/window.hxx>
#include <vcl/svapp.hxx>
-#include <svl/smplhint.hxx>
+#include <svl/hint.hxx>
#include <unotools/accessiblestatesethelper.hxx>
#include <comphelper/sequence.hxx>
#include <comphelper/servicehelper.hxx>
@@ -86,23 +86,19 @@ void SAL_CALL ScAccessiblePreviewTable::disposing()
void ScAccessiblePreviewTable::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
- if (pSimpleHint)
+ const sal_uInt32 nId = rHint.GetId();
+ if ( nId == SFX_HINT_DATACHANGED )
{
- const sal_uInt32 nId {pSimpleHint->GetId()};
- if ( nId == SFX_HINT_DATACHANGED )
- {
- // column / row layout may change with any document change,
- // so it must be invalidated
- DELETEZ( mpTableInfo );
- }
- else if (nId == SC_HINT_ACC_VISAREACHANGED)
- {
- AccessibleEventObject aEvent;
- aEvent.EventId = AccessibleEventId::VISIBLE_DATA_CHANGED;
- aEvent.Source = uno::Reference< XAccessibleContext >(this);
- CommitChange(aEvent);
- }
+ // column / row layout may change with any document change,
+ // so it must be invalidated
+ DELETEZ( mpTableInfo );
+ }
+ else if (nId == SC_HINT_ACC_VISAREACHANGED)
+ {
+ AccessibleEventObject aEvent;
+ aEvent.EventId = AccessibleEventId::VISIBLE_DATA_CHANGED;
+ aEvent.Source = uno::Reference< XAccessibleContext >(this);
+ CommitChange(aEvent);
}
ScAccessibleContextBase::Notify(rBC, rHint);
diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
index 69d23e0c9f72..889e2f579df3 100644
--- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
+++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
@@ -417,10 +417,69 @@ void ScAccessibleSpreadsheet::VisAreaChanged()
void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
- if (pSimpleHint)
+ if ( dynamic_cast<const ScUpdateRefHint*>(&rHint) )
{
- if (pSimpleHint->GetId() == SC_HINT_ACC_CURSORCHANGED)
+ const ScUpdateRefHint& rRef = static_cast<const ScUpdateRefHint&>(rHint);
+ if (rRef.GetMode() == URM_INSDEL && rRef.GetDz() == 0) //test whether table is inserted or deleted
+ {
+ if (((rRef.GetRange().aStart.Col() == maRange.aStart.Col()) &&
+ (rRef.GetRange().aEnd.Col() == maRange.aEnd.Col())) ||
+ ((rRef.GetRange().aStart.Row() == maRange.aStart.Row()) &&
+ (rRef.GetRange().aEnd.Row() == maRange.aEnd.Row())))
+ {
+ // ignore next SC_HINT_DATACHANGED notification
+ mbDelIns = true;
+
+ sal_Int16 nId(0);
+ SCsCOL nX(rRef.GetDx());
+ SCsROW nY(rRef.GetDy());
+ ScRange aRange(rRef.GetRange());
+ if ((nX < 0) || (nY < 0))
+ {
+ OSL_ENSURE(!((nX < 0) && (nY < 0)), "should not be possible to remove row and column at the same time");
+ nId = AccessibleTableModelChangeType::DELETE;
+ if (nX < 0)
+ {
+ nX = -nX;
+ nY = aRange.aEnd.Row() - aRange.aStart.Row();
+ }
+ else
+ {
+ nY = -nY;
+ nX = aRange.aEnd.Col() - aRange.aStart.Col();
+ }
+ }
+ else if ((nX > 0) || (nY > 0))
+ {
+ OSL_ENSURE(!((nX > 0) && (nY > 0)), "should not be possible to add row and column at the same time");
+ nId = AccessibleTableModelChangeType::INSERT;
+ if (nX < 0)
+ nY = aRange.aEnd.Row() - aRange.aStart.Row();
+ else
+ nX = aRange.aEnd.Col() - aRange.aStart.Col();
+ }
+ else
+ {
+ OSL_FAIL("is it a deletion or a insertion?");
+ }
+
+ CommitTableModelChange(rRef.GetRange().aStart.Row(),
+ rRef.GetRange().aStart.Col(),
+ rRef.GetRange().aStart.Row() + nY,
+ rRef.GetRange().aStart.Col() + nX, nId);
+
+ AccessibleEventObject aEvent;
+ aEvent.EventId = AccessibleEventId::ACTIVE_DESCENDANT_CHANGED;
+ aEvent.Source = uno::Reference< XAccessibleContext >(this);
+ aEvent.NewValue <<= uno::Reference<XAccessible>(mpAccCell.get());
+
+ CommitChange(aEvent);
+ }
+ }
+ }
+ else
+ {
+ if (rHint.GetId() == SC_HINT_ACC_CURSORCHANGED)
{
if (mpViewShell)
{
@@ -598,7 +657,7 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
m_LastMarkedRanges = *mpMarkedRanges;
}
}
- else if (pSimpleHint->GetId() == SC_HINT_DATACHANGED)
+ else if (rHint.GetId() == SC_HINT_DATACHANGED)
{
if (!mbDelIns)
CommitTableModelChange(maRange.aStart.Row(), maRange.aStart.Col(), maRange.aEnd.Row(), maRange.aEnd.Col(), AccessibleTableModelChangeType::UPDATE);
@@ -656,66 +715,6 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
}
}*/
}
- else if ( dynamic_cast<const ScUpdateRefHint*>(&rHint) )
- {
- const ScUpdateRefHint& rRef = static_cast<const ScUpdateRefHint&>(rHint);
- if (rRef.GetMode() == URM_INSDEL && rRef.GetDz() == 0) //test whether table is inserted or deleted
- {
- if (((rRef.GetRange().aStart.Col() == maRange.aStart.Col()) &&
- (rRef.GetRange().aEnd.Col() == maRange.aEnd.Col())) ||
- ((rRef.GetRange().aStart.Row() == maRange.aStart.Row()) &&
- (rRef.GetRange().aEnd.Row() == maRange.aEnd.Row())))
- {
- // ignore next SC_HINT_DATACHANGED notification
- mbDelIns = true;
-
- sal_Int16 nId(0);
- SCsCOL nX(rRef.GetDx());
- SCsROW nY(rRef.GetDy());
- ScRange aRange(rRef.GetRange());
- if ((nX < 0) || (nY < 0))
- {
- OSL_ENSURE(!((nX < 0) && (nY < 0)), "should not be possible to remove row and column at the same time");
- nId = AccessibleTableModelChangeType::DELETE;
- if (nX < 0)
- {
- nX = -nX;
- nY = aRange.aEnd.Row() - aRange.aStart.Row();
- }
- else
- {
- nY = -nY;
- nX = aRange.aEnd.Col() - aRange.aStart.Col();
- }
- }
- else if ((nX > 0) || (nY > 0))
- {
- OSL_ENSURE(!((nX > 0) && (nY > 0)), "should not be possible to add row and column at the same time");
- nId = AccessibleTableModelChangeType::INSERT;
- if (nX < 0)
- nY = aRange.aEnd.Row() - aRange.aStart.Row();
- else
- nX = aRange.aEnd.Col() - aRange.aStart.Col();
- }
- else
- {
- OSL_FAIL("is it a deletion or a insertion?");
- }
-
- CommitTableModelChange(rRef.GetRange().aStart.Row(),
- rRef.GetRange().aStart.Col(),
- rRef.GetRange().aStart.Row() + nY,
- rRef.GetRange().aStart.Col() + nX, nId);
-
- AccessibleEventObject aEvent;
- aEvent.EventId = AccessibleEventId::ACTIVE_DESCENDANT_CHANGED;
- aEvent.Source = uno::Reference< XAccessibleContext >(this);
- aEvent.NewValue <<= uno::Reference<XAccessible>(mpAccCell.get());
-
- CommitChange(aEvent);
- }
- }
- }
ScAccessibleTableBase::Notify(rBC, rHint);
}
diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx
index 80f7393e76fc..dc7ce4175f70 100644
--- a/sc/source/ui/Accessibility/AccessibleText.cxx
+++ b/sc/source/ui/Accessibility/AccessibleText.cxx
@@ -720,8 +720,7 @@ ScAccessibleCellTextData::~ScAccessibleCellTextData()
void ScAccessibleCellTextData::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
- if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
+ if ( rHint.GetId() == SFX_HINT_DYING )
{
mpViewShell = nullptr; // invalid now
if (mpViewForwarder)
@@ -948,8 +947,7 @@ ScAccessibleEditObjectTextData::~ScAccessibleEditObjectTextData()
void ScAccessibleEditObjectTextData::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
- if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
+ if ( rHint.GetId() == SFX_HINT_DYING )
{
mpWindow = nullptr;
mpEditView = nullptr;
@@ -1205,8 +1203,7 @@ ScAccessiblePreviewCellTextData::~ScAccessiblePreviewCellTextData()
void ScAccessiblePreviewCellTextData::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
- if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
+ if ( rHint.GetId() == SFX_HINT_DYING )
{
mpViewShell = nullptr; // invalid now
if (mpViewForwarder)
@@ -1279,8 +1276,7 @@ ScAccessiblePreviewHeaderCellTextData::~ScAccessiblePreviewHeaderCellTextData()
void ScAccessiblePreviewHeaderCellTextData::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
- if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
+ if ( rHint.GetId() == SFX_HINT_DYING )
{
mpViewShell = nullptr; // invalid now
if (mpViewForwarder)
@@ -1398,8 +1394,7 @@ ScAccessibleTextData* ScAccessibleHeaderTextData::Clone() const
void ScAccessibleHeaderTextData::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
- if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
+ if ( rHint.GetId() == SFX_HINT_DYING )
{
mpViewShell = nullptr;// invalid now
mpDocSh = nullptr;
@@ -1512,8 +1507,7 @@ ScAccessibleTextData* ScAccessibleNoteTextData::Clone() const
void ScAccessibleNoteTextData::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
- if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
+ if ( rHint.GetId() == SFX_HINT_DYING )
{
mpViewShell = nullptr;// invalid now
mpDocSh = nullptr;
@@ -1649,8 +1643,7 @@ ScAccessibleCsvTextData::~ScAccessibleCsvTextData()
void ScAccessibleCsvTextData::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
- if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
+ if ( rHint.GetId() == SFX_HINT_DYING )
{
mpWindow = nullptr;
mpEditEngine = nullptr;