Skip to content

Commit bf323ca

Browse files
committed
fix merge conflicts
2 parents b74ff93 + b3fba34 commit bf323ca

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

bepdf/beos/BepdfApplication.cpp

+7-4
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,7 @@ void BepdfApplication::RefsReceived(BMessage *msg)
577577
BRect rect(mSettings->GetWindowRect());
578578
bool ok;
579579
bool encrypted = false;
580+
580581
if (mWindow == NULL) {
581582
win = new PDFWindow(&ref, rect, owner, user, &encrypted);
582583
ok = win->IsOk();
@@ -591,13 +592,15 @@ void BepdfApplication::RefsReceived(BMessage *msg)
591592
if (!encrypted) {
592593
BAlert *error = new BAlert(B_TRANSLATE("Error"), B_TRANSLATE("BePDF: Error opening file!"), B_TRANSLATE("Close"), NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
593594
error->Go();
594-
}
595595

596+
if (mWindow == NULL) { // fixme: always true even if a PDF window is already open!
597+
OpenFilePanel();
598+
}
599+
} else {
600+
new PasswordWindow(&ref, rect, this);
601+
}
596602
if (mWindow == NULL) delete win;
597603

598-
if (encrypted) {
599-
new PasswordWindow(&ref, rect, this);
600-
}
601604
} else if (mWindow == NULL) {
602605
mWindow = win;
603606
win->Show();

bepdf/beos/PDFView.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,9 @@ PDFView::MakeTitleString(BPath* path) {
232232
bool
233233
PDFView::OpenFile(entry_ref *ref, const char *ownerPassword, const char *userPassword, bool *encrypted) {
234234
BEntry entry (ref, true);
235+
if (!entry.Exists()) {
236+
return false;
237+
}
235238
BPath path;
236239
entry.GetPath (&path);
237240

@@ -245,11 +248,8 @@ PDFView::OpenFile(entry_ref *ref, const char *ownerPassword, const char *userPas
245248
UpdatePanelDirectory(&path);
246249

247250
bool ok = newDoc->isOk();
248-
// xpdf 3.01 returns false even PDF file is password protected?!?
249-
*encrypted = true; // newDoc->isEncrypted();
250-
// fprintf(stderr, "ok %s encrypted %s\n",
251-
// ok ? "yes" : "no",
252-
// (*encrypted) ? "yes" : "no");
251+
*encrypted = newDoc->isEncrypted();
252+
253253
if (ok) {
254254
delete mDoc;
255255
mDoc = newDoc;

0 commit comments

Comments
 (0)