https://bugs.freedesktop.org/show_bug.cgi?id=37044
This is one of our oldest bugs, looking at the backtraces I'm fairly
sure this has to be triggered by having two differently-layout structs
called TransliterationChgData, one in sw and one in editeng, seeing as
the crash is happening in editeng on calling
TransliterationChgData::push_back in sw and it has no place going
anywhere near editeng.
So simply renaming the two structs to be different would likely fix it,
http://cgit.freedesktop.org/libreoffice/core/commit/?id=7080d629c82422a419d38051536c7711f8abe53e
attached backport to 3-5 to fix minor conflicts.
C.
From 805864fd06f7dddc69420c878235452baa330842 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Thu, 10 May 2012 10:15:34 +0100
Subject: [PATCH] Resolves: fdo#37044 two different TransliterationChgData
structs
There are two structs called TransliterationChgData with different
layout. The crashes on MacOSX must be due to this. Rename them
so they've different names.
Change-Id: I887a33bed26b339e229b7fb1ef8dddd192f6fae3
(cherry picked from commit 7080d629c82422a419d38051536c7711f8abe53e)
Conflicts:
editeng/source/editeng/impedit4.cxx
---
editeng/source/editeng/impedit4.cxx | 25 +++++++++++++------------
sw/source/core/txtnode/txtedt.cxx | 21 ++++++++++++---------
2 files changed, 25 insertions(+), 21 deletions(-)
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index ff441f1..5b80c17 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -2659,16 +2659,17 @@ void ImpEditEngine::SetAutoCompleteText( const String& rStr, sal_Bool
bClearTipW
Help::ShowQuickHelp( pActiveView->GetWindow(), Rectangle(), String(), 0 );
}
-
-struct TransliterationChgData
+namespace
{
- sal_uInt16 nStart;
- xub_StrLen nLen;
- EditSelection aSelection;
- String aNewText;
- uno::Sequence< sal_Int32 > aOffsets;
-};
-
+ struct eeTransliterationChgData
+ {
+ sal_uInt16 nStart;
+ xub_StrLen nLen;
+ EditSelection aSelection;
+ String aNewText;
+ uno::Sequence< sal_Int32 > aOffsets;
+ };
+}
EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, sal_Int32
nTransliterationMode )
{
@@ -2721,8 +2722,8 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection&
rSelection,
//! This way the offsets for the yet to be changed words will be
//! left unchanged by the already replaced text.
//! For this we temporarily save the changes to be done in this vector
- std::vector< TransliterationChgData > aChanges;
- TransliterationChgData aChgData;
+ std::vector< eeTransliterationChgData > aChanges;
+ eeTransliterationChgData aChgData;
if (nTransliterationMode == i18n::TransliterationModulesExtra::TITLE_CASE)
{
@@ -2945,7 +2946,7 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection&
rSelection,
// yet unchanged text parts remain the same.
for (size_t i = 0; i < aChanges.size(); ++i)
{
- const TransliterationChgData &rData = aChanges[ aChanges.size() - 1 - i ];
+ const eeTransliterationChgData& rData = aChanges[ aChanges.size() - 1 - i ];
bChanges = sal_True;
if (rData.nLen != rData.aNewText.Len())
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index 186d4ea..d153212 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -1498,13 +1498,16 @@ sal_Bool SwTxtNode::Hyphenate( SwInterHyphInfo &rHyphInf )
return sal_False;
}
-struct TransliterationChgData
+namespace
{
- xub_StrLen nStart;
- xub_StrLen nLen;
- String sChanged;
- Sequence< sal_Int32 > aOffsets;
-};
+ struct swTransliterationChgData
+ {
+ xub_StrLen nStart;
+ xub_StrLen nLen;
+ String sChanged;
+ Sequence< sal_Int32 > aOffsets;
+ };
+}
// change text to Upper/Lower/Hiragana/Katagana/...
void SwTxtNode::TransliterateText(
@@ -1527,8 +1530,8 @@ void SwTxtNode::TransliterateText(
//! This way the offsets for the yet to be changed words will be
//! left unchanged by the already replaced text.
//! For this we temporarily save the changes to be done in this vector
- std::vector< TransliterationChgData > aChanges;
- TransliterationChgData aChgData;
+ std::vector< swTransliterationChgData > aChanges;
+ swTransliterationChgData aChgData;
if (rTrans.getType() == (sal_uInt32)TransliterationModulesExtra::TITLE_CASE)
{
@@ -1732,7 +1735,7 @@ void SwTxtNode::TransliterateText(
// yet unchanged text parts remain the same.
for (size_t i = 0; i < aChanges.size(); ++i)
{
- TransliterationChgData &rData = aChanges[ aChanges.size() - 1 - i ];
+ swTransliterationChgData &rData = aChanges[ aChanges.size() - 1 - i ];
if (pUndo)
pUndo->AddChanges( *this, rData.nStart, rData.nLen, rData.aOffsets );
ReplaceTextOnly( rData.nStart, rData.nLen, rData.sChanged, rData.aOffsets );
--
1.7.7.6
Context
- [REVIEW 3-5] fdo#37044 crash on mac with transliteration · Caolán McNamara
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.