Summary: | Cannot change endnote to footnote | ||
---|---|---|---|
Product: | kword | Reporter: | Mike McBride <mpmcbride7> |
Component: | general | Assignee: | Thomas Zander <zander> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | 1.5 or before | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Mike McBride
2003-02-01 16:18:49 UTC
I have now noticed, that if you (using the numbered way to replicate bugs) insert another footnote, both references are now displayed as footnotes. Also, if I save the file (after completing step number 6, then reload the file, the "endnote" is now down as a footnote the way it should be. THis may simply be a need to update the display. Note: If I repeat steps 1-6 on a new document, then select Print -> Preview -- The endnotes/Footnotes are not changed correctly. Subject: koffice/kword CVS commit by faure: Many fixes for changing a note type between endnote and footnote. CCMAIL: 53833-done@bugs.kde.org M +9 -7 kwcommand.cc 1.212 M +1 -0 kwdoc.cc 1.596 M +7 -1 kwframelayout.cc 1.29 M +8 -4 kwvariable.cc 1.145 --- koffice/kword/kwdoc.cc #1.595:1.596 @@ -734,4 +734,5 @@ void KWDocument::recalcFrames( int fromP KWTextFrameSet *firstHeader = 0L, *evenHeader = 0L, *oddHeader = 0L; KWTextFrameSet *firstFooter = 0L, *evenFooter = 0L, *oddFooter = 0L; + m_bHasEndNotes = false; // will be set to true if we find any endnote // Lookup the various header / footer framesets into the variables above --- koffice/kword/kwcommand.cc #1.211:1.212 @@ -2062,14 +2061,17 @@ void KWChangeFootNoteParametersCommand:: m_var->setNumberingType( _param.numberingType ); m_var->setManualString( _param.manualString ); - m_var->resize(); - m_var->frameSet()->setCounterText( m_var->text() ); - m_var->setNumDisplay( -1 ); + m_var->setNumDisplay( -1 ); // force renumberFootNotes to recalc KWTextFrameSet * frameset = dynamic_cast<KWTextFrameSet *>( m_doc->frameSet( 0 )); + Q_ASSERT( frameset ); if ( frameset) frameset->renumberFootNotes(); - m_var->paragraph()->invalidate(0); - m_var->paragraph()->setChanged( true ); - m_doc->slotRepaintVariable(); + // Re-layout the footnote/endnote frame + KWFrame* footNoteFrame = m_var->frameSet()->frame( 0 ); + int framePage = footNoteFrame->pageNum(); + m_doc->recalcFrames( framePage, -1 ); + + // Repaint + m_doc->delayedRepaintAllViews(); } --- koffice/kword/kwframelayout.cc #1.28:1.29 @@ -386,5 +386,11 @@ void KWFrameLayout::layout( KWFrameSet* if ( m_doc->hasEndNotes() ) { KWFrame* lastMainFrame = mainTextFrameSet->frameIterator().getLast(); + if ( lastMainFrame->frameBehavior() != KWFrame::AutoExtendFrame ) + { lastMainFrame->setFrameBehavior( KWFrame::AutoExtendFrame ); + // make sure it gets resized + if ( mainTextFrameResized == -1 ) + mainTextFrameResized = lastMainFrame->pageNum(); + } } } --- koffice/kword/kwvariable.cc #1.144:1.145 @@ -335,9 +335,9 @@ void KWFootNoteVariable::formatedNote() if ( m_numberingType == Auto ) { - m_varValue = QVariant(applyStyle( )); + m_varValue = QVariant(applyStyle()); } } -QString KWFootNoteVariable::applyStyle( ) +QString KWFootNoteVariable::applyStyle() { KWVariableSettings* settings = static_cast<KWVariableSettings*>(m_varColl->variableSetting()); @@ -345,5 +345,8 @@ QString KWFootNoteVariable::applyStyle( QString tmp; - int val = m_numDisplay+ tmpCounter.startNumber()-1; + int val = m_numDisplay + tmpCounter.startNumber()-1; + Q_ASSERT( val >= 0 ); + if ( val < 0 ) // let's not go into makeRomanNumber with a negative number :} + return i18n("ERROR"); switch ( tmpCounter.style() ) { @@ -387,4 +390,5 @@ void KWFootNoteVariable::setNumDisplay( { m_numDisplay = val; + if ( val != -1 ) // -1 is used to 'invalidate so that renumberFootNotes recalcs' formatedNote(); } |