summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorVladimir Glazunov <vg@openoffice.org>2010-08-25 16:13:14 +0200
committerVladimir Glazunov <vg@openoffice.org>2010-08-25 16:13:14 +0200
commitdaa7cc050b020028f582d67778c0bdf68a02ef8c (patch)
treea176cc382ea4106e7fb944541e69d19558d95069 /sw
parent84ba099989ffafebdd9f95b42b16831f3e0a2287 (diff)
parent104e5322c5b511105b26b8c811078da66e6d95b9 (diff)
DEV300: changesets OOO330 up to m5
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/edit/edlingu.cxx28
-rw-r--r--sw/source/filter/ww8/ww8par.cxx2
-rw-r--r--sw/source/filter/ww8/ww8par.hxx1
-rw-r--r--sw/source/filter/ww8/ww8par6.cxx19
-rw-r--r--sw/uiconfig/sglobal/toolbar/findbar.xml8
-rw-r--r--sw/uiconfig/sweb/toolbar/findbar.xml8
-rw-r--r--sw/uiconfig/swriter/toolbar/findbar.xml8
-rw-r--r--sw/uiconfig/swxform/toolbar/findbar.xml8
8 files changed, 59 insertions, 23 deletions
diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx
index d99293071048..c9ab4a591383 100644
--- a/sw/source/core/edit/edlingu.cxx
+++ b/sw/source/core/edit/edlingu.cxx
@@ -1318,8 +1318,12 @@ void SwEditShell::MoveContinuationPosToEndOfCheckedSentence()
void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions, bool bRecheck)
{
+ // Note: rNewPortions.size() == 0 is valid and happens when the whole
+ // sentence got removed in the dialog
+
ASSERT( pSpellIter, "SpellIter missing" );
- if(pSpellIter)
+ if(pSpellIter &&
+ pSpellIter->GetLastPortions().size() > 0) // no portions -> no text to be changed
{
const SpellPortions& rLastPortions = pSpellIter->GetLastPortions();
const SpellContentPositions rLastPositions = pSpellIter->GetLastPositions();
@@ -1330,9 +1334,6 @@ void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions,
// iterate over the new portions, beginning at the end to take advantage of the previously
// saved content positions
- if(!rLastPortions.size())
- return;
-
pDoc->StartUndo( UNDO_OVERWRITE, NULL );
StartAction();
@@ -1344,6 +1345,10 @@ void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions,
sal_uInt32 nRedlinePortions = lcl_CountRedlines(rLastPortions);
if((rLastPortions.size() - nRedlinePortions) == rNewPortions.size())
{
+ DBG_ASSERT( rNewPortions.size() > 0, "rNewPortions should not be empty here" );
+ DBG_ASSERT( rLastPortions.size() > 0, "rLastPortions should not be empty here" );
+ DBG_ASSERT( rLastPositions.size() > 0, "rLastPositions should not be empty here" );
+
//the simple case: the same number of elements on both sides
//each changed element has to be applied to the corresponding source element
svx::SpellPortions::const_iterator aCurrentNewPortion = rNewPortions.end();
@@ -1357,8 +1362,17 @@ void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions,
//jump over redline portions
while(aCurrentOldPortion->bIsHidden)
{
- --aCurrentOldPortion;
- --aCurrentOldPosition;
+ if (aCurrentOldPortion != rLastPortions.begin() &&
+ aCurrentOldPosition != rLastPositions.begin())
+ {
+ --aCurrentOldPortion;
+ --aCurrentOldPosition;
+ }
+ else
+ {
+ DBG_ASSERT( 0, "ApplyChangedSentence: iterator positions broken" );
+ break;
+ }
}
if ( !pCrsr->HasMark() )
pCrsr->SetMark();
@@ -1398,6 +1412,8 @@ void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions,
}
else
{
+ DBG_ASSERT( rLastPositions.size() > 0, "rLastPositions should not be empty here" );
+
//select the complete sentence
SpellContentPositions::const_iterator aCurrentEndPosition = rLastPositions.end();
--aCurrentEndPosition;
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index ba932c33c479..24f36b047a4e 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1857,7 +1857,7 @@ void SwWW8ImplReader::Read_HdFt(bool bIsTitle, int nSect,
bool wwSectionManager::SectionIsProtected(const wwSection &rSection) const
{
- return (!rSection.IsNotProtected());
+ return (mrReader.pWwFib->fReadOnlyRecommended && !rSection.IsNotProtected());
}
void wwSectionManager::SetHdFt(wwSection &rSection, int nSect,
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index 025cf0f588f4..c87035f208a1 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -1164,6 +1164,7 @@ private:
bool GetFontParams(USHORT, FontFamily&, String&, FontPitch&,
rtl_TextEncoding&);
bool SetNewFontAttr(USHORT nFCode, bool bSetEnums, USHORT nWhich);
+ USHORT CorrectResIdForCharset(CharSet nCharSet, USHORT nWhich);
void ResetCharSetVars();
void ResetCJKCharSetVars();
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 1588944e179b..b298f3721b00 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -3551,6 +3551,23 @@ bool SwWW8ImplReader::GetFontParams( USHORT nFCode, FontFamily& reFamily,
return true;
}
+USHORT SwWW8ImplReader::CorrectResIdForCharset(CharSet nCharSet, USHORT nWhich)
+{
+ USHORT nResult = 0;
+
+ switch (nCharSet) {
+ case RTL_TEXTENCODING_MS_932:
+ nResult = RES_CHRATR_CJK_FONT;
+ break;
+
+ default:
+ nResult = nWhich;
+ break;
+ }
+
+ return nResult;
+}
+
bool SwWW8ImplReader::SetNewFontAttr(USHORT nFCode, bool bSetEnums,
USHORT nWhich)
{
@@ -3600,6 +3617,8 @@ bool SwWW8ImplReader::SetNewFontAttr(USHORT nFCode, bool bSetEnums,
SvxFontItem aFont( eFamily, aName, aEmptyStr, ePitch, eDstCharSet, nWhich);
+ nWhich = CorrectResIdForCharset(eSrcCharSet, nWhich);
+
if( bSetEnums )
{
if( pAktColl ) // StyleDef
diff --git a/sw/uiconfig/sglobal/toolbar/findbar.xml b/sw/uiconfig/sglobal/toolbar/findbar.xml
index 9ef9d8a1a78f..078c0fc5bed5 100644
--- a/sw/uiconfig/sglobal/toolbar/findbar.xml
+++ b/sw/uiconfig/sglobal/toolbar/findbar.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
- <toolbar:toolbaritem xlink:href=".uno:FindText" toolbar:helpid="helpid:100105" />
- <toolbar:toolbaritem xlink:href=".uno:DownSearch" toolbar:helpid="helpid:100105" />
- <toolbar:toolbaritem xlink:href=".uno:UpSearch" toolbar:helpid="helpid:100105" />
- <toolbar:toolbaritem xlink:href=".uno:SearchDialog" toolbar:text="Find &amp; Replace" toolbar:visible="false" toolbar:helpid="helpid:100105"/>
+ <toolbar:toolbaritem xlink:href=".uno:FindText"/>
+ <toolbar:toolbaritem xlink:href=".uno:DownSearch"/>
+ <toolbar:toolbaritem xlink:href=".uno:UpSearch"/>
+ <toolbar:toolbaritem xlink:href=".uno:SearchDialog" toolbar:visible="false"/>
</toolbar:toolbar>
diff --git a/sw/uiconfig/sweb/toolbar/findbar.xml b/sw/uiconfig/sweb/toolbar/findbar.xml
index 9ef9d8a1a78f..0338d3156195 100644
--- a/sw/uiconfig/sweb/toolbar/findbar.xml
+++ b/sw/uiconfig/sweb/toolbar/findbar.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
- <toolbar:toolbaritem xlink:href=".uno:FindText" toolbar:helpid="helpid:100105" />
- <toolbar:toolbaritem xlink:href=".uno:DownSearch" toolbar:helpid="helpid:100105" />
- <toolbar:toolbaritem xlink:href=".uno:UpSearch" toolbar:helpid="helpid:100105" />
- <toolbar:toolbaritem xlink:href=".uno:SearchDialog" toolbar:text="Find &amp; Replace" toolbar:visible="false" toolbar:helpid="helpid:100105"/>
+ <toolbar:toolbaritem xlink:href=".uno:FindText"/>
+ <toolbar:toolbaritem xlink:href=".uno:DownSearch"/>
+ <toolbar:toolbaritem xlink:href=".uno:UpSearch"/>
+ <toolbar:toolbaritem xlink:href=".uno:SearchDialog" toolbar:visible="false"/>
</toolbar:toolbar>
diff --git a/sw/uiconfig/swriter/toolbar/findbar.xml b/sw/uiconfig/swriter/toolbar/findbar.xml
index 9ef9d8a1a78f..0338d3156195 100644
--- a/sw/uiconfig/swriter/toolbar/findbar.xml
+++ b/sw/uiconfig/swriter/toolbar/findbar.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
- <toolbar:toolbaritem xlink:href=".uno:FindText" toolbar:helpid="helpid:100105" />
- <toolbar:toolbaritem xlink:href=".uno:DownSearch" toolbar:helpid="helpid:100105" />
- <toolbar:toolbaritem xlink:href=".uno:UpSearch" toolbar:helpid="helpid:100105" />
- <toolbar:toolbaritem xlink:href=".uno:SearchDialog" toolbar:text="Find &amp; Replace" toolbar:visible="false" toolbar:helpid="helpid:100105"/>
+ <toolbar:toolbaritem xlink:href=".uno:FindText"/>
+ <toolbar:toolbaritem xlink:href=".uno:DownSearch"/>
+ <toolbar:toolbaritem xlink:href=".uno:UpSearch"/>
+ <toolbar:toolbaritem xlink:href=".uno:SearchDialog" toolbar:visible="false"/>
</toolbar:toolbar>
diff --git a/sw/uiconfig/swxform/toolbar/findbar.xml b/sw/uiconfig/swxform/toolbar/findbar.xml
index 9ef9d8a1a78f..0338d3156195 100644
--- a/sw/uiconfig/swxform/toolbar/findbar.xml
+++ b/sw/uiconfig/swxform/toolbar/findbar.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
- <toolbar:toolbaritem xlink:href=".uno:FindText" toolbar:helpid="helpid:100105" />
- <toolbar:toolbaritem xlink:href=".uno:DownSearch" toolbar:helpid="helpid:100105" />
- <toolbar:toolbaritem xlink:href=".uno:UpSearch" toolbar:helpid="helpid:100105" />
- <toolbar:toolbaritem xlink:href=".uno:SearchDialog" toolbar:text="Find &amp; Replace" toolbar:visible="false" toolbar:helpid="helpid:100105"/>
+ <toolbar:toolbaritem xlink:href=".uno:FindText"/>
+ <toolbar:toolbaritem xlink:href=".uno:DownSearch"/>
+ <toolbar:toolbaritem xlink:href=".uno:UpSearch"/>
+ <toolbar:toolbaritem xlink:href=".uno:SearchDialog" toolbar:visible="false"/>
</toolbar:toolbar>