[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: [PATCH] Fix display of text with qoutes in kspread
From:       David Faure <dfaure () klaralvdalens-datakonsult ! se>
Date:       2003-10-30 9:08:02
[Download RAW message or body]

On Wednesday 29 October 2003 20:10, Peter Simonsson wrote:
> This patch should fix the display of text that has a single qoute at the beginning.
My hero!

>     if (!m_value.asString().isEmpty() && m_value.asString()[0]=='\'' )
> +    {
>        m_strOutText = m_value.asString().right( m_value.asString().length()-1);
This could me .mid(1)

> +      if(m_strOutText[m_strOutText.length() - 1] == '\'')
This should first check for !m_strOutText.isEmpty(), otherwise a single quote
as value will let this go out of bounds.
Hmm, in fact, why did you add this? I thought this was only about
'012345
not about
'012345'
(but maybe the latter is supposed to do the same and I just didn't realize)

> @@ -4405,6 +4412,7 @@ void KSpreadCell::checkTextInput()
>          m_value = KSpreadValue::empty();
This line can be removed then?
>          if(m_pTable->getFirstLetterUpper() && !m_strText.isEmpty())
>              m_strText=m_strText[0].upper()+m_strText.right(m_strText.length()-1);
> +        m_value.setValue(m_strText);
>          //setFormatType(Text_format); // shouldn't be necessary. Won't apply with StringData anyway.
>          return;
>      }

Thanks.

-- 
David Faure -- faure@kde.org, dfaure@klaralvdalens-datakonsult.se
Qt/KDE/KOffice developer
Klarälvdalens Datakonsult AB, Platform-independent software solutions
_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/koffice-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic