summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2022-01-14 14:47:59 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2022-01-14 14:47:59 +0200
commitdbbbd178f9f603dae20513a9b180fd48070ce159 (patch)
tree90fe32a20d5614a38d50c425a589aab0b876f8c4
parent185783d773f37831fc2666729305e235e7626c33 (diff)
Windows: Fixed installing a drag-and-dropped font file
The name of the file was not determined correctly.
-rw-r--r--src/ui/documentwidget.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index 21ea5aba..b73866a8 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -20,7 +20,7 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 20(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
21SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ 21SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
22 22
23/* TODO: Move DocumentView into a source file of its own. Consider cleaning up the network 23/* TODO: Move DocumentView into a source file of its own. Consider cleaning up the network
24 request handling. */ 24 request handling. */
25 25
26#include "documentwidget.h" 26#include "documentwidget.h"
@@ -1283,7 +1283,7 @@ static void drawRun_DrawContext_(void *context, const iGmRun *run) {
1283 iRect wideRect = { init_I2(origin.x - pad, visPos.y), 1283 iRect wideRect = { init_I2(origin.x - pad, visPos.y),
1284 init_I2(d->docBounds.size.x + 2 * pad, 1284 init_I2(d->docBounds.size.x + 2 * pad,
1285 height_Rect(run->visBounds)) }; 1285 height_Rect(run->visBounds)) };
1286 adjustEdges_Rect(&wideRect, 1286 adjustEdges_Rect(&wideRect,
1287 run->flags & startOfLine_GmRunFlag ? -pad * 3 / 4 : 0, 0, 1287 run->flags & startOfLine_GmRunFlag ? -pad * 3 / 4 : 0, 0,
1288 run->flags & endOfLine_GmRunFlag ? pad * 3 / 4 : 0, 0); 1288 run->flags & endOfLine_GmRunFlag ? pad * 3 / 4 : 0, 0);
1289 /* The first line is composed of two runs that may be drawn in either order, so 1289 /* The first line is composed of two runs that may be drawn in either order, so
@@ -1397,7 +1397,7 @@ static void drawRun_DrawContext_(void *context, const iGmRun *run) {
1397 range_String(&styled)); 1397 range_String(&styled));
1398 setAnsiFlags_Text(oldAnsi); 1398 setAnsiFlags_Text(oldAnsi);
1399 deinit_String(&styled); 1399 deinit_String(&styled);
1400 goto runDrawn; 1400 goto runDrawn;
1401 } 1401 }
1402 } 1402 }
1403 } 1403 }
@@ -2612,7 +2612,7 @@ static void updateDocument_DocumentWidget_(iDocumentWidget *d,
2612 setRange_String(&d->sourceMime, param); 2612 setRange_String(&d->sourceMime, param);
2613 format_String(&str, "# TrueType Font\n"); 2613 format_String(&str, "# TrueType Font\n");
2614 iString *decUrl = collect_String(urlDecode_String(d->mod.url)); 2614 iString *decUrl = collect_String(urlDecode_String(d->mod.url));
2615 iRangecc name = baseName_Path(decUrl); 2615 iRangecc name = baseNameSep_Path(decUrl, "/");
2616 iBool isInstalled = iFalse; 2616 iBool isInstalled = iFalse;
2617 if (startsWith_String(collect_String(localFilePathFromUrl_String(d->mod.url)), 2617 if (startsWith_String(collect_String(localFilePathFromUrl_String(d->mod.url)),
2618 cstr_String(dataDir_App()))) { 2618 cstr_String(dataDir_App()))) {
@@ -3120,7 +3120,7 @@ static void checkResponse_DocumentWidget_(iDocumentWidget *d) {
3120 if (equal_String(&mostRecentUrl_History(d->mod.history)->url, url_GmRequest(mr->req))) { 3120 if (equal_String(&mostRecentUrl_History(d->mod.history)->url, url_GmRequest(mr->req))) {
3121 undo_History(d->mod.history); 3121 undo_History(d->mod.history);
3122 } 3122 }
3123 setUrl_DocumentWidget_(d, url_GmDocument(d->view.doc)); 3123 setUrl_DocumentWidget_(d, url_GmDocument(d->view.doc));
3124 updateFetchProgress_DocumentWidget_(d); 3124 updateFetchProgress_DocumentWidget_(d);
3125 postCommand_Widget(d, "media.updated link:%u request:%p", d->requestLinkId, mr); 3125 postCommand_Widget(d, "media.updated link:%u request:%p", d->requestLinkId, mr);
3126 return; 3126 return;
@@ -5041,7 +5041,7 @@ static iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e
5041 format_CStr("!reveal url:%s", 5041 format_CStr("!reveal url:%s",
5042 cstr_String(linkUrl)) }); 5042 cstr_String(linkUrl)) });
5043#endif 5043#endif
5044 } 5044 }
5045 } 5045 }
5046 else if (!willUseProxy_App(scheme)) { 5046 else if (!willUseProxy_App(scheme)) {
5047 pushBack_Array( 5047 pushBack_Array(