[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - accessibility/source

2017-07-11 Thread Michael Stahl
 accessibility/source/extended/accessibletabbarbase.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5f345e3a19bf7cad56951ed90fdf78f03a15b96a
Author: Michael Stahl 
Date:   Fri Jun 30 15:23:15 2017 +0200

tdf#108838 accessibility: fix horrible memory leak in AccessibleTabBarBase

Reproducing tdf#108833 failed because applying the Master Page takes
> 2 hours; the time is spent calling vcl::Window listeners, of which
there were some 39525 after a couple minutes, almost all of which
AccessibleTabBarBase.

AccessibleTabBarBase::WindowEventListener() has an inverted condition
that suppresses the event that is generated from TabBar::Clear()
and thus when DrawViewShell::ResetActualPage() calls Clear() no
AccessibleTabBarPage is removed but then the InsertPage() calls create
duplicate objects that again register as listeners.

The condition is obviously inverted given the CVS commit message:

1.2.88.1
log
@#135353# do not pass VCLEVENT_TABBAR_PAGEREMOVED (all) to objects other 
than AccessibleTabBarPageList
@
text
a69 8

if( ( pWinEvent->GetId() == VCLEVENT_TABBAR_PAGEREMOVED ) &&
( (sal_uInt16)(sal_IntPtr) pWinEvent->GetData() == 
TAB_PAGE_NOTFOUND ) &&
( dynamic_cast< AccessibleTabBarPageList *> (this) != NULL ) )
{
return 0;
}

Change-Id: I2a3b86bbd0f0251a966f41b316a3b313517df24f
(cherry picked from commit b2b085441dc79fb78607dbf1969c12a40db58214)
Reviewed-on: https://gerrit.libreoffice.org/39416
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 
Reviewed-by: Eike Rathke 

diff --git a/accessibility/source/extended/accessibletabbarbase.cxx 
b/accessibility/source/extended/accessibletabbarbase.cxx
index f75d4572a789..b137da3acdd5 100644
--- a/accessibility/source/extended/accessibletabbarbase.cxx
+++ b/accessibility/source/extended/accessibletabbarbase.cxx
@@ -50,7 +50,7 @@ IMPL_LINK( AccessibleTabBarBase, WindowEventListener, 
VclWindowEvent&, rEvent, v
 
 if( ( rEvent.GetId() == VCLEVENT_TABBAR_PAGEREMOVED ) &&
 ( (sal_uInt16)reinterpret_cast(rEvent.GetData()) == 
TabBar::PAGE_NOT_FOUND ) &&
-( dynamic_cast< AccessibleTabBarPageList *> (this) != nullptr ) )
+(dynamic_cast(this) == nullptr))
 {
 return;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - accessibility/source

2017-01-13 Thread Caolán McNamara
 accessibility/source/standard/vclxaccessibletabcontrol.cxx |   11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

New commits:
commit 252f2d4978e5861cb62cca7c1553be63a7bae119
Author: Caolán McNamara 
Date:   Thu Jan 12 14:03:43 2017 +

a11y crash on accessing disposed TabControl during close of impress

Change-Id: I3064eb136ed3a6a32acd64bfb2f6fbe31595e1cf
(cherry picked from commit ff30d20c1ae3a30717123c267d52eb2b3105a1b7)
Reviewed-on: https://gerrit.libreoffice.org/32997
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 

diff --git a/accessibility/source/standard/vclxaccessibletabcontrol.cxx 
b/accessibility/source/standard/vclxaccessibletabcontrol.cxx
index 12837d6..b715964 100644
--- a/accessibility/source/standard/vclxaccessibletabcontrol.cxx
+++ b/accessibility/source/standard/vclxaccessibletabcontrol.cxx
@@ -43,9 +43,14 @@ VCLXAccessibleTabControl::VCLXAccessibleTabControl( 
VCLXWindow* pVCLXWindow )
 :VCLXAccessibleComponent( pVCLXWindow )
 {
 m_pTabControl = static_cast< TabControl* >( GetWindow().get() );
-
-if ( m_pTabControl )
-m_aAccessibleChildren.assign( m_pTabControl->GetPageCount(), 
Reference< XAccessible >() );
+if (!m_pTabControl)
+return;
+if (m_pTabControl->isDisposed())
+{
+m_pTabControl.clear();
+return;
+}
+m_aAccessibleChildren.assign( m_pTabControl->GetPageCount(), Reference< 
XAccessible >() );
 }
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - accessibility/source

2016-12-19 Thread Julien Nabet
 accessibility/source/extended/AccessibleGridControl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 899ea62194d59a69e04823962a3170f762a02e9b
Author: Julien Nabet 
Date:   Mon Dec 19 22:33:12 2016 +0100

tdf#104767: Fix calculus of child index in commitTableEvent (accessibility)

bt:
1  0x2aaade2fea5b in 
accessibility::AccessibleGridControlTableBase::ensureIsValidIndex 
(this=0x586abdb0, nChildIndex=11)
at 
/home/julien/lo/libreoffice/accessibility/source/extended/AccessibleGridControlTableBase.cxx:257
2  0x2aaade2f97f2 in 
accessibility::AccessibleGridControlTable::getAccessibleChild 
(this=0x586abdb0, nChildIndex=11)
at 
/home/julien/lo/libreoffice/accessibility/source/extended/AccessibleGridControlTable.cxx:60
3  0x2aaade2ee054 in 
accessibility::AccessibleGridControl::commitTableEvent (this=0x57e97500, 
_nEventId=5, _rNewValue=uno::Any(void), _rOldValue=uno::Any(void))
at 
/home/julien/lo/libreoffice/accessibility/source/extended/AccessibleGridControl.cxx:354

Seems a regression from 
https://cgit.freedesktop.org/libreoffice/core/commit/?id=0f32ba56a1e775e8ecd6c827ebd48f7f2fb51c81

Change-Id: Ia973eb381832da27ecc39fc5273f67a685d5a7bb
Reviewed-on: https://gerrit.libreoffice.org/32205
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 
(cherry picked from commit 4e1c423358f60f7516a1682c97837edd21addcf3)
Reviewed-on: https://gerrit.libreoffice.org/32209

diff --git a/accessibility/source/extended/AccessibleGridControl.cxx 
b/accessibility/source/extended/AccessibleGridControl.cxx
index 2de159c..b486f62 100644
--- a/accessibility/source/extended/AccessibleGridControl.cxx
+++ b/accessibility/source/extended/AccessibleGridControl.cxx
@@ -351,7 +351,7 @@ void AccessibleGridControl::commitTableEvent(sal_Int16 
_nEventId,const Any& _rNe
 if (nCurrentRow > -1 && nCurrentCol > -1)
 {
 sal_Int32 nColumnCount = m_aTable.GetColumnCount();
-xChild = m_xImpl->m_pTable->getAccessibleChild(nCurrentRow * 
nCurrentCol + nColumnCount);
+xChild = m_xImpl->m_pTable->getAccessibleChild(nCurrentRow * 
nColumnCount + nCurrentCol);
 }
 m_xImpl->m_pTable->commitEvent(_nEventId, 
makeAny(xChild),_rOldValue);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - accessibility/source include/vcl vcl/source

2016-12-10 Thread Tamás Zolnai
 accessibility/source/standard/vclxaccessibleedit.cxx |   15 ++
 include/vcl/texteng.hxx  |2 +
 vcl/source/edit/texteng.cxx  |   20 +++
 3 files changed, 37 insertions(+)

New commits:
commit b88a5657a95e1b94498ed238e2b4e0fb0418d40b
Author: Tamás Zolnai 
Date:   Sat Dec 10 11:23:38 2016 +

tdf#93430: Return the right offsets for runs

MultiLineEdit is a special control which can have
more text portions with different text attributes.

Change-Id: Iab51dba0d0344fad4358f4961c968c031b1660b6
Reviewed-on: https://gerrit.libreoffice.org/31813
Tested-by: Jenkins 
Reviewed-by: Tamás Zolnai 
(cherry picked from commit 8d52045853cecb716138d51b8b6ad0272a86af86)
Reviewed-on: https://gerrit.libreoffice.org/31832
Tested-by: Tamás Zolnai 

diff --git a/accessibility/source/standard/vclxaccessibleedit.cxx 
b/accessibility/source/standard/vclxaccessibleedit.cxx
index 750ce0a..2eff38f 100644
--- a/accessibility/source/standard/vclxaccessibleedit.cxx
+++ b/accessibility/source/standard/vclxaccessibleedit.cxx
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -475,6 +476,20 @@ css::accessibility::TextSegment 
VCLXAccessibleEdit::getTextAtIndex( sal_Int32 nI
 {
 OExternalLockGuard aGuard( this );
 
+// Override general text component behavior: MultiLineEdit can have more 
text portions
+if ( aTextType == AccessibleTextType::ATTRIBUTE_RUN )
+{
+VclPtr pMulitLineEdit = GetAsDynamic< 
VclMultiLineEdit >();
+if ( pMulitLineEdit )
+{
+ExtTextEngine* pTextEngine = pMulitLineEdit->GetTextEngine();
+TextPaM aCursor( 0, nIndex );
+TextSegment aResult;
+pTextEngine->GetTextPortionRange( aCursor, aResult.SegmentStart, 
aResult.SegmentEnd );
+return aResult;
+}
+}
+
 return VCLXAccessibleTextComponent::getTextAtIndex( nIndex, aTextType );
 }
 
diff --git a/include/vcl/texteng.hxx b/include/vcl/texteng.hxx
index 96ac426..4c6c3df 100644
--- a/include/vcl/texteng.hxx
+++ b/include/vcl/texteng.hxx
@@ -257,6 +257,8 @@ public:
 sal_Int32   GetTextLen( sal_uInt32 nParagraph ) const;
 longGetTextHeight( sal_uInt32 nParagraph ) const;
 
+voidGetTextPortionRange(const TextPaM& rPaM, sal_Int32& 
nStart, sal_Int32& nEnd);
+
 sal_uInt16  GetLineCount( sal_uInt32 nParagraph ) const;
 sal_Int32   GetLineLen( sal_uInt32 nParagraph, sal_uInt16 nLine ) 
const;
 
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx
index f91e69d..3ac06dd 100644
--- a/vcl/source/edit/texteng.cxx
+++ b/vcl/source/edit/texteng.cxx
@@ -1212,6 +1212,26 @@ long TextEngine::CalcTextWidth( sal_uInt32 nPara, 
sal_Int32 nPortionStart, sal_I
 return nWidth;
 }
 
+void TextEngine::GetTextPortionRange(const TextPaM& rPaM, sal_Int32& nStart, 
sal_Int32& nEnd)
+{
+nStart = 0;
+nEnd = 0;
+TEParaPortion* pParaPortion = mpTEParaPortions->GetObject( rPaM.GetPara() 
);
+for ( size_t i = 0; i < pParaPortion->GetTextPortions().size(); ++i )
+{
+TETextPortion* pTextPortion = pParaPortion->GetTextPortions()[ i ];
+if (nStart + pTextPortion->GetLen() > rPaM.GetIndex())
+{
+nEnd = nStart + pTextPortion->GetLen();
+return;
+}
+else
+{
+nStart += pTextPortion->GetLen();
+}
+}
+}
+
 sal_uInt16 TextEngine::GetLineCount( sal_uInt32 nParagraph ) const
 {
 SAL_WARN_IF( nParagraph >= mpTEParaPortions->Count(), "vcl", 
"GetLineCount: Out of range" );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - accessibility/source include/vcl vcl/unx

2016-12-09 Thread Tamás Zolnai
 accessibility/source/standard/vclxaccessibleedit.cxx |   44 ++-
 include/vcl/vclmedit.hxx |2 
 vcl/unx/gtk/a11y/atktext.cxx |   18 +--
 vcl/unx/gtk/a11y/atktextattributes.cxx   |6 ++
 4 files changed, 63 insertions(+), 7 deletions(-)

New commits:
commit b815cdf1933813a6864350ea1baade0bccee9ec4
Author: Tamás Zolnai 
Date:   Sun Dec 4 00:03:24 2016 +

tdf#93430: Cannot get accessible text attributes for 'Not in dictionary' 
entry

Squashed from two commits:

tdf#93430: Get run attributes of text objects

.. which are not paragraphs.

Note: For some reason in character attributes sequence
we have a wrong Any value for "CharPosture" property.

Signed-off-by: Tamás Zolnai 
Reviewed-on: https://gerrit.libreoffice.org/31591
(cherry picked from commit 17773e1a8dd6e97f57db111819338c418f819cef)

tdf#93430: Cannot get accessible text attributes for 'Not in dictionary' 
entry

Reviewed-on: https://gerrit.libreoffice.org/31778
Reviewed-by: Tamás Zolnai 
Tested-by: Tamás Zolnai 
(cherry picked from commit e0d8c3821b8fa1e7d00f7b4a7d007f9cb5c592a5)

Change-Id: Ia45526c01cc381d3d6a1b56dbf4f03fdd38a0989
aa2b4fdb582025b763d43f0f24960e2ccee708e3
Reviewed-on: https://gerrit.libreoffice.org/31792
Tested-by: Jenkins 
Reviewed-by: Tamás Zolnai 

diff --git a/accessibility/source/standard/vclxaccessibleedit.cxx 
b/accessibility/source/standard/vclxaccessibleedit.cxx
index 432315a..750ce0a 100644
--- a/accessibility/source/standard/vclxaccessibleedit.cxx
+++ b/accessibility/source/standard/vclxaccessibleedit.cxx
@@ -36,6 +36,10 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
 #include 
 #include 
 
@@ -304,8 +308,46 @@ sal_Unicode VCLXAccessibleEdit::getCharacter( sal_Int32 
nIndex ) throw (IndexOut
 Sequence< PropertyValue > VCLXAccessibleEdit::getCharacterAttributes( 
sal_Int32 nIndex, const Sequence< OUString >& aRequestedAttributes ) throw 
(IndexOutOfBoundsException, RuntimeException, std::exception)
 {
 OExternalLockGuard aGuard( this );
+Sequence< PropertyValue > aProperties = 
VCLXAccessibleTextComponent::getCharacterAttributes( nIndex, 
aRequestedAttributes );
 
-return VCLXAccessibleTextComponent::getCharacterAttributes( nIndex, 
aRequestedAttributes );
+// Handle multiline edit character properties
+VclPtr pMulitLineEdit = GetAsDynamic< VclMultiLineEdit 
>();
+if ( pMulitLineEdit )
+{
+ExtTextEngine* pTextEngine = pMulitLineEdit->GetTextEngine();
+TextPaM aCursor( 0, nIndex );
+const TextAttribFontColor* pFontColor = static_cast(pTextEngine->FindAttrib( aCursor, TEXTATTR_FONTCOLOR ));
+if ( pFontColor )
+{
+for (PropertyValue& aValue : aProperties )
+{
+if (aValue.Name == "CharColor")
+{
+aValue.Value = css::uno::makeAny(static_cast< sal_Int32 
>(COLORDATA_RGB(pFontColor->GetColor().GetColor(;
+break;
+}
+}
+}
+}
+
+// Set default character color if it is not set yet to a valid value
+for (PropertyValue& aValue : aProperties )
+{
+if (aValue.Name == "CharColor")
+{
+if ( aValue.Value == sal_Int32(-1) )
+{
+OutputDevice* pDev = Application::GetDefaultDevice();
+if ( pDev )
+{
+aValue.Value = css::uno::makeAny(static_cast< sal_Int32 
>(pDev->GetSettings().GetStyleSettings().GetFieldTextColor().GetColor()));
+}
+}
+break;
+}
+}
+
+return aProperties;
 }
 
 
diff --git a/include/vcl/vclmedit.hxx b/include/vcl/vclmedit.hxx
index 84b5a6b..8461413 100644
--- a/include/vcl/vclmedit.hxx
+++ b/include/vcl/vclmedit.hxx
@@ -32,6 +32,8 @@ class TextView;
 
 class VCL_DLLPUBLIC VclMultiLineEdit : public Edit
 {
+friend class VCLXAccessibleEdit;
+
 private:
 ImpVclMEdit*  pImpVclMEdit;
 
diff --git a/vcl/unx/gtk/a11y/atktext.cxx b/vcl/unx/gtk/a11y/atktext.cxx
index 14cf916..fbfd0fb 100644
--- a/vcl/unx/gtk/a11y/atktext.cxx
+++ b/vcl/unx/gtk/a11y/atktext.cxx
@@ -482,12 +482,20 @@ text_wrapper_get_run_attributes( AtkText*text,
 
 css::uno::Reference pText
 = getText( text );
-css::uno::Reference
-pTextAttributes = getTextAttributes( text );
-if( pText.is() && pTextAttributes.is() )
+if( pText.is())
 {
-uno::Sequence< beans::PropertyValue > aAttributeList =
-pTextAttributes->getRunAttributes( offset, uno::Sequence< 
OUString > () );
+

[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - accessibility/source

2016-11-26 Thread Tamás Zolnai
 accessibility/source/standard/vclxaccessiblebox.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b9f2330497427a3d5938ec0a2b15b18ce4571404
Author: Tamás Zolnai 
Date:   Sat Nov 26 18:22:42 2016 +

tdf#99687: Find Text widget fails to emit object:text-caret-moved events

Must be an integration bug:
efb23f29983f87104a684e7fab00b84fc59d131d

Change-Id: I53b15975fb97a299103fab870307b03b2607e9e5
Reviewed-on: https://gerrit.libreoffice.org/31238
Reviewed-by: Tamás Zolnai 
Tested-by: Tamás Zolnai 
(cherry picked from commit c1afa80bb3613c9202fa9d83447fdd5d57667cb6)
Reviewed-on: https://gerrit.libreoffice.org/31248
Tested-by: Jenkins 

diff --git a/accessibility/source/standard/vclxaccessiblebox.cxx 
b/accessibility/source/standard/vclxaccessiblebox.cxx
index 6f3997e..4a28c71 100644
--- a/accessibility/source/standard/vclxaccessiblebox.cxx
+++ b/accessibility/source/standard/vclxaccessiblebox.cxx
@@ -236,7 +236,7 @@ void VCLXAccessibleBox::ProcessWindowEvent (const 
VclWindowEvent& rVclWindowEven
 
 case VCLEVENT_EDIT_MODIFY:
 case VCLEVENT_EDIT_SELECTIONCHANGED:
- // case VCLEVENT_EDIT_CARETCHANGED:
+case VCLEVENT_EDIT_CARETCHANGED:
 // Modify/Selection events are handled by the combo box instead of
 // directly by the edit field (Why?).  Therefore, delegate this
 // call to the edit field.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits