[Libreoffice-commits] .: Branch 'libreoffice-3-3' - 2 commits - sw/source
Michael Meeks
mmeeks at kemper.freedesktop.org
Fri Jan 14 03:19:32 PST 2011
sw/source/core/crsr/bookmrk.cxx | 2 +-
sw/source/core/crsr/pam.cxx | 4 +++-
sw/source/filter/ww8/wrtw8nds.cxx | 6 +++---
sw/source/filter/ww8/ww8scan.hxx | 2 +-
sw/source/ui/docvw/edtwin.cxx | 19 ++++++++++++++++---
5 files changed, 24 insertions(+), 9 deletions(-)
New commits:
commit 6d54edb9fa96fd915a90b06886781827acd2fcde
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jan 11 20:33:41 2011 +0000
fix this to build
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index 8037b62..a765a6b 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -841,6 +841,7 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const
bool bAtStartA = pA != NULL && pA->GetMarkStart() == *GetPoint();
bool bAtStartB = pB != NULL && pB->GetMarkStart() == *GetMark();
bRet = ( pA != pB ) || bAtStartA || bAtStartB;
+ bool bProtectForm = pDoc->get( IDocumentSettingAccess::PROTECT_FORM );
if ( bProtectForm )
bRet |= ( pA == NULL || pB == NULL );
}
commit 8d9cf3fdfda0bf4b2ae2464edc0397b0e296f015
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Tue Jan 11 20:18:26 2011 +0100
n#657135: Enhanced fields fixes (key inputs, and 0-length fields import)
diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx
index 9497f8f..46576e0 100644
--- a/sw/source/core/crsr/bookmrk.cxx
+++ b/sw/source/core/crsr/bookmrk.cxx
@@ -88,7 +88,7 @@ namespace
SwPaM aStartPaM(rStart);
SwPaM aEndPaM(rEnd);
io_pDoc->StartUndo(UNDO_UI_REPLACE, NULL);
- if( ( ch_start != aStartMark ) && ( rStart != rEnd ) )
+ if( ( ch_start != aStartMark ) && ( aEndMark != CH_TXT_ATR_FORMELEMENT ) )
{
io_pDoc->InsertString(aStartPaM, aStartMark);
rStart.nContent--;
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index ae1e9fe..8037b62 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -838,8 +838,9 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const
else
{
// Form protection case
- bRet = ( pA != pB );
- bool bProtectForm = pDoc->get( IDocumentSettingAccess::PROTECT_FORM );
+ bool bAtStartA = pA != NULL && pA->GetMarkStart() == *GetPoint();
+ bool bAtStartB = pB != NULL && pB->GetMarkStart() == *GetMark();
+ bRet = ( pA != pB ) || bAtStartA || bAtStartB;
if ( bProtectForm )
bRet |= ( pA == NULL || pB == NULL );
}
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 01bd84f..026adba 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -1821,7 +1821,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess();
if ( ch == CH_TXT_ATR_FIELDSTART )
{
- SwPosition aPosition( rNode, SwIndex( const_cast< SwTxtNode* >( &rNode ), nAktPos + 1 ) );
+ SwPosition aPosition( rNode, SwIndex( const_cast< SwTxtNode* >( &rNode ), nAktPos ) );
::sw::mark::IFieldmark const * const pFieldmark = pMarkAccess->getFieldmarkFor( aPosition );
OSL_ENSURE( pFieldmark, "Looks like this doc is broken...; where is the Fieldmark for the FIELDSTART??" );
@@ -1873,9 +1873,9 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
}
else if ( ch == CH_TXT_ATR_FIELDEND )
{
- SwPosition aPosition( rNode, SwIndex( const_cast< SwTxtNode* >( &rNode ), nAktPos ) );
+ SwPosition aPosition( rNode, SwIndex( const_cast< SwTxtNode* >( &rNode ), nAktPos - 1 ) );
::sw::mark::IFieldmark const * const pFieldmark = pMarkAccess->getFieldmarkFor( aPosition );
- OSL_ENSURE( pFieldmark, "Looks like this doc is broken...; where is the Fieldmark for the FIELDSTART??" );
+ OSL_ENSURE( pFieldmark, "Looks like this doc is broken...; where is the Fieldmark for the FIELDEND??" );
ww::eField eFieldId = lcl_getFieldId( pFieldmark );
if ( pFieldmark->GetFieldname().equalsAscii( ODF_UNHANDLED ) )
diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx
index 6bcfbca..cd4bb2d 100644
--- a/sw/source/filter/ww8/ww8scan.hxx
+++ b/sw/source/filter/ww8/ww8scan.hxx
@@ -683,7 +683,7 @@ public:
long Count() const { return ( pRef ) ? pRef->GetIMax() : 0; }
};
-/// Iterator for footnotes and endnotes
+/// Iterator for fields
class WW8PLCFx_FLD : public WW8PLCFx
{
private:
diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index 2213afb..b16bb6a 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -1755,9 +1755,17 @@ KEYINPUT_CHECKTABLE_INSDEL:
break;
case KEY_DELETE:
- if (rSh.IsInFrontOfLabel() &&
- rSh.NumOrNoNum(FALSE))
- eKeyState = KS_NumOrNoNum;
+ if ( !rSh.HasReadonlySel() )
+ {
+ if (rSh.IsInFrontOfLabel() &&
+ rSh.NumOrNoNum(FALSE))
+ eKeyState = KS_NumOrNoNum;
+ }
+ else
+ {
+ InfoBox( this, SW_RES( MSG_READONLY_CONTENT )).Execute();
+ eKeyState = KS_Ende;
+ }
break;
case KEY_DELETE | KEY_MOD2:
@@ -1921,6 +1929,11 @@ KEYINPUT_CHECKTABLE_INSDEL:
// <--
}
}
+ else
+ {
+ InfoBox( this, SW_RES( MSG_READONLY_CONTENT )).Execute();
+ eKeyState = KS_Ende;
+ }
break;
case KEY_RIGHT:
More information about the Libreoffice-commits
mailing list