Loading common/page_layout/class_worksheet_dataitem.cpp +38 −0 Original line number Original line Diff line number Diff line Loading @@ -462,6 +462,43 @@ void WORKSHEET_DATAITEM_TEXT::IncrementLabel( int aIncr ) m_FullText << (wxChar) ( aIncr + lbchar ); m_FullText << (wxChar) ( aIncr + lbchar ); } } // Replace the '\''n' sequence by EOL // and the sequence '\''\' by only one '\' in m_FullText // if m_FullTextis a multiline text (i;e.contains '\n') return true bool WORKSHEET_DATAITEM_TEXT::ReplaceAntiSlashSequence() { bool multiline = false; for( unsigned ii = 0; ii < m_FullText.Len(); ii++ ) { if( m_FullText[ii] == '\n' ) multiline = true; else if( m_FullText[ii] == '\\' ) { if( ++ii >= m_FullText.Len() ) break; if( m_FullText[ii] == '\\' ) { // a double \\ sequence is replaced by a single \ char m_FullText.Remove(ii, 1); ii--; } else if( m_FullText[ii] == 'n' ) { // Replace the "\n" sequence by a EOL char multiline = true; m_FullText[ii] = '\n'; m_FullText.Remove(ii-1, 1); ii--; } } } return multiline; } void WORKSHEET_DATAITEM_TEXT::SetConstrainedTextSize() void WORKSHEET_DATAITEM_TEXT::SetConstrainedTextSize() { { m_ConstrainedTextSize = m_TextSize; m_ConstrainedTextSize = m_TextSize; Loading Loading @@ -501,3 +538,4 @@ void WORKSHEET_DATAITEM_TEXT::SetConstrainedTextSize() m_ConstrainedTextSize.y *= m_BoundingBoxSize.y / size.y; m_ConstrainedTextSize.y *= m_BoundingBoxSize.y / size.y; } } } } common/page_layout/title_block_shapes.cpp +1 −2 Original line number Original line Diff line number Diff line Loading @@ -152,8 +152,7 @@ void WS_DRAW_ITEM_LIST::BuildWorkSheetGraphicList( else else { { wsText->m_FullText = BuildFullText( wsText->m_TextBase ); wsText->m_FullText = BuildFullText( wsText->m_TextBase ); if( wsText->m_FullText.Replace( wxT("\\n" ), wxT("\n") ) > 0 ) multilines = wsText->ReplaceAntiSlashSequence(); multilines = true; } } if( wsText->m_FullText.IsEmpty() ) if( wsText->m_FullText.IsEmpty() ) Loading common/worksheet.cpp +2 −2 Original line number Original line Diff line number Diff line Loading @@ -136,8 +136,8 @@ wxString WS_DRAW_ITEM_LIST::BuildFullText( const wxString& aTextbase ) msg << aTextbase[ii]; msg << aTextbase[ii]; continue; continue; } } ii++; if( ii >= aTextbase.Len() ) if( ++ii >= aTextbase.Len() ) break; break; wxChar format = aTextbase[ii]; wxChar format = aTextbase[ii]; Loading include/class_worksheet_dataitem.h +8 −0 Original line number Original line Diff line number Diff line Loading @@ -420,6 +420,14 @@ public: */ */ void SetConstrainedTextSize(); void SetConstrainedTextSize(); /** Replace the '\''n' sequence by EOL * and the sequence '\''\' by only one '\' * inside m_FullText * @return true if the EOL symbol is found or is inserted (multiline text) */ bool ReplaceAntiSlashSequence(); /** /** * @return true is a bold font should be selected * @return true is a bold font should be selected */ */ Loading pagelayout_editor/page_layout_writer.cpp +2 −2 Original line number Original line Diff line number Diff line Loading @@ -98,7 +98,7 @@ public: } } catch( IO_ERROR ioe ) catch( IO_ERROR ioe ) { { wxMessageBox( ioe.errorText, _("Write Page Layout Error" ) ); wxMessageBox( ioe.errorText, _("Error writing page layout descr file" ) ); } } } } Loading @@ -125,7 +125,7 @@ public: } } catch( IO_ERROR ioe ) catch( IO_ERROR ioe ) { { wxMessageBox( ioe.errorText, _("Write Page Layout Error" ) ); wxMessageBox( ioe.errorText, _("Error writing page layout descr file" ) ); } } } } Loading Loading
common/page_layout/class_worksheet_dataitem.cpp +38 −0 Original line number Original line Diff line number Diff line Loading @@ -462,6 +462,43 @@ void WORKSHEET_DATAITEM_TEXT::IncrementLabel( int aIncr ) m_FullText << (wxChar) ( aIncr + lbchar ); m_FullText << (wxChar) ( aIncr + lbchar ); } } // Replace the '\''n' sequence by EOL // and the sequence '\''\' by only one '\' in m_FullText // if m_FullTextis a multiline text (i;e.contains '\n') return true bool WORKSHEET_DATAITEM_TEXT::ReplaceAntiSlashSequence() { bool multiline = false; for( unsigned ii = 0; ii < m_FullText.Len(); ii++ ) { if( m_FullText[ii] == '\n' ) multiline = true; else if( m_FullText[ii] == '\\' ) { if( ++ii >= m_FullText.Len() ) break; if( m_FullText[ii] == '\\' ) { // a double \\ sequence is replaced by a single \ char m_FullText.Remove(ii, 1); ii--; } else if( m_FullText[ii] == 'n' ) { // Replace the "\n" sequence by a EOL char multiline = true; m_FullText[ii] = '\n'; m_FullText.Remove(ii-1, 1); ii--; } } } return multiline; } void WORKSHEET_DATAITEM_TEXT::SetConstrainedTextSize() void WORKSHEET_DATAITEM_TEXT::SetConstrainedTextSize() { { m_ConstrainedTextSize = m_TextSize; m_ConstrainedTextSize = m_TextSize; Loading Loading @@ -501,3 +538,4 @@ void WORKSHEET_DATAITEM_TEXT::SetConstrainedTextSize() m_ConstrainedTextSize.y *= m_BoundingBoxSize.y / size.y; m_ConstrainedTextSize.y *= m_BoundingBoxSize.y / size.y; } } } }
common/page_layout/title_block_shapes.cpp +1 −2 Original line number Original line Diff line number Diff line Loading @@ -152,8 +152,7 @@ void WS_DRAW_ITEM_LIST::BuildWorkSheetGraphicList( else else { { wsText->m_FullText = BuildFullText( wsText->m_TextBase ); wsText->m_FullText = BuildFullText( wsText->m_TextBase ); if( wsText->m_FullText.Replace( wxT("\\n" ), wxT("\n") ) > 0 ) multilines = wsText->ReplaceAntiSlashSequence(); multilines = true; } } if( wsText->m_FullText.IsEmpty() ) if( wsText->m_FullText.IsEmpty() ) Loading
common/worksheet.cpp +2 −2 Original line number Original line Diff line number Diff line Loading @@ -136,8 +136,8 @@ wxString WS_DRAW_ITEM_LIST::BuildFullText( const wxString& aTextbase ) msg << aTextbase[ii]; msg << aTextbase[ii]; continue; continue; } } ii++; if( ii >= aTextbase.Len() ) if( ++ii >= aTextbase.Len() ) break; break; wxChar format = aTextbase[ii]; wxChar format = aTextbase[ii]; Loading
include/class_worksheet_dataitem.h +8 −0 Original line number Original line Diff line number Diff line Loading @@ -420,6 +420,14 @@ public: */ */ void SetConstrainedTextSize(); void SetConstrainedTextSize(); /** Replace the '\''n' sequence by EOL * and the sequence '\''\' by only one '\' * inside m_FullText * @return true if the EOL symbol is found or is inserted (multiline text) */ bool ReplaceAntiSlashSequence(); /** /** * @return true is a bold font should be selected * @return true is a bold font should be selected */ */ Loading
pagelayout_editor/page_layout_writer.cpp +2 −2 Original line number Original line Diff line number Diff line Loading @@ -98,7 +98,7 @@ public: } } catch( IO_ERROR ioe ) catch( IO_ERROR ioe ) { { wxMessageBox( ioe.errorText, _("Write Page Layout Error" ) ); wxMessageBox( ioe.errorText, _("Error writing page layout descr file" ) ); } } } } Loading @@ -125,7 +125,7 @@ public: } } catch( IO_ERROR ioe ) catch( IO_ERROR ioe ) { { wxMessageBox( ioe.errorText, _("Write Page Layout Error" ) ); wxMessageBox( ioe.errorText, _("Error writing page layout descr file" ) ); } } } } Loading