[Libreoffice-commits] core.git: 5 commits - accessibility/inc accessibility/source sax/source sc/source sd/source svtools/source
Michael Stahl
mstahl at redhat.com
Tue Feb 11 03:56:34 PST 2014
accessibility/inc/accessibility/extended/accessiblelistbox.hxx | 4 ++--
accessibility/inc/accessibility/extended/accessiblelistboxentry.hxx | 3 +--
accessibility/source/extended/accessiblelistbox.cxx | 10 +++++++---
accessibility/source/extended/accessiblelistboxentry.cxx | 10 ++++++++--
sax/source/tools/converter.cxx | 4 ++++
sc/source/ui/Accessibility/AccessibleCell.cxx | 4 ++++
sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx | 8 +++++++-
sc/source/ui/Accessibility/AccessibleDocument.cxx | 5 +++++
sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx | 2 ++
sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx | 8 ++++++++
sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx | 2 ++
sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx | 8 ++++++++
sd/source/ui/accessibility/AccessibleOutlineView.cxx | 2 ++
svtools/source/control/valueacc.cxx | 1 +
svtools/source/control/vclxaccessibleheaderbar.cxx | 9 ++++++++-
15 files changed, 69 insertions(+), 11 deletions(-)
New commits:
commit bfeef3f7234829db4bfbbd05376c2594c5dd6df0
Author: Michael Stahl <mstahl at redhat.com>
Date: Mon Feb 10 23:25:01 2014 +0100
sc: add some missing locks in new code
Change-Id: Ia35693f6c5915e898e5b137920431c7bebfc761c
diff --git a/sc/source/ui/Accessibility/AccessibleCell.cxx b/sc/source/ui/Accessibility/AccessibleCell.cxx
index e30a4da..454503c 100644
--- a/sc/source/ui/Accessibility/AccessibleCell.cxx
+++ b/sc/source/ui/Accessibility/AccessibleCell.cxx
@@ -512,6 +512,8 @@ uno::Any SAL_CALL ScAccessibleCell::getExtendedAttributes()
::com::sun::star::uno::RuntimeException,
std::exception)
{
+ SolarMutexGuard aGuard;
+
uno::Any strRet;
if (mpViewShell)
{
@@ -542,6 +544,8 @@ uno::Any SAL_CALL ScAccessibleCell::getExtendedAttributes()
// cell has its own ParaIndent property, so when calling character attributes on cell, the ParaIndent should replace the ParaLeftMargin if its value is not zero.
uno::Sequence< beans::PropertyValue > SAL_CALL ScAccessibleCell::getCharacterAttributes( sal_Int32 nIndex, const ::com::sun::star::uno::Sequence< OUString >& aRequestedAttributes ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
+ SolarMutexGuard aGuard;
+
uno::Sequence< beans::PropertyValue > aAttribs = AccessibleStaticTextBase::getCharacterAttributes( nIndex, aRequestedAttributes );
beans::PropertyValue *pAttribs = aAttribs.getArray();
diff --git a/sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx b/sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx
index 0b5dc35..a620ce2 100644
--- a/sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx
@@ -721,6 +721,8 @@ uno::Reference<XAccessibleStateSet> SAL_CALL ScAccessibleDataPilotButton::getAcc
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet >
SAL_CALL ScAccessibleDataPilotButton::getAccessibleRelationSet( ) throw (::com::sun::star::uno::RuntimeException)
{
+ SolarMutexGuard g;
+
utl::AccessibleRelationSetHelper* pRelationSetHelper = new utl::AccessibleRelationSetHelper;
uno::Reference< com::sun::star::accessibility::XAccessibleRelationSet > xSet = pRelationSetHelper;
if(mxParent.is())
@@ -759,7 +761,9 @@ uno::Sequence<sal_Int8> SAL_CALL ScAccessibleDataPilotButton::getImplementationI
OUString SAL_CALL ScAccessibleDataPilotButton::createAccessibleDescription(void)
throw (::com::sun::star::uno::RuntimeException)
{
- if (mpFieldWindow)
+ SolarMutexGuard g;
+
+ if (mpFieldWindow)
return mpFieldWindow->GetHelpText();
return OUString();
}
@@ -822,6 +826,8 @@ OUString ScAccessibleDataPilotButton::getAccessibleActionDescription ( sal_Int32
::com::sun::star::uno::Reference< XAccessibleKeyBinding > ScAccessibleDataPilotButton::getAccessibleActionKeyBinding( sal_Int32 nIndex ) throw (lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException)
{
+ SolarMutexGuard g;
+
if ( nIndex < 0 || nIndex >= getAccessibleActionCount() )
throw lang::IndexOutOfBoundsException();
comphelper::OAccessibleKeyBindingHelper* pKeyBindingHelper = new comphelper::OAccessibleKeyBindingHelper();
diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index 6271438..fc2a0ca 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -1861,6 +1861,8 @@ OUString SAL_CALL
ScAccessibleDocument::getAccessibleName(void)
throw (::com::sun::star::uno::RuntimeException)
{
+ SolarMutexGuard g;
+
OUString aName = ScResId(STR_ACC_DOC_SPREADSHEET);
ScDocument* pScDoc = GetDocument();
if (!pScDoc)
@@ -2372,6 +2374,7 @@ ScAddress ScAccessibleDocument::GetCurCellAddress() const
uno::Any SAL_CALL ScAccessibleDocument::getExtendedAttributes()
throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException)
{
+ SolarMutexGuard g;
uno::Any anyAtrribute;
@@ -2448,6 +2451,8 @@ com::sun::star::uno::Sequence< com::sun::star::uno::Any > ScAccessibleDocument::
SAL_CALL ScAccessibleDocument::get_AccFlowTo(const ::com::sun::star::uno::Any& rAny, sal_Int32 nType)
throw ( ::com::sun::star::uno::RuntimeException )
{
+ SolarMutexGuard g;
+
const sal_Int32 SPELLCHECKFLOWTO = 1;
const sal_Int32 FINDREPLACEFLOWTO = 2;
if ( nType == SPELLCHECKFLOWTO )
diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
index 2cd9d92..305ce15 100644
--- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
@@ -1701,6 +1701,8 @@ ScShapeChildren* ScAccessibleDocumentPagePreview::GetShapeChildren()
OUString ScAccessibleDocumentPagePreview::getAccessibleName(void)
throw (::com::sun::star::uno::RuntimeException)
{
+ SolarMutexGuard g;
+
OUString aName = ScResId(STR_ACC_DOC_SPREADSHEET);
ScDocument* pScDoc = mpViewShell->GetDocument();
if (!pScDoc)
diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
index 89a720e..b089a39 100644
--- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
+++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
@@ -1471,6 +1471,8 @@ Rectangle ScAccessibleSpreadsheet::GetVisCells(const Rectangle& rVisArea)
sal_Bool SAL_CALL ScAccessibleSpreadsheet::selectRow( sal_Int32 row )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException, std::exception)
{
+ SolarMutexGuard g;
+
if (IsFormulaMode())
{
return sal_False;
@@ -1487,6 +1489,8 @@ sal_Bool SAL_CALL ScAccessibleSpreadsheet::selectRow( sal_Int32 row )
sal_Bool SAL_CALL ScAccessibleSpreadsheet::selectColumn( sal_Int32 column )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException, std::exception)
{
+ SolarMutexGuard g;
+
if (IsFormulaMode())
{
return sal_False;
@@ -1503,6 +1507,8 @@ sal_Bool SAL_CALL ScAccessibleSpreadsheet::selectColumn( sal_Int32 column )
sal_Bool SAL_CALL ScAccessibleSpreadsheet::unselectRow( sal_Int32 row )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException, std::exception)
{
+ SolarMutexGuard g;
+
if (IsFormulaMode())
{
return sal_False;
@@ -1520,6 +1526,8 @@ sal_Bool SAL_CALL ScAccessibleSpreadsheet::unselectRow( sal_Int32 row )
sal_Bool SAL_CALL ScAccessibleSpreadsheet::unselectColumn( sal_Int32 column )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException, std::exception)
{
+ SolarMutexGuard g;
+
if (IsFormulaMode())
{
return sal_False;
commit e3e4f19bbc5411b744f09cf6aede541afc1dd058
Author: Michael Stahl <mstahl at redhat.com>
Date: Mon Feb 10 23:06:52 2014 +0100
sd: add some missing locks in new code
Change-Id: Id0efc9a0e108886c261e75bc109e090a16fba960
diff --git a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx
index ab724db..b8fac52 100644
--- a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx
+++ b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx
@@ -837,6 +837,8 @@ uno::Any SAL_CALL AccessibleDocumentViewBase::getExtendedAttributes()
::com::sun::star::uno::RuntimeException,
std::exception)
{
+ ::osl::MutexGuard aGuard (maMutex);
+
uno::Any anyAtrribute;
OUString sValue;
if (mpViewShell && mpViewShell->ISA(::sd::DrawViewShell))
diff --git a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
index 7ee44ba..f597a1f 100644
--- a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
+++ b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
@@ -262,6 +262,8 @@ OUString SAL_CALL
AccessibleDrawDocumentView::getAccessibleName(void)
throw (::com::sun::star::uno::RuntimeException)
{
+ SolarMutexGuard g;
+
OUString sName = SdResId(SID_SD_A11Y_D_PRESENTATION);
::sd::View* pSdView = static_cast< ::sd::View* >( maShapeTreeInfo.GetSdrView() );
if ( pSdView )
@@ -477,6 +479,8 @@ uno::Sequence< sal_Int32 > SAL_CALL
AccessibleDrawDocumentView::getGroupPosition( const uno::Any& rAny )
throw (uno::RuntimeException)
{
+ SolarMutexGuard g;
+
// we will return the:
// [0] group level(always be 0 now)
// [1] similar items counts in the group
@@ -549,6 +553,8 @@ uno::Sequence< sal_Int32 > SAL_CALL
OUString AccessibleDrawDocumentView::getObjectLink( const uno::Any& rAny )
throw (uno::RuntimeException, std::exception)
{
+ SolarMutexGuard g;
+
OUString aRet;
//get the xShape of the current selected drawing object
uno::Reference<XAccessibleContext> xAccContent;
@@ -890,6 +896,8 @@ void SAL_CALL AccessibleDrawDocumentView::disposing (void)
SAL_CALL AccessibleDrawDocumentView::get_AccFlowTo(const ::com::sun::star::uno::Any& rAny, sal_Int32 nType)
throw ( ::com::sun::star::uno::RuntimeException )
{
+ SolarMutexGuard g;
+
const sal_Int32 SPELLCHECKFLOWTO = 1;
const sal_Int32 FINDREPLACEFLOWTO = 2;
if ( nType == SPELLCHECKFLOWTO )
diff --git a/sd/source/ui/accessibility/AccessibleOutlineView.cxx b/sd/source/ui/accessibility/AccessibleOutlineView.cxx
index 981f03c..4980d77 100644
--- a/sd/source/ui/accessibility/AccessibleOutlineView.cxx
+++ b/sd/source/ui/accessibility/AccessibleOutlineView.cxx
@@ -146,6 +146,8 @@ OUString SAL_CALL
AccessibleOutlineView::getAccessibleName(void)
throw (::com::sun::star::uno::RuntimeException)
{
+ SolarMutexGuard g;
+
OUString sName = SdResId(SID_SD_A11Y_D_PRESENTATION);
::sd::View* pSdView = static_cast< ::sd::View* >( maShapeTreeInfo.GetSdrView() );
if ( pSdView )
commit 368cff78a4be5bcbfc3e0d72ed8db4ef71bc892a
Author: Michael Stahl <mstahl at redhat.com>
Date: Mon Feb 10 21:08:07 2014 +0100
accessibility: add some missing locks in new code
Change-Id: Ic38a07c592a89973ca1df807505f87910e84a17f
diff --git a/accessibility/inc/accessibility/extended/accessiblelistbox.hxx b/accessibility/inc/accessibility/extended/accessiblelistbox.hxx
index 58d22a5..ee0ae64 100644
--- a/accessibility/inc/accessibility/extended/accessiblelistbox.hxx
+++ b/accessibility/inc/accessibility/extended/accessiblelistbox.hxx
@@ -66,6 +66,8 @@ namespace accessibility
void RemoveChildEntries(SvTreeListEntry*);
+ sal_Int32 GetRoleType();
+
public:
/** OAccessibleBase needs a valid view
@param _rListBox
@@ -112,8 +114,6 @@ namespace accessibility
::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);
void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
- sal_Int32 SAL_CALL getRoleType();
-
private:
typedef std::map< SvTreeListEntry*, ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > > MAP_ENTRY;
diff --git a/accessibility/inc/accessibility/extended/accessiblelistboxentry.hxx b/accessibility/inc/accessibility/extended/accessiblelistboxentry.hxx
index 57c4a8b..06addbd 100644
--- a/accessibility/inc/accessibility/extended/accessiblelistboxentry.hxx
+++ b/accessibility/inc/accessibility/extended/accessiblelistboxentry.hxx
@@ -229,8 +229,7 @@ namespace accessibility
private:
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > implGetParentAccessible( ) const;
SvTreeListEntry* GetRealChild(sal_Int32 nIndex);
- public:
- sal_Int32 SAL_CALL getRoleType();
+ sal_Int32 GetRoleType();
};
//........................................................................
diff --git a/accessibility/source/extended/accessiblelistbox.cxx b/accessibility/source/extended/accessiblelistbox.cxx
index eced1e5..795e66a 100644
--- a/accessibility/source/extended/accessiblelistbox.cxx
+++ b/accessibility/source/extended/accessiblelistbox.cxx
@@ -400,7 +400,7 @@ namespace accessibility
return m_xParent;
}
// -----------------------------------------------------------------------------
- sal_Int32 SAL_CALL AccessibleListBox::getRoleType()
+ sal_Int32 AccessibleListBox::GetRoleType()
{
sal_Int32 nCase = 0;
SvTreeListEntry* pEntry = getListBox()->GetEntry(0);
@@ -428,8 +428,12 @@ namespace accessibility
}
return nCase;
}
- sal_Int16 SAL_CALL AccessibleListBox::getAccessibleRole( ) throw (RuntimeException)
+
+ sal_Int16 SAL_CALL AccessibleListBox::getAccessibleRole()
+ throw (RuntimeException)
{
+ ::comphelper::OExternalLockGuard aGuard( this );
+
if(getListBox())
{
short nType = getListBox()->GetAllEntriesAccessibleRoleType();
@@ -444,7 +448,7 @@ namespace accessibility
if(!bHasButtons && (getListBox()->GetTreeFlags() & TREEFLAG_CHKBTN))
return AccessibleRole::LIST;
else
- if(getRoleType() == 0)
+ if (GetRoleType() == 0)
return AccessibleRole::LIST;
else
return AccessibleRole::TREE;
diff --git a/accessibility/source/extended/accessiblelistboxentry.cxx b/accessibility/source/extended/accessiblelistboxentry.cxx
index 3d2cefa..cdbf943 100644
--- a/accessibility/source/extended/accessiblelistboxentry.cxx
+++ b/accessibility/source/extended/accessiblelistboxentry.cxx
@@ -390,7 +390,7 @@ namespace accessibility
return m_aEntryPath.empty() ? -1 : m_aEntryPath.back();
}
// -----------------------------------------------------------------------------
- sal_Int32 SAL_CALL AccessibleListBoxEntry::getRoleType()
+ sal_Int32 AccessibleListBoxEntry::GetRoleType()
{
sal_Int32 nCase = 0;
SvTreeListEntry* pEntry = getListBox()->GetEntry(0);
@@ -421,6 +421,9 @@ namespace accessibility
// -----------------------------------------------------------------------------
sal_Int16 SAL_CALL AccessibleListBoxEntry::getAccessibleRole( ) throw (RuntimeException)
{
+ SolarMutexGuard aSolarGuard;
+ ::osl::MutexGuard aGuard( m_aMutex );
+
SvTreeListBox* pBox = getListBox();
if(pBox)
{
@@ -445,7 +448,7 @@ namespace accessibility
return AccessibleRole::LABEL;
}
}
- if(getRoleType() == 0)
+ if (GetRoleType() == 0)
return AccessibleRole::LIST_ITEM;
else
//o is: return AccessibleRole::LABEL;
@@ -456,6 +459,9 @@ namespace accessibility
// -----------------------------------------------------------------------------
OUString SAL_CALL AccessibleListBoxEntry::getAccessibleDescription( ) throw (RuntimeException)
{
+ SolarMutexGuard aSolarGuard;
+ ::osl::MutexGuard aGuard( m_aMutex );
+
SvTreeListEntry* pEntry = getListBox()->GetEntryFromPath( m_aEntryPath );
if( getAccessibleRole() == AccessibleRole::TREE_ITEM )
{
commit 06d5616f65c6195b65d06f3733a4b325b74f3877
Author: Michael Stahl <mstahl at redhat.com>
Date: Mon Feb 10 20:39:25 2014 +0100
svtools: add some missing locks in new code
Change-Id: I6f000fb0f205b437e4ff5238c8ede5735c403077
diff --git a/svtools/source/control/valueacc.cxx b/svtools/source/control/valueacc.cxx
index cba9d06..786ad10 100644
--- a/svtools/source/control/valueacc.cxx
+++ b/svtools/source/control/valueacc.cxx
@@ -307,6 +307,7 @@ uno::Reference< accessibility::XAccessibleRelationSet > SAL_CALL ValueSetAcc::ge
throw (uno::RuntimeException)
{
ThrowIfDisposed();
+ SolarMutexGuard g;
uno::Reference< accessibility::XAccessibleRelationSet > xRelSet;
Window* pWindow = (Window*)mpParent;
if ( pWindow )
diff --git a/svtools/source/control/vclxaccessibleheaderbar.cxx b/svtools/source/control/vclxaccessibleheaderbar.cxx
index de2b277..e610875 100644
--- a/svtools/source/control/vclxaccessibleheaderbar.cxx
+++ b/svtools/source/control/vclxaccessibleheaderbar.cxx
@@ -26,6 +26,7 @@
#include <cppuhelper/typeprovider.hxx>
#include <comphelper/sequence.hxx>
#include <com/sun/star/accessibility/AccessibleRole.hpp>
+#include <vcl/svapp.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -100,6 +101,8 @@ Sequence< ::rtl::OUString > VCLXAccessibleHeaderBar::getSupportedServiceNames()
sal_Int32 SAL_CALL VCLXAccessibleHeaderBar::getAccessibleChildCount( )
throw (::com::sun::star::uno::RuntimeException)
{
+ SolarMutexGuard g;
+
sal_Int32 nCount = 0;
if ( m_pHeadBar )
nCount = m_pHeadBar->GetItemCount();
@@ -109,6 +112,8 @@ sal_Int32 SAL_CALL VCLXAccessibleHeaderBar::getAccessibleChildCount( )
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL
VCLXAccessibleHeaderBar::getAccessibleChild( sal_Int32 i ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException)
{
+ SolarMutexGuard g;
+
if ( i < 0 || i >= getAccessibleChildCount() )
throw IndexOutOfBoundsException();
@@ -130,8 +135,10 @@ sal_Int16 SAL_CALL VCLXAccessibleHeaderBar::getAccessibleRole( ) throw (::com::
return com::sun::star::accessibility::AccessibleRole::LIST;
}
-void SAL_CALL VCLXAccessibleHeaderBar::disposing (void)
+void SAL_CALL VCLXAccessibleHeaderBar::disposing()
{
+ SolarMutexGuard g;
+
ListItems().swap(m_aAccessibleChildren);
VCLXAccessibleComponent::disposing();
}
commit 414fa67bf20f1c8b1b75790142babb655a052ca9
Author: Michael Stahl <mstahl at redhat.com>
Date: Tue Feb 11 12:49:44 2014 +0100
sax: my suggestion was not as good as i thought...
... as indicated by the failing unit test.
Change-Id: I1a8a8b933b10673e71261726dc8887dfe1d3e2ee
diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx
index 48ad958..6642a60 100644
--- a/sax/source/tools/converter.cxx
+++ b/sax/source/tools/converter.cxx
@@ -1545,8 +1545,12 @@ static bool lcl_parseDate(
if (!bIgnoreInvalidOrMissingDate)
{
bSuccess &= (0 < nDay);
+ }
+ if (nMonth > 0) // not possible to check if month was missing
+ {
bSuccess &= (nDay <= lcl_MaxDaysPerMonth(nMonth, nYear));
}
+ else assert(bIgnoreInvalidOrMissingDate);
}
if (bSuccess && (nPos < string.getLength()))
More information about the Libreoffice-commits
mailing list