Quantcast

[PATCH] fdo#47674 Calc: save settings for import ascii text dialog

classic Classic list List threaded Threaded
5 messages Options
Laurent BP Laurent BP
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[PATCH] fdo#47674 Calc: save settings for import ascii text dialog

Hello,

I propose a patch for fdo#47674

Open Text-CSV saved settings of ScImportAsciiDlg dialog, but not Paste > Unformatted Text and Data > Text to Columns.
This patch adds two groups in Calc.xcs to save the settings (which are independent).
cSep last parameter of ScImportAsciiDlg constructor was removed as it was useless (parameter is controlled by settings).

I set \t as default separator for both Paste Unformatted Text and Text to Columns. I set DetectSpecialNumbers at true as default for Paste Unformatted Text. Why is it not set to true for import CSV file? It seems to me to be the more common behavior.

Have a good day.

Laurent BP


0001-fdo-47674-Save-settings-for-Import-Ascii-Text-Dlg.patch
LibreOffice 3.6.5
Eike Rathke-2 Eike Rathke-2
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [PATCH] fdo#47674 Calc: save settings for import ascii text dialog

Hi jumbo444,

On Friday, 2012-08-10 06:26:52 -0700, jumbo444 wrote:

> I propose a patch for fdo#47674

I'll follow up on that tomorrow.

> Open Text-CSV saved settings of ScImportAsciiDlg dialog, but not Paste >
> Unformatted Text and Data > Text to Columns.
> This patch adds two groups in Calc.xcs to save the settings (which are
> independent).
> cSep last parameter of ScImportAsciiDlg constructor was removed as it was
> useless (parameter is controlled by settings).

Browsing through it seems your approach is fine, I'll look at details
later.

> I set \t as default separator for both Paste Unformatted Text and Text to
> Columns. I set DetectSpecialNumbers at true as default for Paste Unformatted
> Text. Why is it not set to true for import CSV file? It seems to me to be
> the more common behavior.

That DetectSpecialNumbers may get in the way as it also detects
abbreviated dates and other not so obvious strings that can be converted
to numeric values. Many times that is not wanted for file data. Whether
it's good to have it enabled as default for clipboard and column data
I'm not sure. I think it doesn't harm to try..

  Eike

--
LibreOffice Calc developer. Number formatter stricken i18n transpositionizer.
GnuPG key 0x293C05FD : 997A 4C60 CE41 0149 0DB3  9E96 2F1A D073 293C 05FD

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice

attachment0 (205 bytes) Download Attachment
Eike Rathke-2 Eike Rathke-2
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [PUSHED] fdo#47674 Calc: save settings for import ascii text dialog

In reply to this post by Laurent BP
Hi jumbo444,

On Friday, 2012-08-10 06:26:52 -0700, jumbo444 wrote:

> I propose a patch for fdo#47674

Pushed
http://cgit.freedesktop.org/libreoffice/core/commit/?id=597bdd89d108fb8325d81f5b30ffdd0d3ea68072
with changes
http://cgit.freedesktop.org/libreoffice/core/commit/?id=d26599c3e1dea940439985b46b727cfc22b37c38

Thanks!
  Eike

--
LibreOffice Calc developer. Number formatter stricken i18n transpositionizer.
GnuPG key 0x293C05FD : 997A 4C60 CE41 0149 0DB3  9E96 2F1A D073 293C 05FD

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice

attachment0 (205 bytes) Download Attachment
Laurent BP Laurent BP
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[PATCH] fdo#47674 Calc: save settings for import ascii text dialog

Hello Eike,

Thanks for reviewing my patch.
Eike Rathke-2 wrote
* For TextToColumn some fields are preset and not changeable and configuration does not provide properties, do not attempt to access non-existing properties. In fact unotools/source/config/configmgr.cxx mocks about these cases if built with debug.
OK
Eike Rathke-2 wrote
* Do not use RTL_CONSTASCII_USTRINGPARAM with new code, OUString knows about ASCII literals.
Actually, I'm quite lost with all types of string. Where can I get tuto about string, String, OUString, UString, etc.?
Eike Rathke-2 wrote
* Converted an if(meCall==...){}if(meCall==...) to a switch case.
I noticed that caption of Dlg is missing filename in case of File Import. Patch enclosed correct this.
0001-fdo-47674-Save-setting-for-Import-Ascii-Text-Dlg.patch
Eike Rathke-2 wrote
* Sensible indentation, please ;-)
I'm new with Linux and not comfortable with vim. I'm coming from MS-Windows. I learned C at school in late 80's, then TurboC, Borland C++ and C++ Builder by myself. So I have still a lot to learned :)
I promise to improve my coding ;)

Sincerely

Laurent BP
LibreOffice 3.6.5
Eike Rathke-2 Eike Rathke-2
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [PUSHED] fdo#47674 Calc: save settings for import ascii text dialog

Hi jumbo444,

Btw, if you'd like to see your first name here then use it in your From
header ;-)

On Saturday, 2012-08-18 02:46:59 -0700, jumbo444 wrote:

> > * Do not use RTL_CONSTASCII_USTRINGPARAM with new code, OUString knows
> > about ASCII literals.
> >
> Actually, I'm quite lost with all types of string. Where can I get tuto
> about string, String, OUString, UString, etc.?

Not really a tutorial, but overview
https://wiki.documentfoundation.org/Development/String_Classes

Note that internally we don't use std::string, and if possible new code
should use OUString instead of the deprecated String, and OString
instead of ByteString.


> I noticed that caption of Dlg is missing filename in case of File Import.
> Patch enclosed correct this.

Good catch, thanks, pushed as
http://cgit.freedesktop.org/libreoffice/core/commit/?id=5b985dcf72d31cee191711f879675ec9affa2f76


> > * Sensible indentation, please ;-)
> >
> I'm new with Linux and not comfortable with vim. I'm coming from MS-Windows.
> I learned C at school in late 80's, then TurboC, Borland C++ and C++ Builder
> by myself. So I have still a lot to learned :)
> I promise to improve my coding ;)

Great :-)  If you use Vim then just press Tab for one indentation level,
each source file has a Vim mode line at the end to tell it to use
4 spaces and no tabs per indentation level:

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Similar for Emacs the very first line:

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */

  Eike

--
LibreOffice Calc developer. Number formatter stricken i18n transpositionizer.
GnuPG key 0x293C05FD : 997A 4C60 CE41 0149 0DB3  9E96 2F1A D073 293C 05FD

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice

attachment0 (205 bytes) Download Attachment
Loading...