Skip to content

Commit

Permalink
fixed spr data handling
Browse files Browse the repository at this point in the history
  • Loading branch information
JanisEst committed Jan 19, 2016
1 parent 60b5a18 commit 22d5216
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions KeePassQRCodeViewExt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,22 +159,19 @@ public void OnShowQRCode(object sender, DynamicMenuEventArgs e)

var value = pe.Strings.GetSafe(key).ReadString();

char scan, wanted;
pe = SprEngine.FindRefTarget(
value,
new SprContext(pe, host.Database, SprCompileFlags.All),
out scan,
out wanted
);
if (null != pe)
value = SprEngine.Compile(value, new SprContext(pe, host.Database, SprCompileFlags.All));

try
{
value = pe.Strings.GetSafe(key).ReadString();
var data = new QRCodeGenerator().CreateQrCode(value, QRCodeGenerator.ECCLevel.L);
if (data != null)
{
new ShowQRCodeForm(data.GetBitmap(10, Color.Black, Color.White)).ShowDialog();
}
}

var data = new QRCodeGenerator().CreateQrCode(value, QRCodeGenerator.ECCLevel.L);
if (data != null)
catch
{
new ShowQRCodeForm(data.GetBitmap(10, Color.Black, Color.White)).ShowDialog();
MessageBox.Show("The data can't be displayed as a QR Code.");
}
}
}
Expand Down

0 comments on commit 22d5216

Please sign in to comment.