Ticket #10032: 0001-stylededit-save-as.patch

File 0001-stylededit-save-as.patch, 1.3 KB (added by Freeman, 6 years ago)
  • StyledEditWindow.cpp

    From 84a9868d77a246c9d9c19b55f267fb25b682cdc7 Mon Sep 17 00:00:00 2001
    From: Freeman Lou <freemanlou2430@Yahoo.com>
    Date: Thu, 12 Dec 2013 21:45:24 +0000
    Subject: [PATCH] stylededit save as
    
    ---
     StyledEditWindow.cpp | 18 +++++++++++-------
     1 file changed, 11 insertions(+), 7 deletions(-)
    
    diff --git a/StyledEditWindow.cpp b/StyledEditWindow.cpp
    index abcdb33..c803617 100644
    a b  
    2929#include <CharacterSetRoster.h>
    3030#include <Clipboard.h>
    3131#include <Debug.h>
     32#include <Entry.h>
    3233#include <File.h>
    3334#include <FilePanel.h>
    3435#include <FindDirectory.h>
    StyledEditWindow::Save(BMessage* message)  
    874875status_t
    875876StyledEditWindow::SaveAs(BMessage* message)
    876877{
    877     if (fSavePanel == NULL) {
    878         entry_ref* directory = NULL;
    879         entry_ref dirRef;
    880         if (fSaveMessage != NULL) {
    881             if (fSaveMessage->FindRef("directory", &dirRef) == B_OK)
    882                 directory = &dirRef;
    883         }
     878    entry_ref* directory = NULL;
     879    entry_ref dirRef;
     880    if (fSaveMessage != NULL) {
     881        if (fSaveMessage->FindRef("directory", &dirRef) == B_OK)
     882            directory = &dirRef;
     883    }
     884
     885    BEntry entry(directory);
    884886
     887    if (entry.Exists() == false || fSavePanel == NULL) {
     888        delete fSavePanel;
    885889        BMessenger target(this);
    886890        fSavePanel = new BFilePanel(B_SAVE_PANEL, &target,
    887891            directory, B_FILE_NODE, false);