~valavanisalex/inkscape/fix-793086

« back to all changes in this revision

Viewing changes to src/ui/dialog/filedialogimpl-win32.cpp

  • Committer: Jon A. Cruz
  • Date: 2011-06-04 22:33:05 UTC
  • Revision ID: jon@joncruz.org-20110604223305-r841bbzu6mmb8z32
Possible Win32 compile fix.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
 
44
44
#include "filedialog.h"
45
45
#include "filedialogimpl-win32.h"
 
46
#include "sp-root.h"
46
47
 
47
48
#include <zlib.h>
48
49
#include <cairomm/win32_surface.h>
409
410
    *(filterptr++) = L'\0';
410
411
 
411
412
    _filter_count = extension_index;
412
 
    _filter_index = 2;  // Select the 2nd filter in the list - 2 is NOT the 3rd
 
413
    _filter_index = 2;  // Select the 2nd filter in the list - 2 is NOT the 3rd
413
414
}
414
415
 
415
416
void FileOpenDialogImplWin32::GetOpenFileName_thread()
421
422
 
422
423
    WCHAR* current_directory_string = (WCHAR*)g_utf8_to_utf16(
423
424
        _current_directory.data(), _current_directory.length(),
424
 
                NULL, NULL, NULL);
 
425
        NULL, NULL, NULL);
425
426
 
426
427
    memset(&ofn, 0, sizeof(ofn));
427
428
 
962
963
    g_free(utf8string);
963
964
 
964
965
    // Check the document loaded properly
965
 
    if(svgDoc == NULL) return false;
966
 
    if(svgDoc->root == NULL)
 
966
    if (svgDoc == NULL) {
 
967
        return false;
 
968
    }
 
969
    if (svgDoc->getRoot() == NULL)
967
970
    {
968
971
        svgDoc->doUnref();
969
972
        return false;
989
992
    // write object bbox to area
990
993
    Geom::OptRect maybeArea(area);
991
994
    svgDoc->ensureUpToDate();
992
 
    static_cast<SPItem *>(svgDoc->root)->invoke_bbox( maybeArea,
993
 
        static_cast<SPItem *>(svgDoc->root)->i2d_affine(), TRUE);
 
995
    svgDoc->getRoot()->invoke_bbox( maybeArea,
 
996
                                    svgDoc->getRoot()->i2d_affine(), TRUE);
994
997
 
995
998
    NRArena *const arena = NRArena::create();
996
999
 
997
1000
    unsigned const key = SPItem::display_key_new(1);
998
1001
 
999
 
    NRArenaItem *root = static_cast<SPItem*>(svgDoc->root)->invoke_show(
 
1002
    NRArenaItem *root = svgDoc->getRoot()->invoke_show(
1000
1003
        arena, key, SP_ITEM_SHOW_DISPLAY);
1001
1004
 
1002
1005
    NRGC gc(NULL);
1033
1036
 
1034
1037
    // Tidy up
1035
1038
    svgDoc->doUnref();
1036
 
    static_cast<SPItem*>(svgDoc->root)->invoke_hide(key);
 
1039
    svgDoc->getRoot()->invoke_hide(key);
1037
1040
    nr_object_unref((NRObject *) arena);
1038
1041
 
1039
1042
    // Create the GDK pixbuf
1666
1669
    *(filterptr++) = 0;
1667
1670
 
1668
1671
    _filter_count = extension_index;
1669
 
    _filter_index = 1;  // A value of 1 selects the 1st filter - NOT the 2nd
 
1672
    _filter_index = 1;  // A value of 1 selects the 1st filter - NOT the 2nd
1670
1673
}
1671
1674
 
1672
1675
void FileSaveDialogImplWin32::GetSaveFileName_thread()
1678
1681
 
1679
1682
    WCHAR* current_directory_string = (WCHAR*)g_utf8_to_utf16(
1680
1683
        _current_directory.data(), _current_directory.length(),
1681
 
                NULL, NULL, NULL);
 
1684
        NULL, NULL, NULL);
1682
1685
 
1683
1686
    // Copy the selected file name, converting from UTF-8 to UTF-16
1684
1687
    memset(_path_string, 0, sizeof(_path_string));
1730
1733
    _result = false;
1731
1734
    _main_loop = g_main_loop_new(g_main_context_default(), FALSE);
1732
1735
 
1733
 
        if(_main_loop != NULL)
1734
 
        {
1735
 
            if(Glib::Thread::create(sigc::mem_fun(*this, &FileSaveDialogImplWin32::GetSaveFileName_thread), true))
1736
 
                g_main_loop_run(_main_loop);
 
1736
    if(_main_loop != NULL)
 
1737
    {
 
1738
        if(Glib::Thread::create(sigc::mem_fun(*this, &FileSaveDialogImplWin32::GetSaveFileName_thread), true))
 
1739
            g_main_loop_run(_main_loop);
1737
1740
 
1738
 
            if(_result)
1739
 
                appendExtension(myFilename, (Inkscape::Extension::Output*)_extension);
1740
 
        }
 
1741
        if(_result)
 
1742
            appendExtension(myFilename, (Inkscape::Extension::Output*)_extension);
 
1743
    }
1741
1744
 
1742
1745
    return _result;
1743
1746
}