ooo-build r12558 - in trunk: . patches/dev300
- From: pmladek svn gnome org
- To: svn-commits-list gnome org
- Subject: ooo-build r12558 - in trunk: . patches/dev300
- Date: Fri, 16 May 2008 16:26:29 +0100 (BST)
Author: pmladek
Date: Fri May 16 15:26:28 2008
New Revision: 12558
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12558&view=rev
Log:
2008-05-16 Petr Mladek <pmladek suse cz>
* patches/dev300/sw-field-patch.diff: crash when loading documents
with forms, thanks Florian for hint; n#390953
Modified:
trunk/ChangeLog
trunk/patches/dev300/sw-field-patch.diff
Modified: trunk/patches/dev300/sw-field-patch.diff
==============================================================================
--- trunk/patches/dev300/sw-field-patch.diff (original)
+++ trunk/patches/dev300/sw-field-patch.diff Fri May 16 15:26:28 2008
@@ -528,10 +528,8 @@
case USE_OLD_PRINTER_METRICS:
mbOldPrinterMetrics = value;
-diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
-index a2d1761..2624a4d 100644
---- sw/source/core/doc/docbm.cxx
-+++ sw/source/core/doc/docbm.cxx
+--- sw/source/core/doc/docbm.cxx.old 2008-05-16 17:02:47.000000000 +0200
++++ sw/source/core/doc/docbm.cxx 2008-05-16 17:06:13.000000000 +0200
@@ -100,7 +100,13 @@
#ifndef _NDTXT_HXX
#include "ndtxt.hxx" // for lcl_FixPosition
@@ -546,7 +544,7 @@
SV_IMPL_OP_PTRARR_SORT(SwBookmarks, SwBookmarkPtr)
-@@ -156,7 +162,23 @@ SwBookmark* SwDoc::makeBookmark( /*[in]*/const SwPaM& rPaM, /*[in]*/const KeyCod
+@@ -156,7 +162,23 @@ SwBookmark* SwDoc::makeBookmark( /*[in]*
/*[in]*/IDocumentBookmarkAccess::BookmarkType eMark )
{
SwBookmark *pBM;
@@ -571,7 +569,7 @@
pBM = new SwMark( *rPaM.GetPoint(), rCode, rName, rShortName );
else if( BOOKMARK == eMark || HIDDEN_BOOKMARK == eMark)
{
-@@ -171,10 +193,37 @@ SwBookmark* SwDoc::makeBookmark( /*[in]*/const SwPaM& rPaM, /*[in]*/const KeyCod
+@@ -171,10 +193,44 @@ SwBookmark* SwDoc::makeBookmark( /*[in]*
pBM->pPos2 = new SwPosition( *rPaM.GetMark() );
}
@@ -584,8 +582,15 @@
+ ASSERT(*PBM->pPos1<=*pBM->pPos2, "Bookmark positions not normalized!!!!");
+ const SwTxtNode* pStartTxtNode=this->GetNodes()[pBM->GetPos().nNode]->GetTxtNode();
+ const SwTxtNode* pEndTxtNode=this->GetNodes()[pBM->GetOtherPos()->nNode]->GetTxtNode();
-+ sal_Unicode ch_start=pStartTxtNode->GetTxt().GetChar(pBM->GetPos().nContent.GetIndex());
-+ sal_Unicode ch_end=pEndTxtNode->GetTxt().GetChar(pBM->GetOtherPos()->nContent.GetIndex()-1);
++ xub_StrLen ch_start_pos=pBM->GetPos().nContent.GetIndex();
++ xub_StrLen ch_end_pos=pBM->GetOtherPos()->nContent.GetIndex();
++ if (ch_end_pos==0 || ch_end_pos<=ch_start_pos) {
++ ch_end_pos=ch_start_pos;
++ } else {
++ ch_end_pos--;
++ }
++ sal_Unicode ch_start=pStartTxtNode->GetTxt().GetChar(ch_start_pos);
++ sal_Unicode ch_end=pEndTxtNode->GetTxt().GetChar(ch_end_pos);
+ bool form=(IDocumentBookmarkAccess::FORM_FIELDMARK_NO_TEXT==eMark); /*(pBM->GetName().CompareToAscii(FIELD_FORM_BOOKMARK_PREFIX, strlen(FIELD_FORM_BOOKMARK_PREFIX))==0);*/
+ if (form) {
+ if (ch_start!=CH_TXT_ATR_FORMELEMENT) {
@@ -613,7 +618,7 @@
if( !pBookmarkTbl->Insert( pBM ) )
delete pBM, pBM = 0;
-@@ -194,7 +241,110 @@ SwBookmark* SwDoc::makeBookmark( /*[in]*/const SwPaM& rPaM, /*[in]*/const KeyCod
+@@ -194,7 +250,117 @@ SwBookmark* SwDoc::makeBookmark( /*[in]*
SetModified();
}
}
@@ -714,8 +719,15 @@
+ rtl::OString aOString = ::rtl::OUStringToOString (s, RTL_TEXTENCODING_UTF8);
+ const SwTxtNode* pStartTxtNode=pDoc->GetNodes()[pBM->GetPos().nNode]->GetTxtNode();
+ const SwTxtNode* pEndTxtNode=pDoc->GetNodes()[pBM->GetOtherPos()->nNode]->GetTxtNode();
-+ sal_Unicode ch_start=pStartTxtNode->GetTxt().GetChar(pBM->GetPos().nContent.GetIndex());
-+ sal_Unicode ch_end=pEndTxtNode->GetTxt().GetChar(pBM->GetOtherPos()->nContent.GetIndex()-1);
++ xub_StrLen ch_start_pos=pBM->GetPos().nContent.GetIndex();
++ xub_StrLen ch_end_pos=pBM->GetOtherPos()->nContent.GetIndex()
++ if (ch_end_pos==0 || ch_end_pos<=ch_start_pos) {
++ ch_end_pos=ch_start_pos;
++ } else {
++ ch_end_pos--;
++ }
++ sal_Unicode ch_start=pStartTxtNode->GetTxt().GetChar(ch_start_pos);
++ sal_Unicode ch_end=pEndTxtNode->GetTxt().GetChar(ch_end_pos);
+ printf("CHECK(%s %p[%i/'%c'] %p[%i/'%c']);\n", aOString.getStr(), pStartTxtNode, ch_start, ch_start, pEndTxtNode, ch_end, ch_end);
+ }
+ }
@@ -724,7 +736,7 @@
}
void SwDoc::deleteBookmark( /*[in]*/sal_uInt16 nPos )
-@@ -703,7 +853,7 @@ void _SaveCntntIdx( SwDoc* pDoc, ULONG nNode, xub_StrLen nCntnt,
+@@ -703,7 +869,7 @@ void _SaveCntntIdx( SwDoc* pDoc, ULONG n
}
if( pBkmk->GetOtherPos() && pBkmk->GetOtherPos()->nNode.GetIndex() ==
@@ -733,7 +745,7 @@
{
aSave.SetContent( pBkmk->GetOtherPos()->nContent.GetIndex() );
aSave.IncType();
-@@ -1166,3 +1316,41 @@ void _RestoreCntntIdx( SvULongs& rSaveArr, const SwNode& rNd,
+@@ -1166,3 +1332,41 @@ void _RestoreCntntIdx( SvULongs& rSaveAr
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]