https://bugs.documentfoundation.org/show_bug.cgi?id=32935

--- Comment #37 from Matt W <[email protected]> ---
I spent some time diving through the libreoffice source, and I can see how to
fix this but I don't really have time to get libreoffice compiling, and get
this through the development process.

There are two options to fix this:
1) Easy option:
Add the Dialog::InitFlag::NoParent flag to the ModalDialog constructor for
imports (as far as I can tell this is, ScImportOptionsDlg and
ScImportAsciiDlg):
line 240 of sc/source/ui/dbgui/scuiasciiopt.cxx:
ScImportAsciiDlg::ScImportAsciiDlg( vcl::Window* pParent, const OUString&
aDatName,
                                    SvStream* pInStream, ScImportAsciiCall
eCall ) :
        ModalDialog (pParent, "TextImportCsvDialog",
            "modules/scalc/ui/textimportcsv.ui"),

becomes:

ScImportAsciiDlg::ScImportAsciiDlg( vcl::Window* pParent, const OUString&
aDatName,
                                    SvStream* pInStream, ScImportAsciiCall
eCall ) :
        ModalDialog (pParent, "TextImportCsvDialog",
            "modules/scalc/ui/textimportcsv.ui", Dialog::InitFlag::NoParent),


and line 101 of core/sc/source/ui/dbgui/scuiimoptdlg.cxx:
ScImportOptionsDlg::ScImportOptionsDlg(
        vcl::Window*                 pParent,
        bool                    bAscii,
        const ScImportOptions*  pOptions,
        const OUString*         pStrTitle,
        bool                    bMultiByte,
        bool                    bOnlyDbtoolsEncodings,
        bool                    bImport )
    :   ModalDialog ( pParent, "ImOptDialog",
            "modules/scalc/ui/imoptdialog.ui" )

becomes:
ScImportOptionsDlg::ScImportOptionsDlg(
        vcl::Window*                 pParent,
        bool                    bAscii,
        const ScImportOptions*  pOptions,
        const OUString*         pStrTitle,
        bool                    bMultiByte,
        bool                    bOnlyDbtoolsEncodings,
        bool                    bImport )
    :   ModalDialog ( pParent, "ImOptDialog",
            "modules/scalc/ui/imoptdialog.ui", Dialog::InitFlag::NoParent)


This will make the dialog always have a window tab - even when you're pasting
ascii into calc.  I think this is probably acceptable.  Main issue will be that
the dialog won't be modal in these cases.


2) Harder option:
So the issue with option 1 is that the dialog will always be a new window. 
What we really need is another dialog flag added like
Dialog::InitFlag::NoParentIfNull or something - so it takes a parent if there
is one, but otherwise doesn't set one.
This would be easy enough to add to dialog.cxx, but I think the things that
call ScImportOptionsDlg and ScImportAsciiDlg don't bother to pass the window in
and rely on the default window-finding behaviour of ModalDialog.  Still not
super hard to fix - just have to track down the places that reference the
dialogs and pass the window context in.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to